STM8AF5288 - CAN issues
I'm trying to get my STM8AF5288 to read CAN from a TJA1050.
I had it reading perfectly. 1Mbps @ 16Mhz. Using time_seg1 of 8, tim_seg2 of 7, prescale of 1. SJW1.
The sending unit is an Arduino attached to an MCP2515 and TJA1050. Verified with another arduino unit that it can read the sending on the CAN bus.
Now, I decided that after utilizing the internal clock and being able to read CAN, I would switch to an external resonator. Threw that on, and suddenly couldn't get CAN to work anymore. I hadn't even selected the external clock to be used. Still had internal setup in the code.
So, I removed the resonator I installed. Still can't get CAN.
I have 7x of these PCB, so I thought maybe I messed something up. Rebuilt another w/ all new components. Still not seeing CAN.
I am getting stuff populated in the CAN FIFO data. But, it's always the same thing and appears to be 'junk'. Where, previously I was seeing the correct standard ID and 8 data bytes following.
For my purpose (automotive, hobby / non-commercial), I ultimately need to read 500Kbps. Which I am seeing prescale 2, seg 1 @ 13, seg 2 @ 2, sjw of 1. Using bittiming.can-wiki.info.
The thing I'm trying to figure out, is what would cause the signal to not be suddenly read? I'm at a complete loss of where to look, where to even begin.... from working, to suddenly not working....
I took the CAN code from the example, and like mention, everything was working fine. Currently setting HSI clock via
CLK_DeInit();
CLK_HSIPrescalerConfig(CLK_PRESCALER_HSIDIV1);
CLK_ClockSwitchConfig(CLK_SWITCHMODE_AUTO, CLK_SOURCE_HSI, DISABLE, CLK_CURRENTCLOCKSTATE_DISABLE);
Any information is greatly appreciated, thank you!
