This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello,
We are using the HalCoGen tool and configuring the CAN bit timing in the BTR register. Could you provide any more information on what HalCoGen is optimizing for, particularly regarding the BRP value?
For example, I'd like to understand why is the BRP chosen to be 49 as opposed to 24 in the example below. The configuration with 24 would double the fBrp to 4MHz, and could have the following parameters: tq = 250ns, SYNC_SEG = 1, PROP_SEG = 10, PH_SEG1 = 3, PH_SEG2 = 2. That would have the same Bit Rate, t_propseg, and Sample Point.
One thought is that HalCoGen is forcing PH_SEG1 = PH_SEG2 or PH_SEG2 = PH_SEG1+1 based on 24.3.2.1 'Calculation of the Bit Timing Parameters' in the TMS570LS0714 reference manual. That requirement is fulfilled by setting BRP=49 but not by setting BRP=24. It also seems reasonable to me that it is choosing BRP=49 based on desiring the highest oscillator tolerance between two viable configurations.
Thanks!
Matt
Hello,
Both 24 and 49 can be used. The maximum prop_seg is 8 tq. The bit rime is consist of 8 to 25 tq.
If BRP=24, the tq is 250ns instead of 500ns, number of tq is 16 --> PH_SEG1 + PH_SEG2 = 16-1 (sync) - 8 (prop)=7 --> PH_SEG2=4, PH_SEG1=3
Hi QT,
Thanks for your reply that makes sense. Does HalCoGen provide a method for setting the BRP to choose between the two viable configurations?
Best,
Matt
Hello Matt,
No. You have to change the code manually to use different BRP value.