AVR CAN - Mobs & Buffer Frame mode

Hello everybody.. I would need some help on AVR CANbus and expecially about Buffer Frame Receiver mode... I m going to post my example code...in this case i need to receive messages using two Mobs with 2 different ID and than print on a file those messages received using serial port, but something is wrong.

Are the mons initialization, routine interrupt and main function correct? what's wrong??

thank u so much Daniele

#include #include #include #include "config.h" #include "can_lib.h" #include "can_drv.h" #include "USART.h"

ISR(CANIT_vect) { unsigned char Sentence[100]; char CAN_MSG[8], SaveCANPAGE; char MOBNB; unsigned long int ID;

MOBNB = (CANPAGE & 0xF0)>>4; SaveCANPAGE = CANPAGE;

if ((CANGIT & 0x10) == 0x10) // BxOK set { for (MOBNB=0; MOBNB

Reply to
pidy
Loading thread data ...

On 08/10/2006 the venerable pidy etched in runes:

What is probably wrong is that you have put a function call to 'sprintf' inside your ISR. That is a very bad idea.

This is not an appropriate place to post this message 'comp.arch.embedded' would be much better.

--
John B
Reply to
John B

ok i d just post it in the right section... anyway i dont think the error is that one u said.. i always use sprintf inside my ISR expecially in debug mode without problem...

the error should be in the use of Frame Buffer...

Reply to
pidy

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.