MAKE Problem

MiniPOV4 and previous versions

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
RichC
 
Posts: 4
Joined: Sun May 29, 2011 5:02 pm

MAKE Problem

Post by RichC »

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.

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: MAKE Problem

Post by adafruit »

try using _delay_ms()
do the example programs work?

RichC
 
Posts: 4
Joined: Sun May 29, 2011 5:02 pm

Re: MAKE Problem

Post by RichC »

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).

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: MAKE Problem

Post by adafruit »

try to add #include <util/delay.h> at the top of the .c file!

RichC
 
Posts: 4
Joined: Sun May 29, 2011 5:02 pm

Re: MAKE Problem

Post by RichC »

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

Post by RichC »

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.

Locked
Please be positive and constructive with your questions and comments.

Return to “MiniPOV”