Go to previous topic
Go to next topic
Last Post 30 Oct 2007 01:29 AM by  kplaetevoet
flexcan
 8 Replies
Author Messages
kplaetevoet
New Member
New Member
Posts:


--
18 Oct 2007 12:56 AM
    Hello,

    Is there an example code for the flexcan?
    Initial code?

    thanks in advance
    srinivas.acharya@lntemsys.com
    New Member
    New Member
    Posts:


    --
    29 Oct 2007 04:38 AM
    Did you ge the code for flexcan to use on MCf5329 EVB? let me know.. I have the code but the ports are not working for CANRX and CANTX. How you have initialised the ports?
    thanks in advance,
    kplaetevoet
    New Member
    New Member
    Posts:


    --
    29 Oct 2007 05:09 AM
    I didn't get the code for the flexcan.

    I have written my own with the help of the automatic code generator
    (CFInit).

    To assign canrx and cantx to the pins you have to write to
    PAR_LCDDATA 0xFC0A_405D and
    PDDR_LCDDATAH

    be careful the canrx and cantx are onto 2 places on the device...

    greetings
    srinivas.acharya@lntemsys.com
    New Member
    New Member
    Posts:


    --
    29 Oct 2007 05:23 AM
    Yes, as you said it, in MCF5329EVB, CANRX and CANTX are available on 3 pins. FECI2C , SSI, and LCDDATA. I tried to use on all the 3 pins it still does not work. But the loopback for CAN works. Only it does not work on the port out of the board.

    Is it sufficient to initialise LCDDATA lines with
    MCF_GPIO_PAR_LCDDATA =0xA0

    Could you share more details?

    thanks in advance,
    Srinivas
    kplaetevoet
    New Member
    New Member
    Posts:


    --
    29 Oct 2007 05:32 AM
    Hi,

    I use LCD_D16 and LCD_D17 for can with code:

    #define CF5329_GPIO_PAR_LCDDATA_PAR_LD16(x) (((x)&0x03)<<4)
    #define CF5329_GPIO_PAR_LCDDATA_PAR_LD17(x) (((x)&0x03)<<6)


    CF5329_GPIO_PAR_LCDDATA = ( 0
    | CF5329_GPIO_PAR_LCDDATA_PAR_LD16(0x02)
    | CF5329_GPIO_PAR_LCDDATA_PAR_LD17(0x02));
    PDDR_LCDDATAH = 0x00;


    greetings
    srinivas.acharya@lntemsys.com
    New Member
    New Member
    Posts:


    --
    29 Oct 2007 06:40 AM
    Yes, now I tried this your suggested way. When I call the CAN write with std id, I get the Messagebuffer
    updated with 1000 to 1100, but not further.
    also at that time I see the ERRSTAT showing 00000252.
    Bus is connected, what could be wrong.?
    kplaetevoet
    New Member
    New Member
    Posts:


    --
    29 Oct 2007 09:21 AM
    Hey,

    You can use the Coldfire Initialisation Utility

    http://www.microapl.co.uk

    this program generate all basic code for the MCF5329.

    greetings
    srinivas.acharya@lntemsys.com
    New Member
    New Member
    Posts:


    --
    29 Oct 2007 10:44 PM
    Thank you for your inputs. Just to check if have the same parts both sides,
    we are using MCF53xx_SDK with part number 1001660.

    In the schematic, it appears that FECI2C is used for CANTX, CANRX. When we configure these pins as GPIO and we tried to toggle with software, then the pin data output register MCF_GPIO_PODR_FECI2C toggles, while also we cannot makeout toggling on the pins.

    Just to make sure are you using the same partnumber, and schematik?
    I did not understand how LCDDATA16,17 are used?
    kplaetevoet
    New Member
    New Member
    Posts:


    --
    30 Oct 2007 01:29 AM
    Hi,

    Sure I'm not working on the demo board, but on my own devlopped board.
    I'm using MCF5329CVM240.


    ---