Search found 31 matches

by hwmaier
Wed Jun 14, 2017 10:15 am
Forum: Hardware
Topic: CAN controller clock and slow CAN bitrates
Replies: 15
Views: 24677

Re: CAN controller clock and slow CAN bitrates

@ESP_igrr Thank you for the clarification. Your support is excellent. However I must admit I was hoping there would be a solution. The fact that the clock frequency for the CAN controller cannot be reduced does put some limits on the usage scenarios for the ESP32 CAN. Without being able to reduce th...
by hwmaier
Wed Jun 14, 2017 1:05 am
Forum: General Discussion
Topic: Reducing clock frequency
Replies: 7
Views: 18877

Re: Reducing clock frequency

@ESP_igrr: I thought that would be the case. Thank you for clarification. I was hoping to be able to reduce the APB_CLK so the CAN controller can run on a lower clock frequency so we can support certain standard baudrates. Seems I have run out of options now (refer to https://www.esp32.com/viewtopic...
by hwmaier
Tue Jun 13, 2017 11:32 pm
Forum: General Discussion
Topic: Reducing clock frequency
Replies: 7
Views: 18877

Re: Reducing clock frequency

Following conversation above, does the Wifi and BT subsystems depend on APB clock to be 80MHz or can APB clock be changed to a different value without affecting Wifi & BT?
by hwmaier
Tue Jun 13, 2017 11:49 am
Forum: Hardware
Topic: CAN controller clock and slow CAN bitrates
Replies: 15
Views: 24677

Re: CAN controller clock and slow CAN bitrates

@rudi: Thank you for your replies. I am aware that the CAN controller is a SJA1000 and I have worked with the SJA1000 before, so know the chip quite well. I also have access to the ESP32 Technical Reference. But the ESP32 offers little information about the possible clock sources of the CAN controll...
by hwmaier
Tue Jun 13, 2017 10:48 am
Forum: Hardware
Topic: CAN controller clock and slow CAN bitrates
Replies: 15
Views: 24677

Re: CAN controller clock and slow CAN bitrates

This also can be verified using a CAN bit rate calculator like this one:

https://www.kvaser.com/support/calculat ... alculator/
by hwmaier
Tue Jun 13, 2017 10:46 am
Forum: Hardware
Topic: CAN controller clock and slow CAN bitrates
Replies: 15
Views: 24677

Re: CAN controller clock and slow CAN bitrates

In order to achieve a 10kbps CAN bitrate, the clock speed for the CAN controller must not be higher than 32 MHz. The CAN controller is not documented much, so I am hoping that there is a register to either pre-scale the clock or a clock divider of some sort or to use a different and slower clock sou...
by hwmaier
Tue Jun 13, 2017 10:34 am
Forum: Hardware
Topic: CAN controller clock and slow CAN bitrates
Replies: 15
Views: 24677

Re: CAN controller clock and slow CAN bitrates

@rudi: Its not a matter of software but hardware capabilities of the ESP32 chip. The baud rate prescaler in the SJA1000 is only 6 bit wide, resulting in a max pre-scaler value of 64. As a result the longest time quanta achievable is 1.6us. The max number of time quanta we can use with a SJA1000 is 2...
by hwmaier
Tue Jun 13, 2017 9:01 am
Forum: Hardware
Topic: CAN controller clock and slow CAN bitrates
Replies: 15
Views: 24677

CAN controller clock and slow CAN bitrates

Hi all, The ESP32 CAN controller is clocked with APB clock of 80 MHz. Using this clock it won't be possible to operate with the CANopen standard bit rates of 5kbit/s, 10kbit/s and 20kbit/s. Higher bit rates are no problem, all standard bitrates from 50kbit/s upwards work. Is there a possibility to u...
by hwmaier
Thu Jun 08, 2017 8:27 am
Forum: ESP-IDF
Topic: RS-485 support
Replies: 27
Views: 57441

Re: RS-485 support

@ aaquilina Are you using my PR? If yes, it has a small bug which I have not fixed yet in the PR which may cause this issue: Try changing uart_set_rs485_hd_mode to esp_err_t uart_set_rs485_hd_mode(uart_port_t uart_num, bool enable) { UART_CHECK((uart_num < UART_NUM_MAX), "uart_num error", ESP_FAIL);...
by hwmaier
Sat Jun 03, 2017 12:57 am
Forum: ESP-IDF
Topic: RS-485 support
Replies: 27
Views: 57441

Re: RS-485 support

@aaquilina: Of course it has to enabled as well. Before the FIFO is written to you have to set the GPIO and also enable the interrupt. There are two locations in uart.c where this needs to be done. Once in uart_fill_fifo and once in the ISR. I submitted a PR with my code, so you can check it out. Pl...