MAKE Problem
Moderators: adafruit_support_bill, adafruit

MAKE Problem

by RichC on Sun May 29, 2011 5:29 pm

Have MiniPOV3 from kit. Using Win XP with serial port. MiniPOV works and I can reprogram it with the supplied .hex programs. However, if I MAKE a .hex file from my own .c program and program the MiniPOV, all the desired LED's are ON constantly (somewhat dimly). The same thing happens if I re-MAKE and reprogram one of the supplied .c programs. It's as if, when I compile, the 'delay_ms' function is not working. Any help would be appreciated.
RichC
 
Posts: 4
Joined: Sun May 29, 2011 5:02 pm

Re: MAKE Problem

by adafruit on Tue May 31, 2011 1:10 pm

try using _delay_ms()
do the example programs work?
User avatar
adafruit
 
Posts: 11719
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Re: MAKE Problem

by RichC on Fri Aug 12, 2011 4:04 pm

Tried using _delay_ms()
Still doesn't work.
As I mentioned before for example, I can program the MiniPOV3 with a supplied program (test_leds.hex) and it works properly. However, if I MAKE a new 'test_leds.hex' file myself from the supplied 'test_leds.c' file and program the MiniPOV3 with this new .hex file and run it, there is the same error (i.e. all the LED's are ON constantly, somewhat dimly).
RichC
 
Posts: 4
Joined: Sun May 29, 2011 5:02 pm

Re: MAKE Problem

by adafruit on Fri Aug 12, 2011 7:05 pm

try to add #include <util/delay.h> at the top of the .c file!
User avatar
adafruit
 
Posts: 11719
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Re: MAKE Problem

by RichC on Fri Aug 12, 2011 9:42 pm

Tried adding #include <util/delay.h>. Still doesn't work.
I noticed that the test_leds.hex file supplied for the kit has a size of 764 bytes.
When I MAKE the same .hex file from the .c file supplied for the kit, the test_leds.hex file produced has a size of 300 bytes.
RichC
 
Posts: 4
Joined: Sun May 29, 2011 5:02 pm

Re: MAKE Problem

by RichC on Wed Aug 17, 2011 8:35 pm

FYI:
I have discovered that in my case, during compile, the compiler is removing the empty FOR loop:
for (timer=0; timer <= 4200; timer++);
So essentially, there is almost no delay between writes to PORTB, and that is why the led's look like all are ON dimly.
This seems to be a 'normal' action of the compiler using the MAKEFILE supplied with the kit. Possibly, there is an optimization setting that would eliminate this problem.
RichC
 
Posts: 4
Joined: Sun May 29, 2011 5:02 pm