astroboy907

I have discarded the interrupts for now. It seems it is a different problem.

After uploading an Arduino Pro 8mhz bootloader to the chip, the LED blinks at around 1/2 second pulses (using an UNO board). Going into AVR studio, apparently this sets the fuses to select the crystal on the board as oscillator. Change that to internal, and the LED blinks every second.

However, it seems not to use timer2 whatsoever. Nada. Zilch. And I have no idea why it simply refuses to use any timer asynchronously. Everything seems to base off the internal timer- wther or not there is a timer connected to the TOSC pins or not.

I did a project a while back that has some similar features, namely clocking Timer2 from a 32.768kHz crystal, generating an interrupt every 8 seconds, and sleeping in between interrupts:http://adventuresinarduinoland.blogspot.com/2012/02/high-tech-night-light.html

Running that on the UNO seems to work- as long as you are not running off the internal oscillator.

As for the chip itself, I have attached a photo of what the fuse settings are (currently). At this time I was trying a different bootloader which is why the bootloader fuse size is kinda off. Re-burning it to UNO bootloader.Have tried with UNO bootloader, Pro 8mhz bootloader, etc, with and without changing fuse settings to internal oscillator

So this proves that the timer is interrupting, however, this was done with the fuses set as Extended : 0xFEHigh : 0xD6Low : 0xFF (external 8 mHz oscillator)

Edit: To NickSorry, my prototyping process is a bit edgy at the moment. I have not really had any experience actually trying to, well, /professionally/ prototype something. I am simply using the breadboard to test things I cannot on the UNO board (example, taking off the oscillator, or trying a different speed crystal).

Actually... well, now I see some of my mistakes... Im just gonna move the whole thing to a breadboard and wire up ICSP to that. I have a 16mhz crystal so I can upload fine using ICSP... The final product I want is an arduino chip that has an RTC running off Timer2 interrupts, whilst using the internal oscillator to run code that the interrupt will eventually trigger

astroboy907

Whole thing is on a breadboard, still nothing. Asking around for some new chips, etc. IDK whats wrong with this..

-My internal timer seems to work, I can do LED stuff and the timing works without a crystal-Interrupts *seem* to work when I have the fuses set to use an EXTERNAL oscillator

So I think perhaps something is up when the chip goes into asynchronous timer mode. I'm guessing somehow my chip doesnt get there.

Only think i can find different between your chips and mine in terms of fuses is the clock calibration fuse, which I don't exactly know what that is...Oh, one more thing, what bootloader did you format your chips on before doing this? I know this is a pretty weird problem, and I hate to spend a lot of your time on it, but any help would be appreciated greatly.Thanks!!

astroboy907

FINALLY!!!!!! I dont know exactly what I did, but it works. Odd. I think I basically had to set the fuses to use the internal oscillator, then proceed to burn a bootloader that makes use of the internal oscillator (I just used the stock "Arduino on a breadboard option")From there I uploaded the sketch, and it worked

Still not verifying that was exactly what I did, I was basically just messing around, trying to get ANYTHING to work on the chip.

Working on debugging my code currently. It works for the mostpart but by button interrupt stops working after it is used 3 times... Weird.

//Careful messing with the system color, you can damage the LEDs if//you assign the wrong color. If you're in doubt, set it to red and load the code,//then see what the color is.#define RED 1int systemColor = RED;int display_brightness = 15000; //A larger number makes the display more dim. This is set correctly below.

//The very important 32.686kHz interrupt handler//The very important 32.686kHz interrupt handlerISR (TIMER2_OVF_vect){ seconds += 8; //We sleep for 8 seconds instead of 1 to save more power //seconds++; //Use this if we are waking up every second

seems to fix it, but then the 32khz clock doesn't "tick" forward (perhaps a bit of interrupt clashing here?)

I dont really know what is going on, I have checked most of the code but i don't get what is causing the problem. I am just using a wire-to-ground to trigger the interrupt, maybe i need to wire in a straight button... I'm not sure. Looks and seems a bit like a debounce issue to me.I did have to edit my code to fit into the forum, cutting out the time-setting part, and some of the comments. Just ask if you need the full deal, I kept all the loop() code in though