Let me describe my project: I'm bulding a count-up/count-down large format display timer with big 5x7 led dot matrices. I'm trying to use Keil uVision3 to program my microcontroller. I'm trying to use an at89s52 to control an TLC5920 LED driver chip. The LED driver chip needs Sin, SCK, LATCH(bar), BLANK, and CSEL0-2 from the microcontroller. I am a decent C programmer. But, I do not know how to use Keil to do things like send P2.0 serial data or P2.1 a high or low signal or monitor P2.7 for a pulse from a keypad. Could someone please direct me to a knowledge base that explains how to program such things in Keil evaluation? Also, I would greatly appreciate any project advice. Thanks, Lee Lerner
"SCON = 0x50; TMOD |= 0x20; TH1 = 0xf3; TR1 = 1; TI = 1; PCON |= 0x80;" As Erik says, this is all UART stuff. That's for asynchronous comms. Your interface is synchronous (it has a clock signal), so the UART is of no use there at all! You just need two port pins, and set them high and low as shown in the timing diagrams in the datasheet
I understand the timing diagrams and such and have worked through many examples. Yet, I still do not know how to even set a pin high or low. Do I do it using some hex value?
Read P0^1 = 1; P3^7 = 0; or you can just write to the port. P2 = 0x23;
P0^1 = 1; P3^7 = 0;
See the section titled Parallel Port I/O in the uVision Getting Started Guide