PDA

View Full Version : Help with uController Serial Keypad (demo program anyone?)



Microcontrolled
07-09-2009, 08:01 AM
I just got the Serial Keypad from uController and could not get it to interface with the Propeller properly. I was just wondering what the serial commands sent out from it where, and whether or not anyone had a program written for it that could test if it's working.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Toys are microcontroled.
Robots are microcontroled.
I am microcontroled.


If it's not Parallax then don't even bother. :-)
·

Mini-Din/PS2 connectors are for sale! 5 for $1! PM me if you wish to make an order.
Cheap·shipping unless specified!··········150 left!!··

parts-man73
07-09-2009, 08:43 AM
No commands - just open a serial port with FullDuplexSerial or some other serial object. 9600 baud.

The way I test them after assembly.....
Supply VDD and VSS to the Serial Keypad. (can be 3.3V or 5V)
plug a PropPlug into your computer.
Connect VSS on the PropPlug to the same VSS on the Serial Keypad.
Connect the TX pin on the Serial Keypad to the RX pin on the PropPlug (I'd use a 1k resistor or similar, especially if you are supplying the Keypad with 5V)
Open PST or other terminal program on your computer and now any key you press on the KeyPad should appear on the Terminal program.


If you own a Serial LCD, you could probably connect them directly to each other, of course making sure you have a common VSS.

The Serial KeyPad simply outputs the ASCII codes for the characters you press on the KeyPad at 9600 baud. If you supply the Keypad with 5V, the TX pin will output the serial data at 5V levels. If you supply the Keypad with 3.3V, the TX pin will output the serial data at 3.3V levels.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Brian

uController.com (http://uController.com) - home of SpinStudio - the modular Development system for the Propeller

PropNIC (http://uController.com) - Add ethernet ability to your Propeller! PropJoy (http://uController.com) - Plug in a joystick and play some games!

SD card Adapter (http://uController.com) - mass storage for the masses Audio/Video adapter (http://uController.com) add composite video and sound to your Proto Board

mosquito56
07-09-2009, 10:04 AM
This is what I have, pm· me if you can't figure it out. There is no commenting. The readit is for testing purposes only.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·······

······· "What do you mean, it doesn't have any tubes?"
······· "No such thing as a dumb question" unless it's on the internet

Microcontrolled
07-09-2009, 05:42 PM
I have connected it straight to a serial LCD and it did not work. Thanks for the program, I will try it.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Toys are microcontroled.
Robots are microcontroled.
I am microcontroled.


If it's not Parallax then don't even bother. :-)
·

Mini-Din/PS2 connectors are for sale! 5 for $1! PM me if you wish to make an order.
Cheap·shipping unless specified!··········150 left!!··

parts-man73
07-09-2009, 07:16 PM
Do you have a PropPlug to test it with the method I outlined above ? Or what is your Propeller set-up, as-in, what board do you want to plug it into?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Brian

uController.com (http://uController.com) - home of SpinStudio - the modular Development system for the Propeller

PropNIC (http://uController.com) - Add ethernet ability to your Propeller! PropJoy (http://uController.com) - Plug in a joystick and play some games!

SD card Adapter (http://uController.com) - mass storage for the masses Audio/Video adapter (http://uController.com) add composite video and sound to your Proto Board

Microcontrolled
07-09-2009, 10:13 PM
PE Labs kit on a fully assembled board. I do have a Prop Plug to test it with, but I have not had time to do that yet. In a while I will be able to test it using that method.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Toys are microcontroled.
Robots are microcontroled.
I am microcontroled.


If it's not Parallax then don't even bother. :-)
·

Mini-Din/PS2 connectors are for sale! 5 for $1! PM me if you wish to make an order.
Cheap·shipping unless specified!··········150 left!!··

GeorgeCollins
07-10-2009, 11:06 AM
Enclosed is some very simple test code for the uController. It's not as good as mosquitos, but it should also work. It uses Simple_Serial and tv_text from the library.

You need a TV display for output, but you could switch the output to something else pretty easily. If there is something else I can help with please ask.




' Key Test for uController Serial Pad
' George Collins

CON

_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000

TV_PIN = 20
KEY_PIN = 0

OBJ

text : "tv_text"
ser : "Simple_Serial"


VAR
BYTE mybyte

PUB start

'start tv term with TV_PIN as first pin to tv plug
text.start(TV_PIN)

' Tx of serial pad goes to Key Pin
ser.init(KEY_PIN,-1,9600)
repeat
mybyte:=ser.rx
waitcnt(cnt+1_000_000)
text.out(mybyte)

{{
┌───────────────────────────────────────────────── ────────────────────────────────────────────────── ───────────────────────────┐
│ TERMS OF USE: MIT License │
├───────────────────────────────────────────────── ────────────────────────────────────────────────── ───────────────────────────┤
│Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation │
│files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, │
│modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software│
│is furnished to do so, subject to the following conditions: │
│ │
│The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.│
│ │
│THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE │
│WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR │
│COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │
│ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. │
└───────────────────────────────────────────────── ────────────────────────────────────────────────── ───────────────────────────┘
}}



▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.trailofdestruction.com

Microcontrolled
07-10-2009, 06:13 PM
I just CANNOT figure out how to recieve signals from that thing!
I will try yours, GC, for if that works then I can copy that method. Moquito's did not work, parts-man's testing method worked, but I have tryed using FDS to receive it by Decimal, Hexadecimal, String, and byte and it will not
register if I pushed "1" or not in an if...then loop. I will try the new code, thanks.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Toys are microcontroled.
Robots are microcontroled.
I am microcontroled.


If it's not Parallax then don't even bother. :-)
·

Mini-Din/PS2 connectors are for sale! 5 for $1! PM me if you wish to make an order.
Cheap·shipping unless specified!··········150 left!!··

GeorgeCollins
07-11-2009, 01:12 PM
I am trying to think of problems I have encountered... I am using 5v, not 3.3v for power. I think it is supposed to work on 3.3v, but that is something to try.

Are you just running the demo code? Could there be anything else setting the pins for in/out?

Serial communications seem very susceptible to problems from a poor physical connection.

When I use a battery, it can have a low enough charge to drive the prop by itself, but get flaky when I start to attach sensors or chips to the same circuit.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Robots (http://www.trailofdestruction.com)