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.
I've bought a sparkfun logomatic v1.0 to change reprogram as an advanced datalogger. There is a lpc2138 onboard and it is possible to program it with the lpc2000 flash utility.
I've tried to compile a test progam, just to blink some leds on P0.x but the processor seems to do only the first command. I believe there is somewhere a parameter in the compiler settings I've mist.
I set up for a lpc2138 changed the freq to 147.456 MHz, IROM from 0x4 to 0x7FFF, IRAM from 0x40004000 to 0x40007FFF just like detailed in the datasheet.
#include <LPC213x.H> void delayms(int j) { unsigned int i; unsigned int k; i = 0; k = 0; while (i != j) { k = 0; while (k != 14746) { k++; } i++; } } int main (void) { PINSEL0 = 0x00000000; IODIR0 = 0xFFFFFFFF; IOCLR0 = 0xFFFFFFFF; while (1) { IOSET0 = 0xFFFFFFFF; delayms(1000000000); IOCLR0 = 0xFFFFFFFF; delayms(1000000000); } };
Is there anything I'm missing? Thanks in advance, Ruben
It was indeed a problem of the frequency, I putted in 147 MHz, it was 14 MHz in reallity.
Now, I have only a problem that the arm does only a few times the while(1) cycle.
Thanks for the answers. Ruben