![]() |
Forum Index : Microcontroller and PC projects : PicoMite V6.00.02 betas
![]() ![]() |
|||||
Author | Message | ||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2925 |
I have used many different 1-Wire devices in the past (directly linked to PICs, and also with MMBASIC) and they work great PROVIDING you use genuine parts AND observe the datasheet parameters. Buying a pack of 10 'sensors' for $1 is not recommended for 1-wire (I have been down that path and it is NOT worth the headache) NOTE: From the datasheet: R0, R1: Thermometer resolution bits. Table 3 below defines the resolution of the digital thermometer, based on the settings of these 2 bits. There is a direct tradeoff between resolution and conversion time, as depicted in the AC Electrical Characteristics. The factory default of these EEPROM bits is R0=1 and R1=1 (12-bit conversions). Thermometer Resolution Configuration R1 R0 Thermometer Resolution Max Conversion Time 0 0 9 bit 93.75 ms (tconv/8) 0 1 10 bit 187.50 ms (tconv/4) 1 0 11 bit 375.00 ms (tconv/2) 1 1 12 bit 750.00 ms (tconv) For everything Micromite visit micromite.org Direct Email: whitewizzard@micromite.o |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 9957 |
MMBasic uses 10-bit as the default with the tempr function and allows 100mSec, 200mSec, 400mSec and 800mSec for the various modes. If the DS18B20 isn't ready after these times MMBasic returns 1000. This algorithm hasn't changed since the original Maximite |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6206 |
There is a very long thread from August 2020 discussing DS18B20 chips that are out of spec. My tests were done on the CMM2 and may need some tweaking to run on the pico. I will try and do some testing later in the week when I get back home. https://www.thebackshed.com/forum/ViewTopic.php?TID=12339&PID=152037#152037#152037 Jim VK7JH MMedit |
||||
bfwolf Regular Member ![]() Joined: 03/01/2025 Location: GermanyPosts: 65 |
@WhiteWizzard, @Peter: I didn't know that the DS18B20 had a configurable resolution! I simply ordered a few from a Chinese company I trust and used them on an Arduino UNO and it worked - with 12 bits of resolution. You learn something new every day ![]() ![]() I just took the trouble to take a quick look at the data sheet: The resolution must be specified by a "Write Configuration Register". What happens if a transmission error occurs (e.g. due to interference or poor power supply)? I'm not sure that a CRC check is carried out before the data is transferred to the RAM? The data sheet says: "Byte 8 of the scratchpad is read-only and contains the CRC code for bytes 0 through 7 of the scratchpad. The DS18B20 generates this CRC using the method described in the CRC Generation section. Data is written to bytes 2, 3, and 4 of the scratchpad using the Write Scratchpad [4Eh] command; the data must be transmitted to the DS18B20 starting with the least signifi- cant bit of byte 2. To verify data integrity, the scratchpad can be read (using the Read Scratchpad [BEh] command) after the data is written." That sounds like it would be left to the user to test? bfwolf. Edited 2025-03-10 07:22 by bfwolf |
||||
phil99![]() Guru ![]() Joined: 11/02/2018 Location: AustraliaPosts: 2398 |
That being the case and it does work for genuine DS18B20 units it can't be expected to work as per the manual on all non genuine ones. That said my two non genuine ones behave a little differently on b17 than they did on V6.01.01. Minor adjustments to programs can compensate for that. Will carry out further experiments on the DS18B20 thread linked to by TassyJim. |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6206 |
V6.00.02b17 Standard picomite with no options set. Known good DS18B20 and 'slow' module from Jaycar both work as expected. Jim VK7JH MMedit |
||||
electricat![]() Senior Member ![]() Joined: 30/11/2020 Location: LithuaniaPosts: 279 |
it seems used it wrong, so post deleted Edited 2025-03-10 16:19 by electricat My MMBasic 'sand box' |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 4809 |
Please be aware that the 2350 suffers from a GPIO pin fault. This is a hardware fault, that changes the input impedance if the pin is used as input. This may have impact on the DS18B20 in powered mode, but definitely will impact the behaviour of the DS18B20 when used in slave power mode. For slave power mode, use a 2040, just to be sure. Volhout PicomiteVGA PETSCII ROBOTS |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 9957 |
Slave power mode works fine on RP2350. I programmed round the E9 issue. Re: a previous comment about the DS18B20 not respecting the resolution - it does However if the actual temperature is 23.5 all resolutions will show 23.5. If the actual temperature is 23.625 then resolutions 0 and 1 will show 23.5 and 2 and 3 will show 23.625. Edited 2025-03-10 19:56 by matherp |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 9957 |
I've updated the betas for HDMI and RP2350 VGA to b18 These now all support 848x480 widescreen - same as mode 10 on the CMM2 To use the new resolution on HDMI use: OPTION RESOLUTION 848 Valid modes are: 1: 848 x 480 x 1bit with tiles 2: 424 x 240 x 4-bit with 1 layer buffer 3: 848 x 480 x 4-bit 5: 424 x 240 x 8-bit RGB332 On VGA use: OPTION WIDESCREEN ON/OFF Valid modes are: 1: 848 x 480 x 1bit with tiles 2: 424 x 240 x 4-bit with 1 layer buffer 3: 848 x 480 x 4-bit I assume only a proper widescreen monitor will show these correctly. CPU speed is 336MHz for both VGA and HDMI ![]() Edited 2025-03-11 05:25 by matherp |
||||
bfwolf Regular Member ![]() Joined: 03/01/2025 Location: GermanyPosts: 65 |
Did you mean my comment? ![]() I didn't mean to suggest that it was the software.. So if the DS18B20 receives the data correctly, it should also set the resolution and timing correctly. But suppose 1 or more bits were received incorrectly by the DS18B20 (e.g. due to interference or because it's a "bad chip")? Then it could be that it takes the measurement with 11 or 12 bits of resolution and of course takes longer to do so. That would also explain why an additional delay seemed to help. Regarding the new widescreen modes: Nice feature! ![]() bfwolf |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 9957 |
Very unlikely to be the case. Much more likely that the "bad" chip takes longer to do the conversion. Jim's code in the other thread tests this when powered (not parasitic) and tells how long each chip takes for each resolution |
||||
ville56 Senior Member ![]() Joined: 08/06/2022 Location: AustriaPosts: 209 |
just had a strange effect with b17 on an RP2350 .... The touchpad with an FT3663 stopped working, dunno exactly when, probably after an upgrade to b16 or b17. Checked wiring and options, all ok. Anyway, cleared flash with Clear_Flash_RP2350.uf2 ... to no avail. Reflashed from b7 onwards, no cure. Flashed b17 again and then OPTION TOUCH DISABLE and setting the touch option again as FT3663 and it worked again. So for some reason the Clear_Flash_RP2350.uf2 did not reset the flash completely, some garbage must have been left over which in turn upset the touch option. So my question: is there any better way to completely wipe the flash on either pico or pico2 then with the Clear_Flash(_RP2350) utlities? Reagrds, Gerald 73 de OE1HGA, Gerald |
||||
electricat![]() Senior Member ![]() Joined: 30/11/2020 Location: LithuaniaPosts: 279 |
@Peter, HDMI/USB/2350 02b17 Yesterday moved from 02b11 to 02b17 One of my programs I am working on started to fail executing line with --> execute "files" Loaded older versions - same. OK. entered cmd NEW, then two simple lines chdir "b:\somepath" ' dir with 8 files execute "files" First run, files were listed. Next and folowing runs - command timeout, restart, mm.watchdog always returns ->> 0 After reboot, loaded my program i was working on. Failed. Again, NEW, typed in two lines. This time failed on first run. Did not tried to roll back to 02b11 or flash 02b18 yet. My MMBasic 'sand box' |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 9957 |
FILES used in a program does some heavy sh*t to work. You can't use it with execute. Just use it direct Manual entry on EXECUTE Edited 2025-03-12 02:36 by matherp |
||||
electricat![]() Senior Member ![]() Joined: 30/11/2020 Location: LithuaniaPosts: 279 |
I read you. It brokes itself internally trying to lift to heavy weights ![]() Still I feel, I must excuse and explain, why 'user' is boring You ![]() MM.WATCHDOG returns 0 after "crash restart" but after "Command timeout" there should be 1 Before posting observation I was so naive and tried also 'control' watchdog using all combinations of WATCHDOG timeout or WATCHDOG OFF or WATCHDOG HW timeout or WATCHDOG HW OFF My idea was. If EXECUTE is command under caution about it`s 'dangers' in use, and I understand it resets reason (maybe) becouse of watchdog (while 0 indicates it is not the case, but still), maybe I can order it wait a little bit more. I can do file listing by simple writing procedure on exit. BUt... The cat died due to its excessive curiosity. ![]() My MMBasic 'sand box' |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 9957 |
Sorry but it is my choice not to return 1 in MM.WATCHDOG because a command timeout is different from a "real" watchdog timeout You shouldn't use EXECUTE for any command that doesn't return pretty much immediately so if you get a command timeout it is a programming error that needs fixing. Edited 2025-03-12 18:04 by matherp |
||||
ville56 Senior Member ![]() Joined: 08/06/2022 Location: AustriaPosts: 209 |
@Peter, just trying to get a touch panel with a FT6336 controller working. TOUCH(x/y) do report valid coordinates. The problem is, that there is no response to TOUCH INTERRUPT and also no resonse to any of the touch sensitive GUI components. Environment: PicoMite MMBasic RP2350A Edition V6.00.02b18 OPTION SYSTEM SPI GP2,GP3,GP4 OPTION SYSTEM I2C GP0,GP1 OPTION FLASH SIZE 4194304 OPTION COLOURCODE ON OPTION CPUSPEED 300000 'KHz OPTION DISPLAY 45, 132 OPTION LCDPANEL ILI9341, RLANDSCAPE,GP5,GP6,GP7,GP8,INVERT OPTION GUI CONTROLS 75 OPTION TOUCH FT6336 GP10,GP9,,50 GUI CALIBRATE 1, 314, 6, -10276, 10588 OPTION SDCARD GP11 Regards, Gerald 73 de OE1HGA, Gerald |
||||
bfwolf Regular Member ![]() Joined: 03/01/2025 Location: GermanyPosts: 65 |
@Peter, @electricat: Would this be runable from "EXECUTE"? ![]() > list Sub PrintFiles(byval Path$ As string) Local f$ As String f$ = Dir$(Path$) Do While f$ <> "" Print f$ f$ = Dir$() Loop End Sub PrintFiles("a:\") End > run bootcount byref-byval.bas timer.bas > bfwolf |
||||
dddns Senior Member ![]() Joined: 20/09/2024 Location: GermanyPosts: 211 |
Maybe a special case: > option list PicoMite MMBasic USB RP2040 Edition V6.00.02b18 OPTION SERIAL CONSOLE COM1,GP28,GP29 OPTION SYSTEM SPI GP22,GP23,GP20 OPTION SYSTEM I2C GP24,GP25 OPTION FLASH SIZE 16777216 OPTION COLOURCODE ON OPTION KEYBOARD US, 0, 0, 150, 50 OPTION HEARTBEAT OFF OPTION PICO OFF OPTION CPUSPEED 378000 'KHz OPTION LCDPANEL CONSOLE 4 OPTION DISPLAY 30, 80 OPTION LCDPANEL SSD1963_7, LANDSCAPE,,GP16,NORESET OPTION TOUCH GP21,GP19 GUI CALIBRATE 1, 101, 404, 2019, 1378 OPTION SDCARD COMBINED CS OPTION KEYBOARD REPEAT 150,50 OPTION RTC AUTO ENABLE OPTION DEFAULT FONT 4, 1 > > print mm.info(sdcard) Not Configured > My main issue is of cause the sdcard but: Once "option display" is set, I have no idea how to get rid of it again. Answer: "option display 24,80" will let it disappear from the option list again. Edited 2025-03-13 20:58 by dddns |
||||
![]() ![]() |
![]() |