Arakis
Posts: 11
Joined: Thu Nov 01, 2012 12:29 am

Disable UART / serial console to get max GPIO's

Fri Nov 09, 2012 5:24 pm

Hello,
i ask me, how to disable the UART / serial console. I read, when disabling this, it would be possible to get some extra GPIO's, for example GPIO0 and GPIO1 (PIN1, PIN3).

Another question is, why have GPIO21(GPIO27, PIN13) only 1.6V instead of 3.2, when Hi?

Greetings,
Sebastian

User avatar
tedhale
Posts: 114
Joined: Thu Sep 20, 2012 4:52 pm
Location: Williamsburg, VA, USA
Contact: Website

Re: Disable UART / serial console to get max GPIO's

Fri Nov 09, 2012 5:34 pm

look here
http://raspberrypihobbyist.blogspot.com ... -port.html

It is about my work to set up a serial port using those pins, but I describe how to disable the system use of the serial port.
Follow those instructions and those two pins will be available for use as GPIO.
That is, unless there is something in the serial port driver that keeps the in use, but I don't think that is the case.

Not sure about the 1.6v question. I have used all 17 GPIO pins with no problem.
- Ted B. Hale
http://raspberrypihobbyist.blogspot.com

Arakis
Posts: 11
Joined: Thu Nov 01, 2012 12:29 am

Re: Disable UART / serial console to get max GPIO's

Fri Nov 09, 2012 6:01 pm

Thank you for your hint, i will have a look at it.

At the photo of your blog, wich wires you are using? I never found them in the internet to buy them.

Greetings,
Sebastian

User avatar
Grumpy Mike
Posts: 943
Joined: Sat Sep 10, 2011 7:49 pm
Location: Manchester (England England)
Contact: Website

Re: Disable UART / serial console to get max GPIO's

Fri Nov 09, 2012 9:09 pm

Arakis wrote:Hello,
i ask me, how to disable the UART / serial console. I read, when disabling this, it would be possible to get some extra GPIO's, for example GPIO0 and GPIO1 (PIN1, PIN3).
Sebastian
Just define those pins as an input or an output, that over rides any previous definition.
Another question is, why have GPIO21(GPIO27, PIN13) only 1.6V instead of 3.2, when Hi?
Are you sure you are doing it right and have no shorts? Can you post your code. You should not be seeing this.

dmb
Posts: 38
Joined: Wed May 30, 2012 9:33 am

Re: Disable UART / serial console to get max GPIO's

Mon Nov 12, 2012 10:15 am

Hi Ted,

Did you manage to get the GPIO serial port working with your CM11A ? I'm trying to do exactly the same thing I've using a ready-made MAX3232 module, but not getting any joy at the moment, although the setup works using a PL2302 usb dongle with my CM11U so the software aspect seems OK. I'm wondering whether 2/3/5 is enough or whether I need pin-9 in the mix too.

Cheers,

David
tedhale wrote:look here
http://raspberrypihobbyist.blogspot.com ... -port.html

It is about my work to set up a serial port using those pins, but I describe how to disable the system use of the serial port.
Follow those instructions and those two pins will be available for use as GPIO.
That is, unless there is something in the serial port driver that keeps the in use, but I don't think that is the case.

Not sure about the 1.6v question. I have used all 17 GPIO pins with no problem.

User avatar
tedhale
Posts: 114
Joined: Thu Sep 20, 2012 4:52 pm
Location: Williamsburg, VA, USA
Contact: Website

Re: Disable UART / serial console to get max GPIO's

Mon Nov 12, 2012 3:31 pm

I am pretty sure that the CM11A did work with just the TX and RX lines used.
It has been a couple of months but I am pretty sure that it did test out OK.
I have been working in my (rare) spare time to finish the complete interface board, so I haven't been using the serial port for a while.
My SPI bus has finally been added and tested out, so I hope to get the device mounted and connected to my alarm and X10 systems this week.
Before I do that i will connect my CM11a and see if it still works.

(The SPI bus will be used for analog inputs, mostly to read temperatures. It may also be used to expand the GPIO if needed.)

For my initial testing I just connected the RasPi serial to a PC and tested using minicom and hyperterminal.
- Ted B. Hale
http://raspberrypihobbyist.blogspot.com

User avatar
tedhale
Posts: 114
Joined: Thu Sep 20, 2012 4:52 pm
Location: Williamsburg, VA, USA
Contact: Website

Re: Disable UART / serial console to get max GPIO's

Tue Nov 13, 2012 1:45 pm

I tested it again last night and it does not work. It appeared to work with my software, but it was never actually outputing anything.
I downloaded and built "heyu" to test it and it failed also.
This is probably due to needing to have hardware handshaking. I don't believe that a fully functional RS-232 via the GPIO pins is possible.
Tonight I will experiment with forcing the handshaking high (either DTR or CTS or both) and test that.
I am sure that will allow some communications, but I am concerned that data may be lost if the RasPi is under heavy load.

Will report back tomorrow.
- Ted B. Hale
http://raspberrypihobbyist.blogspot.com

User avatar
tedhale
Posts: 114
Joined: Thu Sep 20, 2012 4:52 pm
Location: Williamsburg, VA, USA
Contact: Website

Re: Disable UART / serial console to get max GPIO's

Tue Nov 13, 2012 1:51 pm

I quick search found this

http://www.smarthome.com/manuals/protocol.txt

Which says that RI (an input to the RasPI) is needed, which doesn't really make sense.
This is going to take some experimentation.
I wish I still had an RS-232 breakout box.
- Ted B. Hale
http://raspberrypihobbyist.blogspot.com

User avatar
tedhale
Posts: 114
Joined: Thu Sep 20, 2012 4:52 pm
Location: Williamsburg, VA, USA
Contact: Website

Re: Disable UART / serial console to get max GPIO's

Wed Nov 14, 2012 3:01 am

Arakis wrote:Thank you for your hint, i will have a look at it.

At the photo of your blog, wich wires you are using? I never found them in the internet to buy them.

Greetings,
Sebastian
I suspect you are referring to the wires that I used to connect from the GPIO ribbon cable to the breadboard.
Those wires can be found anywhere you can get a breadboard.
They are made for making the connections on a breadboard, but are much nicer than the plain wires that are usually used.

You should be able to do the same thing with any solid 20-22 AWG wire.
It just needs to be big enough to fit snuggly into the connector.
- Ted B. Hale
http://raspberrypihobbyist.blogspot.com

User avatar
tedhale
Posts: 114
Joined: Thu Sep 20, 2012 4:52 pm
Location: Williamsburg, VA, USA
Contact: Website

Re: Disable UART / serial console to get max GPIO's

Wed Nov 14, 2012 3:07 am

It appears that my ancient CM11a interface has finally failed. :cry:
I connected it to a Black Box DB-9 Tester (simple in-line device that has green/red LEDs for all the lines) and it showed no life.
Normally, when this device is plugged into a serial interface, at least the TX or RX line will light up (green for High and red for Low)
However, I get nothing from my CM11a, which indicates no output at all.
Bummer. I will have to order a replacement.

All my research (including looking at source code for working programs) indicates that handshaking must be turned off.
The documentation does say the the RI line will be asserted when there is data ready to read.
This is probably done to allow a program to simply poll this status line instead of attempting to read when there is no data to receive.
My software simply does a Status Request (command code FF) and ignores any timeouts.
This has worked fine for years in both the Linux and Windows versions of my software.

Since you built the serial interface yourself, there are any number of things that could be wrong.
The first thing that that I would test is a connecting a PC to the serial port you made and see if the two computers can talk.
I tested it using Minicom on the RasPi and HyperTerminal on the (Windows) PC.
- Ted B. Hale
http://raspberrypihobbyist.blogspot.com

User avatar
tedhale
Posts: 114
Joined: Thu Sep 20, 2012 4:52 pm
Location: Williamsburg, VA, USA
Contact: Website

Re: Disable UART / serial console to get max GPIO's

Mon Nov 19, 2012 2:18 pm

It turns out that my old CM11a wasn't dead. The cable was just so worn out that it wasn't making good contact.
I now have a shiny new one ($39 on eBay) that works even when I shake the cable.

Found that my test using the DB-9 tester is meaningless. A good CM11a will also fail to light up any leds.
Once it is plugged in to the computer and TX is seen low, then it will show RX as low.
The handshaking lines are not used, although I never looked at the RI line (It is not even shown on my tester.)

The heyu program and my software both work fine now using the GPIO serial port. :D
- Ted B. Hale
http://raspberrypihobbyist.blogspot.com

dmb
Posts: 38
Joined: Wed May 30, 2012 9:33 am

Re: Disable UART / serial console to get max GPIO's

Wed Nov 21, 2012 4:57 pm

Hi Ted,

That's great information, thanks for putting in all that work. I think I'll need to get hold of a breakout box to figure out what's going wrong with my setup. At least I know that I only need rx/tx, and in theory my serial board supports both signals so I should be able to get something going.

All the best,

David

dmb
Posts: 38
Joined: Wed May 30, 2012 9:33 am

Re: Disable UART / serial console to get max GPIO's

Wed Nov 21, 2012 5:02 pm

edit: In case anyone else ever follows this thread, I didn't actually build the RS232 board myself, but bought it on the basis of another poster's good experiences with it. It's one of these: http://www.ebay.co.uk/itm/271036807405? ... 1497.l2649

juanRIOT
Posts: 21
Joined: Fri Aug 26, 2011 12:17 pm

Re: Disable UART / serial console to get max GPIO's

Fri Dec 14, 2012 4:50 pm

dmb wrote:edit: In case anyone else ever follows this thread, I didn't actually build the RS232 board myself, but bought it on the basis of another poster's good experiences with it. It's one of these: http://www.ebay.co.uk/itm/271036807405? ... 1497.l2649
Can this board be used like a WF-700-RELAY? Its a RS232 interface module for most pulse type coin acceptor or bill acceptor products. Details @ http://www.waferstar.com/downloads/WF-7 ... manual.pdf. Images @ http://www.waferstar.com/en/PULSE-PC.html

Purpose is to make it a middle ware between coin validator and to RPi GPIO.

Return to “Interfacing (DSI, CSI, I2C, etc.)”