Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : PicoMite USB betas
Page 4 of 5 | |||||
Author | Message | ||||
phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 2135 |
From the comments of Peter and others it seems in V5.09.00 the USB port is dedicated to a USB keyboard (and perhaps other USB devices via a hub). The console is only via a TTL COM port so you need a USB to TTL adapter connected to the specified pins (gp8 Rx, gp9 Tx I think). The PC terminal emulator must be set to 115200 baud. Edited 2024-02-25 12:31 by phil99 |
||||
Hans Senior Member Joined: 18/10/2022 Location: CanadaPosts: 116 |
@Phil99 Thanks I will try that next. Hans … |
||||
Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 6787 |
The Pico (or clone) MUST have a way to put 5V out of the USB socket. This isn't true of all clones. The YD-RP2040 can't be used easily as MBUS doesn't come out to a pin and D+/D- aren't available as test points under the board. A genuine Pico is merely powered via MBUS instead of VSYS. Once the USB firmware is loaded the following happens: Pins GP8 and GP9 are now a serial TTL port for the console. If you want the console then you have to connect it to your PC via a suitable adapter (usually a USB-TTL adapter). The USB port on the Pico (or clone) module is switched into Host mode. Now it can't be connected to a PC apart from the special instance of firmware updates using the Boot button. The most useful way to use it is to connect it to a non-powered USB hub. When updating the firmware on a Pico that has the USB firmware you MUST disconnect the supply to MBUS before connecting the Pico's USB port to your PC. This is to protect the USB port on your PC. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
stanleyella Guru Joined: 25/06/2022 Location: United KingdomPosts: 2129 |
I get this on connecting usb to usb to ttl converter which 5v powers rpipico vbus. it recognises usb kb dongle and it was option keyboard uk. |
||||
Hans Senior Member Joined: 18/10/2022 Location: CanadaPosts: 116 |
I have a CH340 module that I use for programming stand alone Arduinos. So can the pins be optioned to another set of pins? Thanks for the explanation. Hans ... |
||||
Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 6787 |
No, you can't change those. Peter has used the same pins that would otherwise have been used for the PS2 keyboard, which makes sense. To me, anyway. :) Your CH340 will be fine. While running you can use the 5V output from the CH340 to power the Pico's MBUS pin (you can't use the 3V3 output as we need 5V for the Pico's USB in host mode). When updating the firmware you must disconnect the supply from the CH340 USB and put the 5V into the Pico's USB via the programming lead. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
stanleyella Guru Joined: 25/06/2022 Location: United KingdomPosts: 2129 |
Hi Mick, It's simple so sharing download usb version and unzip press button and hold down then connect usb lead and win bing and a new drive. copy the uft you downloaded and expanded paste into new drive, the drive will disappear connect usb keyboard , can be a wireless dongle the pico need 5v on vbus that it may have got from usb or a 5v reg. if you connect a usb to ttl converter to use for connecting to windows for teraterm or mmedit or xterm then the 5v on the usb to ttl pin wires to vbus and the pico is powered. think of the usb to ttl connected to what where the ps2 keyboard pins. the 3.3v out pin on the pico still gives 3.3v Mick said " (you can't use the 3V3 output as we need 5V for the Pico's USB in host mode)." Edited 2024-02-26 08:35 by stanleyella |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 9115 |
Yes you can - OPTION SERIAL CONSOLE TXpin, RXpin |
||||
Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 6787 |
Oh, didn't know that, Peter. Thanks. I'd assumed that you'd kept them on GP8 and GP9 for a reason. :) Stan: It's no use putting 5V onto VSYS for the USB system (in most cases). There is a blocking diode between VSYS and MBUS that prevents the host output from powering the USB devices. That's why you must power it via MBUS. It bypasses the diode. You can get the 5V supply from a separate source if you like, or you can get it from the 5V output of the CH340 (which I've done many times). It makes it nice and neat if that's your normal power source. All you need to do to update the firmware is unplug the USB from the CH340 and plug it into the Pico while holding down the Boot button. After the transfer just swap the lead back and plug in the USB hub to the Pico. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
robert.rozee Guru Joined: 31/12/2012 Location: New ZealandPosts: 2350 |
it also looks like you can use: OPTION SERIAL CONSOLE DISABLE to reclaim the use of two GPIO pins, with GP8 and GP9 being freed up cheers, rob :-) Edited 2024-02-26 23:59 by robert.rozee |
||||
stanleyella Guru Joined: 25/06/2022 Location: United KingdomPosts: 2129 |
Mick, these are my connections. usb to ttl 5V to vbus, that powers the usb keyboard and through the diode to the switching reg and 3.3V out. if I update firmware then disconnect usb to ttl and usb kb then hold button and connect to pc usb or it will power usb to ttl in reverse, maybe bad edit doh I soldered the usb to ttl so I'll stick a Schottky diode in the 5V from usb to ttl to vbus so safe Edited 2024-02-27 04:41 by stanleyella |
||||
stanleyella Guru Joined: 25/06/2022 Location: United KingdomPosts: 2129 |
Is this a problem? I draw coordinates but it aways joins the last to the first like the polygon command but it shouldn't. should it? OPTION BASE 1 dim lx%(35)=(0,5,9,13,3,18,25,30,48,53,57,47,32,11,5,9,57,89,108,149,170,220,262,300,320,400,447,493,510,545,572,600,638,605,590) ' 1 5 10 15 20 25 30 35 dim ly%(35)=(0,7,15,25,40,70,100,130,130,160,193,253,298,346,420,430,430,400,370,457,450,400,440,466,424,400,460,460,452,403,373,320,240,210,190) ' 1 5 10 15 20 25 30 35 dim l%,o% mode 1 cls box 0,0,mm.hres,mm.vres,,1 'polygon 35,lx%(),ly%() for l%=1 to 34 o%=l%+1 line lx%(l%),ly%(l%),lx%(o%),ly%(o%) next l% box 80,80,48,48,,1 circle 100,98,8 box 92,106,16,8 line 92,114,88,126 line 108,114,112,126 line 86,126,90,126 line 110,126,114,126 |
||||
Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 6787 |
Your circuit is right, Stan. The 5V rail on USB-TTL converters goes straight through from the USB socket to the 5V pin. You can't "reverse power" it. However, you can reverse power a PC USB port that it's plugged into. That's why I say that you disconnect the converter USB and connect the Pico USB for firmware updates then swap them back after. You can only ever get one source of supply that way. If you use a separate 5V supply then you need to do more messing about. The rule still applies, only one source of supply. The best way is to only connect RX, TX and GND from the converter and remember to disconnect the separate supply before updating the firmware. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
stanleyella Guru Joined: 25/06/2022 Location: United KingdomPosts: 2129 |
"You can't "reverse power" it." dunno if 5V into usb to ttl 5V out would be damage if it was not connected to a pc usb. It's soldered so a 0.3V drop diode to be safe. just cut a track and solder. Footnote added 2024-02-28 03:10 by stanleyella Flashed ok without diode and usb to ttl still working :) |
||||
stanleyella Guru Joined: 25/06/2022 Location: United KingdomPosts: 2129 |
the line draw program earlir for l%=1 to 5 o%=l%+1 line lx%(l%),ly%(l%),lx%(o%),ly%(o%) next l% makes no difference. it says it;s flashing and vga screen scrolls no errors it runs as before like it hasn't flashed it??? |
||||
phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 2135 |
You may have found a bug as removing the For and Next still draws a polygon. Option BASE 1 Dim lx%(35)=(0,5,9,13,3,18,25,30,48,53,57,47,32,11,5,9,57,89,108,149,170,220,262,300,320,400,447,493,510,545,572,600,638,605,590) Dim ly%(35)=(0,7,15,25,40,70,100,130,130,160,193,253,298,346,420,430,430,400,370,457,450,400,440,466,424,400,460,460,452,403,37 3,320,240,210,190) Dim l%,o% MODE 1 CLS Box 0,0,MM.HRes,MM.VRes,,1 'Line GRAPH lx%(),ly%() 'polygon 35,lx%(),ly%() l%=1 o%=l%+1 Line lx%(l%),ly%(l%),lx%(o%),ly%(o%) You can however get what you want using LINE GRAPH instead of Polygon. Line GRAPH lx%(),ly%() Edited 2024-02-27 08:40 by phil99 Footnote added 2024-02-27 15:49 by phil99 Polygon could have been made to work by closing the loop around the screen border. |
||||
Hans Senior Member Joined: 18/10/2022 Location: CanadaPosts: 116 |
Thanks that's great Peter! Hans ... |
||||
stanleyella Guru Joined: 25/06/2022 Location: United KingdomPosts: 2129 |
Hi phil99,you said "You can however get what you want using LINE GRAPH instead of Polygon. Line GRAPH lx%(),ly%()" just joins the dots that worked fine, I never knew about that command, thanks for pointing it out sir. it seems to not need an index,it just reads the arrays,:) nice one, stan |
||||
phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 2135 |
Some more experimenting with the Line issue with arrays. It only happens with integer arrays, and doesn't always draw a polygon. A minimal command line version. > dim x%(3)=(30,90,90,30), y%(3)=(30,30,90,90) Draws 3 sides of a square but the 4th finishes at (0,0)> Line x%(0),y%(0),x%(1),y%(1) > Edit. Stan's earlier code works correctly if all the "%" symbols are removed. Edited 2024-02-27 15:52 by phil99 |
||||
Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 4233 |
Hi phill99, stanleyella, This is a real bug. Since x%(0) is a value (not an array like x%()) the command LINE x%(0),y%(0),x%(1),y%(1) should plot a single line. It is simply 2 sets of coordinates. To draw all value in the arrays, it should be LINE GRAPH x%(),y%(),c POLYGON x%(),y%(),c Or (maybe if I interpret the user manual correct) LINE x%(),y%(),a%(),b%() I can also confirm that this bug exsits in V5.08.00 (the official release on Geoff's page). Appart from plotting the whole array with LINE, that is a but, the other bug is that it ends the sequnce at (0,0). That is a second bug. Regards, Volhout PicomiteVGA PETSCII ROBOTS |
||||
Page 4 of 5 |
Print this page |