a timer that goes logic high or low every 15mins ( using tiny85 chip)

Thread Starter

timtim1234

Joined Nov 30, 2023
246
Welcome to the world of electronics hardware and software, computers, programming, and debugging.

Your situation is not unique. Many times one is faced with multiple problems. For example, let us say that there are three problems happening at the same time. You cannot succeed if only one problem is resolved. Oftentimes, one of the problem is misinformation or a situation that is out of date.

When you finally have all the problems resolved and your system is up and running, you look back and think how "silly" was each problem.
So very true!!!
 

Thread Starter

timtim1234

Joined Nov 30, 2023
246
I think i got it!! and no i didnt fix the chip meaning the chip don't seems to be bricked!! i have to go i am running late!!...will try to run blink code later!!!

"C:\Users\Admin\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino18/bin/avrdude" "-CC:\Users\Admin\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.5.2/avrdude.conf" -v -pattiny85 -cstk500v1 -PCOM6 -b19200 -e -Uefuse:w:0xFF:m -Uhfuse:w:0b11010111:m -Ulfuse:w:0xE2:m "-Uflash:w:C:\Users\Admin\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.5.2/bootloaders/empty/empty_all.hex:i"

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

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

Using Port : COM6
Using Programmer : stk500v1
Overriding Baud Rate : 19200
Setting bit clk period : 5.0
AVR Part : ATtiny85
Chip Erase delay : 400000 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 12 4 0 no 512 4 0 4000 4500 0xff 0xff
flash 65 12 32 0 yes 8192 64 128 30000 30000 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 : 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 = 0x1e930b (probably t85)
avrdude: erasing chip
avrdude: reading input file "0xFF"
avrdude: writing efuse (1 bytes):

Writing | ################################################## | 100% 0.01s

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

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

avrdude: verifying ...
avrdude: 1 bytes of efuse verified
avrdude: reading input file "0b11010111"
avrdude: writing hfuse (1 bytes):

Writing | ################################################## | 100% 0.02s

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

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

avrdude: verifying ...
avrdude: 1 bytes of hfuse verified
avrdude: reading input file "0xE2"
avrdude: writing lfuse (1 bytes):

Writing | ################################################## | 100% 0.02s

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

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

avrdude: verifying ...
avrdude: 1 bytes of lfuse verified
avrdude: reading input file "C:\Users\Admin\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.5.2/bootloaders/empty/empty_all.hex"
avrdude: writing flash (2 bytes):

Writing | ################################################## | 100% 0.09s

avrdude: 2 bytes of flash written
avrdude: verifying flash memory against C:\Users\Admin\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.5.2/bootloaders/empty/empty_all.hex:
avrdude: load data flash data from input file C:\Users\Admin\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.5.2/bootloaders/empty/empty_all.hex:
avrdude: input file C:\Users\Admin\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.5.2/bootloaders/empty/empty_all.hex contains 2 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.05s

avrdude: verifying ...
avrdude: 2 bytes of flash verified

avrdude done. Thank you.
 

MrChips

Joined Oct 2, 2009
34,827
When you get something resolved it is helpful to others if you post in detail what you did to solve the problem.
This is what AAC is all about. We solve problems so that others can benefit.
 

Thread Starter

timtim1234

Joined Nov 30, 2023
246
Sorry, I was running late so I had to go. sooo Perhaps it does pay to ski down expert slopes on the first day of skiing :) anyway after hours of reading and videos this video seem to be my fix HOWEVER I haven't tried the blink code, yet I have to go again I hope later tonight try it the blink code


This video has TWO method of burning a bootloader, I did the FIRST method in the video.
 

Thread Starter

timtim1234

Joined Nov 30, 2023
246
Blink code working led is flashing: NOTE: MUST go to sketch then "upload using programmer" DO NOT click on the upload arrow button!! You will get a programmer not found error message, I think that was what it was. I am also going to assume my bootloader is working fine because led is blinking. Ohh I forgot I edit the blink code for the pin I want for output, I am using pin 5 on the tiny85, so the code would be this:
Code:
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(0, OUTPUT);
}

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

Sketch uses 464 bytes (5%) of program storage space. Maximum is 8192 bytes.
Global variables use 9 bytes (1%) of dynamic memory, leaving 503 bytes for local variables. Maximum is 512 bytes.
"C:\Users\Admin\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino18/bin/avrdude" "-CC:\Users\Admin\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.5.2/avrdude.conf" -v -pattiny85 -cstk500v1 -PCOM6 -b19200 "-Uflash:w:C:\Users\Admin\AppData\Local\Temp\arduino\sketches\CD7B76825CB18381C7B318B1012010E3/Blink.ino.hex:i"

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

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

Using Port : COM6
Using Programmer : stk500v1
Overriding Baud Rate : 19200
Setting bit clk period : 5.0
AVR Part : ATtiny85
Chip Erase delay : 400000 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 12 4 0 no 512 4 0 4000 4500 0xff 0xff
flash 65 12 32 0 yes 8192 64 128 30000 30000 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 : 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.03s

avrdude: Device signature = 0x1e930b (probably t85)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "C:\Users\Admin\AppData\Local\Temp\arduino\sketches\CD7B76825CB18381C7B318B1012010E3/Blink.ino.hex"
avrdude: writing flash (464 bytes):

Writing | ################################################## | 100% 0.72s

avrdude: 464 bytes of flash written
avrdude: verifying flash memory against C:\Users\Admin\AppData\Local\Temp\arduino\sketches\CD7B76825CB18381C7B318B1012010E3/Blink.ino.hex:
avrdude: load data flash data from input file C:\Users\Admin\AppData\Local\Temp\arduino\sketches\CD7B76825CB18381C7B318B1012010E3/Blink.ino.hex:
avrdude: input file C:\Users\Admin\AppData\Local\Temp\arduino\sketches\CD7B76825CB18381C7B318B1012010E3/Blink.ino.hex contains 464 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.36s

avrdude: verifying ...
avrdude: 464 bytes of flash verified

avrdude done. Thank you.
 
Last edited:

Thread Starter

timtim1234

Joined Nov 30, 2023
246
The circuit I am using for bootloader and to program tiny85 is this one at this link:

https://www.digikey.com/en/maker/tu...lash-the-arduino-bootloader-to-an-attiny85-ic

note: to add a LED for the above code, do this

Solder a resistor 220 ( i am using 1 k so led not as bright) to pin 5 of the tiny85 then the other end of that resistor goes to the anode end of the led and then the cathode end of the led goes to gnd which is pin 4 of the tiny85 chip.
 

be80be

Joined Jul 5, 2008
2,395
I posted that you have to use Ctrl-shift-U or it will not use the arduino as programmer you hit the arrow button it tells you progammer not found
 

LesJones

Joined Jan 8, 2017
4,511
Here is a version of the hex file for the ATTiny85 to run with the internal oscillator. To load it you will have to use the arduino to emulate a USBisp programmer. (I think this will be the way you are trying to load the boot loader into the ATTiny85.)
The active high 1 second pulse is on pin 5, the active low one is on pin 7 and the 0.5 hz square wave is on pin 7.

Les.
 

Thread Starter

timtim1234

Joined Nov 30, 2023
246
I posted that you have to use Ctrl-shift-U or it will not use the arduino as programmer you hit the arrow button it tells you progammer not found
that could be so many posts, and reading and videos i forget were everything comes from..lol and thanks for the help :)
 
Last edited:

Thread Starter

timtim1234

Joined Nov 30, 2023
246
Here is a version of the hex file for the ATTiny85 to run with the internal oscillator. To load it you will have to use the arduino to emulate a USBisp programmer. (I think this will be the way you are trying to load the boot loader into the ATTiny85.)
The active high 1 second pulse is on pin 5, the active low one is on pin 7 and the 0.5 hz square wave is on pin 7.

Les.

did you post a file? if so it didn't show up. I also selected internal 8 mhz osc so that should be done already?
 

LesJones

Joined Jan 8, 2017
4,511
Yes I did forget to attach the file. Here it is. Here is a tip to make using avrdude easier.
Create a text file with the commands for writing the file to the ATTiny and selecting the directoy path.
Then copy the line for the commanf from the text file and paste it into the command line window just after the prompt.
It saves a lot off typing.
This is an example .
-----------------------------------------------------------------------------------------
IR beam TX
ATtiny13

Writing
avrdude -p t13 -c usbasp -C avrdude.conf -U flash:w:filename.hex:i

Reading
avrdude -p t13 -c usbasp -C avrdude.conf -U flash:r:filename.hex:i


-----------------------------------------------------------------------------------------
ATtiny85

cd C:\

cd C:\Projects\AVR_Programming\Avrdude6 (This is the directory where averdude is on my computer.)

Writing
avrdude -p t85 -c usbasp -C avrdude.conf -U flash:w:filename.hex:i

Reading
avrdude -p t85 -c usbasp -C avrdude.conf -U flash:r:filename.hex:i

avrdude -p t85 -c usbasp -C avrdude.conf -U flash:w:Att85timer.hex:i

avrdude -p t85 -c usbasp -C avrdude.conf -U flash:r:filenameX.hex:i

avrdude -p t85 -c usbasp -C avrdude.conf -U lfuse:w:0x6A:m

avrdude -p t85 -c usbasp -C avrdude.conf -U flash:w:15Min_timer.hex:i (usbasp is the programmer I use. You will have to use the name that the aruino uses when programmed to behave as a usbisp)



Copy the hex file you plan to write into the sme directory as averdude (This saved putting the pathe to the hex file in the command line.

Les.
 

Attachments

Last edited:

Thread Starter

timtim1234

Joined Nov 30, 2023
246
Yes I did forget to attach the file. Here it is. Here is a tip to make using avrdude easier.
Create a text file with the commands for writing the file to the ATTiny and selecting the directoy path.
Then copy the line for the commanf from the text file and paste it into the command line window just after the prompt.
It saves a lot off typing.
This is an example .
-----------------------------------------------------------------------------------------
IR beam TX
ATtiny13

Writing
avrdude -p t13 -c usbasp -C avrdude.conf -U flash:w:filename.hex:i

Reading
avrdude -p t13 -c usbasp -C avrdude.conf -U flash:r:filename.hex:i


-----------------------------------------------------------------------------------------
ATtiny85

cd C:\

cd C:\Projects\AVR_Programming\Avrdude6 (This is the directory where averdude is on my computer.)

Writing
avrdude -p t85 -c usbasp -C avrdude.conf -U flash:w:filename.hex:i

Reading
avrdude -p t85 -c usbasp -C avrdude.conf -U flash:r:filename.hex:i

avrdude -p t85 -c usbasp -C avrdude.conf -U flash:w:Att85timer.hex:i

avrdude -p t85 -c usbasp -C avrdude.conf -U flash:r:filenameX.hex:i

avrdude -p t85 -c usbasp -C avrdude.conf -U lfuse:w:0x6A:m

avrdude -p t85 -c usbasp -C avrdude.conf -U flash:w:15Min_timer.hex:i (usbasp is the programmer I use. You will have to use the name that the aruino uses when programmed to behave as a usbisp)



Copy the hex file you plan to write into the sme directory as averdude (This saved putting the pathe to the hex file in the command line.

Les.
ok thanks for the tip! the hex you posted is for a 15 min timer. is there a way i can get the UNO code for that too?
 

LesJones

Joined Jan 8, 2017
4,511
I find writing in the version of C used by the arduino mor difficult than assembler. So you would have to try to understnd hoe the program works and use it as a guide to writing arduino code. I have attached the source code. this is just a text file with a .asm extension that is used by atmel studio. (I am using version 6)
Have you tried to program the ATTiny 85 from the .hex file ?

Les
 

Attachments

Thread Starter

timtim1234

Joined Nov 30, 2023
246
I find writing in the version of C used by the arduino mor difficult than assembler. So you would have to try to understnd hoe the program works and use it as a guide to writing arduino code. I have attached the source code. this is just a text file with a .asm extension that is used by atmel studio. (I am using version 6)
Have you tried to program the ATTiny 85 from the .hex file ?

Les
ok thanks and no i haven't tried programming from a hex file yet.
 

Thread Starter

timtim1234

Joined Nov 30, 2023
246
i just looked at that file hum assembler looks more difficult to me but, like everything, once you learn it then over time its not as bad.
 

Thread Starter

timtim1234

Joined Nov 30, 2023
246
Well I have been playing around ( a big thanks to everyone that has helped) with this tiny85 wow it can do a a lot!!!
I have a friend who also started to mess around with the tiny85 too :)

we are finding out, that we are running of i/o pins fast..lol

so my question is what is the next chip that is the same as the tiny85 ( Dip package, stand alone chip) but with more pins and can be programmed with an Arduino too?

Thanks
 

Thread Starter

timtim1234

Joined Nov 30, 2023
246
Also, it looks like (unless I am not understanding it right) that pin 1 on the tiny85 can only be programmed for it to be an output pin by setting a fuse. However, doing so, then the isp programmer won't work to program the chip. Is this correct?
 
Top