| Menu | JAQForum Ver 19.10.27 |
Forum Index : Microcontroller and PC projects : PicoMite V6.02.00 release candidates - Structured types
Good explanation! I just took a quick look at the HD44780 datasheet and understood it. Does that mean the (parallel) LCD driver and the I2CLCD driver don't make any assumptions about the number of characters per line and also don't use automatic line breaks? That would be good in this case! It would mean that if you output 20 characters starting from line 1 / column 1 on a 16x2 display, the last 4 would end up in the "invisible display RAM" — but if one knows that, it's fine. And you simply always configure the HD44780 chip to '2-line display' by setting N=1 in the HD44780 command 'Function Set'? ![]() |
||||||
Peter, The version you sent me yesterday has been working flawlessly all this time. I spent a whole day looking into my autorun problem with this version. I added a pause 1000 to the first line of the program, and it worked immediately. Now I'm doing a long-term test. Would this demonstrate operation with a level shifter or without external pullup resistors at 3V3 for an I2C LCD? I also did some testing with the new version V6.02.00RC6 with a level shifter, and it works perfectly. I also tested with a 2x16 LCD using a PCF8574A and a standard RP2040. LIST SYSTEM I2C indicates the correct I2C address, 3F, but the program returns an error. >run [5] I2CLCD INIT &H3F Error : 63 is invalid (valid is 32 to 39) Kind regards, Jan. |
||||||
Sorry, maybe a different problem? I see that the address should be &H38 or 56 decimal, and with LIST SYSTEM I2C it's 3F? So I adjusted this, but it doesn't help. I'll keep looking. [5] I2CLCD INIT &H38 Error : 56 is invalid (valid is 32 to 39) > list system i2c HEX 0 1 2 3 4 5 6 7 8 9 A B C D E F 00: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 3F 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- > Kind regards, Jan. |
||||||
Comparing the datasheets for the PCF8574 and PCF8574A chips the address ranges are different. The A version is &B0111000 to &B0111111 = &H38 to &H3F = dec 56 to 63. So even changing the A0 to A2 address pins won't help. The driver may need adjusting to make it work with that chip. |
||||||
I found a problem with this 2x16 I2C module. The pull-up resistors were missing. Now I've used another PCF8574A with address 27 hex and LIST SYSTEM I2C, but unfortunately, nothing appears on the screen. The other screen with the 2x16 I2C PCF8574A module has the 4k7 SMD resistors inserted, but still has 3F as the address, but nothing appears on the screen. An old kas.bas program with the latest firmware V6.02.00RC6 and an old LCDI2C subroutine with OPTION SYSTEM I2C GP20, GP21, SLOW, and address 3F (PCF8574A) works, the 2x16 LCD screen does work. Thanks, Phil99. The driver is the problem. Kind regards, Jan. |
||||||
Peter, I thought the RAM wasn't reset, but the date and time are reset when the power remains on? This also applies to the option autorun on,noreset. Even without the autorun option on, the date and time are reset. Pause 2000 ' Everything happens automatically with I2CLCD from version V6.02.00RC6. ' A 4x20 LCD2004 LCD screen. ' A level shifter between the RP2040 module and the LCD2004 with an I2C PCB. ' Or desolder the 4K7 pullup resistors and connect them externally to 3V3. ' No RTC time and date: date$="dd-mm-yyyy" and time$="hh:mm:ss" until power off. ' The SD CARD is mounted on the Raspberry Pi Pico RP2040 for a complete system. ' OPTION SYSTEM I2C RP20, RP21 ' For the I2C bus. See > HELP OPTION. ' OPTION SDCARD GP19, GP10, GP11, GP12 ' For the SD card. See > HELP OPTION. I2CLCD INIT &H20 ' Request address with: LIST SYSTEM I2C Do I2CLCD 1,C20,"B+ Westland" ' I2CLCD Y,X Y=Line no., X=Char no., C=Middle I2CLCD 2,C20,"Hobby Computer Club" I2CLCD 4,1, "Fr "+Date$+" "+Left$(Time$,5) ' Anything is possible with one line. Pause 1000 Loop > flash save 2 > option autorun 2,noreset > > time$="16:04:02" > date$="16-1-2026" > run Kind regards, Jan. |
||||||
Ther current version doesn't support addresses &H38 to &H3F. I'll include this in the next release. Other than that I don't understand what you are telling me. I've tested a 16x2 on &H27 and it works perfectly Edited 2026-01-17 02:53 by matherp |
||||||
Peter, Sorry, I'm completely wrong. I checked back to V6.00.03, where the date and time were already cleared after a reset. I thought it was the same as with PSRAM, where the RAM memory is retained after a reset, but that's a completely different story, as the memory is located in slots 1-5. Kind regards, Jan. |
||||||
V6.02.00RC7 PicoMiteV6.02.00RC7.zip This version tweeks the I2CLCD command to allow address ranges &H20 to &H27 and &H38 to &H3F. In addition it adds functionality to DEVICE BITSTREAM to allow a second pin to be specified and used OR the same pin to be used twice (WTF? - see below). The other change is to allow the Basic user to effectively specify a pin as open collector. When this option is set the pin is driven when a low signal is output and set to high-impedance when a high signal is output. Here is the manual for the enhanced command which is still fully compatible with the previous syntax. BITSTREAM_User_Manual.pdf In it are two expanded examples of use of the new facility. Using two pins, the first example generates a PS2 output allowing the PicoMite to act as a PS2 Keyboard or mouse. This is fully tested and I have posted a slightly enahanced version of the program here. Does this open up the way finally for a MMBasic standard gamepad? The second example uses the capability to specify the same pin twice to create an IR transmit output. The first use of the pin is to generate the 38KHz carrier and the second use ANDs the signal with it, effectively modulating the carrier as is required. I haven't wired up this to do a full test but the output looks perfect on the scope. This should allow the Basic user to create any IR protocol without having to resort to a csub and/or external electronics to AND two pins. The new functionality of DEVICE BITSTREAM should open up many new possibilities for complex communication protocols to be coded directly in Basic. NB: you can now also use BITSTREAM as a command without needing DEVICE Edited 2026-01-17 18:44 by matherp |
||||||
My dream... :) If you could wire-OR a PS2 keyboard and such a gamepad then the only thing stopping it would be a decent case and buttons/direction pad. Or maybe use a PS2 mouse input for a gamepad? |
||||||
The new Bitstream will be very useful, thank you. IR Tx from a single pin can be done with the original Bitstream but is more complicated. Getting Philips RC5 and RC6 Manchester protocol into the Bitstream with the carrier was a brain strainer. See here on FotS |
||||||
deleted ... Edited 2026-01-18 02:10 by ville56 |
||||||
Thank you, Peter. The LCD screen now works with the other addresses, and the 2x16 screens also work now. My existing greenhouse program worked after changing from LCDI2C to I2CLCD; I only had to adjust I2CLCD INIT. After that, I deleted the old subroutines, and it still works, now with various sensors. After the update, I did have to reload the program from the SD card on the RP2040 because the memory and the A drive aren't erased after an update. (The command list has become longer, so I2CLCD has a different name.) I'm very happy with this update, which makes it clearer by putting more functionality on a single line of the LCD in a program, instead of everything on a separate line. It's also helpful for beginners to get a simple LCD screen working with just a few lines of code. I still have a lot to explore in the existing PicoMite Basic code. Jan. |
||||||
| The Back Shed's forum code is written, and hosted, in Australia. |