Go Down

Topic: DFRobot Romeo as ArduinoISP - Problem programming ATtiny (Read 220 times) previous topic - next topic

TruePatrick

Hello,
I've been having a problem programming my avr ATtiny 2313A PU20.
To program It, I am using Romeo V2 port.

I can easly send the sketch ArduinoISP from examples to the romeo with changing:
RESET pin as 10
And heart beat as led pin 13. After programming, the led starts a heart beat.

Later I tried to burn the bootloader.
Occured error:

avrdude: stk500_getsync(): not in sync: resp=0x00

The settings:
Board- Attiny2313 (1Mhz internal clock) (tried also 8Mhz)
Programmer: Arduino as ISP

I've checked the wiring and it is good.
Also tried several arduino software from 1.0.5 to the newest 1.8..


I've found a dfrobot forum how to use boards to burn bootloaders link

Click: ctrl+F and type romeo

There are some instructions how to wire with the chipBUT THE IMAGES ARE MISSING.

Thank you kindly for help.


pert

I've deleted your other cross post @TruePatrick.

Cross posting is against the rules of the forum. The reason is that duplicate posts can waste the time of the people trying to help. Someone might spend 15 minutes writing a detailed answer on this thread, without knowing that someone else already did the same in the other thread.

Repeated cross posting will result in a suspension from the forum.

In the future, please take some time to pick the forum section that best suits the topic of your question and then only post once to that forum section. This is basic forum etiquette, as explained in the sticky "How to use this forum - please read." post you will find at the top of every forum section. It contains a lot of other useful information. Please read it.

Thanks for your cooperation.

TruePatrick

Sorry, I wanted to delete that post, but couldn't find the button for it. Later I disovered the function "move to another section". If you find that necessary, delete this post please.

DrAzzy

sync error indicates failure to communicate with the board being used as ISP programmer.

Did you remember to upload ArduinoISP sketch onto the Arduino being used as programmer?

Use a recent version of the IDE; there are issues with using a Leonardo-alike (32u4 based board) - working around that was what led to normal Arduino boards (eg, Uno/Nano/etc) needing a 10uF cap between reset and ground.

My core (ATTinyCore - https://github.com/SpenceKonde/ATTinyCore ) deals with this by having a separate entry for Arduino as ISP (ATTinyCore) and Arduino as ISP (ATmega32U4, ATTinyCore). If you are using my core (which is recommended - it supports more parts, and is slightly more flash efficient compared to the commonly used damellis core, and is actively maintained) - it can be installed through board manager as well on versions of the IDE that support that. ), I think you want Arduino as ISP (ATmega32U4, ATTinyCore) selected.
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

TruePatrick

#4
Aug 24, 2019, 08:03 pm Last Edit: Aug 24, 2019, 08:16 pm by TruePatrick
Thank you for reply,
Did you remember to upload ArduinoISP sketch onto the Arduino being used as programmer?
Yes I did Sir

My core (ATTinyCore - https://github.com/SpenceKonde/ATTinyCore ) deals with this by having a separate entry for Arduino as ISP (ATTinyCore) and Arduino as ISP (ATmega32U4, ATTinyCore).
Actually, I did use this core - ATtinyCore from Spence Konde 1.3.0 version

I think you want Arduino as ISP (ATmega32U4, ATTinyCore) selected.
I've tried this on 2 boards. DFRobot Romeo V2 (which is leonardo compatible) and clone of arduino UNO

working around that was what led to normal Arduino boards (eg, Uno/Nano/etc) needing a 10uF cap between reset and ground.
Since, I've seen in tutorials people who were using UNO I did use 10uF capacitor as well.

Right now I'm trying programming ATtiny 2313A with my romeo board again.

One more thing, when I am uploading ArduinoISP to the board, Which Programmer do i have to choose? AVRISP mkll OR Arduino as ISP

TruePatrick

#5
Aug 24, 2019, 08:10 pm Last Edit: Aug 24, 2019, 08:12 pm by TruePatrick
Here are settings from TOOLS. Are they chosen correctly? The Chip is ATtiny 2313A-PU

DrAzzy

When you upload ArduinoISP to the board, that is a normal upload. Tools -> Programmer is not used for normal uploads to a board with a bootloader. Doesn't matter what you choose.

Those options are fine - though most people choose to have the board run at 8MHz.
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

TruePatrick

#7
Aug 24, 2019, 11:58 pm Last Edit: Aug 25, 2019, 12:00 am by TruePatrick
It is brand new chip. Never been programmed. Bootloader option didnt work. I've tried also with the capacitor to the reset and ground pin.
Here's the error:
Code: [Select]

Arduino:1.8.9 (Windows 10), Płytka:"ATtiny2313/4313, Enabled, ATtiny2313, 8 MHz (internal), EEPROM retained, B.O.D. Disabled, no, Enabled, Port A (pins 2,3,17)"

C:\Users\Patryk\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude -CC:\Users\Patryk\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.3.0/avrdude.conf -v -pattiny2313 -carduino -PCOM3 -b19200 -e -Uefuse:w:0xFF:m -Uhfuse:w:0b10011111:m -Ulfuse:w:0xE4:m

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

         System wide configuration file is "C:\Users\Patryk\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.3.0/avrdude.conf"

         Using Port                    : COM3
         Using Programmer              : arduino
         Overriding Baud Rate          : 19200
         Setting bit clk period        : 5.0
         AVR Part                      : ATtiny2313
         Chip Erase delay              : 15000 us
         PAGEL                         : PD4
         BS2                           : PD6
         RESET disposition             : possible i/o
         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     6     4    0 no        256    4      0  4000  4500 0xff 0xff
           flash         65     6    64    0 yes      2048   32     64  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  9000  9000 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           calibration    0     0     0    0 no          2    0      0     0     0 0x00 0x00

         Programmer Type : Arduino
         Description     : Arduino
         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.00s

avrdude: Device signature = 0xffffff (retrying)

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0xffffff (retrying)

Błąd przy wgrywaniu bootloadera.
Reading | ################################################## | 100% 0.00s

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


avrdude done.  Thank you.


I've checked connections twice using this chip schematic link and arduino isp code.

DrAzzy

Wiring problem MISO shorted to VCC (or other wiring mistakes that end up looking the same)
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

TruePatrick

It's not the first time I get this error. I always check the wiring. What could be a problem here? Honestly I am tired and ashamed that I can not program this single chip.

TruePatrick

#10
Aug 25, 2019, 03:36 pm Last Edit: Aug 25, 2019, 03:37 pm by TruePatrick
Success! Give me a quick moment to explain step by step what I did for the future romeo V2 programmers!

TruePatrick

#11
Aug 25, 2019, 03:56 pm Last Edit: Aug 25, 2019, 04:08 pm by TruePatrick
I solved problem concerning programming ATtiny 2313A-PU using DFRobot Romeo V2.2 board.

First, upload code Arduino as ISP code from examples.

Most important line that I have modified is this:

Code: [Select]

#define RESET     10 // Use pin 10 to reset the target rather than SS
#define LED_HB    13
#define LED_ERR   8
#define LED_PMODE 7


Next step is to click upload. You should see led blinking which is soldered to the board (next to the usb port).

Next, we will connect pins. We are going to use ICSP pins (which are 6 pins next to the proccesor - see pictures Connection below).
To connect pins Romeo to chip ATtiny use this schematic:
-Romeo schematic - I know it is not Romeo V2 board but it is very similiar.
-Connect pin 10(Romeo digital) as RESET(attiny2313A)
-Connect the capacitor RST(romeo) to Ground(romeo)
For all the connection check Connections file in attachements

Check pinout for your chip. In my case I used this site for the ATtiny2313A link

Open Arduino IDE and in the menu preferences paste this:
Code: [Select]
http://drazzy.com/package_drazzy.com_index.json
and upload additional board in the board maneger.

Next step is to burn bootloader. Check file Bootloader-Attiny2313 in the attachements.
Simple click Burn Bootloader.

Next is to check if we can program this chip.
Paste this code to the Arduino IDE:
Code: [Select]

/*
  Blink

  Turns an LED on for one second, then off for one second, repeatedly.

  Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO
  it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to
  the correct LED pin independent of which board is used.
  If you want to know what pin the on-board LED is connected to on your Arduino
  model, check the Technical Specs of your board at:
  https://www.arduino.cc/en/Main/Products

  modified 8 May 2014
  by Scott Fitzgerald
  modified 2 Sep 2016
  by Arturo Guadalupi
  modified 8 Sep 2016
  by Colby Newman

  This example code is in the public domain.

  http://www.arduino.cc/en/Tutorial/Blink
*/

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(6, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(6, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(6, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second
}

And connect Led Pin as showed in the Connection files.
Click upload and Do Not change any settings. You should see no errors.

It really took me few days to program my first chip. I'm glad that this worked out. Hope you won't have any problems. Cheers!

Go Up