GP32 Ext Port Question / Ir Update


lek

Member
Joined
Nov 12, 2003
Messages
165
Age
43
Location
Warwickshire, UK
Website
www.neverendless.com
My EXT port's Tx pin is constantly at 3.3v unless it is sending a signal (i.e. it is active low), which is a bit of a pain when it comes to controlling things via the port (simple circuits become more complicated for components that expect high signals to represent data)

An easy way around this is to wire such components between the Tx pin and the 3.3v pin, thus creating a potential difference of 0 (3.3 - 3.3). Then when a signal is generated at the Tx pin, it's voltage lowers, thus the potential difference between the Tx 3.3v pin increases.

However, it seems that the higher the baud rate of the UART, the less this potential difference is, as the Tx pin seems to have less and less voltage change when sending data at higher baudrates. At 300bps, I can expect ~1V potential differnce to drive a component, at 7200bps, this drops to ~100-200mV (as far as I can tell). Either way, neither voltage is really sufficient to drive much :(

A transistor hooked up to the Tx pin should allow a component to be used with the full 3.3V however, the Tx signal turns the transistor on/off, which in turn can control the flow between the GND and 3.3V pins that your component is connected too.

Has anyone else noticed this about the Tx port, that it is active low? I was under the impression that computer serial ports had a Tx line that was at 0v when idle (although there seems to be comflicting info on this). I would've expected the GP32's EXT port to act the same, given that it is geared somewhat towards serial communication.

Seeing as I managed to break a leg off each of ~10 transistors yesterday :blink:, I'll have to wait until later this week to overcome my problem/try a circuit with a transistor.

-------------------------------------------------------------------------

On another note, the IR receiver I am building now successfully receives signals reliably at up to 3600bps (low I know, also only seems to work at multiples of this, 900, 1800, otherwise the data is sometimes not the same between received signals when it should be). The original receiver worked off low voltage, but wasn't reliable. Having switched to an even-lower voltage one, it works great. Receiving distance has been tested to 10m currently. When I find the time I'll try it over a greater distance, outside or something.

The IR transmitter part works, but due to the above gripe over the Tx ports voltage, it only works very close to the receiver (it only gets a few mV to run off), and also only transmits at a max of 1200bps (this is the max of the transmitter unfortunately, higher would require IRDA components, which may or may not allow control of TV's, etc, and would run off a higher voltage).

Still enough to learn IR remotes and reproduce the signals though, maybe even simple low data multiplayer games (pong anyone?)

Receiving wise, enough to control an MP3 player program or other app on the gp32_console from a distance.

Should be getting some tri-colour LED's in the post soon to signify transmitting/receiving/both. B)
 
A reply from our electronics engineer. He is a little to busy to speak at the moment sorry!

UART output pins are normally active low logic level signals (3.3V CMOS in this case), and the line drivers used to convert to/from RS232 levels not only do the level shifting, but are also invariably inverters as well. Thus, the active low logic level TX pin becomes an active high RS232 TX pin.

Your method of producing an active low signal is incredibly dodgy, relying on converting a current source into a current sink, which is full of fear and trepidation. Due to issues such as pulse width, capacitance & resistance of external circuit and the driver, etc, it is not likely to work in any useful way. The correct and simple solution is just to hang an inverter gate on the inputs and outputs of the EXT port,
obviously wired the correct way around for the function desired and running from the correct voltage. A 74LVX04 would do the job nicely. This presumes you want logic level signals for the external circuit, of course.

hope this helps.
 
If you want an opinion, ask an electronics engineer. If you want 10 different opinions, ask 10 electronics engineers :D

Anyway, with all due respect to nigelibrown's engineer, I disagree. Most logic chips are better at sinking current than sourcing it, so your connection method is fine. (this goes back to the days of eg. TTL logic, which was terrible at sourcing current. Nowadays it's still uncommon to find logic that will source as much current as it will sink).

That said, you can't guarantee to get more than a couple of mA out of (or into) the CPU's uart pin, so you do need some sort of buffering. Rather than using a bipolar transistor, how about using a small-signal mosfet? These are generally better at switching at high speed without distorting the signal than bipolar ones. I haven't got any data to hand about common devices that you could buy from your local shop, but if you go and ask for a small-signal N-channel mosfet you should be fine. Just make sure that Vth (the switching voltage) is around 2V or less, and DON'T get a JFET, these are different beast entirely!

I'm suspicious about your statement that "it seems that the higher the baud rate of the UART, the less this potential difference is"... the TX output should be just fine at pulling down to 0V all the way up to the maximum bit rate. After all, even 115200bps is slow compared to the 66MHz signals to the memory chip. How are you measuring the output voltage? Can you post a picture of an oscilloscope trace?

Oh, and UART outputs from micros are always active low.
 
Thanks for your replies!

The 74LVX04 you mentioned looks promising nigelibrown. I found what I think is a suitable alternative, the 74HC04, easier for me to get. I have some bits arriving soon, and if they turn out to not be suitable, I'll give a voltage inverter a go, certainly seems an easy way to solve my problem.

I wasn't aware that UART are RS232 both treated high/low signals differently, makes sense now I know that. I wasn't too happy myself with the Tx pin basically being unprotected from back current (i think that's right??!).

I'm no expert on this, but I assume that what your saying Robster is that the current wants to flow in one direction, and the pull is greater to Vcc than to the Tx pin, in this case??! This sound right to me, the Tx pin is being "forced" to source current am I right? I guess a suitable diode would protect the Tx pin from this.

You right about using a MOSFET too, didn't think at the time. The transistor(s) that I have coming to me should do the job though, they're high-speed iirc.

I'm only able to monitor the Tx pins voltage via my multimeter (no scope atm :( ). Tbh I think it doesn't take readings often enough to give me a reliable picture of whats going on. The Tx pin is probably chaning voltage so rapidly (esp at higher bauds) that my multimeter doesn't measure it properly. I think.

I will get a 'scope sometime. Sometime soon.....
 
When you are finished with this mod, will you be planning on selling the unit? Or are you going to send robster(www.cobbleware.com) the schematics so that anyone may make use of this cool project?
 
I have thought about selling them if possible, although I have problems sourcing EXT connectors :p

Regardless, I was going to release a final circuit anyway, once it works as I intend it too. Its just the transmitting I have to get working better now. Recieving is fine.


Could do with some better software than the GP32 SDK rubbish I've managed to produced atm...
 
Back
Top