7-segment Display Driver Help
mcfaddy
Posts: 3
Hello, I have an MC14489B display driver that I'm trying to use in conjunction with the propeller chip to run 4 7-segment displays. Also, I'm using the Spin language. The displays are for a game in which 2 players are involved and I'll have two pairs each counting up from 00 to 20 or so.
I'm new to this, so any help would be greatly appreciated. I've gone through the manual for the chip and while most of it is Greek to me, I can't seem to find any way to set the mode for it (at least, I think that's why nothing's lighting up). Basically, I can't find whether it needs a mode sent to it before sending the digits to illuminate and if it does, I wouldn't know what mode to send it for this particular application.
I've tried to find examples in BASIC online, but haven't found anything that I could decipher. If anyone has any sample code in Spin, that would be awesome.
The datasheet for the driver can be found here: http://html.alldatasheet.com/html-pdf/97949/MOTOROLA/MC14489B/322/1/MC14489B.html
I've also attached it MC14489B.pdf.
Also, I don't have any experience in using two digits to represent one number (i.e., counting from 9 to 10 or from 19 to 20). Any suggestions of how to use the propeller chip and Spin language to do this would also be a plus.
Thank you!
I'm new to this, so any help would be greatly appreciated. I've gone through the manual for the chip and while most of it is Greek to me, I can't seem to find any way to set the mode for it (at least, I think that's why nothing's lighting up). Basically, I can't find whether it needs a mode sent to it before sending the digits to illuminate and if it does, I wouldn't know what mode to send it for this particular application.
I've tried to find examples in BASIC online, but haven't found anything that I could decipher. If anyone has any sample code in Spin, that would be awesome.
The datasheet for the driver can be found here: http://html.alldatasheet.com/html-pdf/97949/MOTOROLA/MC14489B/322/1/MC14489B.html
I've also attached it MC14489B.pdf.
Also, I don't have any experience in using two digits to represent one number (i.e., counting from 9 to 10 or from 19 to 20). Any suggestions of how to use the propeller chip and Spin language to do this would also be a plus.
Thank you!
pdf
2M
Comments
After that you need to send 20 serial bits for data, first 4 bits are all 1's
and the other 16 bits are 4bits for each digit
If you want a 'A' send 1010
Don't use bank1 for your 4 led digits as your not sending the whole 24bits of data.
If 24bit is required, just send 4 more zeros.
set enable pin to 0
for i=1 to 20
set serial pin to 0 or 1
set clk pin to 1
set clk pin to 0
next i
set enable pin to 1
But could not hurt just to make sure he got that part right.
And that it's a 5volt device, and input are trigged at 3.85v if Vdd is 5.5v
maybe powering with 5v through a diode to get 4.3v
and it could still run and triggering it's input at 3.3would be close.
For a cheap level shifter, connect your 3.3V output (propeller) to the emitter of an npn transistor, pull the base up to 3.3V, pull the collector up to 5V and connect the collector to your 5V input. Cavet: this only works if your 3.3V logic high output level is greater than about 2.8V.
Make sure /enable is driven, it's used for synchronization and and data is latched on the rising edge.
The least significant bit of the config register is standby/blank. Make sure it's set.
If you're programming in assembly, check your timings. Minimum pulse width for clk (high or low) is
125us. For an 80Mhz prop, that's 3 instructions.
@Pence128: I had a look at the data sheet and the clock cycle times are given in nano seconds (ns) which should explain my confusion about you using us which is commonly used for micro seconds. Anyway, generating a 4MHz clock isn't a problem. The setup and hold times are more of an issue in case you want to combine clock and data transmission at max clock speed. But I believe the way this chip is going to be used will not suffer from a slightly slower clock
CON
_xinfreq=5_000_000
_clkmode=xtal1+pll16x
enable=16
clk=17
data=18
PUB Main | value, config, i
dira[enable..data]~~
outa[enable]~
config:=%0000_0001
value:=%1001_0000_0000_0000_0000_1001
repeat i from 7 to 0
outa[data]:=config>>i
outa[clk]~~
outa[clk]~
outa[enable]~~
outa[enable]~
repeat i from 23 to 0
outa[data]:=value>>i
outa[clk]~~
outa[clk]~
outa[enable]~~
The way I understand your comments and the data sheet, this should output the digit '9'. I've got only one digit hooked up at the moment and I have triple checked wiring. I've got 5V powering the chip, and 3.3V from the prop chip for enable, clk, and data in.
Again, I'm new to this (programming and ICs in general), so any specific comments on my code or an example of what the correct code should be (to display any single digit) would be greatly appreciated. Google has so far failed me on providing code examples in Spin (which is the only language I can use at the moment), so I'm relying on you guys for help.
Thanks.
PE -- There are a lot of SPIN examples in the Propeller Manual and the PEK Labs book, too. Those are free downloads from Parallax.
Also, http://propeller.wikispaces.com/