Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

16 segment led driver

Status
Not open for further replies.

Angy

New Member
Hello all,

I'm looking to use a 16segment led display on one of my projects.Unfortunatley, I do not find any information on microchip website or any sample code to get me started on this driver. I'm thinking of using 8 bit micro 16f946 chip from microchip.If any of you have any ideas or sample codes to go about implementing it, please share it with me.Thank you.
 
Thank you for your reply.

Unfortunately,I'm not familiar with maxim or their programming environment. I prefer to use microchip's products for this design. Any suggestions will be appreciated.Thanks.
 
Maxim's

MAX7219.

Read the datasheet. Is not that hard to grasp.

Come with your difficulties but try yourself first.

Look where it is explained how to communicate. Even if you do not know what is it, (I2C or whatever) you could understand how it is done. It is simple.
 
Thats what i was trying to say. It would be harder to do it yourself in code. Im not calculating genius but im not sure if that PIC would have enough mem to make anything useful if you filled it up with code to control the 16 segment led in code. Using the max MAX7219 or other would greatly reduce code size and not to mention stop a few headaches.
 
Thank you all for your replies.
I do know the theory behind the SPI and I2c communication but I have not practically implemented it. I have a I2C routine handy for a 7segment display that I could work with or start from scratch. If using maxim chip decreases the code I like to try that.
I will read up on MAX7219 and get in touch with you all if I have questions.
 
sure... im a huge maxim-ic user and it helps to be able to use there products to complete something quick and with out having to code a hundred lines lol...

With there IC and a SPI / I2C routine its as simple as 1 line of code (in C) to set the display.

Even in asm it should not be too hard. Even tho i never used asm with spi/i2c but seems simple enough. Anyway good luck and we will be here to help.
 
I read on max7219, the data sheet says its driver for common cathode configuration.
The display i'm using is a 16 segment common anode configuration.
p/no is LTP-587HR from LITE-ON electronics. Can you recommend something from Maxim?
 
Hi!

I have ordered for samples from Maxim (MAX6969). I have a PICDEM2 PLUS BOARD from microchip that I can use to drive the 16segment display. Do you think I can use this board along with the Maxim chip to drive the led display?.
I read up something on i2c and spi communication. I also read about the bit banging, the first thing I will need to do is to mark up a schematic, am i right?
 
I dont own a PICDEM2 PLUS BOARD but im sure you should be able to since its a DEM boards.

about the schematic ... not really needed but always good pratice... the issue is you need to learn how the software works to effectively setup the hardware.

If you setup the hardware without know what the software will do then its useless because you might be miss wiring.

What i recommend is you Learn SPI (or the bit-banged version) this way you know how to wire the Maxim chip when you get it.

Please download the Datasheet for that chip asap and study it. To learn how it it works with the pic read carefully:

PAGE 7 & 8 : Detailed Description, Initial Power-Up and Operation, 4-Wire Serial Interface

This will tell you everything you need to know on the communication side. The only wierd part here is that it isnt a normal SPI its a 4 Wire which is like its own type. (Well at least in my own opinion)

The CS line would be the LE but its not really a CHIP SELECT line here its a sort of toggle-enable line. Where as after you send your data you set it high and then low. After you set it low it will set the new data latches from the internal shift register.

Its really easy when you read it. I dont know how to explain well :( but when you read it you will see what i mean.

I dont think you will use the OE line. Read this from datasheet:

The fourth input provides output-enable control of the
output drivers. OE is high to force outputs
OUT0–OUT15 high impedance, without altering the
contents of the output latches, and low to enable outputs
OUT0–OUT15 to follow the state of the output
latches.

Which is basically a floating pin. (Hi-Z = High impedance)

The others should be direct enough to know.
 
Last edited:
I got the maxim chip max6969 and I'm thinking of prototyping with the demo board i have on hand. (picdem2 plus)

hardware connections from maxim chip to micro (16F877A)...
the 'question marks' are the ones i do not know where to connect to the pic16f877a.

Max6969
1- gnd -common
2-DIN-?
3-clk- ?
4-LE-load??
5-out0 goes to cathode of the 16 segment led.
......
20-out15 goes to cathode of the 16 segment led

21-OE-?
22-Dout-?
23-set-?
24-v+ =Vcc


First of all is it okay to use a 8bit micro to control 3-digit 16segment display?
I'm first building a prototype for a single digit 16 segment display and then i will worry abut the 3 digit.
Do i need to mount the display on a different bread board? or can i mount it on the demo board?
Thanks.
 
i always recommend using a breadboard for all non-permanent work.

If you look at the Datasheet then you will see:

DIN = Data IN
"Serial-Data Input. Data is loaded into the internal 16-bit shift register on CLK’s rising edge."
This is where are the data comes in. Data is loaded into the shift register on the clocks rising edge

CLK = Clock
"Serial-Clock Input. Data is loaded into the internal 16-bit shift register on CLK’s rising edge."
When this pin is low you setup the DIN and then set high to "CLOCK IT" meaning when low nothing happens. You have to set the Data Pin to high(logic 1) or low(logic 0) then set this CLK pin and then it goes into the shift register.

LE=LOAD ENABLE
"Load-Enable Input. Data is loaded transparently from the internal shift register(s) to the output latch(es) while LE is high
When this is high it means all data in the shift register is loaded into the OUTx pins with out affecting the original data

. Data is latched into the output latch(es) on LE’s falling edge, and retained while LE is low."

When it turns low the placed into the latches replacing original data with new data.
OE:
"Output-Enable Input. High forces outputs OUT0 to OUT15 high impedance, without altering the contents of the output latches.
This basically buts all pins in a open state. I guess you might not even need this HIGH ever.
Low enables outputs OUT0 to OUT15 to follow the state of the output latches.
should be understandable :D Look at the diagram on page (6)
"


DOUT = DATA OUT
"Serial-Data Output. Data is clocked out of the 16-bit internal shift register to DOUT on CLK’s rising edge."
Used for adding more MAX6969 together so you can use multiple digits by shifting in more data without having to setup extra pins off uC.

SET = LED Current Settings
"LED Current Setting. Connect SET to GND through a resistor (RSET) to set the maximum LED current"

Use this to set the maximum current for all leds.
 
Thanks for the reply. I 'm putting things together and I will let you know how it works out. The seven segment display routine that I have converts the voltage and current from binary to BCD and then uses a table and pulls the right values from it to display.
something like this:
addwf PCL, F ;add to PC low
retlw B'00111111' ;led drive for 0
retlw B'00000110' ;led drive for 1
retlw B'01011011' ;led drive for 2
retlw B'01001111' ;led drive for 3
retlw B'01100110' ;led drive for 4
retlw B'01101101' ;led drive for 5
retlw B'01111101' ;led drive for 6
retlw B'00000111' ;led drive for 7
retlw B'01111111' ;led drive for 8
retlw B'01100111' ;led drive for 9
retlw B'01110111' ;led drive for A
retlw B'01111100' ;led drive for b
retlw B'00111001' ;led drive for C
retlw B'01011110' ;led drive for d
retlw B'01111001' ;led drive for E
retlw B'01110001' ;led drive for F

Do you have any idea how i do the same with sixteen segment?that too using a 8bit micro.
Tnku
 
Thanks for the reply. I 'm putting things together and I will let you know how it works out. The seven segment display routine that I have converts the voltage and current from binary to BCD and then uses a table and pulls the right values from it to display.
something like this:
addwf PCL, F ;add to PC low
retlw B'00111111' ;led drive for 0
retlw B'00000110' ;led drive for 1
retlw B'01011011' ;led drive for 2
retlw B'01001111' ;led drive for 3
retlw B'01100110' ;led drive for 4
retlw B'01101101' ;led drive for 5
retlw B'01111101' ;led drive for 6
retlw B'00000111' ;led drive for 7
retlw B'01111111' ;led drive for 8
retlw B'01100111' ;led drive for 9
retlw B'01110111' ;led drive for A
retlw B'01111100' ;led drive for b
retlw B'00111001' ;led drive for C
retlw B'01011110' ;led drive for d
retlw B'01111001' ;led drive for E
retlw B'01110001' ;led drive for F

Do you have any idea how i do the same with sixteen segment?that too using a 8bit micro.
Tnku

Same as you do for anything else on an 8 bit micro, use two bytes to give you sixteen bits - and make your table twice as long.
 
Will this work?
; Driver for 16 bit Led Display using the #p16f946 micro


; a b
; ------- -------
; 1 \ 1 / 1
; 1 \ j 1 / 1
; h 1 \ 1 / 1 c
; 1 i \ 1 / k 1
; 1 \ 1 / 1
; 1------ ------1
; 1 o / 1 \ 1
; g 1 / 1 \ l 1 d
; 1 /n 1 \ 1
; 1 / 1 \ 1
; 1 / 1 m \ 1
; -------- -------
; f e
;


;16 bit assignment
;a= 1; b=2; c=3; d=4; e=5; f=6; g=7; h=8; i=9; j=10; k=11; l=12; m=13; n=14; o=15
SEG16 _TABLE
addwf PCL, F ;add to PC low
retlw B'11111111' ;led drive for 0
retlw B'00000000'

retlw B'00001100' ;led drive for 1
retlw B'00000000'

retlw B'00110111' ;led drive for 2
retlw B'10001000'

retlw B'00111111' ;led drive for 3
B'10001000'

retlw B'10000000' ;led drive for 4
retlw B'10101010'

retlw B'10111011' ;led drive for 5
retlw B'00011000'

retlw B'11111000' ;led drive for 6
retlw B'10001000'


retlw B'00001111' ;led drive for 7
retlw B'00000000'

retlw B'11111111' ;led drive for 8
retlw B'10001000'


retlw B'10001111' ;led drive for 9
retlw B'10001000'


retlw B'11001111' ;led drive for A
retlw B'10001000'


retlw B'11111111' ;led drive for b
retlw B'10001000'


retlw B'11110011' ;led drive for C
retlw B'00000000'


retlw B'11000000' ;led drive for d
retlw B'01000001'


retlw B'11110011' ;led drive for E
retlw B'10001000'



retlw B'11000011' ;led drive for F
retlw B'10001000'

end
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top