Need some help guys - Page 1
Forum section: electronics / general

author: mainman
author_rank: Regular Contributor
timestamp: April 08, 2014, 04:31:53 pm
content: Ok I have a Atmega8-PU 16 MHZ Microcontroller I am struggling to configure to use a external 16 MHZ crystal.I set all the high and low bits using the AVR calculator to allow my desired configuration but when I place the chip in circuit on my bread board and scope the external 16MHZ crystal there is no clock. Yes I have it wired correctly with two 22p capsHigh byte:0xDFLow byte: 0xEEI should make know others have gotten their AVR running using the same fuse configuration so it is something I am doing wrong on my end.I am using a topmax2 universal programmer to program the AVR. I was wondering do the external crystal and caps need to be installed on the AVR when you are initially programming and configuring it to run with a external clock. I ask because I am not doing in system programming of the AVR. I am programming it on a universal programmer.Really appreciate the help

author: Erwin Ried
author_rank: Regular Contributor
timestamp: April 08, 2014, 07:23:12 pm
content: Where are you setting the high and low byte? I have noticed some utilities have these reverted (1 is 0). I tried to do exactly the opposite and I ended locking few atmegas(had to buy a HV programmer to unlock them)

author: mainman
author_rank: Regular Contributor
timestamp: April 08, 2014, 07:44:21 pm
content: Quote from: Erwin Ried on April 08, 2014, 07:23:12 pmLOWBodlevel 1 (unprogrammed)Boden 1 (unprogrammed)Suto1 1 (unprogrammed)Suto0 0 ProgrammedCksel3 1 (unprogrammed)Cksel2 1 (unprogrammed)Cksel1 1 (unprogrammed)Cksel0 0 ProgrammedHighRstdisbl 1 (unprogrammed)Wtdon 1 (unprogrammed)Spien 0 ProgrammedCkopt 1 (unprogrammed)Eesave 1 (unprogrammed)Bootsz 1 (unprogrammed)Bootrst 1 (unprogrammed)I leave all the BLB and LB as 1= erasedHow can you tell if you locked the chip just for my information.

author: Erwin Ried
author_rank: Regular Contributor
timestamp: April 08, 2014, 07:48:23 pm
content: This is using Avrdude?You can tell because it stops reporting the chip id

author: Neverther
author_rank: Regular Contributor
timestamp: April 08, 2014, 08:13:23 pm
content: The datasheet says that your clock settings are recommended for resonators or crystals not operating nowhere near max frequency.Use 16k cycles startup with fast crystals (try with slowest 64ms startup, if it works, go faster).

author: dannyf
author_rank: Super Contributor
timestamp: April 08, 2014, 09:20:33 pm
content: QuoteDon't use those magic numbers: you will never remember exactly what they are.Use macros or a gui to set fuses.

author: mainman
author_rank: Regular Contributor
timestamp: April 08, 2014, 09:38:59 pm
content: Quote from: dannyf on April 08, 2014, 09:20:33 pmI have to work with what I have, what I have being the gui of my universal programmer. Those magic numbers are entered into a avr fuse calculator and that calculator is what tell me how to set the bits.Quote from: Neverther on April 08, 2014, 08:13:23 pmI am working from a proven design that I am trying to duplicate, I can not deviate from how the project tells me how to set the fuses.My problem is I personally am not interpreting the directions correctly and need more detailed instructions on how to interpret those directions being how do you go about actually programming the AVR I am using with a universal programmer as opposed to ISP.Most people go the ISP route as it is cheaper so directions were given from that perspective. I have at my disposal a actual universal programmer which is how I am proceeding. Programming the AVR the ISP rounte is not a option for me especially since the tool I have at my disposal can do the job I just need instructions.Quote from: Erwin Ried on April 08, 2014, 07:48:23 pmI am using Max loader for chipmax2

author: westfw
author_rank: Super Contributor
timestamp: April 09, 2014, 07:41:26 am
content: QuoteDo you know if your universal programmer is doing SPI programming, or parallel programming?The former (say as ISP) needs to always have a clock, but parallel programming doesn't.Just because you have your AVR is a socket on a "universal programmer" doesn't mean that it's using a different programming protocol that ISP...

author: Stonent
author_rank: Super Contributor
timestamp: April 09, 2014, 12:20:45 pm
content: What does get no clock mean exactly? The crystal setup will be generating a clock if wired correctly electrically.Is your chip exactly the same as the design you are duplicating? I.e. both are dip or both are qfp etc? What voltage are you using? You can get different cups in the same series that run at different voltages. Is there a load on the chip during programming? I messed up a chip once because the circuit was pulling on the chip during programming and caused the fuses to not set correctly.

author: madires
author_rank: Super Contributor
timestamp: April 09, 2014, 12:55:27 pm
content: Quote from: mainman on April 08, 2014, 04:31:53 pmA common issue is mixing up values of the ceremic caps, like using 220pF or something like that. Please measure both ceremics. Another problem could be the breadboard because of it's own capacitance. Maybe you have to lower the cap's value to compensate for that.

author: mainman
author_rank: Regular Contributor
timestamp: April 09, 2014, 07:42:59 pm
content: Quote from: Stonent on April 09, 2014, 12:20:45 pmNo clock means I attach a 16Mhz crystal to pins xtal1 and 2 and observe with my DSO that there is no oscillation from the crystal.The design calls for a ATMEGA8-16PU and I am using a ATMEGA8A-PU which is a 16MHZ and should be equivalent going by the datasheet. I guess I will order the exact MCU now and see if it helpsQuote from: madires on April 09, 2014, 12:55:27 pmThat was the first thing I did dude, even experimented with 33p caps to no effect.Check continuity on my breadboard and it all good there.Quote from: westfw on April 09, 2014, 07:41:26 amThat what the Spien bit is for on the configuration screen for the universal programmer, setting this bit enables SPI programming of the chip.

author: casinada
author_rank: Frequent Contributor
timestamp: April 09, 2014, 09:27:41 pm
content: Adding capacitance to the breadboard will make it bigger not smaller.Watch this Video from Dave:

author: westfw
author_rank: Super Contributor
timestamp: April 10, 2014, 01:39:54 am
content: Huh. I can't even find a manual that indicates that the topmax2 supports the programming of AVRs at all. (the EETools web site says it does, but it's not in the manual.) And their support forums are full of spam. You'd think a $700 programmer would have better documentation and online presence.QuoteBut you already used a different chip (8 vs 8A.) I think setting the clock fuses to the most conservative possible value would be a good starting point, at least to see if it works.Do you have a known-good board that you can put the chip in (like an Arduino)?FWIW, I had some home-made arduino boards with ceramic resonators that worked fine with 168 and 328 chips and the "low power oscillator" fuse setting, but needed the "higher power oscillator" fuse settings to get it to work with ATmega8 (as per what the documentation said.) So going from one chip to another CAN have effects on the oscillator behavior, even for relatively closely related chips.

author: mainman
author_rank: Regular Contributor
timestamp: April 10, 2014, 05:44:54 am
content: Quote from: westfw on April 10, 2014, 01:39:54 amActually I thought the 8A was equivalent to the 8 and I bought 8A because I thought they no longer made the 8.Yeap the topmax2 definitely supports MCU, it had better since it's expensive as hell.Yes I have a arduino. I just ordered some ATMEGA8-16PU and hopefully using the exact AVR will solve my problem.I did some quick research and found thread pointing out incompatibility issue between the older ATMEGA8-16PU and the newer ATMEGA8A