Re: Doubt with interfacing LCD with TMS320F2812

hi I'm working on TMS320F2812, a 32-bit DSP. I need to interface an a 8X1 LED with my Processor through the GPIO's of the processor. The GPIO's are connected to the LED's through a 74HC273 D-Latch. Can anyone give me pointers on how I must go about the same ?? I have a couple of doubts : 1. My GPIO pins are wired to the D0 to D7 pins of the D-latch. The Outputs Q0 to Q7 are wired to the 8X1 LED Board. My confusion is : how do i ensure connectivity of the GPIO's with pins (D0 - D7) of the latch through Software ( C- routine ) ??? i.e, Do i need to define a structure with the address of D0 - D7 so that I actually realise the connection between them through software ?? Will appreciate if anyone can give me any pointers on how to go about the same. Any sample codes will be of immense help tooo. thanks skn

skn82 (author)  westfw10 years ago
hmm.. I think is a microprocessor.. Anyway, I'm connecting the Clock of the latch to another GPIO pin of the processor and the reset to the reset pin in the processor.. Does that now mean that, i just need to write code to input data to the GPIO, which will then latch data and turn on/off the led, depending on my input ??? thanks skn
westfw skn8210 years ago
yeah, it would look like:
    outbyte(D0to7_port, pattern);  /* output the data */    outbit(LatchPort, LATCHBIT, 1) /* Strobe  the bit */    delay(LATCHBITTIME);   /* Leave it high for a bit */    outbit(LatchPort, LATCHBIT, 0); /* Turn latch bit back off. */     /* Now you can do other things with D0to7_port */
Or something like that.
skn82 (author)  westfw10 years ago
Hi Thanks for the quick reply.... Can u please elaborate on ur answer ?? thanks skn
westfw10 years ago
In addition to the Dn pins connected to the latch, presumably the clock input of the latch is connected to something as well. In a typical microprocessor setup, it would be connected to some sort of address decode circuit, and when you wrote to the appropriate address the latch would latch the data from the databus to its outputs, and it would stay there even after databus went on to do other things. In a typical microcontroller setup, it would be tied to another GPIO pin, and would permit you to share D0..7 between (for example) several latches, depending on which clock you triggered after putting data on the datalines. I'm not sure where the TI DSP lies on the microcontroller/microprocessor vector, but this should give you some ideas.