RFC: One-Wire and interrupts

42 views
Skip to first unread message

Oliver Seitz

unread,
Nov 2, 2020, 5:07:03 AM11/2/20
to jal...@googlegroups.com
Hi all!

I've had problems using serial_hw_int_cts and ds18b20 in a program, so I've made some additions to the one_wire library. You can define a safety level: Level 1 makes errors to occur less often with few side effects. Level 2 reduces errors triggered by interrupts to zero, but it will limit e.g. serial reception to a speed of 19200 baud.

The default of level 0 works as before to keep compatibility.

The most annoying error I've seen was that the "convert temp"-command was regularly corrupted, so I got during several minutes always the same reading of the scratchpad which was a temperature of a long time ago.
Then, occasionally the power-up after the write was delayed so the sensors did reset, giving a wrong temperature of 85°C.

If there are no objections, could someone commit the attached file please?

Thanks,
Kiste
one_wire.jal

Rob CJ

unread,
Nov 2, 2020, 6:37:16 AM11/2/20
to jal...@googlegroups.com
Hi Kiste,

Thanks for the effort. 

I will validate the library (running a Python script to check against the 'coding rules') and will commit it for you.

BTW. Something completely different for all JAL users. In one of the new bee packages I solved an inconsistency problem in quite some device files. Only is you use the 'fuses' keyword ZCD, then you must fix that.

Instead of 'pragma ZCD on' it should be 'pragma ZCD enabled' (or disabled). The motivation for this that for some devices 'on' was enabled and for others 'on' was disabled. I know changed  them all to the correct enabled or disabled.

I am not sure if you will encounter this but at least you are aware in case you get a compilation error.


Kind regards,

Rob


Van: 'Oliver Seitz' via jallib <jal...@googlegroups.com>
Verzonden: maandag 2 november 2020 11:04
Aan: jal...@googlegroups.com <jal...@googlegroups.com>
Onderwerp: [jallib] RFC: One-Wire and interrupts
 
--
You received this message because you are subscribed to the Google Groups "jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jallib+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jallib/1904390978.575683.1604311459507%40mail.yahoo.com.

Rob CJ

unread,
Nov 2, 2020, 1:30:08 PM11/2/20
to jal...@googlegroups.com
Hi Kiste,

I noticed two things when checking the one-wire library:
1) There does not seem to be a sample program that is needed to compile the library. The 'rule' is that there is at least one sample program for each library. Apparently this one was missed.
2) The combination of capitals and small letters is not allowed according to the coding convention. I can change it for you in gie_save. Normally capitals are only used for constants (but that is not an official convention I think).  Below you find the message from Python script:
 
File: one_wire.jal
1 errors found
        ERROR: one_wire.jal: 59,61,64,75,79,95,97,100,113,117,130,132,135,151,155,167,169,172,188,192,215,217,220,237,241: Found Capitals in token: 'GIE_save'

I can create a simple sample program but if you have one laying around  that we can use I can upload that too. It has to be something that somebody can easily use, e.g. sending the temperature as text to a terminal via the USART. If you do not have something that we can use I will create one this weekend.

Kind regards,

Rob


Van: jal...@googlegroups.com <jal...@googlegroups.com> namens Rob CJ <rob...@hotmail.com>
Verzonden: maandag 2 november 2020 12:37
Aan: jal...@googlegroups.com <jal...@googlegroups.com>
Onderwerp: Re: [jallib] RFC: One-Wire and interrupts
 

Oliver Seitz

unread,
Nov 2, 2020, 1:54:08 PM11/2/20
to jal...@googlegroups.com
Hi and thanks for the information, I'll try to keep the style in mind next time.

I found a sample named 16f648a_ds18b20_single.jal which uses the library indirectly. Is that enough?

Greets
Kiste

Am Montag, 2. November 2020, 19:30:10 MEZ hat Rob CJ <rob...@hotmail.com> Folgendes geschrieben:


Rob CJ

unread,
Nov 3, 2020, 1:56:28 AM11/3/20
to jal...@googlegroups.com
Hi Kiste,

I missed that one. Normally the sample program carries the name of the library.

Thanks for the hint. I will fix the naming convention and fix it.

Kind regards,

Rob


Van: 'Oliver Seitz' via jallib <jal...@googlegroups.com>
Verzonden: maandag 2 november 2020 19:54
Reply all
Reply to author
Forward
0 new messages