Go Down

Topic: Standalone 3.3v Atmega 328p - [working] (Read 13373 times) previous topic - next topic

Erni

I noted that you power the mini with 3.3V.
That is not a good idea as the programming lines are at 5V, so you are risking to destroy the mini.
The max. voltage supplied to the pins is VCC+0.5V = 3.8V.
It is better to poer the mini with 5V

fkeel

dang. that would explain it.

if I power it with 5v for burning the bootloader - could I still burn the 3.3v bootloader?

guess I should just use a 3.3v arduino as the ISP then....
http://embodimentlabs.tumblr.com/
http://paulstrohmeier.info/

ralphd


if I power it with 5v for burning the bootloader - could I still burn the 3.3v bootloader?


Look at the boards.txt to see.  I think the only difference is a lower BODLEVEL fuse setting for the "3.3v" bootloader.

Coding Badly


Both sides need to be at the same voltage.  It makes no difference if you choose 5V or 3.3V.  Pick whichever is most convenient.  Level-shifting can make it possible to have them a different voltages but, for what you are doing, it is not worth the effort.

Quote
I then selected Arduino Pro Mini 3.3v (8Mhz) in the Arduino IDE,


I believe the Pro Mini uses an external clock (resonator or crystal).  If it does, the fuse settings will be wrong for what you are trying to do.  The "bare board" settings are very likely closer to what you want.  (I think the board entry is called "bare board".)

fkeel

#34
Jan 23, 2014, 03:01 am Last Edit: Jan 23, 2014, 03:19 am by fkeel Reason: 1
Well, I am still having trouble getting this to work.

I am still using the Arduino as ISP (I have switched to a Duemilanove and am not using the 10uF Capacitor). I decided to switch to using AVRdude (first time using it though, so a little bumpy).

I tested it with a Attiny84 and everything seems to be working fine.  (However I did not connect the RESET pin)

When I try to target the Atmega329p I get errors. Also, the ISP Arduino seems to freeze up (the 'heartbeat' LED will stop 'beating').
Still tinkering around with this.

I attached a screenshot. As allways, thoughts & comments highly appreciated.

(I'll upload some pictures of my setup, but my phone is being a bit of a pain, so that'll have to wait a bit)


*

@CodingBadly - I will give that a shot. (EDIT: cant find that option) However, I think I have some more fundamental problem

EDIT: Woooah. I had VCC in the wrong pin.  Things look better (it does not freeze anymore), but it is still giving me errors. Saying "Device Signatur = 0x000000"

one moment uploading screenshot.


Any chance I fried the Atmega328p somewhere in the process? Would I get this type of response?
http://embodimentlabs.tumblr.com/
http://paulstrohmeier.info/

Coding Badly

Any chance I fried the Atmega328p somewhere in the process? Would I get this type of response?


Possibly.  Yes.

But first, add a few[font=Courier New] -v [/font](dash lowercase Vs)to the command-line and post the results (you can copy the window contents using options available on the system menu).

fkeel

I'm not really getting anywhere. I just built a new board from scratch (this time using a 8mhz oscillator), checked all connections with a multimeter (chip to board, board to pins, no solder bridges etc.) and am not getting it to work.

Power and logic lines are all at 5v

This is what AVRdude is telling me:

EDIT: I have run this a couple of times and I have noticed that the device signature appears to be changing around.  It started out as 0x00000f then it changed to 0xff00ff and then it changed to 0xffff00. ... something is very wrong :-(

Code: [Select]

C:\Users\One>avrdude -P COM11 -b 19200 -c avrisp -p m328p -n

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.09s

avrdude: Device signature = 0x000007
avrdude: Expected signature for ATMEGA328P is 1E 95 0F
        Double check chip, or use -F to override this check.

avrdude done.  Thank you.


C:\Users\One>avrdude -P COM11 -b 19200 -c avrisp -p m328p -v -n

avrdude: Version 5.10, compiled on Jan 19 2010 at 10:45:23
        Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
        Copyright (c) 2007-2009 Joerg Wunsch

        System wide configuration file is "C:\WinAVR-20100110\bin\avrdude.conf"


        Using Port                    : COM11
        Using Programmer              : avrisp
        Overriding Baud Rate          : 19200
        AVR Part                      : ATMEGA328P
        Chip Erase delay              : 9000 us
        PAGEL                         : PD7
        BS2                           : PC2
        RESET disposition             : dedicated
        RETRY pulse                   : SCK
        serial program mode           : yes
        parallel program mode         : yes
        Timeout                       : 200
        StabDelay                     : 100
        CmdexeDelay                   : 25
        SyncLoops                     : 32
        ByteDelay                     : 0
        PollIndex                     : 3
        PollValue                     : 0x53
        Memory Detail                 :

                                 Block Poll               Page
     Polled
          Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  Max
W   ReadBack
          ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ---
-- ---------
          eeprom        65     5     4    0 no       1024    4      0  3600  36
00 0xff 0xff
          flash         65     6   128    0 yes     32768  128    256  4500  45
00 0xff 0xff
          lfuse          0     0     0    0 no          1    0      0  4500  45
00 0x00 0x00
          hfuse          0     0     0    0 no          1    0      0  4500  45
00 0x00 0x00
          efuse          0     0     0    0 no          1    0      0  4500  45
00 0x00 0x00
          lock           0     0     0    0 no          1    0      0  4500  45
00 0x00 0x00
          calibration    0     0     0    0 no          1    0      0     0
0 0x00 0x00
          signature      0     0     0    0 no          3    0      0     0
0 0x00 0x00

        Programmer Type : STK500
        Description     : Atmel AVR ISP
        Hardware Version: 2
        Firmware Version: 1.18
        Topcard         : Unknown
        Vtarget         : 0.0 V
        Varef           : 0.0 V
        Oscillator      : Off
        SCK period      : 0.1 us



I am not really sure what to look for in the debug info in order to get this working.

(Sidenote - should the Arduino as ISP sketch work on the Arduino Nano? I currently have it running on a Duemilenove, but would like to set it up on my pro mini, so that the voltage levels match up.)
http://embodimentlabs.tumblr.com/
http://paulstrohmeier.info/

fkeel

Could somebody please double-check the board layout for me?



Red components: 0.1uF capacitor
http://www.digikey.com/product-detail/en/C0805C104K5RACTU/399-1170-1-ND/411445
Purple: 10uF capacitor
http://www.digikey.com/product-detail/en/C0805C106K8PACTU/399-4925-1-ND/1090920
Yellow: 1k Resistor:
http://www.digikey.com/product-detail/en/ERJ-6ENF1001V/P1.00KCCT-ND/118957
Blue: 10k Resistor:
http://www.digikey.com/product-detail/en/ERJ-6ENF1002V/P10.0KCCT-ND/119248
Green: 8Mhz Resonator
http://www.digikey.com/product-detail/en/CSTCE8M00G52-R0/490-5994-1-ND/3845194

Notes:
- The Atmega328p is rotated by 90 degrees clockwise (little dot is on the top right corner).
- The 10uF capacitor is ceramic, not electrolytic as on the actual pro mini
- The issues described in the previous post are using a board which has an oscillator

EDIT: Just tripple checked it with a multimeter. No solder bridges, no cold solder joints. All the connections are as in the picture.
EDIT2: Pulling AREF High (using a 10k resistor) permanently changes the address to 0xffffff
EDIT3: Pulling it Low or leaving it floating doesnt change anything. address seems to be 0xffffff now.
EDIT3b: AVRdude/ArduinoISP hangs every other time. I have to click the reset button on the arduino to 'unfreeze' it. When that happens the 'heartbeat' led is steady on.
EDIT4: Added some images of my setup
EDIT5: Apparently if I disconnect RESET, it goes 0xffffff and if RESET is connected properly it usually outputs 0x000000 but sometimes outputs arbitrary addresses (as described before.)

Anyway. I'm pretty lost. Odd thing is I have programmed Tinies many many times using this method and I have never had an issue.
http://embodimentlabs.tumblr.com/
http://paulstrohmeier.info/

JoeO

I think you are missing the ground from the Arduino to your board.

fkeel

its not visible in the picture, but its there. (the black cable which connects the GND of my breakout board to the cathode of the LEDs  is ground.)

Thanks for checking it though. Anything else you noticed? I really don't know where to go from here.
http://embodimentlabs.tumblr.com/
http://paulstrohmeier.info/

Coding Badly


I apologize.  I should have been more specific.  Add four [font=Courier New] -v [/font](dash lowercase Vs) to the command-line and post the results (you can copy the window contents using options available on the system menu).

fkeel

No need to apologize. I really appreciate your help!

Something odd happened. When I tried it again today, first time round, the device ID was recognized correctly. I tried repeating it, again, recognized correctly. I was suspicious, because everything was literally as I had left it and nothing had changed, but was already laughing inside. Third time round - invalid device ID.

I tried it with a different prototype. First time I check, correct ID, second time invalid ID.

Here is the output from when it was working (I did not get to save the whole thing, because at the time I didn't realize I might want it later on. What you see is ~ the second half of -v -v -v -v and the full output using only -v

Code: [Select]
avrdude: Recv: . [10]
avrdude: Send: E [45] . [05] . [04] . [d7] . [c2] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [10]
avrdude: Send: P [50]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [10]
avrdude: AVR device initialized and ready to accept instructions

Reading |                                                    | 0% 0.00savrdude:
Send: V [56] 0 [30] . [00] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [1e]
avrdude: Recv: . [10]
avrdude: Send: V [56] 0 [30] . [00] . [01] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [95]
avrdude: Recv: . [10]
Reading | #################                                  | 33% 0.07savrdude:
Send: V [56] 0 [30] . [00] . [02] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [0f]
avrdude: Recv: . [10]
Reading | ################################################## | 100% 0.11s

avrdude: Device signature = 0x1e950f
avrdude: Send: V [56] P [50] . [00] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: b [62]
avrdude: Recv: . [10]
avrdude: safemode read 1, lfuse value: 62
avrdude: Send: V [56] P [50] . [00] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: b [62]
avrdude: Recv: . [10]
avrdude: safemode read 2, lfuse value: 62
avrdude: Send: V [56] P [50] . [00] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: b [62]
avrdude: Recv: . [10]
avrdude: safemode read 3, lfuse value: 62
avrdude: safemode: lfuse reads as 62
avrdude: Send: V [56] X [58] . [08] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [d9]
avrdude: Recv: . [10]
avrdude: safemode read 1, hfuse value: d9
avrdude: Send: V [56] X [58] . [08] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [d9]
avrdude: Recv: . [10]
avrdude: safemode read 2, hfuse value: d9
avrdude: Send: V [56] X [58] . [08] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [d9]
avrdude: Recv: . [10]
avrdude: safemode read 3, hfuse value: d9
avrdude: safemode: hfuse reads as D9
avrdude: Send: V [56] P [50] . [08] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [ff]
avrdude: Recv: . [10]
avrdude: safemode read 1, efuse value: 7
avrdude: Send: V [56] P [50] . [08] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [ff]
avrdude: Recv: . [10]
avrdude: safemode read 2, efuse value: 7
avrdude: Send: V [56] P [50] . [08] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [ff]
avrdude: Recv: . [10]
avrdude: safemode read 3, efuse value: 7
avrdude: safemode: efuse reads as 7
avrdude: Send: V [56] . [a0] . [03] . [fc] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [ff]
avrdude: Recv: . [10]
avrdude: Send: V [56] . [a0] . [03] . [fd] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [ff]
avrdude: Recv: . [10]
avrdude: Send: V [56] . [a0] . [03] . [fe] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [ff]
avrdude: Recv: . [10]
avrdude: Send: V [56] . [a0] . [03] . [ff] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [ff]
avrdude: Recv: . [10]

avrdude: Send: V [56] P [50] . [00] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: b [62]
avrdude: Recv: . [10]
avrdude: safemode read 1, lfuse value: 62
avrdude: Send: V [56] P [50] . [00] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: b [62]
avrdude: Recv: . [10]
avrdude: safemode read 2, lfuse value: 62
avrdude: Send: V [56] P [50] . [00] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: b [62]
avrdude: Recv: . [10]
avrdude: safemode read 3, lfuse value: 62
avrdude: safemode: lfuse reads as 62
avrdude: Send: V [56] X [58] . [08] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [d9]
avrdude: Recv: . [10]
avrdude: safemode read 1, hfuse value: d9
avrdude: Send: V [56] X [58] . [08] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [d9]
avrdude: Recv: . [10]
avrdude: safemode read 2, hfuse value: d9
avrdude: Send: V [56] X [58] . [08] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [d9]
avrdude: Recv: . [10]
avrdude: safemode read 3, hfuse value: d9
avrdude: safemode: hfuse reads as D9
avrdude: Send: V [56] P [50] . [08] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [ff]
avrdude: Recv: . [10]
avrdude: safemode read 1, efuse value: 7
avrdude: Send: V [56] P [50] . [08] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [ff]
avrdude: Recv: . [10]
avrdude: safemode read 2, efuse value: 7
avrdude: Send: V [56] P [50] . [08] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [ff]
avrdude: Recv: . [10]
avrdude: safemode read 3, efuse value: 7
avrdude: safemode: efuse reads as 7
avrdude: safemode: Fuses OK
avrdude: Send: Q [51]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [10]

avrdude done.  Thank you.


C:\Users\One>avrdude -P COM11 -b 19200 -c avrisp -p m328p -v -n

avrdude: Version 5.10, compiled on Jan 19 2010 at 10:45:23
        Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
        Copyright (c) 2007-2009 Joerg Wunsch

        System wide configuration file is "C:\WinAVR-20100110\bin\avrdude.conf"


        Using Port                    : COM11
        Using Programmer              : avrisp
        Overriding Baud Rate          : 19200
        AVR Part                      : ATMEGA328P
        Chip Erase delay              : 9000 us
        PAGEL                         : PD7
        BS2                           : PC2
        RESET disposition             : dedicated
        RETRY pulse                   : SCK
        serial program mode           : yes
        parallel program mode         : yes
        Timeout                       : 200
        StabDelay                     : 100
        CmdexeDelay                   : 25
        SyncLoops                     : 32
        ByteDelay                     : 0
        PollIndex                     : 3
        PollValue                     : 0x53
        Memory Detail                 :

                                 Block Poll               Page
     Polled
          Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  Max
W   ReadBack
          ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ---
-- ---------
          eeprom        65     5     4    0 no       1024    4      0  3600  36
00 0xff 0xff
          flash         65     6   128    0 yes     32768  128    256  4500  45
00 0xff 0xff
          lfuse          0     0     0    0 no          1    0      0  4500  45
00 0x00 0x00
          hfuse          0     0     0    0 no          1    0      0  4500  45
00 0x00 0x00
          efuse          0     0     0    0 no          1    0      0  4500  45
00 0x00 0x00
          lock           0     0     0    0 no          1    0      0  4500  45
00 0x00 0x00
          calibration    0     0     0    0 no          1    0      0     0
0 0x00 0x00
          signature      0     0     0    0 no          3    0      0     0
0 0x00 0x00

        Programmer Type : STK500
        Description     : Atmel AVR ISP
        Hardware Version: 2
        Firmware Version: 1.18
        Topcard         : Unknown
        Vtarget         : 0.0 V
        Varef           : 0.0 V
        Oscillator      : Off
        SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.09s

avrdude: Device signature = 0x1e950f
avrdude: safemode: lfuse reads as 62
avrdude: safemode: hfuse reads as D9
avrdude: safemode: efuse reads as 7

avrdude: safemode: lfuse reads as 62
avrdude: safemode: hfuse reads as D9
avrdude: safemode: efuse reads as 7
avrdude: safemode: Fuses OK

avrdude done.  Thank you.
http://embodimentlabs.tumblr.com/
http://paulstrohmeier.info/

fkeel

This is the output later on. Note that the device id is still changing around seemingly arbitrarily.
Code: [Select]

Attached it as a .txt file, as its rather large...


I had the feeling this may have something to do with the capacitors I am using. I tried it without the 10uF cap, but that did not help. Two of my 0.1uf caps are essentially in parallel. I will try removing one and see if that changes anything.

As allways - open to suggestions.

EDIT: Just checked each and every connection again. No cold soldier joints, no soldier bridges.
I ran avrdude again, attaching the output of this trial as output2.txt
http://embodimentlabs.tumblr.com/
http://paulstrohmeier.info/

fkeel

I'm pretty sure its an issue with the resonator I'm using. I just replicated the circuit using dip parts and a 16Mhz Crystal (closest thing I have to 8mhz resonator) and everything works fine.

If I remove the crystal I get similar behavior.

Not quite sure how to fix this though. I want my board running with either an 8mhz resonator or no resonator at all.

Are their any obvious noobie mistakes in regards to resonators? Any simple way of debugging whether my resonator is working as it should?
http://embodimentlabs.tumblr.com/
http://paulstrohmeier.info/

ralphd

It looks like the CKSEL fuse settings are the same for an 8Mhz and 16Mhz crystal.  Try the 16Mhz crystal on the part you're having trouble with.

Go Up