ATTiny25 + USBasp Programmer uploads the program but doesn´t run

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello

 

I'm trying to run an example Blinking LED using a ATTiny25 being programmed by an USBasp, it does let me (upload the firmware) but nothing happens (the pin doesn't toggle). I'm configuring pin 5 as the toggling pin. I attach an image where you can see I'm selecting the USBasp as the programmer and the ATTiny25 as the processor, also the assembly code from the program (log.txt) and another image from the messages I get once I finish uploading the FW using Arduino IDE.

I'm using Arduino IDE 1.8.5

I have tried also AVRDUDESS 2.4 IDE and I get no errors after loaded the FW. Image attached.

 

Another comment, I have done the same procedure in 2 USBasp programmers just to discard the programmer HW.

 

I'm running out of ideas, any comment is highly appreciated.

 

Regards,

Pascal.

 

 

 

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You're using Arduino IDE and use assembly you wrote by yourself?
Where you got that assembly file? I believe it's not your own work.
How can you be certain that your code didn't work because your programmer? Not the code?
.
MG

I don't know why I'm still doing this hobby

Last Edited: Fri. Nov 3, 2017 - 09:24 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Could the problem be the arduino pin mapping to physical pins?

(Following from the core_pins.h file)

/*=============================================================================
  Pin definitions for the ATtiny85
=============================================================================*/

#if defined( __AVR_ATtinyX5__ )

#define PIN_B0  ( 0)
#define PIN_B1  ( 1)
#define PIN_B2  ( 2)
#define PIN_B3  ( 3)
#define PIN_B4  ( 4)
#define PIN_B5  ( 5)  /* RESET */

 

Arduino pin 5 is ATtiny pin B5 which is physical pin 1 (the RESET pin) on the ATtinyX5.

 

David (aka frog_jr)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I took the code from the example section in the IDE and then pointed to be pin 5. The assembly code attached was generated from a translator tool which took it from the generated hex file.

 

Regards,

Pascal.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm confused with your comment... when you use pinMode(pin,Mode), the pin parameter isn't the real physical pin that you are pointing to?

 

Regards,

Pascal.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Was the example designed for a tiny25/45/85?

I would change the int LED_BUILTIN = 5; to something else.

For example:

int LED_BUILTIN = 0;  // USE PIN_B0 on pin 5 (or 11)

 

The following can be a guide to what pins are available:

                                     DIP/SOIC/TSSOP   QFN/MLF

#define PIN_B0  ( 0)  <- Physical pin 5             11
#define PIN_B1  ( 1)  <- Physical pin 6             12
#define PIN_B2  ( 2)  <- Physical pin 7             14
#define PIN_B3  ( 3)  <- Physical pin 2               2
#define PIN_B4  ( 4)  <- Physical pin 3               5
#define PIN_B5  ( 5)  <- Physical pin 1               1  (NOTE: this is the RESET pin)
 

 

David (aka frog_jr)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

sch0bert wrote:
the pin parameter isn't the real physical pin that you are pointing to?

No. Arduino maps pins to their own format which is useful for boards that may have different processors & port/pin mapping.

 

(You posted the question while I was typing my previous post #6)

David (aka frog_jr)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

frog_jr wrote:
Arduino pin 5 is ATtiny pin B5 which is physical pin 1 (the RESET pin) on the ATtinyX5.

 

Try a different pin and see what happens!