EmbeddedRelated.com
Forums

Communication between two LPC2129 using CAN

Started by houssemkouki2004 September 19, 2007
Hello community
who could send me some source code for the gesture of communication
between 2 LPC2129 without using structures plezzz!

An Engineer's Guide to the LPC2100 Series

At 12:49 PM 9/19/2007 +0000, houssemkouki2004 wrote:
>Hello community
>who could send me some source code for the gesture of communication
>between 2 LPC2129 without using structures plezzz!

Why would structures or lack thereof make any difference?

Robert

http://www.aeolusdevelopment.com/

From the Divided by a Common Language File (Edited to protect the guilty)
ME - "I'd like to get Price and delivery for connector Part # XXXXX"
Dist./Rep - "$X.XX Lead time 37 days"
ME - "Anything we can do about lead time? 37 days seems a bit high."
Dist./Rep - "that is the lead time given because our stock is live.... we
currently have stock."
--- In l..., Robert Adsett wrote:
>
> At 12:49 PM 9/19/2007 +0000, houssemkouki2004 wrote:
> >Hello community
> >who could send me some source code for the gesture of communication
> >between 2 LPC2129 without using structures plezzz!
>
> Why would structures or lack thereof make any difference?
>

I'm a bit confused as well. The CAN controller block is an obvious
'structure', as is the GAF. A CAN message, consisting of an 8-byte
block with an 11/29-bit rx/tx ID is another 'item' that seems like it
should be collected together in one struct. My CAN IDs have an
internal sub-structure of logical source, destination, channel,
peripheral type etc, and it's extremely convenient to use structs,
unions etc. to access these sub-fields.

OP - if not structures to hold the GAF, ID, messages etc, then what?
What is your interrupt-handler to do with received data? Where is the
transmit-handler to get its next data from?

If you are polling, just look at the flags in CANGSR/CANRFS/CANCMR to
see if anything has been received and accept it, and test/set
CANGSR/CANCMR/CANTFx/CANTIDx/CANTDAx/CANTDBx to send stuff.

Rgds,
Martin
Why the problem with structures? Seems quite sensible to me to make a
structure to define a CAN message?

Andy

-----Original Message-----
From: l... [mailto:l...]On Behalf Of
houssemkouki2004
Sent: 19 September 2007 13:50
To: l...
Subject: [lpc2000] Communication between two LPC2129 using CAN
Hello community
who could send me some source code for the gesture of communication
between 2 LPC2129 without using structures plezzz!
thanx for ur replies..
I know it's a lot easier to use structures for CAN messages, but I got
some problems to send a frame of 200 bytes data, this frame contains
messages that I've sent from a PC to the master by UART ,the master
split it into many lines, and send each line to the appropriate slave,
the transmit buffers can't contain all this data (and there is sth
wrong with using the 3 transmit buffers at the same time (see LPC
errata sheet)), what could I do ?
By the sounds of it, buffer it yourself and send it out in chunks of data
and reassemble at the other end. Pretty much what I already do for sending
large strings across a CAN bus.

Andy

-----Original Message-----
From: l... [mailto:l...]On Behalf Of
houssemkouki2004
Sent: 20 September 2007 09:21
To: l...
Subject: [lpc2000] Re: Communication between two LPC2129 using CAN
thanx for ur replies..
I know it's a lot easier to use structures for CAN messages, but I got
some problems to send a frame of 200 bytes data, this frame contains
messages that I've sent from a PC to the master by UART ,the master
split it into many lines, and send each line to the appropriate slave,
the transmit buffers can't contain all this data (and there is sth
wrong with using the 3 transmit buffers at the same time (see LPC
errata sheet)), what could I do ?