Author Topic: Need some help guys  (Read 8609 times)

0 Members and 1 Guest are viewing this topic.

Offline mainmanTopic starter

  • Regular Contributor
  • *
  • Posts: 62
Need some help guys
« on: April 08, 2014, 04:31:53 pm »
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 caps


High byte:0xDF
Low byte:   0xEE

I 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



« Last Edit: April 08, 2014, 07:36:55 pm by mainman »
 

Offline Erwin Ried

  • Regular Contributor
  • *
  • Posts: 212
  • Country: no
Re: Need some help guys
« Reply #1 on: April 08, 2014, 07:23:12 pm »
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)
 

Offline mainmanTopic starter

  • Regular Contributor
  • *
  • Posts: 62
Re: Need some help guys
« Reply #2 on: April 08, 2014, 07:44:21 pm »
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)

LOW

Bodlevel 1       (unprogrammed)
Boden    1       (unprogrammed)
Suto1     1       (unprogrammed)
Suto0     0         Programmed
Cksel3    1       (unprogrammed)
Cksel2    1       (unprogrammed)
Cksel1    1       (unprogrammed)
Cksel0    0        Programmed

High 

Rstdisbl  1         (unprogrammed)
Wtdon   1          (unprogrammed)
Spien     0           Programmed
Ckopt    1          (unprogrammed)
Eesave  1          (unprogrammed)
Bootsz   1          (unprogrammed)
Bootrst   1         (unprogrammed)


I leave all the BLB and LB as 1= erased



How can you tell if you locked the chip just for my information.

 

Offline Erwin Ried

  • Regular Contributor
  • *
  • Posts: 212
  • Country: no
Re: Need some help guys
« Reply #3 on: April 08, 2014, 07:48:23 pm »
This is using Avrdude?

You can tell because it stops reporting the chip id
 

Offline Neverther

  • Regular Contributor
  • *
  • Posts: 129
Re: Need some help guys
« Reply #4 on: April 08, 2014, 08:13:23 pm »
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).
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Need some help guys
« Reply #5 on: April 08, 2014, 09:20:33 pm »
Quote
High byte:0xDF
Low byte:   0xEE

Don't use those magic numbers: you will never remember exactly what they are.

Use macros or a gui to set fuses.
================================
https://dannyelectronics.wordpress.com/
 

Offline mainmanTopic starter

  • Regular Contributor
  • *
  • Posts: 62
Re: Need some help guys
« Reply #6 on: April 08, 2014, 09:38:59 pm »
Quote
High byte:0xDF
Low byte:   0xEE

Don't use those magic numbers: you will never remember exactly what they are.

Use macros or a gui to set fuses.

I 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.



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).


I 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.



This is using Avrdude?

You can tell because it stops reporting the chip id


I am using Max loader for chipmax2
« Last Edit: April 08, 2014, 10:25:08 pm by mainman »
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4676
  • Country: us
Re: Need some help guys
« Reply #7 on: April 09, 2014, 07:41:26 am »
Quote
I am using a topmax2 universal programmer to program the AVR.  I was wondering do the external crystal and caps need to be installed
Do 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...
 

Offline Stonent

  • Super Contributor
  • ***
  • Posts: 3824
  • Country: us
Re: Need some help guys
« Reply #8 on: April 09, 2014, 12:20:45 pm »
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.
The larger the government, the smaller the citizen.
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 9313
  • Country: de
  • A qualified hobbyist ;)
Re: Need some help guys
« Reply #9 on: April 09, 2014, 12:55:27 pm »
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 caps

A 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.
 

Offline mainmanTopic starter

  • Regular Contributor
  • *
  • Posts: 62
Re: Need some help guys
« Reply #10 on: April 09, 2014, 07:42:59 pm »
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.

No 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 helps


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 caps

A 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.

That 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
I am using a topmax2 universal programmer to program the AVR.  I was wondering do the external crystal and caps need to be installed
Do 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...

That what the Spien bit is for on the configuration screen for the universal programmer, setting this bit enables SPI programming of the chip.
« Last Edit: April 09, 2014, 09:49:10 pm by mainman »
 

Offline casinada

  • Frequent Contributor
  • **
  • Posts: 600
  • Country: us
Re: Need some help guys
« Reply #11 on: April 09, 2014, 09:27:41 pm »
Adding capacitance to the breadboard will make it bigger not smaller.
Watch this Video from Dave:


 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4676
  • Country: us
Re: Need some help guys
« Reply #12 on: April 10, 2014, 01:39:54 am »
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.

Quote
I can not deviate from how the project tells me how to set the fuses.
But 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.
 

Offline mainmanTopic starter

  • Regular Contributor
  • *
  • Posts: 62
Re: Need some help guys
« Reply #13 on: April 10, 2014, 05:44:54 am »
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.

Quote
I can not deviate from how the project tells me how to set the fuses.
But 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.

Actually 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
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->