Hello,
I'm new to the 80C51 family of microcontrollers, although I have worked with PIC18F microcontrollers a long time ago. I'm trying to get started with the P89LPC922 in a 20-pin DIP package. I'm just trying to get a "Hello World" type project up and running. The system should blink and LED on and off at a rate detectable to a human. I wired up the hardware, wrote the firmware and programmed the device, but it doesn't seem to do anything.
I have 3.6V on pins 4 (active low reset) and 15 (VDD), and I have ground on pin 5 (VSS). I'm using pin 2 (P1.7) to blink the light. All other pins are not connected. If I disconnect from the microcontroller and apply 3.6V directly to the LED, it lights with less than 10mA of current used.
Below is the C code I used for the firmware. The header file just gives the locations of the SFRs. I'll post it if anyone wants to see it. I compiled the source down to an intel hex file with SDCC.
I programmed the microcontroller with a Galep-5 universal programmer. The programmer reports that programming is successful. The configuration byte is 0x63, which disables the watchdog timer and selects the internal RC oscillator, among other things.
When power is applied, the LED remains off. I have 3.6V on pins 4 and 15 and 0V on pin 5. The other pins including pin 2 seem to stay around 0.3V, but they wander, sometimes a high as a volt. I'm not sure what do try next.
I'm new to the 80C51 family of microcontrollers, although I have worked with PIC18F microcontrollers a long time ago. I'm trying to get started with the P89LPC922 in a 20-pin DIP package. I'm just trying to get a "Hello World" type project up and running. The system should blink and LED on and off at a rate detectable to a human. I wired up the hardware, wrote the firmware and programmed the device, but it doesn't seem to do anything.
I have 3.6V on pins 4 (active low reset) and 15 (VDD), and I have ground on pin 5 (VSS). I'm using pin 2 (P1.7) to blink the light. All other pins are not connected. If I disconnect from the microcontroller and apply 3.6V directly to the LED, it lights with less than 10mA of current used.
Below is the C code I used for the firmware. The header file just gives the locations of the SFRs. I'll post it if anyone wants to see it. I compiled the source down to an intel hex file with SDCC.
Rich (BB code):
#include <P89LPC922.h>
void main()
{
long i;
// Configure Port 1 bit 7 in push-pull output mode
P1M1 = 1;
P1M2 = 0;
P1_7 = 1; // Turn on LED
while(1) // Main loop
{
for(i=1;i<100000;i++); // Delay so human can see
P1_7 = !P1_7; // Toggle LED
}
}
When power is applied, the LED remains off. I have 3.6V on pins 4 and 15 and 0V on pin 5. The other pins including pin 2 seem to stay around 0.3V, but they wander, sometimes a high as a volt. I'm not sure what do try next.