Hi dears ,
I want to write a program to blink an LED each 1 second. I've wrote below code but after loading into the MCU, it does not work at all. Would you let me know how can I do it, please ? < #include "LPC13xx.h" #define PRESCALE 60000 ;
void delayMS(unsigned int milliseconds); void initTimer0();
int main() {
LPC_SYSCON->SYSAHBCLKCTRL = (1<<7); initTimer0(); LPC_GPIO0->DIR |= (1<<3) |(1<<4); LPC_GPIO0->DATA = 0x0;
while(1) { LPC_GPIO0->DATA |= (1<<3);
LPC_GPIO0->DATA |= (1<<3); delayMS(500); LPC_GPIO0->DATA &= ~(1<<3); delayMS(500); LPC_TMR16B0->TCR = 0x0; //disable counter } }
void initTimer0() { //LPC_TMR16B0->CTCR = 0x0; LPC_TMR16B0->PR = PRESCALE-1; LPC_TMR16B0->TCR = 0x02;//reset timer
}
void delayMS(unsigned int milliseconds) { LPC_TMR16B0->TCR = 0x02;//reset timer LPC_TMR16B0->TCR = 0x01;//set timer while(LPC_TMR16B0->TC < milliseconds); LPC_TMR16B0->TCR = 0; //disable counter
}>
Hey coder people.
i need code for something like raspberry pi camera connected to a 8X51 cpu processor.
can u give a link.
not urgent but i need it very soon ;--)