We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello, I've been trying to burn a simple "Blinking LED" program on the AT89LP6440 MCU with no luck. I am using Keil Uvision 4.0, and there are no compilation errors or warning for the code below:
#include <AT89LP6440.H> sbit led = P2^0; void delay(long i) { for(i=0;i<i;i++); } void main() { while(1) { led=1; delay(20000); led=0; delay(20000); } }
Am i missing anything? The multimeter shows that P2_0 just stays HIGH (5 Volts). Thanks, Ben
void delay(long i) { for(i=0;i<i;i++); }
Your use of 'i' for everything isn't very helpful
But the 8051 have quite a lot of job working with long variables, so reusing the same variable for the loop and end condition has some advantages when speeding up the code :p
Wow that was stupid! Thanks, will change and check again.
I've changed the code to this:
#include <AT89LP6440.H> sbit led = P2^0; void delay(int num) { int i; for(i=0;i<num;i++); } void main() { while(1) { led=1; delay(20000); led=0; delay(20000); } }
Still no results. Maybe I'm missing an I\O configuration?
how is your LED connected? is the LED on or off? how do you 'burn' the code?