• My objective is to use one of the serial ports on the Pico as the console when the Pico isn't plugged into a USB port, but have the console automatically move back to USB when the Pico is plugged into a USB port.

    The documentation states that:

    force: if false, changes in connection state (eg USB/Bluetooth) can move the console automatically
    

    This seems to imply that there is a way to automatically set the console to USB when the Pico is plugged into a USB port, but otherwise use Serial1, for example. If so, how is this accomplished?

    Also, I'm a little confused by the pinout of the Pico in the online docs. Which serial interfaces are actually available? I'm assuming that the globals Serial1 and Serial2 correspond to USART1 and USART2, but why does USART1 RX appear on A10 and B7?

  • Hi!

    What you're after is actually what should happen by default on the Pico. If you can use pins B6/B7 you're sorted - the console will be on those at 9600 baud until USB is connected.

    Which serial interfaces are actually available?

    Sorry, that is confusing. USARTX and SerialX are the same as you suggest, so you have two serial ports available, Serial1 and Serial2.

    why does USART1 RX appear on A10 and B7?

    The STM32 chip can be configured (with Serial1.setup(...)) to have the RX pin on either A10 or B7 (not at the same time). By default it's B7 though.

    For anyone else reading - this is specific to the STM32 chips used in Original/Pico/WiFi boards. The nRF52 chips used in the Espruino Bluetooth boards allow you to use any peripheral on any pin.

  • Thank you--that makes perfect sense. Also, since I posted the question, I found the mention of B6/B7 (in the [!] of the pinout diagram); maybe it's mentioned somewhere else, too, but that's the only place I found it.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

E.setConsole() force option on Pico (and question about Pico Serial* to USART* mapping)

Posted by Avatar for Eric24 @Eric24

Actions