tap lfo on attiny84a

Started by carlozsulca, July 10, 2021, 10:25:14 PM

Previous topic - Next topic

carlozsulca

I am designing a vibrato tap tempo based on the BOSS VB-2, I found the tap tempo code for an attiny85, I recently found the code for this attiny84a, which is controlled by a rotary encoder, but I don't know how to install these files on the attiny84 Has anyone already done it?  or do you know how I can pass it to .hex to program the attiny84
the link of these files:
https://github.com/hsabro/tap-tempo/tree/master/tap-tempo%20lfo/attiny84a/firmware



box

Hi,
in my handy tool I am using
USB TL866II Plus Programmer For 15000+IC SPI Flash NAND EEPROM MCU PIC AVR GAL
Box

carlozsulca

Quote from: box on July 10, 2021, 11:51:24 PM
Hi,
in my handy tool I am using
USB TL866II Plus Programmer For 15000+IC SPI Flash NAND EEPROM MCU PIC AVR GAL
Box
I was using an arduino uno isp to program the attiny but the code I was programming was a .c, I copied to the arduino IDE and programmed the attiny but this case with several .c and .h and my question was how could all those happen files to a .hex to program an attiny 84

anotherjim

I think what you have is a makefile for a specific toolchain.

If you had the code in a binary to load into the chips program Flash it would not include the chips fuse settings which might be critical if it doesn't run at the default internal 1Mhz CPU clock. Also, if the program relies on some default data in the chips EEPROM, there would be another binary for that.

Looks to me like an AVRdude toolchain to use the makefile with an ISP programmer that works with it.
I use a different setup - AVRstudio and an AVR programmer so can't help with any specifics.

If this is a one-off project for you, it might be better to find a readymade taplfo chip for your project. ElectricDruid possibly.

ElectricDruid

There's code available (both uncompiled ASM and compiled HEX) for the Electric Druid chips over on my site. For example, the StompLFO might do what you need (8 waveforms, tap tempo):

https://electricdruid.net/electric-druid-chips-the-next-generation/

To program one of these, the minimum you need is to download MPLAP X IDE (a big download) and get a programmer like the PICKit3 or a cheap clone. The "Integrated Development Enviroment" (IDE) is much more than you need, but they don't supply the much simpler, lighter weight "Integrated Programming Environment" separately. But the IPE is really the one you need for just pushing code into chips. It's way simpler.

Sorry, I haven't played with the AVRs, so I can't help much with those.

carlozsulca

I was watching some videos and I was able to compile the .h and .c in ubuntu, it turned out to be a .hex, but now there is another problem, I think now it is a little easier to solve, I do not know, I really just started in what is programming, It happens that the attiny85 only reads the values of the potentiometer when turning on and every 40 or 60 seconds approximately, the tap button if it works correctly, I attach the .hex for the attiny 84a and 85 in case someone wants them
https://drive.google.com/drive/folders/1tVbGvh180cgo1TBRnIoEgfCcA3mP4J4n?usp=sharing

anotherjim

As I said, the Hex only loads the program, it doesn't set the configuration fuses. Most programs I would write for the Tiny85/84 would use the internal clock set for 8Mhz. If your chip is running too slow, it's most likely still on the default 1Mhz speed. Actually, the default IS the internal 8Mhz clock but with the CKDIV8 fuse set which divides it by 8!
As an aside, a Tiny85 can also double speed to 16Mhz, but that requires an entry in the code, not the fuses.
The fuses can be changed any time before or after loading the flash code, but as the flash programming should be done no faster than 1/4 of the clock speed then the code can load faster if you clear CKDIV8 first.
This is the visual control I have in AVRstudio. Easy!

The CKDIV8 is the only one I change unless I want an external clock such as a crystal.
There are command-line tools to do the same job, but it requires the fuse bits encoded to hex bytes. There are fuse calculator tools to generate them.
It is very easy to "brick" the chip with the wrong fuse settings -  do not experiment!

Ripthorn

I can confirm it's easy to brick a part when messing with the fuses. Then again, I've also done a bunch of successful parts. I have a project in progress that does a tap templo LFO on attiny85. I have it mostly working, but haven't had time to sit down and get the last bug or two worked out. Project page: https://scientificguitarist.wixsite.com/home/tinylfo
Exact science is not an exact science - Nikola Tesla in The Prestige
https://scientificguitarist.wixsite.com/home

carlozsulca

It seems that it is a problem of the code and not of the clock since I use the same attiny85 at 8Mhz for another lfo tap, I also just tested the .hex for the attiny84 on a new attiny84a and it worked without problems, honestly the lfo tap is more interesting for the attiny84 since it works with a rotary encoder saving space from the potentiometers, if someone manages to fix the code of the attiny85 I would be very grateful

Ripthorn

An encoder only uses two pins, so with some rearranging, an ATTiny85 could easily do the job, you just might have to make some feature compromises.
Exact science is not an exact science - Nikola Tesla in The Prestige
https://scientificguitarist.wixsite.com/home