Home \ Help \ Search \ Login RSS

Welcome, Guest. Please Login

This forum is now READ-ONLY! Please visit http://forum.wiring.co/ for the new forum.

Wiring ForumWiring HardwareTroubleshooting › Problems with clock speed and unreliable behavior

Page Index Toggle Pages: 1
Problems with clock speed and unreliable behavior (Read 2884 times)
04/16/07 at 11:36:02

bdhubbard   Offline
YaBB Newbies
I Love YaBB 2!

Posts: 1
Hi Prof. Barragan,

We are using a custom PCB with a low voltage ATMEGA168-10pu and are having what we believe are clock speed problems.   The external crystal runs at 4mHz and the system supply voltage ranges from 3.7V down to 2.5V; 3.0V is typical (CR123a batteries).  Compiled HEXfiles are uploaded using the AVR Studio and the AVRISP-mkII, so there is no bootloader.  

Our problems are taking two forms: 1) We are unable to find a fuse setting on the programmer which seems to work with our crystal - almost all of the external timings are 2x to 4x too slow.  2) We are getting mysterious problems in which segments of code will execute on some runs through the main loop and not on others (as if the pins or code had disappeared). Execution simply restarts at the top of the main loop.  The problems are typically get more severe for code located at the end of the main loop.  Finally, have you ever had a piezo speaker burn out a digital pin?

A typical loop through the code:
Flashes some 10mA LEDs
Plays some PWM-based music on a piezo speaker
Reads a photocell,
Runs a PWM controlled DC motor using a bi-directional driver chip (LB1630).  The motor circuits are pretty well decoupled.  

The code has run without problems on both a BS2 and an Arduino.

Thank you,

Bruce H.
IP Logged
Reply #1 - 04/16/07 at 12:39:31

Alan_Kilian   Offline
Full Member
Wiring? It looks like
Java to me.

Posts: 118
Make sure you have the low-voltage brownout detector fuse set properly.

I had a problem running the stock Wiring board at 3.3 Volts. (Which you shouldn't do anyway.)
where the brownout detector kept going off and makign a mess of things.
IP Logged
Page Index Toggle Pages: 1