Author Topic: AVR 328p  (Read 2154 times)

0 Members and 1 Guest are viewing this topic.

Offline scarecrow90Topic starter

  • Jr. Member
  • **
  • Posts: 10
  • Helpful? 0
AVR 328p
« on: March 15, 2013, 03:01:07 AM »
Hei. Here is my AVR 328p electrical scheme, i'm not sure if i conected well the ISP, i can't find my chip with any program (USBASP), can anyone tell me if is ok the pinout for ISP? Oh 1 more question: is an Quartz Crystal really necessary for the CPU to start? thx alot.
« Last Edit: March 15, 2013, 04:07:29 AM by scarecrow90 »

Offline mstacho

  • Supreme Robot
  • *****
  • Posts: 376
  • Helpful? 10
Re: AVR 328p
« Reply #1 on: March 15, 2013, 06:26:34 AM »
The programmer seems to be connected properly.  Try to connect to it in AVRStudio.  Be sure that all the proper bits are set (uh...someone more knowledgeable than I will guide you on which lockbits to set :-P ).

You don't need a crystal, it's just useful to have to make sure your timing is more accurate.  Hooking up crystals is sort of a pain, since you need to make sure the filter capacitors are correct or else the crystal may not even oscillate :-P  For now stick with the internal clock.

MIKE
Current project: tactile sensing systems for multifingered robot hands

Offline scarecrow90Topic starter

  • Jr. Member
  • **
  • Posts: 10
  • Helpful? 0
Re: AVR 328p
« Reply #2 on: March 15, 2013, 06:46:42 AM »
Ty alot for your time Mike. I tried with AVRStudio 4, PoniProgram, eXtreme Burner, KhazamaAVR and still can't connect to CPU. And i don't think AVRStudio will work with USBASP(not sure, is just my opinion :D ). I'll give u an example of error. This is what i get with Burner (AVR) . Is any chance that my CPU is dead? If i plug in my servos they start to spin even if i don't have any program on my CPU. Even if my motors are CC, i think they should recive electrical impulse from CPU to start, if there is no program on microcontroller they should stay still. Am I wrong? Ty again for your time.
« Last Edit: March 15, 2013, 06:48:16 AM by scarecrow90 »

Offline mstacho

  • Supreme Robot
  • *****
  • Posts: 376
  • Helpful? 10
Re: AVR 328p
« Reply #3 on: March 15, 2013, 07:00:04 AM »
Try putting a pull-up resistor from RST to VCC.  20KOhm, I THINK, is the correct value (but check the datasheet.  You won't break anything with the wrong value, it just won't work :-P ).  To do that, literally take the resistor and connect it across the pins for RST and VCC.

I'm not sure if you are supposed to connect your programmer to ARef or to VCC.  Double check that as well.

MIKE
Current project: tactile sensing systems for multifingered robot hands

Offline GearMotion

  • Supreme Robot
  • *****
  • Posts: 489
  • Helpful? 24
  • Two decades+ of Embedded Design
    • CircuitGizmos
Re: AVR 328p
« Reply #4 on: March 15, 2013, 01:39:05 PM »
Use a 10k pull up on reset. Connect Aref and Avcc to Vcc (+5V).

You show a 7804 but the line is labelled 5V.

You have an LED without a resistor across 5V/GND.

Your 7804 (7805?) needs a ground connection NOT through a capacitor.

I suggest getting your power supply working BEFORE connecting to the microcontroller.


Offline jwatte

  • Supreme Robot
  • *****
  • Posts: 1,345
  • Helpful? 82
Re: AVR 328p
« Reply #5 on: March 15, 2013, 11:03:20 PM »
In addition, the chip will work with a reset pull-up from 1k to 100k or so. The programmer may expect the pull-up to be weaker than 1k, though -- I've always used 10k and it works great.

Also, you need the crystal to program the chip if the chip has ever been programmed to run with a crystal (such as Arduino chips.) When the chips come from the factory, they are set to use the internal oscillator (at 8 MHz) AND have the divide-clock-by-8 bit set, so they run at 1 MHz. This is important to know, because if you try to run the programmer too fast compared to the clock setting, it won't work. I think the max programmer speed is 250 kHz for the default AVR chip from the factory. If you can't see the chip with a tool like avrdude, then try a slower programmer setting.

Offline scarecrow90Topic starter

  • Jr. Member
  • **
  • Posts: 10
  • Helpful? 0
Re: AVR 328p
« Reply #6 on: March 16, 2013, 03:17:33 AM »
My LED already have a incorporate chip,and i get for microcontroller and sesor 5V, for servos 5.8V. Ty alot for advice i will try a pull up at reset and i try to connect VCC, AVCC and AREF, i will see what will happen. :). Ty for your time.

Offline scarecrow90Topic starter

  • Jr. Member
  • **
  • Posts: 10
  • Helpful? 0
Re: AVR 328p
« Reply #7 on: March 16, 2013, 04:39:12 AM »
ok i connected AREF to AVCC and VCC, i used a pull up 10kwohm from RST to VCC, and i get the same error.

Offline Jon_Thompson

  • Jr. Member
  • **
  • Posts: 37
  • Helpful? 1
Re: AVR 328p
« Reply #8 on: March 16, 2013, 05:33:04 AM »
Scarecrow90, may I make a couple of suggestions that might save you a lot of time?

First, start again by clearing the breadboard and sorting out the power supply. You need a 7805 voltage controller, and to connect the ground pin directly to ground, not through a capacitor. Add a 1K resistor to the LED to show that power is on without drawing an undue amount of current.

Next, add just the microcontroller and hook up the 5V supply to it. Wire in the header and contact the chip from the PC. If it works, add the servos and write a small program to test them.

If everything still works, hook up the IR sensor using the manufacturer's datasheet and write a small program to test this.

Essentially, what I'm saying is work in small steps, get each step working and build on it. Then document the schematic to reflect working reality ;)
You can still do a lot with a small brain.

 


Get Your Ad Here

data_list