EmbeddedRelated.com
Forums

programming 8 character LED with C8051F022

Started by methi April 20, 2005
Hi,
I am using the Cygnal C8051F022 for the first time and have some
background with C programming. I dont know where to start off with
progamming an 8 character LED with C8051F022 though. Can anybody give
me some ideas about this. Would be very helpful.Thanks,
Methi

methi wrote:

>Hi, >I am using the Cygnal C8051F022 for the first time and have some >background with C programming. I dont know where to start off with >progamming an 8 character LED with C8051F022 though. Can anybody give >me some ideas about this. Would be very helpful.Thanks, >Methi
Correct answers to your question depend entirely on how the LED display is connected to your 8051. Is it, for example, connected using memory or I/O mapped latches, or serially using SPI or I2C, or some other method? -- ======================================================================== Michael Kesti | "And like, one and one don't make | two, one and one make one." mkesti@gv.net | - The Who, Bargain
Hi....The 8051 is connected to the LED display via the data bus (port
7)...which are pins 65-72...this is an 8 bit buffer going to the 8
character LED display....there are also read,write and other control
signals going to the LED display.

methi wrote:

>Hi....The 8051 is connected to the LED display via the data bus (port >7)...which are pins 65-72...this is an 8 bit buffer going to the 8 >character LED display....there are also read,write and other control >signals going to the LED display.
It would seem, then, that your display is memory-mapped, especially if some of those "other control bits" are address bits from P5/P6. You would therefore write to it as you would write to any specific address. For example, in C you might initialize a pointer to the desired address and assign the desired data to the dereferenced pointer value. In assembler you might initialize DPTR to the desired address and use the MOVX instruction. There are probably other ways, too. The data that you write depends on the nature of the display. If it's just a series of latches, one per digit driving 7-segment displays, you will need to write bit patterns that light specific display segments, perhaps using a lookup table to translate numerals to those patterns. If, on the other hand, there is some sort of display controller involved, the data that need to be written are specified by that controller's spec sheet. As you can see, there is far more to be known about your display to give you specific advice. -- ======================================================================== Michael Kesti | "And like, one and one don't make | two, one and one make one." mkesti@gv.net | - The Who, Bargain
Hi Michael,
Thankyou very much. The display that I am using is  PDSP1883. What you
have explained seems clear enough. I have one question for you. Do you
have any idea about "readback" feature in 8051...Is it possible to
readback the program from the cygnals 8051..
Thanks

On 20 Apr 2005 10:01:57 -0700, "methi" <gmethi@gmail.com> wrote:

>Hi, >I am using the Cygnal C8051F022 for the first time and have some >background with C programming. I dont know where to start off with >progamming an 8 character LED with C8051F022 though. Can anybody give >me some ideas about this. Would be very helpful.Thanks, >Methi
There should be some registers that enables one to switch on/off each LED of the display individually. So in general to display a specific character on the display one has to map a character to information on which individual LEDs should be on/off. This information must then be written to the display registers to actually switch the specific LEDs on/off. So write a routine that can switch specific LEDs. Generate the data on which set of LEDs should be on in a character to represent a specific character. Write a routine that takes a character e.g. '3' as input. Fetches the data that represents a '3' on the LED display, and update the display registers to switch on the LEDs that represent a '3'. Depending on the exact hardware, some or all of this might be done in the diplay. To save pins, the LEDs might be multiplexed in which case one has to drive a specific LED only for a short period before driving the next. This must be done fast enough so that all the 'ON' LEDs appear on at the same time. Hope this helps Regards Anton Erasmus
Thanku so much...i appreciate the help
Methi

methi wrote:

> Hi, > I am using the Cygnal C8051F022 for the first time and have some > background with C programming. I dont know where to start off with > progamming an 8 character LED with C8051F022 though. Can anybody give > me some ideas about this. Would be very helpful.Thanks, > Methi
You should start off reading the data sheet thoroughly and before that it would be a good idea to read the 8051 bible which can be found at 8052.com. A plain vanilla 8051 has four 8 bit ports that can be used as inputs or outputs so one or more of these hould be considered for your application. I am not clear what you mean by an 8 character LED display - is it a single 8 segment display or 8 of these or can it actually display characters as opposed to just numbers? Ian
Hi Ian,
I am talking about a single 8 segment display....

thanks,
methi

Do you mean a 7-segment display with a single decimal point ???

If not, how are the 8 segments arranged ???

methi wrote:
> Hi Ian, > I am talking about a single 8 segment display.... > > thanks, > methi >