[OpenTRV-dev] Puzzling long-term bugs

Kevin Wood kevin at the-wood-family.com
Wed Sep 28 17:32:04 BST 2016


Yes, the BAUD rate can't be exactly correct unless your crystal is a
multiple of the exact BAUD rate, so there's always some "slip". That's not
a problem unless you send a completely solid stream of data because the
receiving UART resyncs on each start bit after it has fallen idle, so
keeping the packets of serial data small with a delay in-between can help.

That said, I can't remember what crystal we're using (Wasn't it 1MHz?) nor
what the divider setup is in the AVR, but I know you can't get an accurate
match for the BAUD rate unless you go for a 1.8432 / 3.6864 MHz crystal.

Best Regards


Kevin

> Is this more than just UART being UART and the clocks of of each side
> being
> out?
>
>
> Maybe try repeatedly sending 'U' on one of the problematic devices and
> measure the frequency, should be half the baud rate as U is 01010101
>
> IIRC you use a relatively slow baud rate (4800 IIRC) so you could be
> overwriting data in a buffer if you send data to fast?
>
> Jeremy
>
> On 28 Sep 2016 3:08 p.m., "Damon Hart-Davis" <damon at opentrv.uk> wrote:
>
>> Hi,
>>
>> We have a Wiki page here for our general amusement:
>>
>> https://github.com/opentrv/OTWiki/wiki/Puzzling-Long-Term-Bugs
>>
>> We’ve certainly been having some puzzlement while putting together a
>> small
>> run of valves for a trial over the last few days.  Could be summarised
>> as
>> ‘dodgy serial’:
>>
>> - Some REV7 and other V0p2 units seem to have problems with serial RX
>> and
>> TX, garbling some characters
>>     - Seems especially problematic for longer (16+?) blocks of
>> characters
>> such as setting a key
>>     - Have tried to ensure no sleeping or other fiddling with CPU clock
>> during UART operation
>>     - Seems to apply to a few % of REV7, REV10 boards at least
>>     - It has been possible to load a large (30KB) app over serial with
>> the
>> bootloader.
>>
>> Any ideas welcome!
>>
>> Rgds
>>
>> Damon
>>
>> _______________________________________________
>> OpenTRV-dev mailing list
>> OpenTRV-dev at lists.opentrv.org.uk
>> http://lists.opentrv.org.uk/listinfo/opentrv-dev
>>
> _______________________________________________
> OpenTRV-dev mailing list
> OpenTRV-dev at lists.opentrv.org.uk
> http://lists.opentrv.org.uk/listinfo/opentrv-dev
>




More information about the OpenTRV-dev mailing list