Programming atmega32 clock source

AI Thread Summary
When programming the ATmega32 with an external 16MHz crystal, it's crucial to set the fuse bits correctly, as they determine the clock source. The fuse bits should be set before programming the microcontroller, as they will not take effect until exiting programming mode. If the fuse bits are set to use an external crystal, the microcontroller will require that crystal to be present for programming the flash memory. Some universal burners can reprogram fuses after programming, but this may require a temporary external clock source. Consulting the ATmega32 datasheet and the universal burner's instructions is essential for proper programming and fuse management.
asad1111
Messages
51
Reaction score
0
iam using atmega 32 and i want to use external 16MHZ crystal I have figured out the fuse setting for this as lowbuyte=0xFF and highbyte=0Xc9
what i cannot understand is should i set fuse bits before programming or after programming? because as i have specified external crystal as clock source if i set fuse bits before programming it will require external crytal to be programmed (iam assuming controller requires clock source to be programmed does it?)and if i set the fuse bits after programming how will i reprogram it?

Iam using a universal burner to programme atmega32
 
Engineering news on Phys.org
As I remember, the Atmega 32 latches the fuses when you leave the programming mode. So even if you program the fuse bits, they won't have effect until you leave the programming mode. So the answer to your question is that, you don't need the external crystal before you leave the programming mode.

And yes the controller needs a clock source to be able to program the flash.

If you want to reprogram the fuse bits, there is something about the Lock bits that you need to do. So read up on the lock bits in the user manual.

Sidenote: I heard of some guys who programmed the fuse bit for an external crystal, left the programming mode, but they had no external crystal, so the controller didn't do anything. So be sure the crystal is connected and all before you program the fuse bits and leave programming mode. :D
 
thanks runie I have an external crystal so that won't be a problem but can i reprogram the flash (not the fuse bits ) without using external crystal?since i have set the fused bits to external crystal from where will it get the clock to reprogram flash?
 
I believe it will need the clock from the external source then. So if you remove the crystal, then you can't program the flash.

However, some microcontrollers do it, such that when you enter programming mode, it switches to the internal oscillator. Thus you can always program the flash. But I don't know if this is the case with the ATmega 32.

The User Manual should tell you more.
 


I would recommend setting the fuse bits before programming the atmega32. This is because the fuse bits control important settings such as the clock source, and it is important to have them set correctly before programming. If you set the fuse bits after programming, you may encounter difficulties in reprogramming the atmega32 if the clock source is not properly set.

In order to reprogram the atmega32 after setting the fuse bits, you may need to use a different programming method or tool. For example, some universal burners have the capability to reprogram fuses after programming the microcontroller. You may also need to use an external clock source, such as a crystal oscillator, to temporarily provide the correct clock signal for programming.

It is important to carefully read the instructions and specifications for your specific universal burner to ensure that you are using the correct method for programming and setting the fuse bits. Additionally, consulting the datasheet for the atmega32 can provide more detailed information about the programming process and recommended methods.
 
Very basic question. Consider a 3-terminal device with terminals say A,B,C. Kirchhoff Current Law (KCL) and Kirchhoff Voltage Law (KVL) establish two relationships between the 3 currents entering the terminals and the 3 terminal's voltage pairs respectively. So we have 2 equations in 6 unknowns. To proceed further we need two more (independent) equations in order to solve the circuit the 3-terminal device is connected to (basically one treats such a device as an unbalanced two-port...
suppose you have two capacitors with a 0.1 Farad value and 12 VDC rating. label these as A and B. label the terminals of each as 1 and 2. you also have a voltmeter with a 40 volt linear range for DC. you also have a 9 volt DC power supply fed by mains. you charge each capacitor to 9 volts with terminal 1 being - (negative) and terminal 2 being + (positive). you connect the voltmeter to terminal A2 and to terminal B1. does it read any voltage? can - of one capacitor discharge + of the...
Thread 'Weird near-field phenomenon I get in my EM simulation'
I recently made a basic simulation of wire antennas and I am not sure if the near field in my simulation is modeled correctly. One of the things that worry me is the fact that sometimes I see in my simulation "movements" in the near field that seems to be faster than the speed of wave propagation I defined (the speed of light in the simulation). Specifically I see "nodes" of low amplitude in the E field that are quickly "emitted" from the antenna and then slow down as they approach the far...
Back
Top