Wiring Forum
Programming Questions & Help >> Integration >> Wiring not running user programs on custom board

Message started by perroloco on 06/08/08 at 14:41:01

Title: Wiring not running user programs on custom board
Post by perroloco on 06/08/08 at 14:41:01
Hi there!

Just downloaded wiring 0016, and i'm trying to use it with an old custom board i did some time ago. Its a very simple breakout board with a 16Mhz oscillator, similar to the wiring one. It only has a max232 tied to both uarts.

Steps done:

1) Downloaded the bootloader from the wiring SVN  (http://wiring.uniandes.edu.co/source/trunk/wiring/bootloader/stk500boot.hex)

2) Burned the bootloader inside the Atmega128 using my STK500 board ISP connector.

3) Programmed fuses on this way (with the STK500):
LOW: 0x3F

4) Connected a led to PG2

Things working:

The bootloader seems to work. When i reset the atmega128 the led at PG2 is ON for 8 secs and then it goes OFF, so the uC looks alive and working.

Using the "Upload to I/O board" option of the wiring editor is working. AVRDude does the veryfing process and ends OK. To be sure i used the AVRStudio+STK500 board to read the entire flash and i can confirm that the user program is at the beginning of the flash, so the bootloader is working.

But my problem comes with the user program (wiring sketch), i'm using this to test:

void setup()
   pinMode(50,OUTPUT); // Set PG2 as output

void loop()
   digitalWrite(50,HIGH); // Set led ON
   delay(500); // Wait 500 msec
   digitalWrite(50,LOW); // Set led OFF
   delay(500); // Wait 500 msec

It's supossed that the led at PG2 should blink... but...

The program compiles OK on the wiring editor, and also uploads fine, then i reset the  board and the LED is ON for 8 secs (bootloader running), then it goes OFF and doesn't blinks!

I've also tryed with some Serial.begin / Serial.print() programs, and it doesn't work, so it seems USER programs are not running at all...

Maybe i'm missing something? Maybe wrong fuses?
Any idea?

Title: Re: Wiring not running user programs on custom board
Post by barragan on 11/22/08 at 18:42:08
Wiring uses Timer0 for controlling things like delay, millis() etc, the 32Khz XTAL is attached to the timer0 pins and needed for Wiring to work properly

Wiring Forum » Powered by YaBB 2.5 AE!
YaBB Forum Software © 2000-2010. All Rights Reserved.