Search found 16 matches

by Filip_KONAX
Wed Jun 22, 2022 5:13 pm
Forum: Raspberry Pi microcontroller boards
Topic: uasyncio / stdio over usb / uart
Replies: 2
Views: 1451

Re: uasyncio / stdio over usb / uart

hippy wrote:
Wed Jun 22, 2022 4:01 pm
There have been issues with threading on the MicroPython RP2 port but I believe those should have been fixed in recent builds. Make sure you have a recent build - 1.19 arrived after the threading fix so that should include it.
Thank you for the reply, unfortunately using 1.19 already...
by Filip_KONAX
Wed Jun 22, 2022 3:38 pm
Forum: Raspberry Pi microcontroller boards
Topic: uasyncio / stdio over usb / uart
Replies: 2
Views: 1451

uasyncio / stdio over usb / uart

I'm loosing confidence in MicroPython being a good choice for my project. Struggling all along the road with unpredictable execution stops. Short description of the project (see my other posts): using RP2 and MicroPython with a Waveshare modem on hardware uart. 1) stdio over usb stops when having a ...
by Filip_KONAX
Mon Jun 20, 2022 7:00 am
Forum: Raspberry Pi microcontroller boards
Topic: Is it possible to have two serial ports open on the Pico with one USB connection?
Replies: 6
Views: 4989

Re: Is it possible to have two serial ports open on the Pico with one USB connection?

Hi Peter, the question was to have two virtual (CDC) serial ports on one USB connection, don't see how you can do that using PIO :?
pythoncoder wrote:
Wed Jun 15, 2022 9:45 am
What about the examples using the PIO to implement a UART? See this link.
by Filip_KONAX
Mon Jun 20, 2022 6:58 am
Forum: Raspberry Pi microcontroller boards
Topic: Is it possible to have two serial ports open on the Pico with one USB connection?
Replies: 6
Views: 4989

Re: Is it possible to have two serial ports open on the Pico with one USB connection?

That's an option indeed if you don't need the rest of the features you get using MicroPython
electronut wrote:
Wed Jun 15, 2022 2:45 am
Thanks, Filip. I might as well as drop to C for implementing this. I found that TinyUSB has a dual CDC port example:

https://github.com/hathach/tinyusb/tree ... dual_ports
by Filip_KONAX
Fri Jun 17, 2022 6:18 pm
Forum: Raspberry Pi microcontroller boards
Topic: UART data loss despite large RX buffer
Replies: 8
Views: 2771

Re: UART data loss despite large RX buffer

Hi Robert! Thank you very much for trying this out. I'm wondering: A) What data sequences and what responseList you did the testing with? B) Is data coming at regular intervals or e.g. first a bit, then a pause and then the rest, containing the response you are looking for? Would you be able to test...
by Filip_KONAX
Fri Jun 17, 2022 10:43 am
Forum: Raspberry Pi microcontroller boards
Topic: RP2 multithreading - Pin - UART - should I switch to C? -> changed to PRINT stops
Replies: 7
Views: 2381

Re: RP2 multithreading - Pin - UART - should I switch to C? -> changed to PRINT stops

Hi Peter Thank you, feeling a bit stupid. I did put the second thread in a separate module, that's why it wasn't working with a global variable. I didn't need global variable, I just needed to reference the modules namespace! :oops: Try this: import _thread from time import sleep_ms running = True c...
by Filip_KONAX
Fri Jun 17, 2022 5:57 am
Forum: Raspberry Pi microcontroller boards
Topic: Print and Ctrl-C stops being responsive - USB in timeout
Replies: 1
Views: 1486

Print and Ctrl-C stops being responsive - USB in timeout

I have a project using an RPi PICO that uses the hardware UART to connect to a modem. I need to communicate a lot using the uart, e.g. during the setup phase. In order to be able to follow this setup, I'm printing to the terminal (standard REPL over CDC-USB UART) and I also keep a log in a file. I s...
by Filip_KONAX
Thu Jun 16, 2022 3:35 pm
Forum: Raspberry Pi microcontroller boards
Topic: RP2 multithreading - Pin - UART - should I switch to C? -> changed to PRINT stops
Replies: 7
Views: 2381

Re: RP2 multithreading - Pin - UART - should I switch to C?

This is a peculiar use of a lock, whose purpose is normally to control access to a shared resource. While I can't see why your code isn't working, I suggest you replace the lock with a simple shared global boolean, say stop_thread . The two threads can share variables, although care needs to be tak...
by Filip_KONAX
Thu Jun 16, 2022 3:08 pm
Forum: Raspberry Pi microcontroller boards
Topic: RP2 multithreading - Pin - UART - should I switch to C? -> changed to PRINT stops
Replies: 7
Views: 2381

Re: RP2 multithreading - Pin - UART - should I switch to C? -> changed to PRINT stops

Just upgraded to v1.19. Seems to work better.
I'll keep you posted!

Still wondering (see above) if putting sleep statements is the way-to-go...?
by Filip_KONAX
Thu Jun 16, 2022 2:46 pm
Forum: Raspberry Pi microcontroller boards
Topic: RP2 multithreading - Pin - UART - should I switch to C? -> changed to PRINT stops
Replies: 7
Views: 2381

Re: RP2 multithreading - Pin - UART - should I switch to C? -> changed to PRINT stops

I think I might have found the solution for the stopping of the printing of the REPL in combination with constant uart usage. I introduced on different locations in my code sleep_ms calls, what seels to give time to the REPL to process the printing. Is this the way-to-go or are there better ways to ...