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

Thread Starter

timtim1234

Joined Nov 30, 2023
246
Re post #236.
1 The main reason for disabling the divide by 8 is to clock the cpu at 8 Mhz (Rather than 1 Mhz) as this is the value required when you set up the Arduino to us the ATtiny 85.
2 I have used a USBasp programmer since I first started programming atmel 8 bit microcontrollers about 10 years ago. I have never had any problems using the USBasp programmers.
Here a screen capture of using the arduino isp programmer. I don't think it is comunicating with the ATtiny85 as it can't even read the signature byte.
View attachment 329677
3 I did not try to use avrduess in the same way as you did.

1). ahh ok i see what you mean so once its "Setup" then a person can use 1mhz? I would assume it would just run the code slower which could be an issue if a person is using alot of timers,etc? is this correct?

2) change your -c to this -c stk500v1 for the arduino isp programmer

3). try it using avrduess just to see if it works then
 

be80be

Joined Jul 5, 2008
2,395
I thought someone said in the thread that the bootloader is need to use the chip by itself
They probably did but thats not true bootloader is for loading code but the chip will run code that's loaded with a programmer without the boot loader
plus you can have more code.

What you have posted you didn't burn a boot loader you set the fuses with the empty_all_hex
 
Last edited:

BobTPH

Joined Jun 5, 2013
11,524
The purpose of the boot loader in the Arduino ecosystem is so that Arduino boards be used without a programmer. With a programmer, it is not needed. I have never used a boot loader myself for dozens of PIC boards I have made.
 

Thread Starter

timtim1234

Joined Nov 30, 2023
246
They probably did but thats not true bootloader is for loading code but the chip will run code that's loaded with a programmer without the boot loader
plus you can have more code.

What you have posted you didn't burn a boot loader you set the fuses with the empty_all_hex
hummm what you mean i didn't burn a bootloader? I edited the boot loader ino? well i thought that is what it was doing when i click on burn bootloader??
 

Thread Starter

timtim1234

Joined Nov 30, 2023
246
The purpose of the boot loader in the Arduino ecosystem is so that Arduino boards be used without a programmer. With a programmer, it is not needed. I have never used a boot loader myself for dozens of PIC boards I have made.
ohh ok well so then i don't need that to make the chip run by itself. good to know!! i thought it was need for the chip to run
 

be80be

Joined Jul 5, 2008
2,395
vrdude.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"

Thats the no boot loader setting it loads the fuses
arduino use bootloader to program without a programmer like the uno,digspark, mega
 

LesJones

Joined Jan 8, 2017
4,511
Re post #242.
1 The cpu clock frequency has nothing to do with how many timers you can run. Running at a lower clock frequency reduces power consumption. It also means that you do not need tount as many instructions or timer/counter interrups for a given amount of time. A higher clock frequency gives higher resolution of a time interval 1 Mhz gives a resolution of 1 uS 8 Mhz gives a resolution of 125 nS.

2 Using stk500v1 as the programmer type gives a dilfferent error. avrdude can not even communicate with the programmer.
When using arduinoisp as the programer type avrdude can communicate with the programmer BUT the programmer can't communicate with the ATtiny85.

3 I am not going to try loading avrdudess again. I don't even know if we are both using the same operating system.

Les.
 

Thread Starter

timtim1234

Joined Nov 30, 2023
246
Re post #242.
1 The cpu clock frequency has nothing to do with how many timers you can run. Running at a lower clock frequency reduces power consumption. It also means that you do not need tount as many instructions or timer/counter interrups for a given amount of time. A higher clock frequency gives higher resolution of a time interval 1 Mhz gives a resolution of 1 uS 8 Mhz gives a resolution of 125 nS.

2 Using stk500v1 as the programmer type gives a dilfferent error. avrdude can not even communicate with the programmer.
When using arduinoisp as the programer type avrdude can communicate with the programmer BUT the programmer can't communicate with the ATtiny85.

3 I am not going to try loading avrdudess again. I don't even know if we are both using the same operating system.

Les.

1). ahh ok that is good to know!!

2). humm that interesting.... did you say it worked at one time? If so, what change? Software installed? Hardware? install a usb driver? etc

3). sorry i forgot to say i am on Windows 10. I don't think that would cause a problem but........ even tho you don't want to load avrdudess doing so may tell you more what is going on.
 

Thread Starter

timtim1234

Joined Nov 30, 2023
246
So, how is your actual project going?
Well......... funny you ask.... LOL i "HAD" the chip programmed and working, but the chip been reprogrammed with other code that I find on forums and I have been tweaking it, and playing with code that has nothing to do with a "timer"..lol . I kinda got sided tracked, one of the side effects of ADHD..lol

ohh I forgot to add I let some "smoke" out too, due to wiring "errors"..lol :)
 

be80be

Joined Jul 5, 2008
2,395
This work good you need the .h files from here lots good examples there too. https://github.com/digistump/DigistumpArduino/tree/master/digistump-avr/libraries
Code:
//----------------------------------------
//ATtiny85 Module Interfaced with I2C OLED
//----------------------------------------
#include <DigisparkOLED.h>
#include <Wire.h>
//#include <iostream>
//---------------------------------------------------
#define SW  1
#define SW1 4
unsigned int i = 0;
unsigned long tm = 0;
//===================================================
void setup()
{
  pinMode(SW,INPUT);
  pinMode(SW1,INPUT);
  oled.begin();
  oled.clear();
  oled.setFont(FONT8X16);
  oled.setCursor(30, 0);
  oled.print("Timer");
}
//===================================================
void loop()
{   
    if(digitalRead(SW) == HIGH) {delay(100); i++;}
    oled.setFont(FONT8X16);
    oled.setCursor(0, 2);
    oled.print("Counter: ");
    oled.setCursor(70, 2);
    oled.println(i);
    delay(100);
  tm = i;
  if(digitalRead(SW1) == HIGH)
  do {
    oled.setFont(FONT8X16);
    oled.setCursor(0, 4);
    oled.print("timer: ");
    oled.setCursor(70, 4);
    oled.println(tm);
    delay(60000);
    tm--;
   } while (tm < 1);
  
}
 

Thread Starter

timtim1234

Joined Nov 30, 2023
246
This work good you need the .h files from here lots good examples there too. https://github.com/digistump/DigistumpArduino/tree/master/digistump-avr/libraries
Code:
//----------------------------------------
//ATtiny85 Module Interfaced with I2C OLED
//----------------------------------------
#include <DigisparkOLED.h>
#include <Wire.h>
//#include <iostream>
//---------------------------------------------------
#define SW  1
#define SW1 4
unsigned int i = 0;
unsigned long tm = 0;
//===================================================
void setup()
{
  pinMode(SW,INPUT);
  pinMode(SW1,INPUT);
  oled.begin();
  oled.clear();
  oled.setFont(FONT8X16);
  oled.setCursor(30, 0);
  oled.print("Timer");
}
//===================================================
void loop()
{  
    if(digitalRead(SW) == HIGH) {delay(100); i++;}
    oled.setFont(FONT8X16);
    oled.setCursor(0, 2);
    oled.print("Counter: ");
    oled.setCursor(70, 2);
    oled.println(i);
    delay(100);
  tm = i;
  if(digitalRead(SW1) == HIGH)
  do {
    oled.setFont(FONT8X16);
    oled.setCursor(0, 4);
    oled.print("timer: ");
    oled.setCursor(70, 4);
    oled.println(tm);
    delay(60000);
    tm--;
   } while (tm < 1);
 
}
ok and what you mean h files from here? From the link you posted?? I see the link has good examples :)
 
Top