Search found 10 matches
- Thu Mar 24, 2022 9:14 am
- Forum: Raspberry Pi microcontroller boards
- Topic: sm.exec() and Pin.value()
- Replies: 2
- Views: 2814
Re: sm.exec() and Pin.value()
No ideas up to now? In the meantime I tried to find a work-around. So I modified https://github.com/raspberrypi/pico-micropython-examples/blob/master/pio/pio_exec.py in order to change 2 pins with an exec instruciton. import time from machine import Pin import rp2 # Define an empty program that uses...
- Wed Mar 23, 2022 2:36 pm
- Forum: Raspberry Pi microcontroller boards
- Topic: sm.exec() and Pin.value()
- Replies: 2
- Views: 2814
sm.exec() and Pin.value()
Hi, I would like to stop the PIO and set the output pin in the main loop. But it looks to me that it's not possible to set the pin output state from the main loop when it's defined to be the output of the PIO. Is this feature not available? As an example I extended the LED blink example: import utim...
- Fri Jan 07, 2022 7:00 pm
- Forum: Raspberry Pi microcontroller boards
- Topic: PIO measuring time between pin change
- Replies: 7
- Views: 21981
Re: PIO measuring time between pin change
Well, maybe I should have read the docu a little bit more carefully. set() works with data up to 31, because the number of bits in the command is limited. @rp2.asm_pio(set_init=rp2.PIO.IN_HIGH, autopush=True, push_thresh=32) # push() is done automatically win in_()! def period(): set(x, 31) in_(x, 3...
- Fri Jan 07, 2022 2:13 pm
- Forum: Raspberry Pi microcontroller boards
- Topic: PIO measuring time between pin change
- Replies: 7
- Views: 21981
Re: PIO measuring time between pin change
Maybe I should explain what I would like to do. I have a sensor with SPC interface (for an explaination see https://www.nxp.com/docs/en/application-note/AN4219.pdf ) where the time between falling edges of the signal line defines the data transferred. This is a screenshot of the Master trigger pulse...
- Fri Jan 07, 2022 12:44 pm
- Forum: Raspberry Pi microcontroller boards
- Topic: PIO measuring time between pin change
- Replies: 7
- Views: 21981
Re: PIO measuring time between pin change
After a while I come back to the time measurement. It took a little bit because of the festival season and I had to get the answer of the sensor correct, I have level-shifters with pull-up resistors and have to switch from drive to open-drain. But now it works, now I can focus on the measurement bet...
- Mon Nov 22, 2021 7:15 pm
- Forum: Raspberry Pi microcontroller boards
- Topic: PIO measuring time between pin change
- Replies: 7
- Views: 21981
Re: PIO measuring time between pin change
Hi,
Many thanks, that's exactly what I am searching for!
My first thought is not true because when I change the pin to 25, the PIO works. I will check and double-check my code to see why it's not working as expected.
KR,
Christof
Many thanks, that's exactly what I am searching for!

My first thought is not true because when I change the pin to 25, the PIO works. I will check and double-check my code to see why it's not working as expected.
KR,
Christof
- Fri Nov 19, 2021 6:41 pm
- Forum: Raspberry Pi microcontroller boards
- Topic: PIO measuring time between pin change
- Replies: 7
- Views: 21981
PIO measuring time between pin change
Hi, I would like to measure the time of a pulse in low level. So I used the PWM example in order to generate a pulse on the LED. And I wrote a PIO script that first waits for the pin being low and then decrements scratch register x untkl the pin goes high. At least this was the intention of this scr...
- Thu Nov 18, 2021 8:27 am
- Forum: Raspberry Pi microcontroller boards
- Topic: Side-step pindirs missing?
- Replies: 4
- Views: 3194
Re: Side-step pindirs missing?
Thanks, that's also what I've seen. Maybe we could add this to the to-do list, maybe I can do it when I have time to dig a little bit more in the MicroPython source code.
KR,
Christof
KR,
Christof
- Tue Nov 16, 2021 5:23 pm
- Forum: Raspberry Pi microcontroller boards
- Topic: Side-step pindirs missing?
- Replies: 4
- Views: 3194
Re: Side-step pindirs missing?
Thanks for the answer! This is exactly what I was searching for. I think I can do it w/o sidestep and as my application is similar, I will be inspired by this source code :D In general, did I get it wrong that the switching from IN to OUT is also possible with sidesteps? Is this function still missi...
- Tue Nov 16, 2021 9:05 am
- Forum: Raspberry Pi microcontroller boards
- Topic: Side-step pindirs missing?
- Replies: 4
- Views: 3194
Side-step pindirs missing?
Hi, I am quite new to PIO concept, I would like to make a simplex communication on one pin. To be more precise the pin concept is open-drain (external pull-up) and the communication is triggered by the Pico by pulling the line LOW. This is working in my PIO program, but after this pulse, the pin has...