Hello, I have just 'discovered' this site and chip. I don't know why I've not come across
it before as ive done a fair few searches for an easily programmable microcontroller.
I'd like to give some background on myself. I started to muck about with electronics and
picaxe a few months ago, pretty much stuck to the most basic chips being the 08M and 14M
as I could easily plug them straight onto a breadboard along with the stero connector to
program them.
I wrote an app in VB.NET to send and recieve data using the SerialPort control which you
just drag and drop onto a form.
When I wanted to go for a chip with a lot more power I ended up getting a basic stamp
and BOE and parts kit from Parallax. The Basic Stamp was pretty expensive. Im not sure of
the comparison with this chip here but I know the Basic Stamp I purchased was a lot more
expensive. And all Ive done so far is get the Stamp to send a "Hello World" to my PC
screen so I havent done anything yet.
I have two questions on my mind.
1. Once you have programmed the chip can you fairly easily pull it off the development
board and plug it onto a breadboard for its final application ?
2. Can you use this chip to accept data from a standard 4*4 keypad and is there any
tutorial out there on how to acclomplish this as I am rather clueless, well to be honest I
think I saw some keypad example code in a zip file so I know from that that it CAN be done
?
Thanks for reading,
Mike.
------------------------------------

(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )
> ... 1. Once you have programmed the chip can you fairly easily pull
it off the development board and plug it onto a breadboard for its final
application ?
Sure. It's usually just as easy to put a serial port connector (a DB9
or a four-pin header, usually) on your final project breadboard so you
can program and operate the processor in place but, if you wish, you can
program the processor module on one board and run the code on another.
> ... 2. Can you use this chip to accept data from a standard 4*4 keypad...
Yes, certainly. A 4x4 matrix keypad can be directly connected to eight
I/O pins. The following code if taken from the LCDX function library
(in Files).
Tom
'-------------------------------------------------------------------------------
Public Function GetKeypadRaw() As Byte
' This program will read a 4 x 4 matrix keypad connected to the PORTC
pins and return its Raw data.
' Keypad port shares I/O pins with LCD display so it must be returned as
we found it. 255 = no key
' On return, PORTC is configured to input-pullup.
Dim Vertical As Byte
Dim Horizontal As Byte
' Set PortC high
Register.DDRC = bx1111_1111
Register.PORTC = bx1111_1111
' Set up PORTC for a horizontal scan:
' Set bits C0 .. C3 (LSNybble) to input-pullup -- horizontal.
' Set bits C4 .. C7 (MSNybble) to output-low -- vertical.
Register.DDRC = bx1111_0000
Register.PORTC = bx0000_1111
' LSNybble
Horizontal = Register.PINC And bx0000_1111
' Set PortC high
Register.DDRC = bx1111_1111
Register.PORTC = bx1111_1111
' Set up PORTC for a vertical scan:
' Set bits C0 .. C3 (LSNybble) to output-low -- horizontal.
' Set bits C4 .. C7 (MSNybble) to input-pullup -- vertical.
Register.DDRC = bx0000_1111
Register.PORTC = bx1111_0000
' MSNybble.
Vertical = Register.PINC And bx1111_0000
' Combine horizontal and vertical nybbles.
GetKeypadRaw = Vertical Or Horizontal
' Turn on PortC Pull-ups
Register.DDRC = bx0000_0000
Register.PORTC = bx1111_1111
End Function
'-------------------------------------------------------------------------------
Public Function GetKeypad() As Byte
' This sub will read the NetMedia 4 x 4 matrix keypad connected to the
PORTC pins
' and return the keys values as displayed on the keypad. Values are 0-9
and 10 - 15, 255 = no key.
' Keypad port shares I/O pins with LCD display so it must be returned as
we found it.
' On return, PORTC is configured to input-pullup.
Dim Vertical As Byte
Dim Horizontal As Byte
Dim Raw_Key As Byte
' Set PortC high
Register.DDRC = bx1111_1111
Register.PORTC = bx1111_1111
' Set up PORTC for a horizontal scan:
' Set bits C0 .. C3 (LSNybble) to input-pullup -- horizontal.
' Set bits C4 .. C7 (MSNybble) to output-low -- vertical.
Register.DDRC = bx1111_0000
Register.PORTC = bx0000_1111
' LSNybble
Horizontal = Register.PINC And bx0000_1111
' Set PortC high
Register.DDRC = bx1111_1111
Register.PORTC = bx1111_1111
' Set up PORTC for a vertical scan:
' Set bits C0 .. C3 (LSNybble) to output-low -- horizontal.
' Set bits C4 .. C7 (MSNybble) to input-pullup -- vertical.
Register.DDRC = bx0000_1111
Register.PORTC = bx1111_0000
' MSNybble.
Vertical = Register.PINC And bx1111_0000
' Combine horizontal and vertical nybbles.
Raw_Key = Vertical Or Horizontal
' Turn on PortC Pull-ups
Register.DDRC = bx0000_0000
Register.PORTC = bx1111_1111
' If no key is pressed return 255 and exit function
If Raw_Key = 255 Then
GetKeypad = Raw_Key
Exit Function
End If
' Map the raw keypad data to the NetMedia Keypad keys
Select Case Raw_Key
' For digits 0 - 9
Case 126
Raw_Key = 1
Case 125
Raw_Key = 2
Case 123
Raw_Key = 3
Case 190
Raw_Key = 4
Case 189
Raw_Key = 5
Case 187
Raw_Key = 6
Case 222
Raw_Key = 7
Case 221
Raw_Key = 8
Case 219
Raw_Key = 9
Case 237
Raw_Key = 0
' For other keypad keys
Case 119
Raw_Key = 10 ' Up Arrow
Case 183
Raw_Key = 11 ' Down Arrow
Case 215
Raw_Key = 12 ' "2nd" Key
Case 238
Raw_Key = 13 ' Clear Key
Case 235
Raw_Key = 14 ' Help Key
Case 231
Raw_Key = 15 ' Enter Key
' Bad keypad read will return 255
Case Else
Raw_Key = 255
End Select
GetKeypad = Raw_Key
End Function
'-------------------------------------------------------------------------------
------------------------------------
______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.
(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )
And the NZ distributor has stock!
*******************************************
Neil Jepsen. B.Sc. M.Sc(Hons). CPL.Member NZAS
Acoustic Consultant.
Jepsen Acoustics & Electronics Ltd
PO Box 1904.
Palmerston North.
New Zealand.
Ph +64 6 357 7539
FAX +64 6 357 7217
Mobile 0274 428 094
This e-mail and any attachments are CONFIDENTIAL and may contain legally privileged
information. If you are not the intended recipient of this e-mail message, please
telephone or e-mail us immediately, delete this message from your system and do not read,
copy, distribute, disclose or otherwise use this e-mail message and any attachments.
Although Jepsen Acoustics & Electronics Ltd believes this email and any attachments to be
free of any virus or other defect which may affect your computer, it is the responsibility
of the recipient to ensure that it is virus free and JAEL does not accept any
responsibility for any loss or damage arising in any way from its use.
micheal.alynch wrote:
> Thanks Tom. Much appreciated your response with some code there as well.
> I bought a BasicStamp 2p for $89.00 AUS. As the XBasic chip is more
> powerfull and I like the code as I program in VB.NET so XBasic is
> easier for me to pick up or use more effectivly. Anyway Im surprised
> the chip here is less expensive, the closest distributer to me is New
> Zealand, Ill have to see how the price conversion goes :).
>
> I guess you pay a premimum for parallax support ??
> ------------------------------------------------------------------------
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.5.387 / Virus Database: 270.13.14/2238 - Release Date: 07/14/09 18:03:00
>
>
------------------------------------

(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )