Flowcode and Internal CAN

Tips, Tricks and methods for programming, learn ways of making your programming life easier, and share your knowledge with others.

Moderators: Benj, Mods

Please rate this article out of 5: (1 being the worst and 5 being the best)

1
0
No votes
2
0
No votes
3
0
No votes
4
0
No votes
5
6
100%
 
Total votes: 6

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Flowcode and Internal CAN

Post by Benj »

Hello,

Ok thanks for the reminder. I have managed to make this change to the component. Are any of you able to test the code for me before I put it into the Flowcode PIC release.

To start copy the attached file into your "Flowcode v4/Components" directory.

Then use the CAN2 component and the custom code feature go into the defines section of code for the CAN2 component and change this line.

Code: Select all

#define INTERNAL_CAN_ENABLE	0
And change it to this to activate the internal functionality.

Code: Select all

#define INTERNAL_CAN_ENABLE	1
Let me know how you get on.
Attachments
PIC_CAN2.c
(52.98 KiB) Downloaded 551 times

MW
Posts: 38
Joined: Mon Feb 26, 2007 2:04 am
Has thanked: 4 times
Been thanked: 2 times
Contact:

Re: Flowcode and Internal CAN

Post by MW »

Hi,

I have had a play with this today, but have not had much joy.

I downloaded the new CAN2 component and installed it as per instructions. I then went into custom code where I found the line in question but found it already to be edited as per your post. I then wrote a very simple flow chart where the CAN initialises then sends an ext identifier string once a second and toggles a led. I loaded the file into a target board I made up a while ago with an 18f2580 and a CAN voltage shifter (circuit as per a microchip datasheet).

The program compiled and loaded fine, the LED toggles but the CAN string does not appear to be transmitting.

This could be a hardware issue but I don't have anything else to test with.

Thanks
MW

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Flowcode and Internal CAN

Post by Benj »

Hello,

I have internal CAN hardware setup at home so I will have a go with the code this weekend and see if I can get it to run correctly.

MW
Posts: 38
Joined: Mon Feb 26, 2007 2:04 am
Has thanked: 4 times
Been thanked: 2 times
Contact:

Re: Flowcode and Internal CAN

Post by MW »

Hi,

Did you have any luck with this?

Cheers
MW

User avatar
misoct
Posts: 64
Joined: Sat Sep 04, 2010 11:03 pm
Location: Egypt
Has thanked: 8 times
Been thanked: 17 times
Contact:

Re: Flowcode and Internal CAN

Post by misoct »

Benj wrote:Hello,

I have internal CAN hardware setup at home so I will have a go with the code this weekend and see if I can get it to run correctly.
Hi Ben

Based on posts in the forum members on the same subjecthttp://www.matrixmultimedia.com/mmforum ... 29&t=10445, which I put here is still no solutions to the problem of the same and I would like to know whether there is a problem in the program could not be resolved
Thanks

User avatar
Jay Dee
Posts: 398
Joined: Tue Aug 18, 2009 6:42 pm
Has thanked: 121 times
Been thanked: 154 times
Contact:

Re: Flowcode and Internal CAN

Post by Jay Dee »

Hi Guys,
Just started to play with Internal CAN (PIC18F25K80), I wish to run a CAN baud rate of 1 Mbit. I need to also select a suitable Oscillator freq for the chip to allow for this.
The start of this thread mentions a calculator in the components properties but I can find it anywhere... any pointers? :?
Regards, J.

P.S.
I've just selected a 20MHz Crystal for the Pic Osc and set the CAN config BRGCON1 to Ox0
This gives me a 1Mbit Baud Rate.

I also changed the PPP config settings.
Oscillator: HS
But left the 'PLLx4 enable Bit : Enable'

Will the PLL setting try to give me a 40MHz FOsc ? :?

Post Reply