vDrive: With MDV sound? I wonder.

Nagging hardware related question? Post here!
User avatar
Popopo
Gold Card
Posts: 459
Joined: Wed Apr 07, 2021 10:37 am

Re: vDrive: With MDV sound? I wonder.

Post by Popopo »

Hi Norman
NormanDunbar wrote: Tue Jun 03, 2025 6:52 am You can get the code off the chip fairly easily using AVRDude. Unless of course, the lock bits are configured, in which case no. The code that comes off will be a binary version of the C or C++ code that the source was written in, plus it will have been optimised for size by the compiler.
I remove the Attiny from Digispark board, and now trying to program the "bootloader", but getting err all time with Arduino IDE.
So, in case that now I program the HEX file with Avrdude, will it overwrite the EEPROM (so the "fuses") with the code into the HEX file?

NormanDunbar wrote: Tue Jun 03, 2025 6:52 am Somewhere on these forums is a post from me ages ago, discussing this noise generator and a version I wrote in assembly. Somewhere! I remember thinking that the speaker needed a resistor to limit current and blowing the chip.
It must, also I placed 220 Ohm resistor for protecting the IC (limit current). Actually 200 should be enough.

I'm gonna post a video from 2 days ago playing with it (into DigiSpark board).

IMO, unless the HEX fuses the clock signal or something important for generating the sound (not only to use USB connection) the fuses doesn't do any relevant. In fact as you will see, the OSC shows the square with 256Khz aprox, exactly what expected to create the sound. Isn't it?

With bootloeader working, actually nothing special, but here we have a better sound with the resistor and capacitor
https://youtube.com/shorts/22SM0ZojidU

Without resistor to get the original signal by the schema (not a good idea, it must have a resistor to protect IC)
https://youtube.com/shorts/SHHEK0sO62M?feature=share


Testing 2 speakers
https://youtube.com/shorts/SOSniH_h5XE?feature=share

Trying to program from Linux with Arduino as ISP... getting error when burning "bootloader"

Code: Select all

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 "/home/popopo/.arduino15/packages/ATTinyCore/hardware/avr/1.5.2/avrdude.conf"
         User configuration file is "/home/popopo/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyACM0
         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 = 0x000000 (retrying)

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

Failed chip erase: uploading error: exit status 1
I'm going to try from Windows


User avatar
NormanDunbar
Forum Moderator
Posts: 2483
Joined: Tue Dec 14, 2010 9:04 am
Location: Buckie, Scotland
Contact:

Re: vDrive: With MDV sound? I wonder.

Post by NormanDunbar »

Popopo wrote: Tue Jun 03, 2025 12:47 pm I remove the Attiny from Digispark board, and now trying to program the "bootloader", but getting err all time with Arduino IDE.
So, in case that now I program the HEX file with Avrdude, will it overwrite the EEPROM (so the "fuses") with the code into the HEX file?
Hmmm, it seems that the Digispark has set the fuse to prevent the reset pin from being used as a reset pin, so there's information here -- https://www.instructables.com/How-to-un ... ert-it-to/ -- about how to get around this and convert it back to an ATtiny85. The reset pin can be used as an additional GPIO pin, albeit with limited current carrying potential.

a quote from the above page;
Digispark ATtiny85 boards come with the Micronucleus bootloader and with the reset pin disabled. When reset is disabled you get an additional digital pin, and you must upload sketches using the bootloader. You may not use ISP programming.
So, it looks like you must use the bootloader if you are using a Digispark. Sorry, I wasn't aware of this.

Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
stephen_usher
Super Gold Card
Posts: 540
Joined: Tue Mar 11, 2014 8:00 pm
Location: Oxford, UK.
Contact:

Re: vDrive: With MDV sound? I wonder.

Post by stephen_usher »

New ATTiny85-P20 chips are available from Pi Hut for £2.50 so just get another one. :-)


Derek_Stewart
Font of All Knowledge
Posts: 4729
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: vDrive: With MDV sound? I wonder.

Post by Derek_Stewart »

Hi,

The Digispark board plugs into a USB Type A cable so cable be programmed from the PC USB port.

I might get one for my vDriveQL, but I like Stephen's approach to the problem and it solution.

If all else falls, the Oqtadrive as all this built in and works with more then a single MDV format and can mount ZIP files.


Regards,

Derek
Derek_Stewart
Font of All Knowledge
Posts: 4729
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: vDrive: With MDV sound? I wonder.

Post by Derek_Stewart »

Hi,

I should also say, I have 3 working QLs, with most of the Microdrive emualators running: Oqtadrive, vDriveQL, MicroPico, no tape based Microdrives.

The Digispark board can be bought for just over £3 in USB A and SIL Header format with the ATTiny85 in a socket. making the whole project for less than £5

With regards to having sound on the MicroPico, could the MicroPico operation using the LED not be fed to a transistor and get a logical One to the speaker each time the LED flashes, and give a beep on the speaker?


Regards,

Derek
User avatar
Popopo
Gold Card
Posts: 459
Joined: Wed Apr 07, 2021 10:37 am

Re: vDrive: With MDV sound? I wonder.

Post by Popopo »

Hi Norm,
Thank you for your help.

Let's think together,
NormanDunbar wrote: Tue Jun 03, 2025 3:20 pm Hmmm, it seems that the Digispark has set the fuse to prevent the reset pin from being used as a reset pin, so there's information here -- https://www.instructables.com/How-to-un ... ert-it-to/ -- about how to get around this and convert it back to an ATtiny85. The reset pin can be used as an additional GPIO pin, albeit with limited current carrying potential.
That's right, as you write. But not always (for every digispark board), in any case, the reset pin affect to this project?
Reset pin is pin1, transformed into GPIO by Digispark GPIO#5, since the project use PB1 and PB4 it doesn't matter actually. Does it?
As shown in the osc image that I posted above, I got the square and freq supposed to get by the project (or similar one, now I cannot tell which one is the original after reading so many sites with same goal).

We can compare pinouts:
https://forum.arduino.cc/t/useless-pin- ... d/655868/3
https://learn.sparkfun.com/tutorials/ti ... -use-hints
Digispark site wrote:Digispark ATtiny85 boards come with the Micronucleus bootloader and with the reset pin disabled. When reset is disabled you get an additional digital pin, and you must upload sketches using the bootloader. You may not use ISP programming.
I have been programing it with Arduino as ISP, so ISP is enable for me => reset pin is still a reset pin.
Checking the doc a little deeper you can tell that there are a section with some PowerShell scripts (or CMD files) to set fuses with different (and the most common sets) from Windows (same applies about linux cause we also have avrdude). Some more recent than others, even some bootloaders updates.
We don't know what we have in a Digispark board since so many options, but we can focus in what we get in the output bettwen PB1 and PB4 that shapes the PWM output (our sound to play).
Am I wrong or missing a clue?
I appreciate your oppinion that gives me more options to check out (maybe I missed out something).
NormanDunbar wrote: Tue Jun 03, 2025 3:20 pm So, it looks like you must use the bootloader if you are using a Digispark. Sorry, I wasn't aware of this.
I have been using Digispark to upload the sketch, but also the new (and recommended by the own Digispark new library AttinyCore). So no problem with it.

My conclusion by now is:
Since it is a array of digital codes to produce a PWM modulation, that should be transformed into a wave signal by combs of resistors and capacitors. The keys points should be freq & width of pulses. And they looks right (to me, cause nobody published the pattern that we should obtain, did one?


User avatar
Popopo
Gold Card
Posts: 459
Joined: Wed Apr 07, 2021 10:37 am

Re: vDrive: With MDV sound? I wonder.

Post by Popopo »

stephen_usher wrote: Tue Jun 03, 2025 8:06 pm New ATTiny85-P20 chips are available from Pi Hut for £2.50 so just get another one. :-)
Hi Stephen :)
The game is to reproduce what it is told that works. In case that not, confirm it.
I don't know Attiny85-20 but I will read about it, in any case... why to change when supposedly the "regular" one works fine?

2.50 pounds is not bad price.
Just I want to understand why this whirl is not a whirl but a metallic annoying sound :)

Edit:
I checked it out, already I am using the 20Mhz version :) : https://www.mouser.es/ProductDetail/Mic ... 4Icw%3D%3D
So no need to buy more of the same kind.
Last edited by Popopo on Wed Jun 04, 2025 11:18 am, edited 1 time in total.


User avatar
Popopo
Gold Card
Posts: 459
Joined: Wed Apr 07, 2021 10:37 am

Re: vDrive: With MDV sound? I wonder.

Post by Popopo »

Hi Derek,
Derek_Stewart wrote: Wed Jun 04, 2025 8:40 am The Digispark board can be bought for just over £3 in USB A and SIL Header format with the ATTiny85 in a socket. making the whole project for less than £5
That is based on Digispark board. I think you could get same problem than us, but please to try and share your experience.
Derek_Stewart wrote: Wed Jun 04, 2025 8:40 am With regards to having sound on the MicroPico, could the MicroPico operation using the LED not be fed to a transistor and get a logical One to the speaker each time the LED flashes, and give a beep on the speaker?
Derek, that is what is done. You can use the LED activity or already (only in my version of MPD) it use a dedicated pin with a transistor to work as switch when the MPD is working. The idea is to implement the same sound emulator used by vDrive in the Pico, so I place the footprints and connector to allow to solder caps, resistors, whatever you love to, without rewriting anything.
My surprise is when I try to reproduce this project that (IMO) should works at first sight, got in troubles with this horrible sound emulation.
Personally I don't like to use Attiny85, but since it was done and some people asked me to implement ( I Did), I wanted to test by myself how it goes, my surprise come with the result and that not many people get a decent sound but ... this such a horrible BEEP BEEP BEEP! XD.

So, if you got a nice sound, the same circuit you can connect it to the MPD, with activity LED (wiring) or by the dedicated pin.
I didn't recode the firmware yet to use the dedicated pin, but it takes no time at all to do it. Just I wanted to be sure and decide if implement (by the way) another feature.

Perhaps I will stop trying the Attiny85 soon, since I don't like how it works and how complicate could be for others to do it properly, I like more to be sure everyone that try it, get it.
In some days I will start to search for another microcontroler.


User avatar
bwinkel67
QL Wafer Drive
Posts: 1533
Joined: Thu Oct 03, 2019 2:09 am

Re: vDrive: With MDV sound? I wonder.

Post by bwinkel67 »

Popopo wrote: Wed Jun 04, 2025 10:16 am Just I want to understand why this whirl is not a whirl but a metallic annoying sound :)
I have a few questions on what you are working on. So, by all accounts (i.e. watching your videos) you are getting that same high pitched sound that I got when I used Johan Engdahl's Digispark board I got from SellMyRetro. You also said you had removed the ATTiny from the Digispark board.

1) So you started with the Digispark board but decided to remove the chip...why? I thought it was easier to just use the Digitspark board, plug it directly into the USB port of a laptop and program it directly from Windows.

a) Why undo all that?
b) Where you concerned about the 10 second delay that Norman had talked about? Johan's board seems to have solved that since there is no delay when hooked to vDrive.

2) You get that same metallic sound I got on my video. Did you use Stephen Usher's code where he sampled the sound and converted it to HEX and hardcoded it into the small program?

I have Johan's board and what I want to do is first capture the binary that's on there so I can copy it back on (to undo any changes I may make when experimenting with it), and then see if I can port Stephen Usher's code onto it to see if it sounds different. So that's why I ask what you are doing because if that's what you did and didn't see any difference then I wouldn't bother. If that's the case, why would Stephen's program run on his ATTiny85 board and sound normal and then sound metallic on the Digispark ATTiny board? What's the difference between the two boards?


User avatar
Popopo
Gold Card
Posts: 459
Joined: Wed Apr 07, 2021 10:37 am

Re: vDrive: With MDV sound? I wonder.

Post by Popopo »

Hi :)

I will answer not to this particular project, but the spread 'FAKE' project of playing sampled sounds with Attiny85.
bwinkel67 wrote: Thu Jun 05, 2025 2:38 am 1) So you started with the Digispark board but decided to remove the chip...why? I thought it was easier to just use the Digitspark board, plug it directly into the USB port of a laptop and program it directly from Windows.
I decided to remove it in order to do not left anything without trying before affirm that this project as it is shown (in the most medias channels: bloogers, U2B, etc) is NOT what some tell, instead a lack of my skills. By now I am at 95% to be able to tell that that thing (whatever supposed to be) is not :). Some speakers have a inductance (L) that could soft the PWM modulation (with help of R-C filter) sound "softer", or just the box where they are placed.

bwinkel67 wrote: Thu Jun 05, 2025 2:38 am a) Why undo all that?
b) Where you concerned about the 10 second delay that Norman had talked about? Johan's board seems to have solved that since there is no delay when hooked to vDrive.
A) part of it I answered above, I needed to remove it also because some pins are affected for Diode-resistors and in some points of modulation "could" affect to the results (but actually very little). Also because many suggested (in a good way) to buy a new Attiny: noway, this is a attiny already, where is the point to buy a new one? if the new doesn't work, what? a new new new new new new one? :) that is the most common way to proceed sometimes, but not this time when I see with the oscilloscope that all the signals are as supposed to be.

B)Moreover, the delay is due to the bootloeader code of the Attiny85 in Digispark version. It requires to fuse (thereby change the bootloader) to run the sketch within first 40 ms (do it instantaneously as we can see in the videos).

At this point, only the internal clock that could be modified (this is a clue point) matters. Since I get the right freq, for me it doesn't matter anymore. I have it, as it is supposed to be. To boot sooner or later is not important for me by now. The most important at this point are the fuses that control 2 things: The oscillator freq and the divider of the freq. Higher freqs and a correct R-C filter could convert the PWM in a decent sound, otherwise we couldn't hear anything else than this annoying sound. Do we have it? for that purpose I Wanted to remove it and work directly with the Attiny85 instead the Digispark, I thought it were easier, but actually, it doesn't matter.
bwinkel67 wrote: Thu Jun 05, 2025 2:38 am 2) You get that same metallic sound I got on my video. Did you use Stephen Usher's code where he sampled the sound and converted it to HEX and hardcoded it into the small program?
Yes I did. At this point, let's be clear... it is something spread for the whole Internet about this Attiny85 and sound capabilities... bull***t. You can produce different sounds sampling and so on, nothing more different than you can get with the Spectrum 48K speaker. The net is full of s**t. None of those have shown a decent circuit that works at first, too easy to say "for me that works".

bwinkel67 wrote: Thu Jun 05, 2025 2:38 am I have Johan's board and what I want to do is first capture the binary that's on there so I can copy it back on (to undo any changes I may make when experimenting with it), and then see if I can port Stephen Usher's code onto it to see if it sounds different. So that's why I ask what you are doing because if that's what you did and didn't see any difference then I wouldn't bother. If that's the case, why would Stephen's program run on his ATTiny85 board and sound normal and then sound metallic on the Digispark ATTiny board? What's the difference between the two boards?
Johan is an expert in many areas. I didn't try his board nor watch any of his tests. In any case, could be better to ask him directly about why your sound is not what you expect, because... perhaps what Johan has gave to you is what the community expected from a PWM signal. I mean, no trick there. He help people with not soldering or programming skills to obtain that done. But not responsibility at all if the sound is not what we expected.

Summing: I suspect we have been cheated by the community of "makers" pretending to get what they didn't :) repeating the same fakes to get money in U2B, that become viral and some used it (thinking that was right) to create projects and accept the results as right.


I challenge anyone, anyone to bet 60€ and send to me an attiny85 with the speaker of 8 Ohms like we have, that make it sounds as we expected (exact as microdrive working does). But if this person loose, this person pay to me for my time. Only with this attiny, the speaker, and the decoupling capacitor feeding them with 5v.
. I will be happy to be wrong.


Attiny digitalized sound is played by PWM == SQUARES, not waves, no waves => not nice sound.
You need to transform PWM into WAV, so you need a DAC that could be built in different ways (resistor Arrays like old time with PCs in parallel port), a R-C filter, whatever could modulate them into something more audible for us.
In any other case, PWM only vary the freq in a limited rank how we hear that sound.

And that is what I am working on now... to built the RC filter and DAC for this project, while playing around with the Attiny85 to fuse it, check changing freqs, and trying everything that anyone could say to try out, etc. Just to attack the problem with different approaches, try-err vs and theory-application.


Post Reply