Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 21:03 20 Nov 2026 Privacy Policy
Jump to

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 : Problem with Olimex RP2040 PC and COM2

     Page 3 of 4    
Author Message
bfwolf
Senior Member

Joined: 03/01/2025
Location: Germany
Posts: 280
Posted: 01:39pm 15 Nov 2026
Copy link to clipboard 
Print this post

  Mixtel90 said  Oh yes - I remember that! :)
If connecting to a RP2350 it's essential that the 5V supply comes from there. The CPU pins do get 5V on them, albeit current limited by R2 and R5. I'd be tempted to increase R5 to 2K7 for this reason. Not a good idea to connect it to a RP2040.


It’s no problem to connect R5 to 3.3V instead of to a 5V supply. However, R1 and R3 must still be connected to a voltage of ≥ 5V; these are available on the Pico itself when it is connected via USB. Alternatively, you could power the entire Pico using +5V. It is apparently permissible to feed 5V into the Pico’s "VSYS" pin via a Schottky diode.
 
ville56
Guru

Joined: 08/06/2022
Location: Austria
Posts: 680
Posted: 02:03pm 15 Nov 2026
Copy link to clipboard 
Print this post

  Mixtel90 said  
So, for compatibility with a Pico, you may need inverters followed by a MAX converter.

I always used MAX232 and they are inverting, no extra inverters ever needed. Have a Pico talking to an ICOM PCR-1000 receiver on my desk using exactly this configuration. MAX3232, from the datasheet, are inverting too.

@Frank: you are right, it is strange ....

tried the following code:

setpin gp20,gp21,com2
open "com2: 300,1024" as #5
print #5, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
pause 1000 'lets the output commence, see EDIT

does run without an error but produces no output on the serial, checked with the scope thus the 300 Bd, to see it easily.

the same statements entered manually on the commandline do produce serial output. so there is something fishy in the state of denmark ...

my environment is:
> option list
PicoMiteHDMI MMBasic RP2350B Edition V7.00.00RC9
OPTION FLASH SIZE 16777216
OPTION COLOURCODE ON
OPTION KEYBOARD US
OPTION PICO OFF
OPTION RESOLUTION 640x480 @ 252000KHz
OPTION HDMI PINS  1, 3, 7, 5
OPTION SDCARD GP22, GP6, GP7, GP4
>

in addition, a CLOSE on the channel also resets the I/O pins from UART1RX/TX to OFF. I was not aware of this.

EDIT: the problem seem to be the end of program before end of transmission. If I put a PAUSE 1000 statement as last line, the output commences. Could not check if it was completed with the correct number of bytes though.

Gerald
Edited 2026-11-16 00:11 by ville56
                                                                 
73 de OE1HGA, Gerald
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 9379
Posted: 02:44pm 15 Nov 2026
Copy link to clipboard 
Print this post

The Pico output is the same polarity as a standard RS-232, it's not TTL standard.

From the manual:
  Quote  Idle is voltage high, the start bit is voltage low, data uses a high voltage for logic 1 and the stop bit is voltage high


It was designed like this to allow direct connection to RS-232 devices that use 5V/0V levels.

A MAX chip will see the high idle voltage from the Pico and set its output low, which is wrong for RS-232. Unfortunately the Pico output has no option to invert it so the answer is to use external inverters - or a conversion chip that doesn't invert.

If you have a TRUE RS-232 device connected from a Pico using only a MAX232 then I've no idea how it's working. The signal is upside down. :)
Edited 2026-11-16 00:51 by Mixtel90
Mick

Zilog Inside! nascom.info for Nascom & Gemini
 
ville56
Guru

Joined: 08/06/2022
Location: Austria
Posts: 680
Posted: 03:34pm 15 Nov 2026
Copy link to clipboard 
Print this post

  Mixtel90 said  The Pico output is the same polarity as a standard RS-232, it's not TTL standard.


maybe we mean the same ...  my terminology is:

for RS-232:
space = idle
mark = active = start bit
positive voltage ... > 3V
negative voltage ... < -3V

RS-232:   Space level = negative voltage, mark level = positive voltage.
Pico:     Space level = 5V,               mark level = 0V (when using MAX232)

this is in my opinion inverting and exactly what the MAX232 is doing.
                                                                 
73 de OE1HGA, Gerald
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 9379
Posted: 04:14pm 15 Nov 2026
Copy link to clipboard 
Print this post

You're quite right, it's me getting my knickers in a twist as usual. :)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
 
ville56
Guru

Joined: 08/06/2022
Location: Austria
Posts: 680
Posted: 04:25pm 15 Nov 2026
Copy link to clipboard 
Print this post

And I'm learning a new phrase ... nickers in a twist.

Its is good to have so many native speakers here
                                                                 
73 de OE1HGA, Gerald
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 9379
Posted: 04:59pm 15 Nov 2026
Copy link to clipboard 
Print this post

We only come here to be educated, don't we?  :)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
 
bfwolf
Senior Member

Joined: 03/01/2025
Location: Germany
Posts: 280
Posted: 05:21pm 15 Nov 2026
Copy link to clipboard 
Print this post

  ville56 said  
  Mixtel90 said  The Pico output is the same polarity as a standard RS-232, it's not TTL standard.


maybe we mean the same ...  my terminology is:

for RS-232:
space = idle
mark = active = start bit
positive voltage ... > 3V
negative voltage ... < -3V

RS-232:   Space level = negative voltage, mark level = positive voltage.
Pico:     Space level = 5V,               mark level = 0V (when using MAX232)

this is in my opinion inverting and exactly what the MAX232 is doing.


Correctly described!

And because "idle" = 1 = -12V, the Elektor circuit works as well. The negative idle voltage from the other end (or the voltage present when it sends a "1" bit) charges capacitor C1; this, in turn, makes it possible to output a negative voltage when sending an "idle" = 1 signal (with PNP transistor T1 switched off).
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 12251
Posted: 05:31pm 15 Nov 2026
Copy link to clipboard 
Print this post

I haven't been following this thread and it may not be relevant but has anyone looked at the INV parameter when opening a serial port - manual page 254
Edited 2026-11-16 03:34 by matherp
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 1199
Posted: 06:05pm 15 Nov 2026
Copy link to clipboard 
Print this post

@Peter:

Please take a moment to read these three posts of mine:

https://www.thebackshed.com/forum/ViewTopic.php?TID=19235&P=2#261656
https://www.thebackshed.com/forum/ViewTopic.php?TID=19235&P=2#261659
https://www.thebackshed.com/forum/ViewTopic.php?TID=19235&P=2#261661

Communication works - but only if I open the file manager first.

Frank
 
ville56
Guru

Joined: 08/06/2022
Location: Austria
Posts: 680
Posted: 06:06pm 15 Nov 2026
Copy link to clipboard 
Print this post

Thanks, because INV is well hidden in the text. The OPEN statement description in the manual doesn't mention it.

... It has the form "COMn: baud, buf, int, int-trigger, EVEN, ODD, S2, 7BIT" ...

Maybe for the next release of the manual ...
                                                                 
73 de OE1HGA, Gerald
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 12251
Posted: 06:29pm 15 Nov 2026
Copy link to clipboard 
Print this post

  Quote  Please take a moment to read these three posts of mine:


Sorry, but no. If you think there is a bug then please create a simple test program demonstrating it that doesn't rely on a board I don't have. Define the version of the firmware you are using and the minimum options that are needed for the bug to appear.
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 1199
Posted: 06:58pm 15 Nov 2026
Copy link to clipboard 
Print this post

Peter, that's exactly the problem.

Something's wrong with the levels until I launch the file manager! After that, my program works. Before that, an LED on my MAX3232 board lights up and my program doesn't work. The file manager is doing something that wasn't happening before.

That's why I wrote these three posts - I described it in detail there. The strange thing happens even before any program starts!

Frank
 
ville56
Guru

Joined: 08/06/2022
Location: Austria
Posts: 680
Posted: 07:19pm 15 Nov 2026
Copy link to clipboard 
Print this post

Frank,

does this also happen if the Pico is outside the Olimex board or only if plugged into that?

Gerald
                                                                 
73 de OE1HGA, Gerald
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 1199
Posted: 07:24pm 15 Nov 2026
Copy link to clipboard 
Print this post

@ville56:

The problem is that the MAX3232 is powered by the Pico. When I unplug the board, nothing works at all because then there's no 3.3V...

Frank
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 12251
Posted: 07:26pm 15 Nov 2026
Copy link to clipboard 
Print this post

Here are some things to do and report on:
After power-on, skip FM, type FILES "B:" and then RUN. If that works, the cause is the B: mount, not the pins.

With the MAX board unplugged, measure GP20/GP21 with a meter after power-on and again after FM.

Compare PEEK(WORD &H40038054) / &H40038058 (pad settings) and &H400280A4 / &H400280AC (pin function) before and after FM. If they're identical, the firmware isn't the difference.

Take out ALL the ON ERROR SKIP lines

Other:
ville56 (page 3): END and CLOSE on COM1/COM2 throw away output that hasn't been sent yet. SerialClose (io/Serial.c:861) calls uart_deinit and frees the TX buffer immediately, without waiting for it to empty. That's why the PRINT #5 at 300 baud followed by END sent nothing.
page 1 problem (RC7 HDMIUSB, where COM2 opened on GP20/21 without an error while the console was using UART1) is a clash that was fixed in RC8.
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 1199
Posted: 07:30pm 15 Nov 2026
Copy link to clipboard 
Print this post

@Peter:

Thank you so much - I'll try all of that out as soon as possible!!!

Frank
 
ville56
Guru

Joined: 08/06/2022
Location: Austria
Posts: 680
Posted: 07:35pm 15 Nov 2026
Copy link to clipboard 
Print this post

  matherp said  
ville56 (page 3): END and CLOSE on COM1/COM2 throw away output that hasn't been sent yet. SerialClose (io/Serial.c:861) calls uart_deinit and frees the TX buffer immediately, without waiting for it to empty. That's why the PRINT #5 at 300 baud followed by END sent nothing.


OK, understand, clean I/O rundown! But why are the rx/tx pins set to "OFF" on close? I just wanted to know the reason behind that. IMHO you do nothing without a reason in MMBasic ...  
                                                                 
73 de OE1HGA, Gerald
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 9379
Posted: 07:38pm 15 Nov 2026
Copy link to clipboard 
Print this post

I would suggest popping the Pico into a breadboard with leds from 3V3 via 1K resistors to GP0 and GP1. You don't need a keyboard and display - use Tera Term and any non-USB builds. A micro SD card would be handy though. You can then test with various builds of MMBasic. You need a simple program that opens COM1, sends something, pauses and closes it again. Watch what happens to the LEDs when you open and close the port before and after using the file manager. If you include reading the port too you can prove that loopback is happening, but that's not really needed. You can try auto-running it. You've reached the stage where you need to strip the system down to its bare bones to try to find out what is happening.

I would avoid using the Olimex for these tests as it is apparently forcing you to use COM2 - something you should avoid on a PicoMite as it is reserved by default.

If things work as expected then you can try COM2 and see if there's any difference, you will need to disable the keyboard or use OPTION KEYBOARD PINS to move a PS2 keyboard. It could even be that COM2 being reserved by default has something to do with it - you have to prove that one way or the other.

Remember that Peter has neither your Olimex board nor your MAX232 board. If you have a hardware problem, no matter how remote, you would be asking him to do the impossible. It would be an idea to make sure that your MAX232 board isn't expecting an open drain input 'cos it won't get it from a PicoMite. :)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
 
ville56
Guru

Joined: 08/06/2022
Location: Austria
Posts: 680
Posted: 07:51pm 15 Nov 2026
Copy link to clipboard 
Print this post

  Frank N. Furter said  @ville56:

The problem is that the MAX3232 is powered by the Pico. When I unplug the board, nothing works at all because then there's no 3.3V...

Frank


sure, you could still monitor the state of the pins (hi, lo, hi-z). I still do not understand if there is a relation to the Olimex board or to the MAX3232. If you unplug the MAX 3232, is the behavior still the same (monitoring with the LEDs)? From the diagram of the Olimex board, there is just a connection from GP20/21 to the connector, nothing else, just simple copper traces. Btw, my Olimex board was awfully soldered. Had to resolder some cold joints but had no shorts. And my ESP TCP-to-serial converter uses the same I/O pins (COM2) and works without any problems.
But I also had killed an I/O pin on a pico some time ago probably by overvoltage (5V). Was only half dead, did not pull down to low anymore, ended up somewhere in the middle. But failure modes may differ.
                                                                 
73 de OE1HGA, Gerald
 
     Page 3 of 4    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2026