Read bit stream from a Serial Interface

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Read bit stream from a Serial Interface

Post by Roberthh » Thu May 11, 2017 2:11 pm

Since you have access to the whole hardware, especially in viper and assembler, you can also access the ADC registers. But you have to deal with the whole control of it. For convenience, all symbolic register names are available in the stm module, and these names match the data sheet. But you can also call the pyb.ADC methods from a viper or native function and carry on from that point on. Check first, if the speed is not already sufficient.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Read bit stream from a Serial Interface

Post by pythoncoder » Fri May 12, 2017 7:15 am

The problem I have with bit-banging in assembler is it's too fast for my test gear ;)
Peter Hinch
Index to my micropython libraries.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Read bit stream from a Serial Interface

Post by Roberthh » Fri May 12, 2017 7:31 am

Yes, the I/O bus is slower than the CPU bus. Between a GPIO I/O line's high/low you hav to insert a few nop(), to allow the I/O to settle, and that is pretty much a trial & error game. Two nop() are guaranteed to work, sometimes one nop() is sufficient. If you find in my TFT driver some nop(), you know why.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Read bit stream from a Serial Interface

Post by pythoncoder » Sat May 13, 2017 5:10 am

That's useful information. I had wondered why those nops were there.
Peter Hinch
Index to my micropython libraries.

feylen
Posts: 1
Joined: Sun Feb 28, 2021 3:36 pm

Re: Read bit stream from a Serial Interface

Post by feylen » Sun Feb 28, 2021 3:40 pm

I know this thread is quite old, but I am currently working on a work project using the SSI protocol to read position data for a servo application. I am interested in how it turned out and if it ended up working in the direction the thread shows. Any news to share on the outcome?

Post Reply