MakeItC - time delays
Posted: Fri Aug 21, 2015 8:42 pm
I have the latest (Aug 20) download of setupC.exe installed in its own folder.
I am trying to run the 'sample.c' file(in the CMSIS folder (dated 2-17-13). I've had to modify several xxx.h files.
I changed the LPCGPIOx nomenclature to match the BasicBoard, and they do turn the LED on/off .
the bit_bucket routine works for a delay BUT......
" start = LPC_TIM0->TC; while (LPC_TIM0->TC - start < 500000);" this and "delay_ms(1500)" hang the chip
'delay_ms()' is in the systick.files --
I added the (int)s to the sample.c file ---following the usage in cor_bitbang.c and it still didn't help.
"//grz start = (int) LPC_TIM0->TC; while (((int) LPC_TIM0->TC - start) < 5000000);"
'
I am at a loss for why the timing locks up -- the other parts of the program work & putchar(t) as a debug around the original timing
statements work.
'
Olzeke51
PS this is low priority - I can use the bit_bucket for time delays.
PPS. I even tried the "WAIT (1500)" statement I found in the 'Csample.c" program - still no go.
I am trying to run the 'sample.c' file(in the CMSIS folder (dated 2-17-13). I've had to modify several xxx.h files.
I changed the LPCGPIOx nomenclature to match the BasicBoard, and they do turn the LED on/off .
the bit_bucket routine works for a delay BUT......
" start = LPC_TIM0->TC; while (LPC_TIM0->TC - start < 500000);" this and "delay_ms(1500)" hang the chip
'delay_ms()' is in the systick.files --
I added the (int)s to the sample.c file ---following the usage in cor_bitbang.c and it still didn't help.
"//grz start = (int) LPC_TIM0->TC; while (((int) LPC_TIM0->TC - start) < 5000000);"
'
I am at a loss for why the timing locks up -- the other parts of the program work & putchar(t) as a debug around the original timing
statements work.
'
Olzeke51
PS this is low priority - I can use the bit_bucket for time delays.
PPS. I even tried the "WAIT (1500)" statement I found in the 'Csample.c" program - still no go.