Inverted Serial on pyboard
Inverted Serial on pyboard
Hi all. I'm wondering if there is a way to have an inverted serial on the pyboard without using an external circuit.
Thanks to everyone that could help on this!
Thanks to everyone that could help on this!
Re: Inverted Serial on pyboard
I took a quick look through the datasheet and I don't see anything in the registers which would do that.
Re: Inverted Serial on pyboard
thanks for checking. No many option thendhylands wrote:I took a quick look through the datasheet and I don't see anything in the registers which would do that.
Re: Inverted Serial on pyboard
You could always bit bang it Or if you need efficiency synthesis it using SPI.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Inverted Serial on pyboard
This is a real hack. It will only work if the baudrate is relatively low, but you could feed the UART tx line to another pin and set up an interrupt callback on any state change which outputs the inverse on another pin. Likewise for the rx data.
I told you it was a hack
I told you it was a hack
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: Inverted Serial on pyboard
If it's not only inverting, but level aligning too, then an external buffer/driver is required anyhow. And in any case the external inverter would protect PyBoard from damage.
Re: Inverted Serial on pyboard
thanks guys.
I'm going to start with the external inverter (that I have already got). My project is at the very early stage and I want to speed up the prototyping using what I already have available. In the second stage I will deal with optimizations like this one.
Could you confirm that all the UART are 5v tolerant? Looking at the data sheet I understand that only pins X5 and X6 are not 5v tolerant. Is that right?
I'm going to start with the external inverter (that I have already got). My project is at the very early stage and I want to speed up the prototyping using what I already have available. In the second stage I will deal with optimizations like this one.
Could you confirm that all the UART are 5v tolerant? Looking at the data sheet I understand that only pins X5 and X6 are not 5v tolerant. Is that right?
Re: Inverted Serial on pyboard
My understanding is that all of the pins are 5v tolerant when in a digital mode. When in an analog mode (i.e. being used as an ADC) then they are only 3.3v tolerant. It looks like X5 & X6 are always tied to the ADC which is why they're not 5V tolerant.
Re: Inverted Serial on pyboard
Thanks a million!dhylands wrote:My understanding is that all of the pins are 5v tolerant when in a digital mode. When in an analog mode (i.e. being used as an ADC) then they are only 3.3v tolerant. It looks like X5 & X6 are always tied to the ADC which is why they're not 5V tolerant.
Re: Inverted Serial on pyboard
If you are going to use an RS232 level shifter that runs on 5V, do be careful that the out-going buffer will accept the 3.3V output from the pyboard as a logic high. I was about to hack something together this week using some MAX232N's that I had sitting around, only to look up the data sheet and discover that its logic-high input threshold was 3.5V; even though the pyboard logic is 5V tolerant, it can't produce 5V logic levels as outputs.
There are level shifters that can be powered from a single 3.3V supply; I have used the MAX3227 for this, and it provides output levels of roughly +/- 5.5 - 6V, which is sufficient for RS232.
-Bryan
There are level shifters that can be powered from a single 3.3V supply; I have used the MAX3227 for this, and it provides output levels of roughly +/- 5.5 - 6V, which is sufficient for RS232.
-Bryan