![]() |
Forum Index : Microcontroller and PC projects : Picomite VGA and Python
Page 1 of 3 ![]() ![]() |
|||||
Author | Message | ||||
Rickard5![]() Guru ![]() Joined: 31/03/2022 Location: United StatesPosts: 463 |
I know this is going to be another Annoying, "HUH, are you some kind of MORON" Question, but since I've been down with my Knee surgery and Impending Hip Replacement, I've been on a huge Maker Binder. I've been seeing all these Great Picomite board designs I really want to build like this morning I just read about this LAND Picomite VGA board that looks Kool, and I'm fighting the urge to order 1 or 2 until I know Will the Picomite VGA hardware as a general rule work with Python or Circuit Python as well as MMBasic ? What I'm talking about is like will Python or Circuit Python output to VGA, Will Python recognize the SD Card, will Python / Circuit Python recognize the KB and or the Realtime Clock ? I don't speak python any more than I understand a Small off duty Czechoslovakian traffic warden, But I want to learn ![]() Thank you in advance for any info I may be Vulgar, but , while I'm poor, I'm Industrious, Honest, and trustworthy! I Know my Place |
||||
LandBoardsLLC Newbie ![]() Joined: 04/06/2022 Location: United StatesPosts: 19 |
Yes and no. Yes, the SD card works just fine with Micro or Circuit Python on PicoMiteVGA compatible hardware. I've tried it and documented it: CircuitPython on PicoMiteVGA Hardware As far as I know the VGA does NOT work. I'd love to see it done though. And the PicoMiteVGA source looks like a great starting point. There may be a PS/2 Python driver "out there". - Doug at Land Boards LLC |
||||
LandBoardsLLC Newbie ![]() Joined: 04/06/2022 Location: United StatesPosts: 19 |
Geoff's PicoMiteVGA credits Miroslav Nemecek for at least the start of their VGA work. His site is at: http://www.breatharian.eu/hw/picovga/index_en.html His C source code is there. - Doug Edited 2022-07-13 05:26 by LandBoardsLLC |
||||
Mixtel90![]() Guru ![]() Joined: 05/10/2019 Location: United KingdomPosts: 7937 |
One thing is certain - the VGA system used on the PicoMite boards as it stands isn't compatible with python of any sort. It uses the second processor and a PIO so you'd probably have to write a library from scratch. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
DaveJacko Regular Member ![]() Joined: 25/07/2019 Location: United KingdomPosts: 83 |
Hiya Rickard, and your fanbase ! ![]() Thankfully we no longer need any other languages.. (and there are hundreds, go back to the COBOL days and start from there) We've got MMBasic, it does everything very well. I'm 60 and my focus is now to be an expert in MMBasic only. It will see me out! Regs Dave. PS. ok, maybe we need 'C', so our heroes can make MMBasic ! Cheers Y'all Try swapping 2 and 3 over |
||||
LandBoardsLLC Newbie ![]() Joined: 04/06/2022 Location: United StatesPosts: 19 |
Interfacing from Python to C++ code isn't a big deal. https://docs.micropython.org/en/latest/develop/cmodules.html |
||||
pwillard Guru ![]() Joined: 07/06/2022 Location: United StatesPosts: 313 |
Heh... I'm using Picomite because I got tired of the limitations and issues I encountered with Circuitpython/Micropython. 2 times I got 1/2 way through a project only to find that the part I was working with was working on worked BETTER in the *other* python... Apart from the learning curve and then needing a little help to get started... I haven't touched either python option since. |
||||
Rickard5![]() Guru ![]() Joined: 31/03/2022 Location: United StatesPosts: 463 |
Everybody I am not disparaging MMBasic, once I found it, it was like the heavens open up and gave me back my Beloved Ohio Scientific Challenger IIIP (my First Computer) Only Better. the Only reason I have asked about python is I have one project I can't figure out in MMBasic , but I can find a Snippet of code I can steal in Python I may be Vulgar, but , while I'm poor, I'm Industrious, Honest, and trustworthy! I Know my Place |
||||
LandBoardsLLC Newbie ![]() Joined: 04/06/2022 Location: United StatesPosts: 19 |
I had an OSI SuperBoard II. Frankly, a lot of all if this is about nostalgia and there's nothing wrong with that at all. We do the things we love[d]. MicroPython is perfectly fine as is MMBASIC. Both are a labor of love of their creators who clearly spend a lot of their spare time on their projects. I see advantages for both but I'm switching away from using Arduino for card testing in my [very small] business and moving over to MMBASIC. The Build-Test-Build process is just plain faster in MMBASIC and the "computer-less" setup beats booting my Test Station PC and running a terminal emulator to run a 2 second test on a card I just built. |
||||
lizby Guru ![]() Joined: 17/05/2016 Location: United StatesPosts: 3378 |
Now you rouse our curiosity. What is it? PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
hitsware2![]() Guru ![]() Joined: 03/08/2019 Location: United StatesPosts: 719 |
Also .... Why the VGA ? There are several displays with Python ' modules ' my site |
||||
Quazee137![]() Guru ![]() Joined: 07/08/2016 Location: United StatesPosts: 593 |
post the python code and lets see what we can do with it. I have taken python code for some Adafruit boards and re-coded to MMBasic biggest was for her ADS1115. Here is a test I did. Option explicit Dim float adc01,adc23,adc0,adc1,adc2,adc3,getvolts,tmp,ofs=-2.67 Dim startime$ RTC gettime RTC SETREG &h07,&h92 startime$=Time$ Dim fs=2,p=0 I2C open 100,5000 Box 0, 0, MM.HRes-1, MM.VRes-1, 8, , RGB(yellow) PWM 2,1000,50 ' 'SetTick 3600000,settime,1 'update time from RTC hourly SetTick 750,ADC,4 'periodical reading clr Do locate 5,1 Print startime$;" ";Time$;" " Print "Volts A01 is "; adc01 Print "Volts A23 is "; adc23 Print "----------------------" Print "Volts A0 is "; adc0 Print ((adc0-.4)/0.2925);"pH " Print "Volts A1 is "; adc1 Print (adc1-2.7315)*100 Print "Volts A2 is "; adc2 Print "Temp ";Str$((adc2-2.7315)*100,0,3);"C " Print "Temp ";Str$((adc2-2.7315)*100*(9/5)+32,0,3);"F " 'Print Str$((adc2-2.7315)*100*(9/5)+32+ofs,0,4);" F " Print "Volts A3 is "; adc3 Print "--------------------" tmp=TEMPR(16) Print "The temp ";Str$(tmp,0,3);" C ",Str$(tmp*1.8+32,0,3);" F " Text MM.HRes/2,30,Date$+" "+Time$,cm,1,fs,RGB(red),RGB(yellow) Text 10,40,"A01 is "+Str$(adc01,2,5),,1,fs,RGB(blue),RGB(yellow) Text 10,65,"A23 is "+Str$(adc23,2,5),,1,fs,RGB(blue),RGB(yellow) Text 10,90,"A0 is "+Str$(adc0,2,5),,1,fs,RGB(blue),RGB(yellow) Text 10,115,"A1 is "+Str$(adc1,2,5),,1,fs,RGB(blue),RGB(yellow) Text 10,140,"A2 is "+Str$(adc2,2,5),,1,fs,RGB(blue),RGB(yellow) Text 10,165,"A3 is "+Str$(adc3,2,5),,1,fs,RGB(blue),RGB(yellow) Text 10,190,"Tmp is "+Str$(tmp*1.8+32),,1,fs,RGB(blue),RGB(yellow) Loop Sub ADC ' ADC reading Local cfreg,cnv,cfhi,cflo cfreg = &h01: cnv =&h00 ' rate 128 sps no comp operations cfhi = &h83 : cflo= &h81 'reading Dif Ain0 , Ain1,FS= +/- 4.096 , 128 sps I2C write &H48,0,3,cfreg,cfhi,cflo 'adr 48 point to config reg I2C write &h48,0,1,cnv ' adr 48 point to conversion reg getadc adc01 = getvolts ' cfhi = &hB3 : cflo= &h81 ' reading Dif Ain2 , Ain3,FS= +/- 4.096 , 128 sps I2C write &H48,0,3,cfreg,cfhi,cflo 'adr 48 point to config reg I2C write &h48,0,1,cnv ' adr 48 point to conversion reg getadc adc23 = getvolts ' cfhi = &hC3 : cflo= &h81 ' reading single Ain0,FS= +/- 4.096 , 128 sps I2C write &H48,0,3,cfreg,cfhi,cflo 'adr 48 point to config reg I2C write &h48,0,1,cnv ' adr 48 point to conversion reg getadc adc0 = getvolts ' cfhi = &hD3 : cflo= &h81 ' reading single Ain1,FS= +/- 4.096 , 128 sps I2C write &H48,0,3,cfreg,cfhi,cflo 'adr 48 point to config reg I2C write &h48,0,1,cnv ' adr 48 point to conversion reg getadc adc1 = getvolts ' cfhi = &hE3 : cflo= &h81 ' reading single Ain2,FS= +/- 4.096 , 128 sps I2C write &H48,0,3,cfreg,cfhi,cflo 'adr 48 point to config reg I2C write &h48,0,1,cnv ' adr 48 point to conversion reg getadc adc2 = getvolts ' cfhi = &hf3 : cflo= &h81 ' reading single Ain1,FS= +/- 4.096 , 128 sps I2C write &H48,0,3,cfreg,cfhi,cflo 'adr 48 point to config reg I2C write &h48,0,1,cnv ' adr 48 point to conversion reg getadc adc3 = getvolts End Sub Sub getadc Local adcv Local integer adcrd(2) 'to receive 2 bytes Pause 100 I2C read &h48,0,2,adcrd() adcv= (adcrd(0)<<8) Or adcrd(1) If adcv > &H7fff Then adcv = adcv - &HFFFF getvolts = adcv *(4.096/32768) End Sub Sub settime RTC gettime Pause 50 End Sub Sub clr Print Chr$(27)+"[f" : Print Chr$(27)+"[2J" End Sub Sub locate x,y Print Chr$(27)+"["+Str$(X)+";"+Str$(Y)+"f"; End Sub |
||||
LandBoardsLLC Newbie ![]() Joined: 04/06/2022 Location: United StatesPosts: 19 |
Back to the original question of this thread... To my way of thinking PicoMiteVGA build is two things. The first is a software build/port of MMBASIC a powerful piece of software with a rich legacy onto the RP2040 core. The second part is the hardware baseline for the PicoMiteVGA build. By way of contrast, the folks that came up with the RP2040 Hardware Reference design made a set of design choices and Pico pin assignments. These rippled into the C++ SDK code base. The differences are largely in 2 areas - the SD card and VGA. The PS/2 interface is a 3rd area of difference. Each approach picked a different method accessing the SD card. PicoMite and PicoMiteVGA chose the SPI method to connect to the SD card. The Hardware Reference design used the other method which uses more pins but it ostensibly "faster" since it accesses the card in a nibble mode. I think the Hardware Reference design made a poor choice since it takes more pins. It's faster, but not "necessary" since SD card speed isn't critical for the vast majority of applications and it's certainly not minimal. In short, it takes up pins of the Pico that are better reserved for other functions. Similarly, the Pico Hardware Reference design chose 16-bit video and PicoMiteVGA chose 4 -bit video. PicoMiteVGA will never do photo-realistic images but it can do "enough" for most applications, particularly "retro" games. Most importantly, the PiPicoMiteVGA hardware saves a whole lot of pins of the Pico. The evidence that the Hardware Reference design is overkill is their dual use of the least significant video bits as inputs which they say don't affect video quality when you use them. So why have them if they don;t matter? I think they were building a showcase design and unconcerned about applications which might want to use pins on the Pico - they didn't leave many/any free. So back to the original question. I envision a use of the hardware design of the PicoMiteVGA where the card does what it does so well in MMBASIC but also can be used in either Micro or Circuit Python(s). The Python(s) build has/needs three features. 1 - The PS/2 keyboard which is missing in the Hardware Reference design is presen in the PicMiteVGA designt. After all, why have a display for output but no means of input other than USB? No way to have a standalone design and still be tethered to the USB port. The PS/2 keyboard then replaces the USB for input. Ie, the Hardware Reference design is all showy output but no input. They provide nice video but just a couple of dual use buttons for controls. 2 - The SD card works just fine under the Python(s), It really just works under the Python(s) since that's the method they prefer anyway and they support it. I tried it, and it works. Again, it was another "showy" choice in the Reference design that allows boasting about SD performance but a poor choice for applications which want/need the extra pins. 3 - The VGA replaces the USB for output, It comes with the stated compromises of the number of bits but that's just fine for most cases (at least most of the cases I care about). In the end the same PicoMiteVGA hardware can be used for standalone applications in either MMBASIC or the Python(s). The pieces that are "missing" (the PS/2 and VGA code) already exist as C++ code which can be made into precompiled Python modules - essentially wrappers to the C++ code that can be called from Python. It would be more work, probably involving messing with the Python kernel itself - to get things like print() working. It involves the same things that video modes and fonts on MMBASIC entailed. If someone wants to run MMBASIC or one of the Python(s) on the same PicoMiteVGA hardware baseline, why not? It's a perfectly good hardware baseline for either. Just my 2c worth. - Doug |
||||
Mixtel90![]() Guru ![]() Joined: 05/10/2019 Location: United KingdomPosts: 7937 |
Under Python it would probably be easier to use the SSD1963 parallel LCD display with a PS/2 keyboard. I suspect there are already libraries for that display which would need some tweaking regarding the pins. I suspect there is a PS/2 library somewhere - the hardware is identical to I2C, it's only software that's different. It's not a VGA system though. :) Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10310 |
NO: Most importantly The framebuffer for a 4-bit image is 38400 bytes not 155520 bytes |
||||
LandBoardsLLC Newbie ![]() Joined: 04/06/2022 Location: United StatesPosts: 19 |
NO: Most importantly The framebuffer for a 4-bit image is 38400 bytes not 155520 bytes Very good point. It's kind of nice to actually have RAM left for an application to use. Even more so with Python. The good part of the Hardware Reference design is being maximal to start with it can be cut down. |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4044 |
It's got to be doable. Make sure uPython won't try to use the 2nd cpu :) Then it's "just" a matter of sorting the software out - GOOD LUCK. Expect plenty of trial and error. John |
||||
Rickard5![]() Guru ![]() Joined: 31/03/2022 Location: United StatesPosts: 463 |
Now you rouse our curiosity. What is it? One HUGE thing that would be LIFE Changing in my Maker world is in broad strokes is I WANT/NEED to build a board that I can plug in to the PM VGA GPIO that has 3 or 4 BIQU A4988 Compatible StepStick Stepper Motor Driver Modules and Breakout other GPIO pins, and figure out how to control the steppers off the stepstick modules I need to use the A4988 Stepstick Modules mainly because I have a bag of 30 - 40 here, their Cheep as Chips and when I need to use Bigger Drivers, they'll just swap out easy. I'm so deeply in love with the PMVGA because MMBasic is a relatively easy language to use, and after a few mistakes on my part there was never a hardware fix that took more than $4 :). but once I learn to control Steppers I already have from 3d Printing, the world will open up with control and automation projects I will be able to build! so The Real thing is I'm trying to build a Picomite Automation Lego :) or a PLC for dummies I may be Vulgar, but , while I'm poor, I'm Industrious, Honest, and trustworthy! I Know my Place |
||||
Mixtel90![]() Guru ![]() Joined: 05/10/2019 Location: United KingdomPosts: 7937 |
Here's the A4988 Data Sheet This looks like a very similar module. Here's a good article on using it with an arduino without a library. Have fun. ;) Edited 2022-07-14 02:11 by Mixtel90 Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
lizby Guru ![]() Joined: 17/05/2016 Location: United StatesPosts: 3378 |
Is there something about those stepper motor driver modules that makes it doable with python but not with MMBasic? Do you have a circuit, as in picomite to module and module to the world? Even a rough sketch. (This is your thread, so I hope I'm not going too far OT.) (Oops, Mick got in there before me. In the circuit he linked, do you need any of the grayed-out pins on the circuit diagram?) Edited 2022-07-14 02:12 by lizby PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
Page 1 of 3 ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |