![]() |
Forum Index : Microcontroller and PC projects : PicoMite Firmware Release Version 6.00.03
![]() ![]() |
|||||
Author | Message | ||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2944 |
CORRECTION - whenever I enter the EDITor , TT switches to 81x30 (but renders correctly). TT remains as 81x30 as explained by Peter, but only when the ‘prompt’ screen is drawn does it render incorrectly. The tick-box mentioned by disco4now does resolve the issue. I will write a quick ‘sniffer’ program to monitor the bytes coming out of the console’s Tx pin as it is these I will ultimately be using in my current TermMite project. Possibly TT is doing something weird which is throwing me to draw incorrect conclusions…. ![]() |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2944 |
Is the following a bug, OR simply my improper use of COM 1? In short - I am using COM 1 in code, but when I come to CLOSE #1 (COM 1 on GP16 & GP17) prior to ENDing the program, it hangs the PicoMite. NOTE - I am also using a serial console on GP0 & GP1 (which is also COM 1) in addition to the USB console. IF I comment out CLOSE #1, the Pico returns correctly to the command prompt. I am viewing the issue while connected via USB to TeraTerm. To replicate this, here is my shortened code (press 'q' to trigger the effect): SetPin gp16,gp17,com1 '16=Tx, 17=Rx Print "Recording. (press q to quit)" Open "COM1:115200,4096" As #1 Do k$=Inkey$ If k$="q" Then Print "End" ' Close #1 ' UNCOMMENTING THIS LINE causes Pico to hang! End End If Loop OPTIONS as follows: PicoMite MMBasic RP2040 Edition V6.00.03 OPTION SERIAL CONSOLE COM1,GP0,GP1,BOTH OPTION COLOURCODE ON OPTION CPUSPEED (KHz) 150000 OPTION DISPLAY 30, 80 Just curious as to whether I can use a serial-console (on COM1 for example), as well as a pair of different COM pins in my code that just happen to be on the same COM 1 (rather than COM 2). |
||||
Mixtel90![]() Guru ![]() Joined: 05/10/2019 Location: United KingdomPosts: 7939 |
There is only one COM1 UART and one COM2 UART, but you can allocate them to different GPIO pins. However you can't allocate the same UART to two different sets of GPIO pins at the same time. You can have one pair of pins on COM1 and one pair of pins on COM2. Of course, there may be ways to force it to happen, but such jollities are certainly not supported in MMBasic. :) If you have the console on COM1 then you can't use COM1 anywhere else as, at the very least, you'll risk a data conflict. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
zeitfest Guru ![]() Joined: 31/07/2019 Location: AustraliaPosts: 582 |
At a guess, closing COM1 means no further i/o on it so there is no exit for the loop and it just cycles continuously. What happens if you re-open com1 after closing it ? |
||||
phil99![]() Guru ![]() Joined: 11/02/2018 Location: AustraliaPosts: 2642 |
Using WhiteWizzard's program the program appears to hang from the perspective of the COM1 console after pressing 'q' but continues to run from the USB console. Press 'q' there after COM1 console has stopped responding and the program ends correctly. It appears closing COM1 also closes the COM1 console. Not really surprising. Edit. Added a line to print to COM1 after opening COM1 and that causes both consoles to hang. So not a practical idea, the console requires a dedicated port. Edited 2025-07-25 14:35 by phil99 |
||||
ville56 Senior Member ![]() Joined: 08/06/2022 Location: AustriaPosts: 223 |
Or just leave the port open as you are using the console anyway and if one can live with console and program I/O intermixed. If one could find out in the program which COM-port is used for the console (com1, com2, usb) it would be easier to decide in the program, but I could not figure out how to do this. So the program has to know which com is the console. 73 de OE1HGA, Gerald |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
Opening or closing a port with the same com number as the console makes no sense. With INPUT$(nbr, [#]fnbr), #0 can be used which refers to the console's input buffer. I am not in the position to test the other INPUT and PRINT commands and the Console port. Jim VK7JH MMedit |
||||
![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |