Go Down

Topic: MicroCore - An optimized and efficient Arduino core for ATtiny13 (Read 11132 times) previous topic - next topic

ideveloper

Dear people,

I am using also this core and have a problem with the device signature.

I built a very easy circuit with ATtiny13 as in all examples.


Using an Arduino UNO as ISP. Setup board and params correctly, UNO has the ISP already programmed in.

If I click burn bootloader, the following comes.

avrdude: Version 6.3, compiled on Jan 17 2017 at 12:01:35
        Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
        Copyright (c) 2007-2014 Joerg Wunsch

        System wide configuration file is "/Users/cantezcan/Library/Arduino15/packages/MicroCore/hardware/avr/1.0.3/avrdude.conf"
        User configuration file is "/Users/cantezcan/.avrduderc"
        User configuration file does not exist or is not a regular file, skipping

        Using Port                    : /dev/cu.usbmodem1421
        Using Programmer              : stk500v1
        Overriding Baud Rate          : 19200
        Setting bit clk period        : 32.0
        AVR Part                      : ATtiny13
        Chip Erase delay              : 4000 us
        PAGEL                         : P00
        BS2                           : P00
        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  MaxW   ReadBack
          ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
          eeprom        65     5     4    0 no         64    4      0  4000  4000 0xff 0xff
          flash         65     6    32    0 yes      1024   32     32  4500  4500 0xff 0xff
          signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
          lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
          calibration    0     0     0    0 no          2    0      0     0     0 0x00 0x00
          lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
          hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00

        Programmer Type : STK500
        Description     : Atmel STK500 Version 1.x firmware
        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.02s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x000000 (retrying)

Error while burning bootloader.
Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
        Double check connections and try again, or use -F to override
        this check.


avrdude done.  Thank you.

------------------------------

if I try to use the -F flag from command line, than it comes other message


avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
avrdude: Expected signature for ATtiny13 is 1E 90 07
avrdude: safemode: hfuse reads as 0
avrdude: erasing chip
avrdude: reading input file "0x3f"
avrdude: writing lock (1 bytes):

Writing |                                                    | 0% 0.00s ***failed; 
Writing | ################################################## | 100% 0.07s

avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0x3f:
avrdude: load data lock data from input file 0x3f:
avrdude: input file 0x3f contains 1 bytes
avrdude: reading on-chip lock data:

Reading | ################################################## | 100% 0.01s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
         0x00 != 0x3f
avrdude: verification error; content mismatch

avrdude: safemode: hfuse reads as 0
avrdude: safemode: Fuses OK (E:FF, H:00, L:00)

avrdude done.  Thank you.



What should I do, that I got a device ID ? or what should I do to overcome this verification error?
I appreciate any help

westfw

A device signature of 0 is almost always a wiring problem with the ISP connections.

Sorontik

Hello  :)

Thanks to hansibull. MicroCore seems to be really cool, especially the ability to burn fuses without having to deal with the binaries :D
The Installation via Boardmanager worked smoothly and could not have been easier.

Unfortunately i struggle with the next part: AVRDude keeps complaining about protocol issues and i can't find the problem...

I want to use an Arduino Nano as Programmer to program an ATTiny13A-PU, so I connected them like this:
Code: [Select]

Nano ISP -> ATTiny

MISO -> PB1 (6) MISO
MOSI -> PB0 (5) MOSI
SCK   -> PB2 (7) SCK
D10   -> PB5 (1) RST


5V   -> (8)
GND -> (1)

uploaded the Arduino as ISP Sketch and tried to flash the following (default) Settings to my Tiny:

BOD : 2,7V
LTO : yes
Clock: 9,6MHz internal

with

Port: COM4 (where my Nano is)
Programmer: "Arduino as ISP"

but it did not work.

This is the Output of AVRDude:

Code: [Select]

avrdude: Version 6.3-20171130
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Users\name\AppData\Local\Arduino15\packages\MicroCore\hardware\avr\1.0.3/avrdude.conf"

         Using Port                    : COM4
         Using Programmer              : arduino
         Overriding Baud Rate          : 19200
         Setting bit clk period        : 32.0
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x15
Fehler beim Brennen des Bootloaders.
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x15
         AVR Part                      : ATtiny13
         Chip Erase delay              : 4000 us
         PAGEL                         : P00
         BS2                           : P00
         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  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65     5     4    0 no         64    4      0  4000  4000 0xff 0xff
           flash         65     6    32    0 yes      1024   32     32  4500  4500 0xff 0xff
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           calibration    0     0     0    0 no          2    0      0     0     0 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00

         Programmer Type : Arduino
         Description     : Arduino

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x14

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x02

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x10
         Hardware Version: 4744608
         Firmware Version: 0.4611299
         Topcard         : STK502
         Vtarget         : 1.8 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: stk500_initialize(): (b) protocol error, expect=0x10, resp=0x01
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x10

avrdude done.  Thank you.


I already did the following:
  • double-check wiring from ISP-Header to Tiny
  • re-upload Arduino as ISP Sketch to Programmer
  • check if Baudrates in AISP and AVRDude match
  • reconfigure and re-upload AISP to use old-style wiring (Pins 10-13), re-wire and double-check
  • try a different ATTiny13
  • add capacitor between 5V and GND parallel to Tiny
  • add external 10k pullup-Resistor for RST(1)



When i monitor the MISO/MOSI/SCK/RST signals on my scope, all but RST are normally LOW which is as I expected.
Yet, after starting the burning sequence, all i see is a 100ms HIGH pulse on SCK.
The others remain unchanged :/

(btw: the three indicator-LEDs of the Arduino as ISP work as always)

I'm done, got no ideas left.
Can anyone give me a hint on what i'm missing?

PS: feel free to ask, if you need further details ;)

pert

AVRDude keeps complaining about protocol issues and i can't find the problem...
Try connecting a 10 uF capacitor between the reset and ground pins on your Nano.

Sorontik

Thanks, that works   8)  8)  8)

Try connecting a 10 uF capacitor between the reset and ground pins on your Nano.
I now have to reset my Nano manually when uploading something to it, but at least i can access my Tiny now.

Can you explain how you came up with this idea and why you choose exactly 10uF?



After disabling LTO, i was finally able to program my tiny Tiny :D
Thanks so much to pert and hansibull, you made using the ATTiny a LOT easier :D

pert

I now have to reset my Nano manually when uploading something to it, but at least i can access my Tiny now.
You can also remove the capacitor when you upload, if you prefer.

Can you explain how you came up with this idea and why you choose exactly 10uF?
It's recommended in the Arduino as ISP tutorial:
https://www.arduino.cc/en/tutorial/arduinoISP
but for some reason that tutorial only recommends it for the Mega, not for the Uno. The reason for the capacitor is to disable the circuit that automatically resets the Nano when the serial connection is opened to do the upload to the ATtiny13. If the Nano resets, it causes the process to fail. As you discovered, the reason for that auto-reset circuit is to allow you to upload to your Nano without needing to press the reset button manually at just the right time. Previously, most people could get by without the capacitor. Recently, Arduino changed the protocol used by the Arduino as ISP programmer in order to allow it to be used also with Leonardo, Micro, etc. Unfortunately, that change also made it more likely that the capacitor would be needed. For this reason, the change has been reverted and a new programmer added specifically for using Leonardo et al for Arduino as ISP. There has not yet been a release that contains the reversion.

I'm sure you can get by with a range of capacitor values anywhere around 10 uF.

Thanks so much to pert and hansibull, you made using the ATTiny a LOT easier :D
You're welcome. I'm glad to hear it's working now. Enjoy!
Per

Sorontik


skywalker34

Hi,
Thanks for this microcore, now I am trying to program my fist ATTiny13.
I am using ARDUINO IDE 1.8.5 on windows 10 PC
I setup the link and get the package in the board manager
I select the ATTiny13 in the board
I use USBasp device to DL
I try first the blink to test and it works
I DL the "clockTune" and adapt the oscillator => works !
I DL "Echo" and it works !

Now I DL the example "ReadASCIIString" but get compilation error "Serial was not declared in this scope" pointing any Serial.xxx (try to comment every time)

Any idea what's wrong ?

Rgds

hansibull

Can you turn on verbose compilation in the IDE settings and post the complete compilation and error message?
MightyCore -  ATmega1284, mega644, mega324, mega164, mega32, mega16, mega8535
Github.com/MCUdude/MightyCore

MiniCore - ATmega8, mega48, mega88, mega168, mega328
Github.com/MCUdude/MiniCore

Go Up