Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Problem with AVR microcontroller programming

Status
Not open for further replies.

ghegde

Member level 1
Joined
Jul 12, 2010
Messages
32
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Location
Singapore
Activity points
1,502
Hi friends,
I have a problem.
Recently I bought few Atmega8 and Atmega16 chips.I used PonyProg programmer with the hardware as show below to program it.

AVR.ISP.SCHEMATIC.png


Now the problem is whenever i program a factory fresh chip it works fine......but when i changed the fuse bit for external clock(i.e.CLKSEL(3:0) set to 1111,CKOPT enabled), the chip does not respond to anything.When i try to read the "Security and configuration setting"
using the PonyProg it gives the error which says "Device missing or unknown device(-24)".

I already lost 2 Atmega8 and One mega16 in this way... :sad:
Please help me ........
 

Are you providing the chip with an external clock? If you set the fuse so that the chip runs off an external clock, and no clock is present, you will no longer be able to communicate with the chip.

Try providing a square wave (1MHz should work) on the XTAL1 pin of the micro. Then try communicating with it again.
 

Hi hobbss,
Yes, I connected a 11.0592MHz crystal oscillator to XTAL1 and XTAL2 pins of the chips.
 

Have you connected the crystal with the 2 capacitors to the xtal pins?

Alex

---------- Post added at 19:47 ---------- Previous post was at 19:44 ----------

Are you sure that the values that you use are for external crystal and no external clock?
for external clock you need square pulses, not crystal.

Alex
 

Hi alexan_e,
No i dint connected the capacitors.Is it mandatory?because my AT89s52 chip works with no capacitors connected to crystals...

---------- Post added at 17:53 ---------- Previous post was at 17:48 ----------

@alexan_e,
"Are you sure that the values that you use are for external crystal and no external clock?
for external clock you need square pulses, not crystal." Did u mean settings of fuse bits in configuration and settings?
 


Hi,

Also consider ProgISP software, seems good to me, it downloads with an English version.

3w's. zhifengsoft.com

Although building you own seems a cheap way, can you beat one of these ready built usbasp devices from ebay.
The device list is out of date, they do program the newer devices like mega328 etc.
**broken link removed**
 

@alexan_e,
I actually checked all the bits of CKSEL in ponyprog which means all the CKSEL bits are programmed.
 

I don't use ponyprog but according to the link in my previous mail checked means unprogrammed,
which should be external crystal (1111), use the capacitors to check if it works.

If the fuses are programmed as you think (0000) then you have enabled the external clock and you need some kind of external oscillator.

Alex
 

    V

    Points: 2
    Helpful Answer Positive Rating
@alexan_e,
I even connected the 22pF capacitors to XTAL pins but no use :(

---------- Post added at 18:21 ---------- Previous post was at 18:19 ----------

@alexan_e,
I even connected the 22pF capacitors to XTAL pins but no use :sad:
 
Last edited:

Then the only logic explanation is that the fuses are programmed (0000) then you have enabled the external clock,
this can't work with a crystal.
Do you have any circuit that can generate a clock, or a crystal oscillator(the ones with 4 pins)?

Alex
 

    V

    Points: 2
    Helpful Answer Positive Rating
No i dont have neither the clock generator nor 4pin crystal oscillator(i have only crystal oscillator with 2 pins).
 

when you connect to one of the AVR that work and still have the factory fuse settings, what do you see.
Which fuses are checked?
The default is 0001 (1MHz int RC) so you can see if the ponyprog shows 0 as checked or unchecked.

Alex
 

@alexan_e,
Yes you are right,the factory fresh chip has 0001 in CKSEL.Later i modified it to 0000.
 

I only have one solution that may work.
Use one of the working chips and change it either to the internal RC of 8MHz or external crystal and then program the chip to turn on/off a port.
if you use the default 1MHz than the result in the output will be of low frequency.


Code C - [expand]
1
2
3
4
DDRA=0xff;  // portA as output
while (1){
PORTA^=0xff;   // invert portA 
}



Then use a pin of that port as an external clock to feed the dead AVRs,
the AVR port should give about 300-400KHz which will probably be enough.

Alex

---------- Post added at 20:55 ---------- Previous post was at 20:51 ----------

I have corrected the code, the initialization of the port should be out of the loop of course.

Alex
 

@alexan_e,
Okay I will try.For the time being i left out with no working AVR chips :(.I will buy tomorrow and will test.
Thank you for ur help :)
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top