View previous topic :: View next topic |
Author |
Message |
Ivo
Joined: 29 Nov 2007 Posts: 68 Location: Belgium
|
Posted: Sun Feb 07, 2010 11:09 pm Post subject: What is the most simply schematic? |
|
|
Hello all,
I want to start with a test to use a ATMega48. I have connect pin 7 with +5v and pin 8 to gnd. There is a capacitor of 100n between those pins. There is a led and a 1k resistor on pin 14 (PB0). And there is a xtal of 12MHz between pins 9 and 10 (xtal1 and xtal2).
Now the controller seems to do nothing. I can not measure any clocksignal, so i thing this is the reason. (pins 9 and 10 are "low")
Any suggestions for me to get this controller working?
Thanks!
Ivo |
|
Back to top |
|
|
mattcro
Joined: 03 Oct 2007 Posts: 327 Location: Scotland
|
Posted: Tue Feb 09, 2010 1:16 pm Post subject: |
|
|
You need to connect a capacitor from XTAL1 to ground and one from XTAL2 to ground. These are typically 20pF. See the crystal oscillator sections in the datasheet.
You must also program the AVR's fuses to set the correct clock/oscillator mode. You should select "Low Power Crystal Oscillator 8-16MHz" or similar in your programming software. _________________ If all else fails, read the manual. Even better: read the manual before something fails. If you can't find it in the manual, search the forum.
BascomAVR 2.0.8.5 |
|
Back to top |
|
|
Ivo
Joined: 29 Nov 2007 Posts: 68 Location: Belgium
|
Posted: Tue Feb 09, 2010 5:52 pm Post subject: |
|
|
Thanks mattcro!
In the mean time, i have connect the chrystal like you said, with two capacitors of 22pF, but still not a single signal on xtal1 or xtal2. I have also connect Pin1 (/reset) over a 10K resistor to 5V and over a 100nF capacitor to 0V.
Now i'm trying to set the fusebits with Bascom, but never done this before, i always gets the message "READLB entry not found" Is it possible to set this fuse bits without clocksignal?
Best regards,
Ivo |
|
Back to top |
|
|
mattcro
Joined: 03 Oct 2007 Posts: 327 Location: Scotland
|
Posted: Tue Feb 09, 2010 9:50 pm Post subject: |
|
|
The AVR chips are supplied with the oscillator set to internal R/C mode (typically 1MHz). This means you always have a clock to get started with. You can then program the fuses to set the oscillator mode to external crystal if you need.
Note that the crystal oscillator if disabled if the chip is set to use internal R/C osc, so the XTAL pins won't do anything.
The procedure for programming the fuses and memory of the AVR depends on your exact programmer type and software. I don't use Bascom to do the chip programming so can't help much with that...
Try removing the 100nF capacitor on the reset pin - this may be causing problems with the programming. Also try reducing the programming speed if you have it set fairly high. _________________ If all else fails, read the manual. Even better: read the manual before something fails. If you can't find it in the manual, search the forum.
BascomAVR 2.0.8.5 |
|
Back to top |
|
|
Ivo
Joined: 29 Nov 2007 Posts: 68 Location: Belgium
|
Posted: Tue Feb 09, 2010 11:24 pm Post subject: |
|
|
Thanks mattcro!
One of these days i will start all over again. My breadboard is starting to be a mess
Thanks for all your advice! |
|
Back to top |
|
|
|