Avr too slow?

Topics regarding the Uzebox hardware/AVCore/BaseBoard (i.e: PCB, resistors, connectors, part list, schematics, hardware issues, etc.) should go here.
anercomp
Posts: 10
Joined: Fri Jan 09, 2015 4:16 pm

Avr too slow?

Post by anercomp »

Hey guys, i built my own Euzebox on a prototype board and in general its working but i have got 1 problem. The video has got a wrong v-synch so i measured the frequency and had to realize, the avr is running on ca 10 mhz, but its on external clock of 28,6363 MHz. i think my fuse and lock bits are right but im not sure. furthermore i get sound but it sounds weird.
thanks for the help!
CunningFellow
Posts: 1480
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Avr too slow?

Post by CunningFellow »

10Mhz is strange.

It is not the 8Mhz that it would be off the internal oscillator and it is not a fundamental freq of the xtal.

If you swap the 28mhz xtal out for a 20mhz one does your 10mhz measured output freq drop down to 7.14 ?

Also check if there is output with NO crystal present.

Those two things will let you know for sure the fuses are set for XT-HS etc
User avatar
D3thAdd3r
Posts: 3289
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Avr too slow?

Post by D3thAdd3r »

CunningFellow wrote:10Mhz is strange.
I can't see any way it could be exactly 10mhz either.

Do you actually have any kind of video output to the screen? As for the sound, if you start up a rom with music, does it just sound really slow(versus how it sounds in the emulator) or is it glitches/static? Also where exactly did you measure 10mhz or did you derive that from some calculation?

I really think it is fuse settings or circuitry(capacitors close enough to crystal?). Otherwise a small percent of the chips have troubles @ 28.636 so there is the possibility that the '644 you have doesn't play well with overclocking(is it a 644P?).
anercomp
Posts: 10
Joined: Fri Jan 09, 2015 4:16 pm

Re: Avr too slow?

Post by anercomp »

first thanks for the quick answers.
D3thAdd3r wrote:
CunningFellow wrote:10Mhz is strange.
I can't see any way it could be exactly 10mhz either.

Do you actually have any kind of video output to the screen? As for the sound, if you start up a rom with music, does it just sound really slow(versus how it sounds in the emulator) or is it glitches/static? Also where exactly did you measure 10mhz or did you derive that from some calculation?

I really think it is fuse settings or circuitry(capacitors close enough to crystal?). Otherwise a small percent of the chips have troubles @ 28.636 so there is the possibility that the '644 you have doesn't play well with overclocking(is it a 644P?).
i calculated the ~10 MHz and used an Osciloscope to measure at the xtal out, dont know 1 or 2.

Yeah i get an video, but its floating from top to bottom all the time, as i said, looks like the v-sync isnt correct. The music is just slow i think, couldnt check the actual sound in the emulator because i use win7 64 bit and the emu is not running for some reason.

I use an ATmega644P
User avatar
D3thAdd3r
Posts: 3289
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Avr too slow?

Post by D3thAdd3r »

On pin 4 of the 644 my scope shows 14.3182mhz of course 1/2 division of the main clock and on pin 39 I have 60hz and pin 38 120hz and pin 37 1.92khz. If you are getting a stable 10mhz on pin 39, like Cunning was saying there are no divider settings possible that could get exactly 10 from 28.636. I'd wager you have a 20mhz crystal on there but this stuff isn't my specialty. It would be helpful if you could take some pictures of what the television is displaying.
anercomp
Posts: 10
Joined: Fri Jan 09, 2015 4:16 pm

Re: Avr too slow?

Post by anercomp »

Here is what it looks like if i start the euzebox on my samsung tv
http://youtu.be/WExaq9r_MHE
User avatar
D3thAdd3r
Posts: 3289
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Avr too slow?

Post by D3thAdd3r »

Seeing parts of the space invaders logo that are supposed to be on the right side interlaced over parts on the left side almost looks like your scan lines are taking at least twice as long as they should(and the tv is doing it's best to interperet those long slow off time hsync signals).
slowavr.jpg
slowavr.jpg (135.09 KiB) Viewed 9049 times
Are you using AVRStudio or avrdude and what fuse settings do you have now? Are you definitely using a crystal or an oscillator and do you have a link to the datasheet for it? Did you try Cunning's idea of see if removing the crystal makes a difference? This will work out in the end, but hopefully Alec or another hardware guru chimes in soon. Try it on another TV if possible.
anercomp
Posts: 10
Joined: Fri Jan 09, 2015 4:16 pm

Re: Avr too slow?

Post by anercomp »

i also tried it on an Philips, but i lost my scart cable for it, but it looked similar, only it displayed all the time and the picture was all the time sliding downwards real quick
i use a crystal, it says MMD28.63636 GKF1
I didnt try removing it yet, what exactly would the consequence of it be? Don't understand the logic behind it :|
i'm using Bascom for programming purposes http://mcselec.com/index.php?option=com ... &Itemid=41
User avatar
D3thAdd3r
Posts: 3289
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Avr too slow?

Post by D3thAdd3r »

anercomp wrote:I didnt try removing it yet, what exactly would the consequence of it be? Don't understand the logic behind it
One of the main possibilities is incorrect fuse settings. If you pull the crystal and it still runs then it means the fuse settings are telling it to run from the internal 8mhz oscillator inside the 644 as Cunning had said. What fuse settings are you using?
Swinkels wrote:It seems that you are using third overtone crystal and your AVR is running with about 9.5MHz. Try other 28,6363 MHz fundamental frequency crystal.
To avoid confusion with differnt crystals type I recommend using integrated oscilator. With the external clock source any AVR will overclock much more stable.
This I found elsewhere on the forums and could be relevant and explain~10mhz
anercomp
Posts: 10
Joined: Fri Jan 09, 2015 4:16 pm

Re: Avr too slow?

Post by anercomp »

i use the fuse setting "ext. fullswing osc." i was told this is the right one for my use.
D3thAdd3r wrote:
Swinkels wrote:It seems that you are using third overtone crystal and your AVR is running with about 9.5MHz. Try other 28,6363 MHz fundamental frequency crystal.
To avoid confusion with differnt crystals type I recommend using integrated oscilator. With the external clock source any AVR will overclock much more stable.
This I found elsewhere on the forums and could be relevant and explain~10mhz
I heard this one before, i think its the best idea to buy an oscillator instead of another bunch of crystals. Thanks!
Post Reply