Hi All,
I am trying to make data communication with CAN automobile blocks.
CAN seems does not initialize and I can't recieve data messages.
The system is :
CANBlock -> Philips 82C215 - >ADUM1200 (5V - >3.3V) -> Atmel
AT91SAM7X with 18.432 Mhz, MCK - 48Mhz.
CAN bus speed is: 500Kbp/s
From datasheet and other sources I calculated the CAN Baudrate to be
CAN_BR = 0x53255 (BRP - 5, SJW - 3, PRS - 2, PHS1 - 5, PHS2 - 5)
The initialization steps are following:
1. Cfg PIO - enable PA19 and PA20 pins
2. Cfg CAN PMC - enable clock for CAN
3. AT91F_AIC_ConfigureIt - enalbe interrups for CAN.
4. Set baudrate - CAN_BR = 0x53255;
5. Enable CAN_WAKEUP interrupt
6. Turn on CAN - CAN_MR = CANEN;
7. Wait for CAN_WAKEUP interrupt !!
comes on,! but same time the status register
has AT91C_CAN_ERRA bit set, why?
8. Enable MB0 intterupt and Initialize Mailbox 0 with MIDvA = 0x110, etc.
wait for data. !
Stuck!. no data!
BUT, CAN block repeatedely sends messages on the bus, this is verified
with other USB-CAN adapter.
I have checked with oscillograph, the CAN bus signal is correct at
PA19 pin of Atmel.
What is wrong here?
Please help.
I can paste the C code also.