![]() |
Forum Index : Microcontroller and PC projects : DS18B20 Temp sensor & MM Basic
Author | Message | ||||
Hatrick Newbie ![]() Joined: 16/11/2015 Location: AustraliaPosts: 6 |
One for Geoff: First, thanks for producing the Basic interpreter for the Micromite. This has stirred my interest after nearly 40 years from first learning Basic. I understand that the DS18B20 temperature sensor takes 200mS to measure the value, and during this time the processor will ignore other interrupts. My question is: during this measurement period, is the digital input count feature (ie, SETPIN (n) CIN, FIN)affected? Will it miss counting pulses during this period? Gerry |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2948 |
Hi Gerry, Just out of interest, are you aware that there is a START command which simply triggers the 'conversion'. Whilst the DS18B20 is doing its thing, the MM can continue doing other stuff (including interrupts). Then simply perform a 'read'; if more than 200mS has passed since the START, then the data will be immediately returned, otherwise the 'balance' of time will need to expire first before the data is returned. Hope this helps . . . . WW |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3303 |
Gerry, Yes, the count input will continue to count. In fact it is the only exception to the "freeze" that occurs while the temperature reading is made. As WW suggested, you can use TEMPR START to start the conversion and do other things while it is progressing. However, if you are just counting it is not really necessary. Geoff Geoff Graham - http://geoffg.net |
||||
Hatrick Newbie ![]() Joined: 16/11/2015 Location: AustraliaPosts: 6 |
Thanks for that, guys. That gives me some ideas as to where I will plant the DS18B20 command in the code. And I might tinker with that START command as well - wasn't aware of that one! rgds gerry |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |