View previous topic :: View next topic |
Author |
Message |
RHA
Joined: 25 Apr 2006 Posts: 31 Location: Germany
|
CAN-Communication disturbed when Controller gets warm/hot |
Posted: Mon Jul 09, 2012 11:35 pm |
|
|
Hi,
I have a project where 2 Motors for blinds have to be synchronized. They both works with a PIC18F46k80 with internal oscillator (16Mhz) and the motors (speeds) are controlled by PWM. For synchronization there are some datas which are permanently transfered over CAN (16Bytes in 2 ID-Frames (2x8Bytes)) with 200.000 Baud. The transmitting of the data is monitored with timers so the master sends an ID-Frame every 15ms and wants to get an answer from the slave within 10ms. When an error occurs or the answer was not get within the 10ms the transmitting will be repeated up to 2 times. The slave goes in error when it don't gets a new frame within 45ms. If there are 3 transmitting errors the communication and the motors stops and the motors will signalize an error.
Now I have the problem when the controller gets warm/hot the communication is disturbed and stops. In the moment I don't know if the controller (kernel) stops the communication or if transmitting error happens (I have to do some further tests) but I know that it comes from the controller (first searched with hot air, then with solder pen directly to the controller).
Has anybody an idea where I can search for the problem? |
|
|
RF_Developer
Joined: 07 Feb 2011 Posts: 839
|
Re: CAN-Communication disturbed when Controller gets warm/ho |
Posted: Tue Jul 10, 2012 1:57 am |
|
|
RHA wrote: | with internal oscillator (16Mhz) |
The internal oscillator isn't very stable over temperature. It doesn't even meet RS232 specs over the full temp range. People use it a lot because its there and it's "free", but for many applications, and any that use communications you really should use an external crystal or oscillator.
RF Developer |
|
|
RHA
Joined: 25 Apr 2006 Posts: 31 Location: Germany
|
|
Posted: Tue Jul 10, 2012 6:45 am |
|
|
Thanks for the hint. I will make a try with an external oscillator within the next days. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19535
|
|
Posted: Tue Jul 10, 2012 7:26 am |
|
|
How much timing error CAN bus can 'handle', depends on the settings you choose. The formula is:
Minimum(Phase_seg1, Phase_seg2)/(2*(13*NBT-Phase_seg2))
So with (say) a nominal bit time of 8 (sum of all the segments), and Phase_seg1=1, Phase_seg2=2, you get:
1/2*(13*8-2) = 0.0049
0.49%.
The internal oscillator gives +/-2% - factor of four too large.....
The data sheet does cover this in paragraph 27.12:
"As a rule of thumb, the bit timing requirements allow
ceramic resonators to be used in applications with
transmission rates of up to 125 Kbit/sec. For the full bus
speed range of the CAN protocol, a quartz oscillator is
required. Refer to ISO11898-1 for oscillator tolerance
requirements."
So, for lower rates, a ceramic resonator may be 'good enough', but for higher rates, a crystal is required. Not even the faintest 'suggestion' of trying to run this bus off the internal RC.....
Best Wishes |
|
|
RHA
Joined: 25 Apr 2006 Posts: 31 Location: Germany
|
|
Posted: Tue Aug 14, 2012 7:22 am |
|
|
A late reply is better than no reply:
It was the oscillator. With an external crystal everything works fine. |
|
|
|