90can128 can controller
2009-12-16 by blue_eagle74
Yahoo Groups archive
Index last updated: 2026-04-28 22:41 UTC
Thread
2009-12-16 by blue_eagle74
I have read the datasheets and researched the net. I used the CV wizard to set the can up. How do I send data? Is there an example of sending data of switch positions, 8 bit, from one micro to another and displaying it using CV? Brian
2009-12-16 by Dave McLaughlin
Hi Brian, If your C programming is good, you could try porting the Atmel CAN bus library to CV. I did this for a project last year and it works pretty well once you figure out how it works. Needs a bit of work to get it going under CV but it can be done. Good luck, CAN is superb once you get it work. Very reliable and robust. Dave.
From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf Of blue_eagle74 Sent: 16 December 2009 10:17 To: AVR-Chat@yahoogroups.com Subject: [AVR-Chat] 90can128 can controller I have read the datasheets and researched the net. I used the CV wizard to set the can up. How do I send data? Is there an example of sending data of switch positions, 8 bit, from one micro to another and displaying it using CV? Brian [Non-text portions of this message have been removed]
2009-12-16 by blue_eagle74
Thanks, I have the files just need to figure out how to use them. Any hints? Brian --- In AVR-Chat@yahoogroups.com, "Dave McLaughlin" <dave_mclaughlin@...> wrote:
> > Hi Brian, > > If your C programming is good, you could try porting the Atmel CAN bus > library to CV. > > I did this for a project last year and it works pretty well once you figure > out how it works. Needs a bit of work to get it going under CV but it can be > done. > > Good luck, CAN is superb once you get it work. Very reliable and robust. > > Dave.
2009-12-31 by blue_eagle74
I have searched and searched but cant find what I need. Can anyone provide a simple C code in CV using the CANbus. A simple one for transmit and/or request info from the other AVR. I just want to talk to another AVR and have it respond and turn on an LED so I can see that it works. I have found code but dont understand it. Does anyone have a tutorial? Brian
2009-12-31 by blue_eagle74
I am using CodeVision to compile and load the chips. I have seen many sites that describe the CAN. I have used the CV wizard to set up the CAN using only MOB1 but don't know how to start sending or recieving data or where to get the data. Brian --- In AVR-Chat@yahoogroups.com, "Dave McLaughlin" <dave_mclaughlin@...> wrote:
> > The CAN controller in the device needs a fair bit of work to fully > understand it and also a good understanding of CAN to be able to use it > fully. > > > > There is quite a bit to setup the device to make it work and it took me > about 1 week with the code from the Atmel website, porting it to the > Codevision compiler before it would work. It is ready to go with the WinAVR > I believe so if you have that compiler, you should be able to figure it out? > I was already familiar with the Microchip MCP2515 before but moving to the > AVR CAN took me a whilst to figure out and I am still working on it. > > > > CAN does not work as a request and get data, except for certain situation > where you do a request. Normally, CAN devices just send data on event or at > preset times. For the likes of digital inputs, I would only send a message > on the bus if there was a change. For analog I would send at a preset rate. > > > > The beauty of CAN is that you don't have to worry about having a master with > multiple slaves as you would with the likes of RS485. You simple ensure that > each device on the bus sends a unique ID for each message. CAN messages are > based on priority so a higher priority message goes first if 2 devices try > to send data at the same time. This reduces your workload in the processor > to very little and you simple set the buffer to transmit and let the CAN > controller do the work of sending the message and detecting errors. > > > > Remember that CAN is source message based. That means there is no > destination address. The remote devices know which messages they are > interested in and are usually setup with the message filters to only receive > those messages. This bit takes a fair bit of work to understand but once you > do, it will be easy to create remote devices listening only for required > messages. > > > > Which compiler are you using? > > > > Dave.
2009-12-31 by Dave McLaughlin
The CAN controller in the device needs a fair bit of work to fully understand it and also a good understanding of CAN to be able to use it fully. There is quite a bit to setup the device to make it work and it took me about 1 week with the code from the Atmel website, porting it to the Codevision compiler before it would work. It is ready to go with the WinAVR I believe so if you have that compiler, you should be able to figure it out? I was already familiar with the Microchip MCP2515 before but moving to the AVR CAN took me a whilst to figure out and I am still working on it. CAN does not work as a request and get data, except for certain situation where you do a request. Normally, CAN devices just send data on event or at preset times. For the likes of digital inputs, I would only send a message on the bus if there was a change. For analog I would send at a preset rate. The beauty of CAN is that you don't have to worry about having a master with multiple slaves as you would with the likes of RS485. You simple ensure that each device on the bus sends a unique ID for each message. CAN messages are based on priority so a higher priority message goes first if 2 devices try to send data at the same time. This reduces your workload in the processor to very little and you simple set the buffer to transmit and let the CAN controller do the work of sending the message and detecting errors. Remember that CAN is source message based. That means there is no destination address. The remote devices know which messages they are interested in and are usually setup with the message filters to only receive those messages. This bit takes a fair bit of work to understand but once you do, it will be easy to create remote devices listening only for required messages. Which compiler are you using? Dave.
From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf Of blue_eagle74 Sent: 31 December 2009 10:37 To: AVR-Chat@yahoogroups.com Subject: [AVR-Chat] Re: 90can128 can controller I have searched and searched but cant find what I need. Can anyone provide a simple C code in CV using the CANbus. A simple one for transmit and/or request info from the other AVR. I just want to talk to another AVR and have it respond and turn on an LED so I can see that it works. I have found code but dont understand it. Does anyone have a tutorial? Brian [Non-text portions of this message have been removed]
2009-12-31 by Dave McLaughlin
I will fire up my compiler later and see if I can give you some pointers from the Atmel code. Dave.
From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf Of blue_eagle74 Sent: 31 December 2009 11:30 To: AVR-Chat@yahoogroups.com Subject: [AVR-Chat] Re: 90can128 can controller I am using CodeVision to compile and load the chips. I have seen many sites that describe the CAN. I have used the CV wizard to set up the CAN using only MOB1 but don't know how to start sending or recieving data or where to get the data. Brian [Non-text portions of this message have been removed]
2009-12-31 by blue_eagle74
That would be great. Thank you. Brian --- In AVR-Chat@yahoogroups.com, "Dave McLaughlin" <dave_mclaughlin@...> wrote:
> > I will fire up my compiler later and see if I can give you some pointers > from the Atmel code. > > > > Dave.
2010-01-03 by blue_eagle74
I just got my 50/100 card edge connectors and have made my eaglecad drawing so I can etch my boards for my backplane. I will have two backplanes with 5 connectors each with ribbon cable connecting them. My order was shorted the connectors for the ribbon cable but I called them and the sockets are on the way. The hard part is the programming so the chips can talk to each other. Brian --- In AVR-Chat@yahoogroups.com, "blue_eagle74" <blue_eagle74@...> wrote:
> > That would be great. Thank you. > > Brian > > --- In AVR-Chat@yahoogroups.com, "Dave McLaughlin" <dave_mclaughlin@> wrote: > > > > I will fire up my compiler later and see if I can give you some pointers > > from the Atmel code. > > > > > > > > Dave. >
2010-01-03 by Dave McLaughlin
Hi Brian, If you look in the code for the Atmel driver you will find a Function in CAN_DRV.H called Can_config_tx() This sets the following register to start the transmission. CANCDMOB |= (MOB_Tx_ENA << CONMOB) There is other stuff you need to setup before calling this. Look for the function can_cmd() in CAN_LIB.C as this show the sequence needed to config before sending. Look for the case CMD_TX_DATA and you will see what I mean. Good luck and if you need more help let me know. Dave.
From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf Of blue_eagle74 Sent: 03 January 2010 08:20 To: AVR-Chat@yahoogroups.com Subject: [AVR-Chat] Re: 90can128 can controller I just got my 50/100 card edge connectors and have made my eaglecad drawing so I can etch my boards for my backplane. I will have two backplanes with 5 connectors each with ribbon cable connecting them. My order was shorted the connectors for the ribbon cable but I called them and the sockets are on the way. The hard part is the programming so the chips can talk to each other. Brian --- In AVR-Chat@yahoogroups.com <mailto:AVR-Chat%40yahoogroups.com> , "blue_eagle74" <blue_eagle74@...> wrote: > > That would be great. Thank you. > > Brian > > --- In AVR-Chat@yahoogroups.com <mailto:AVR-Chat%40yahoogroups.com> , "Dave McLaughlin" <dave_mclaughlin@> wrote: > > > > I will fire up my compiler later and see if I can give you some pointers > > from the Atmel code. > > > > > > > > Dave. > [Non-text portions of this message have been removed]