Which exact library should I use for monitor output when using the Attiny85 Digispark?

I installed the Atiny85 Digispark clone board, the only currently possible way, using this link https://raw.githubusercontent.com/per1234/ReleaseScripts/refs/heads/provisional-package-index/package_drazzy.com_index.json but I don't understand how or which library to use to transfer data to the serial monitor?

1. The DigiUSB library is not available in the Arduino IDE. I couldn't find any clones. Is there a way to use the built-in USB port on the board? At least for printing to the monitor at 9600 baud?

  1. I'm most interested in the first method, but if that's not possible, what library can I use to transfer the serial date to the RX and TX pins? I have a TTL-USB converter on a CH340, and I can use it to read and transmit. But I don't understand how on attiny to transfer or read from these pins .

The way is to create a Software UART Port on a suitable IO pin (Fig-1) using SerialSoftware.h Library and then go through TTL <------> USB converter.


Figure-1:

#include<SoftwareSerial.h>
SoftwareSerial SUART(1, 2);  //SRX = 1, STX = 2

void setup()
{
     SUART.begin(9600);
}

void loop()
{
    SUART.printl(analogRead(A0));
    delay(1000);
}
2 Likes

The Attiny85 microcontroller does not have internal serial interface modules. (USART).

Therefore, it cannot use printed output.
You can use a softserial , but I've never used one on the Attiny.
See the difference in the block diagrams of both.

But, you can use SUART Port and it works.

yes I know, question was about V-USB how to configure it and use on 85 digispark
in case when arduino ide doesnt find digiusb and digicdc

softwareserial is good.
What if we take a different approach? Copy the necessary files from GitHub and include them in the project. DigiCDC.cpp DigiCDC.h usbconfig.h

But it's unclear what to do next? Do I need to download any drivers for the virtual com port?

Are you referring to these files?:

If so, there is more to the "DigisparkCDC" library than just those three files. I recommend installing all the files from the library.

It should not be necessary. Go ahead and just try uploading a simple sketch to your board to see if it works. This example will serve:

The ATtiny85 has only 8 KB of flash memory. Digispark uses about 2 KB of this for the bootloader. Although it would have been possible to add a communication protocol to the bootloader, it was considered unnecessary given the limited amount of available flash.

Not tried with a tiny85

If you only need to transmit data my TX only SW Serial might be worth a try

If you try please let me know if it works or not.

I have downloaded and included your library in the IDE 1.8.19 and have opened an example to see the content. I see you have included SoftwareSerial.h also. Will the sketch work if I comment out the SeralSoftware.h file?

In the Arduino UNO R3, the original signal is an asynchronous TTL serial frame. This signal passes through a TTL↔USB converter chip, which converts it into an asynchronous USB-formatted signal so that it is compatible with the USB-A port of PC, since modern PCs no longer have the traditional COM ports. The PC retrieves the oiginal asynchronous TTL signal using a software based USB <----> TTL converter (hence the tag: virual COM Port and the software driver).

In the Digispark ATtiny85 board, the board appears as a USB device rather than a COM device because the original signal is already in USB format.

If one wants to add communication facilities to the bootloader of the Digispark ATtiny85 board, it is technically possible, but it would require considerable effort. Such work is more appropriate for a professional software house.

I refer to digistump but looks like improved version little bit new.
ook I have compiled as digispark default 16.5mhz (as atiny85 micronucleus digispark it foesnt want to compile)
but now I have problem with unknown usb device with ID 0006 .
I have tried zadig libusbk and winusb but instalation failed :slight_smile: (ok now instalation was successful but anyway unowkn descriptor of usb)
at this point I have stoped at the moment

The DigiSpark is a cool little board, but unfortunately the USB capabilities can be unreliable. The reason is that the ATtiny85 doesn't have a native hardware USB capability, so this is being faked using the code running on the ATtiny85 in the background of your sketch program.

If you use the USB connection only for uploading sketches and powering the board, I think you will have good results, but anything more may bring significant frustration.

So you might consider going with your "plan B" of using the CH340 module..

1 Like

Will installing these drivers help resolve the issue?


I just can't find the installer for Windows 10.

I have tried this one https://github.com/protaskin/LowCDC-Win10x64/files/1984227/LowCDC-Win10x64-1.0.1.6.zip
bcdedit /set testsigning on
but installation has failed