Go Down

Topic: ATtiny 841 Programming Error (Device Signature) (Read 680 times) previous topic - next topic

Ccope19

Mar 22, 2019, 05:49 pm Last Edit: Mar 22, 2019, 06:28 pm by Ccope19
Short Version:  I burned the bootloader using the "ATtiny Modern" version of the "ATtiny841 (optiboot)" board with a 16MHz external crystal by using an Arduino Uno R3 as an ISP.  After that, I went to upload my code (same settings) and it gave me an error saying "Device signature = 0x1e950f", which I think is for the ATmega328P based on what I've found on Google, and "Expected signature for ATtiny841 is 1E 93 15".  When I burnt the bootloader, the output did say that the signature was 0x1e9315 so I'm not sure why it's different to upload code when none of the settings were changed.  Anybody have any idea of what went wrong and how I can fix it?

AVRdude output:
Code: [Select]
avrdude: Version 6.3, compiled on Jan 17 2017 at 12:00:53
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\arduino-1.8.5\hardware\arduino-tiny-841-master\avr/avrdude.conf"

         Using Port                    : COM3
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
         Setting bit clk period        : 5.0
         AVR Part                      : ATtiny841
         Chip Erase delay              : 15000 us
         PAGEL                         : P00
         BS2                           : P00
         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        512    4      0  4000  4500 0xff 0xff
           flash         65    12    32    0 yes      8192   16    512  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          1    0      0     0     0 0x00 0x00

         Programmer Type : Arduino
         Description     : Arduino
         Hardware Version: 3
         Firmware Version: 4.4
         Vtarget         : 0.3 V
         Varef           : 0.3 V
         Oscillator      : 28.800 kHz
         SCK period      : 3.3 us

avrdude: AVR device initialized and ready to accept instructions

An error occurred while uploading the sketch
Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f
avrdude: Expected signature for ATtiny841 is 1E 93 15
         Double check chip, or use -F to override this check.

avrdude done.  Thank you.


sections of avrdude config file:
Code: [Select]

     id            = "t841";
     desc          = "ATtiny841";
     has_debugwire = yes;
     flash_instr   = 0xB4, 0x07, 0x17;
     eeprom_instr  = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
               0xBC, 0x07, 0xB4, 0x07, 0xBA, 0x0D, 0xBB, 0xBC,
               0x99, 0xE1, 0xBB, 0xAC;
## no STK500 devcode in XML file, use the ATtiny45 one
     stk500_devcode   = 0x14;
##  avr910_devcode   = ?;
##  Try the AT90S2313 devcode:
     ##avr910_devcode   = 0x20;
     signature        = 0x1e 0x93 0x15;
     reset            = io;
     chip_erase_delay = 15000;

Code: [Select]
#   ATtiny841 has Signature Bytes: 0x1E 0x93 0x0C.
     memory "signature"
         size            = 3;
         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";

DrAzzy

#1
Mar 23, 2019, 01:09 am Last Edit: Mar 23, 2019, 01:15 am by DrAzzy
If you do upload with the optiboot board def selected, it tries to upload using the bootloader, so its talking to the bootloader on the arduino uno you were using as isp (which reports that its a 328p, causing avrdude to stop the process).

If you want to use the bootloader, connect a serial adapter as described in the attinycore docs.

If you dont want to use a bootloader, and want to just upload via isp, select the (no bootloader) version. (You do still have to do burn bootloader to set the fuses - this is the standard arduino behavior)

Btw - are you still using the ATtiny Modern core, instead of the unified ATtinyCore? I combined them ages ago and have been adding new features and fixes to the combined version only, see link in my sig or github. The biggest feature is probably the unified wire/spi libraries - you can now just use Wire.h and SPI.h and unmodified libraries for i2c/spi devices - you dont need special versions and libraries adapted for ATtiny parts. Everything is automagically handled for you by the special version of those libraries included with the core. Export compiled binary also outputs assembler listings now too.
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

Ccope19

#2
Mar 24, 2019, 06:40 pm Last Edit: Mar 24, 2019, 08:04 pm by Ccope19
I'll see if that works.  As for ATtinyCore, I'm using a school laptop and they blocked GitHub so I had to try to find a way around it by downloading the core from home.  I think they just unblocked it on the computer's we filter but it's still blocked on the routers at school.  When installing it, should I delete the old cores first or leave them and install the new one?

*edit*  It turns out that I did have the ATtinyCore installed and I was able to link it with the URL instead of manually installing it.  I decided to delete both libraries and make sure the core was updated through the boards manager.  Thanks for your help, I'll see if choosing no optiboot works on Monday because all of my equipment at school.  I only have an ICSP header on the pcb so I can't use a serial interface. 

DrAzzy

#3
Mar 24, 2019, 08:01 pm Last Edit: Mar 24, 2019, 08:02 pm by DrAzzy
If you have manually installed the core, you should delete it before installing via board manager (or manually installing the latest version). That said, the version you get by downloading from github and manually installing is usually a few updates ahead of the one you get from board manager - see https://github.com/SpenceKonde/ATTinyCore/blob/master/ChangesNotInBoardManagerYet.md


The school... which is trying to teach computer related things... has blocked github? I'm just speechless.
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

Ccope19

#4
Mar 25, 2019, 03:08 pm Last Edit: Mar 25, 2019, 03:24 pm by Ccope19
I know right, all I needed was access over ethernet to connect a raspberry pi running octoprint for a school 3D printer and now it can't automatically update... at least they forced me to learn how to bypass securities...

Ok, new error... maybe because it isn't the most up to date?  It has optiboot burned onto it and then I used the ATtiny841 (no optiboot).

Code: [Select]
avrdude: Version 6.3, compiled on Jan 17 2017 at 12:00:53
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\arduino-1.8.5\portable\packages\arduino\tools\avrdude\6.3.0-arduino9/etc/avrdude.conf"

avrdude: AVR Part "attiny841" not found.

Then it says a bunch of valid parts... and ends with this:
Code: [Select]

  ucr2     = deprecated, use 'uc3a0512' [C:\arduino-1.8.5\portable\packages\arduino\tools\avrdude\6.3.0-arduino9/etc/avrdude.conf:14615]


*edit*
I'm not too sure that it's because I used the board manager because there wasn't anything listed in the changes not yet in the board manager that would indicate it's missing.  I search the avrdude config file and there's no mention of the ATtiny841...  I even tried installing the core manually (cellular hotspot to bypass the web filter  ;) )

*edit 2*
I thought that maybe because I have a portable version of Arduino IDE (I didn't have admin access when I installed arduino... I've since found a way around that but haven't needed to change Arduino so I left it) that the core was in the wrong location so I made a copy and put it in the C:\arduino-1.8.5\portable\packages folder but that didn't change anything. 

DrAzzy

#5
Mar 25, 2019, 05:09 pm Last Edit: Mar 25, 2019, 05:10 pm by DrAzzy
Use the programmer option that has the (ATTinyCore) after the name - there's a longstanding "feature" of the IDE that causes it to ignore the directives of a custom hardware package's platform.txt that direct the IDE to use the avrdude.conf file that the custom hardware package supplies when uploading sketches to the board when using an ISP programmer, if the selected programmer was not supplied by a custom hardware package. So it uses the default avrdude.conf which doesn't contain definitions for a large number of parts. ATTinyCore supplies a duplicate of the programmer definitions to work around this stupid behavior, these are named with (ATTinyCore) after the name of the programmer.
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

Ccope19

#6
Mar 27, 2019, 04:48 pm Last Edit: Mar 27, 2019, 06:18 pm by Ccope19
Ok, everything works now except I am suddenly receiving an error when compiling for upload...

Code: [Select]
avr-gcc: error: C:\Users\1006602\AppData\Local\Temp\arduino_build_521022/..\arduino_cache_581922\core\core_ATTinyCore-master_avr_attinyx41_chip_841,LTO_disable,clock_16external,eesave_aenable,bod_1v8,bodact_disabled,bodpd_disabled,pinmapping_anew,wiremode_amaster_b38033a7b4a180433b55889669b5e250.a: No such file or directory

exit status 1
Error compiling for board ATtiny441/841 (No bootloader).


It happens on every sketch I try including new ones... I'm not sure why because it didn't used to do this.

*edit*
I read your read-me document in the downloaded core, really useful stuff... probably should have read that before :smiley-sweat: .  I'll downgrade my board version to 1.6.21 and see what happens.

*edit 2*
Nope, same error...

DrAzzy

Do sketches for standard AVR-based Arduino boards compile successfully? That looks like the core.a file not found error, but that typically effects all boards, whether or not from a custom core (and is related, IIRC, to an overly-aggressive antivirus program interfering with the compilation process).
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

Ccope19

Yeah, normal sketches compile and I'm able to upload them to other microcontrollers.  The error only comes when attempting to upload to the 841.  I'll try it on a home computer to see if it's something with the school's settings. 

When I was setting up a 32u4 for the same project, it was weird because it wouldn't let me burn the Pro Micro bootloader but it would let me burn the Leonardo bootloader.  Once that was there, it then let me burn the Pro Micro bootloader...

Ccope19

SUCCESS!

So after literally a month of research and testing, I figured out that even though the original method described above wasn't working due to some mysterious error...  I was able to keep the '841 w/ optiboot' selected and use the hotkey CTRL+SHIFT+U for uploading with a programmer in order to successfully upload a sketch.  I didn't want to use an FTDI programmer because it is slower and I didn't have one on hand (plus all of my designs were based on the use of the ICSP header).  Both methods of uploading a sketch are supposed to bypass the arduino as an ISP so that the computer thinks its talking directly to the ATtiny841 but obviously selecting w/o optiboot didn't want to work.  Plus this is an easier method to.  Thanks for your help on with this DrAzzy even though half my questions were literally in your "ReadMe" document  :smiley-sweat: .

DrAzzy

SUCCESS!

So after literally a month of research and testing, I figured out that even though the original method described above wasn't working due to some mysterious error...  I was able to keep the '841 w/ optiboot' selected and use the hotkey CTRL+SHIFT+U for uploading with a programmer in order to successfully upload a sketch.  I didn't want to use an FTDI programmer because it is slower and I didn't have one on hand (plus all of my designs were based on the use of the ICSP header).  Both methods of uploading a sketch are supposed to bypass the arduino as an ISP so that the computer thinks its talking directly to the ATtiny841 but obviously selecting w/o optiboot didn't want to work.  Plus this is an easier method to.  Thanks for your help on with this DrAzzy even though half my questions were literally in your "ReadMe" document  :smiley-sweat: .
You *really* shouldn't have to do that.

So with everything the same as your working setup, but ATtiny841 (no bootloader) selected, upload gives the part not found error still?
What programmer option are you using? Is it one with (ATTinyCore) after the name?

Try using Upload Using Programmer with ATtiny841 (no bootloader) selected?

ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

Ccope19

#11
Apr 26, 2019, 05:58 pm Last Edit: Apr 26, 2019, 06:41 pm by Ccope19
You *really* shouldn't have to do that.

So with everything the same as your working setup, but ATtiny841 (no bootloader) selected, upload gives the part not found error still?
What programmer option are you using? Is it one with (ATTinyCore) after the name?

Try using Upload Using Programmer with ATtiny841 (no bootloader) selected?
ATTinyCore is selected for the board(s) and programmer and I am using "Arduino as ISP (ATTinyCore)"  These are the results after some testing with chip selection and upload method:
- Optiboot & Normal: Fail (Fuses, expected)
- Optiboot & Programmer: Functions
- No Bootloader & Normal: Fail (Missing file, unexpected)
- No Bootloader & Programmer: Fail (Missing file, unexpected)

This is the test code I used to see if it would upload:
Code: [Select]

/*
 * Keyboard Test 2.1
 * 4/5/19
 * Created by Ccope19
 */
 
void setup() {
  // pins go to buttons which are connected to GND
  pinMode(4, OUTPUT);           // SDA Output
}

void loop() {
  digitalWrite(4, LOW);
  delay(250);
  digitalWrite(4, HIGH);
  delay(250);
}


I'm able to write to digital pins but I'm having trouble using the digitalRead command.  I have buttons that connect to GND and the internal pullup resistor.  I've verified that all of my solder joints are good and my mechanical key switches function as well as verifying the code on a Pro Micro and Uno.  Is there something that's is different for the '841?

Code: [Select]

void setup() {
  // put your setup code here, to run once:
  pinMode(10,INPUT_PULLUP);
  pinMode(4, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  int a = digitalRead(10);
  if (a == HIGH){
    digitalWrite(4, LOW);
  }
  else {
    digitalWrite(4, HIGH);
  }
}


I have tested the I2C communication with the SlaveRecieve/MasterWrite code under the Wire reference.  I'm using both Master and Slave on the '841 because it will be communicating back and forth with a 32u4.

DrAzzy

Are you using the pin mapping you think youre using? There is a clockwise and counterclockwise configuration option. Make sure you are using the correct one for the pin numbers you're using.

It is expected that with Arduino as ISP (without the ATTinyCore after it) it will fail.

Wait - when you are trying to upload to a board using optiboot, have you connected a serial adapter to the ATTiny and selected the corresponding COM port? That's how you're supposed to do normal sketch uploads with optiboot - it looks like you're still talking to the Arduino that you had used as an ISP.


I will see if I can reproduce your problem with non-optiboot board def.
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

Ccope19

#13
Apr 27, 2019, 02:49 am Last Edit: Apr 27, 2019, 02:54 am by Ccope19
Actually I'm not sure for pin mapping,  my tests with digital 4 and I2C worked right.  I'm using a pinout like this (with physical pin 1 being the top left, marked by a dot on the chip):

VCC               -1      14-   GND
XTAL1            -2     13-   D10/A0/AREF
XTAL2           -3     12-   D9/A1/TX0
Reset            -4      11-   D8/A2/RX0
D2                 -5     10-   D7A3
D3/A7/SS    -6       9-   D6/A4/SCL/SCK
SDA/MOSI   -7       8-   D5/A5/MISO

My pin mapping is set to clockwise because counterclockwise says for the old ATTinyCore.  I'm selecting the COM port that the UNO is connected to and using the UNO as an ISP.  I select the ATTinyCore version of the programmer and select Optiboot for the '841.  I have a 16MHz crystal onboard and have both wire modes selected.  All of the B.O.D., LTO, EEPROM, and UART setting are whatever are default (typically disabled) because I don't fully know what each one does, mainly the B.O.D. and LTO settings. 

D2, D3, D7, D8, D9, & D10 are all supposed to be set as INPUT_PULLUP for the buttons and then my only output is an I2C header.  The only other connection is the ICSP header for programming.


DrAzzy

#14
Apr 27, 2019, 06:29 am Last Edit: Apr 27, 2019, 07:17 am by DrAzzy
Counterclockwise is the pinout you described, see the pinout chart in the documentation. And as you can see you have pins numbered in counterclockwise order.

Wire.h configures the pins used regardless of which pin mapping is selected (and manages pin modes for them as it needs to change the pin mode during operation.)
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

Go Up