Re: About the CAN controller.
Posted: Wed Apr 05, 2017 12:36 pm
It is working with MCP2551.
Kvaser log, I sent 8 zeros in the first three packets, then 0, 52 then six zeroes in the subsequent packets and the ESP32 echoes them.
The 2018 is the CAN ID, 8 is the DLC, then the payload, then the timestamp and Transmit or Receive.
What is interesting is the round trip time varies from 1ms to 8ms. 500kbps bus, nothing else on the bus. Any ideas on getting the latency lower? It isn't bad, but my 180MHz ECU usually replies in 1ms to Kvaser.
Getting rid of printf and changing to doesn't change it.
Kvaser log, I sent 8 zeros in the first three packets, then 0, 52 then six zeroes in the subsequent packets and the ESP32 echoes them.
The 2018 is the CAN ID, 8 is the DLC, then the payload, then the timestamp and Transmit or Receive.
Code: Select all
0 2018 8 0 0 0 0 0 0 0 0 66.129150 T
0 2018 8 0 0 0 0 0 0 0 0 66.133580 R
0 2018 8 0 0 0 0 0 0 0 0 76.258980 T
0 2018 8 0 0 0 0 0 0 0 0 76.263080 R
0 2018 8 0 0 0 0 0 0 0 0 80.845390 T
0 2018 8 0 0 0 0 0 0 0 0 80.853070 R
0 2018 8 0 52 0 0 0 0 0 0 87.391740 T
0 2018 8 0 52 0 0 0 0 0 0 87.393020 R
0 2018 8 0 52 0 0 0 0 0 0 89.739940 T
0 2018 8 0 52 0 0 0 0 0 0 89.743010 R
0 2018 8 0 52 0 0 0 0 0 0 90.887330 T
0 2018 8 0 52 0 0 0 0 0 0 90.893050 R
0 2018 8 0 52 0 0 0 0 0 0 92.257020 T
0 2018 8 0 52 0 0 0 0 0 0 92.262990 R
0 2018 8 0 52 0 0 0 0 0 0 93.409870 T
0 2018 8 0 52 0 0 0 0 0 0 93.413030 R
0 2018 8 0 52 0 0 0 0 0 0 94.374990 T
0 2018 8 0 52 0 0 0 0 0 0 94.383010 R
Getting rid of printf and changing
Code: Select all
if(xQueueReceive(CAN_cfg.rx_queue,&__RX_frame, 3*portTICK_PERIOD_MS)==pdTRUE){
Code: Select all
if(xQueueReceive(CAN_cfg.rx_queue,&__RX_frame, 1*portTICK_PERIOD_MS)==pdTRUE){