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