I have just learned a ton of stuff today and its all mixed in my head. I have this issue now where i can Debug on my LPC2148 board from Olimex but i have no clue how to program it.
I tried right click on the wiggler icon and sending the HEX and/or elf to the micro but no luck. When i remove power and wiggler then replace power nothing happens.
But when i press Build and Run…or build and debug it works fine. And stuff. So if some smarter than me (everyone lol) person could help me out i would be great full.
Thanks for at least reading this
Oops forgot this: (my code im trying):
#include <LPC214x.h>
#define LED1 10
#define LED2 11
#define Btn1 15
#define GETBIT(var,bit) (((var)>>(bit))&1)
#define SETBIT(var,bit) ((var)|=(1<<(bit)))
#define CLRBIT(var,bit) ((var)&=(~(1<<(bit))))
void DelayUs(int us) {
for (; us>0; us--);
}
void DelayMs(int ms) {
for (; ms>0; ms--)
DelayUs(1000);
}
unsigned char GetPin(unsigned long tPin){
unsigned long tmp;
DelayMs(10);
tmp = IOPIN0 & (1<<tPin);
if(tmp == 0)
return 0;
else
return 1;
}
int main(void){
char MyDat;
int i,j;
PINSEL0=0x00000000;
IODIR0=0xFFFFFFFF;
CLRBIT(IODIR0,Btn1);
while(1){
MyDat = 1;
MyDat = GETBIT(IOPIN0,Btn1);
if(MyDat == 0x00){
SETBIT(IOPIN0,LED1);
CLRBIT(IOPIN0,LED2);
} else {
CLRBIT(IOPIN0,LED1);
SETBIT(IOPIN0,LED2);
}
DelayMs(100);
}
}
Look for Startup from Reset in the CrossWorks web site FAQs!
Leon
This got me as well, when I first started. To add to Leon, you have to add a definition in order to compile your code to run from a hardware reset.
http://ccgi.rowley.co.uk/support/faq.ph … ticleid=35
Thanks both of you so much. TheDirty… great link!!! i fixed it in 1 minute with that link.