Hi,
i'm trying to use CAN on the extansion header of the Primer 1 for a while now but it doesn't work.
I'm using arm-gcc from codesourcery (2008q1-126), the fwlib v2.0.3 and OOCD which seem to work flawlessly with the Primer 1.
To use CAN on the header i have to remap it to PB8 and PB9.
I think i have a problem there.
Has anyone a hint for me in which order i have to initialise the hardware(after the clock-init).
In which order do i have to remap and initialise the ports to map CAN to PB8 and PB9?
Right now i use the following procedure which doesn't work:
-enable clock for Port B and AFIO: RCC_APB2Periph_GPIOB | RCC_APB2Periph_GPIOB, ENABLE
-enable clock for CAN: RCC_APB1Periph_CAN, ENABLE
-init TX - PB9 as output AFIO
-init RX - PB8 as input IPU
-remap GPIO_Remap1_CAN, ENABLE
-CAN_DeInit
-CAN_StructInit
-set up CAN to 125kHz and 87.5% sampling point
The problem now is that TX(PB9) is driven low all the time, blocking the bus.
RX(PB8) driven high from the transceiver, which is ok. The other bus node is a Peak-CAN USB also set to the bus parameters mentioned above. The PeakCAN works very well with other bus-nodes.
Thx in advance, Paul