Thumbwheels
I ordred 4 Thumbwheel switches today, 0-9 BCD output that I plan on getting a value from 0 to 9999 from.
I wrote some code to read the condition of the inputs on SX48 RB.D and RB.E I have not tested it yet but it compiles ok.
I am looking for some schematics for wiring up these Thumbwheel switches. The Datasheets mainly give the truth tables and not much on other info like pullup resistors or diodes if needed.
Thanks in advance
I wrote some code to read the condition of the inputs on SX48 RB.D and RB.E I have not tested it yet but it compiles ok.
I am looking for some schematics for wiring up these Thumbwheel switches. The Datasheets mainly give the truth tables and not much on other info like pullup resistors or diodes if needed.
Thanks in advance
DEVICE SX48, OSC4MHZ FREQ 4_000_000 Thumbwheel_12 Var RD ' 8 Input pins for ones and tens places Thumbwheel_34 Var RE ' 8 Input pins for hundreds and thousands places ones Var Byte Tens Var Byte Hundreds Var Word Thousands Var Byte Total Var Word PROGRAM Start Start: Main: Ones = Thumbwheel_12 & $0F 'Get lower 4 bits of RD Tens = Thumbwheel_12 & $F0 'Get Higher 4 bits of RD Tens= Tens>>4 Tens = Tens*10 Hundreds = Thumbwheel_34 & $0F 'Get lower 4 bits of RE Hundreds = Hundreds * 100 Thousands = Thumbwheel_34 & $F0 'Get Higher 4 bits of RE Thousands= Thousands>>4 Total = Thousands*1000 Total = Total+Hundreds Total = Total+ Tens Total = Total+Ones GOTO Main
Comments
It should be very easy. If not, write back!
- Sparks
Is there much danger if I connect these directly to the I/O pins without using the 220 R?