0

I want to use the Arduino IDE serial monitor with my Digispark ATtiny85 over USB.

I can without problems upload this code(Digispark CDC example):

#include <DigiCDC.h>
void setup() {                
  SerialUSB.begin(); 
}
void loop() {  
  SerialUSB.println(F("TEST!"));
 //SerialUSB.delay(10);
}

In a terminal, I can confirm, that it indeed creates a new devise:

ll /dev/*usb*
crw-rw-rw-  1 root  wheel   21,  89 27 Sep 10:36 /dev/cu.usbmodem1411
crw-rw-rw-  1 root  wheel   21,  88 27 Sep 10:36 /dev/tty.usbmodem1411

When trying to start the Arduino serial monitor, I get the error:

 Error opening serial port '/dev/cu.usbmodem1411'. (Port busy)

I have confirmed that there are no open files or processes using the USB port. I have the same problem trying to use cu or screen in the terminal.

I have googled the problem, and found that several people has the same problem on new mac computers, but I have not been able to find a solution. -any ideas?

  • Digispark Rev3 (Chinese clone - with bootloader firmware 1.6 (1.06))
  • Arduino IDE 1.8.7
  • Mac OSX High Sierra 10.13.6
  • I don't know about OS X, but I do know that the ATTiny85 doesn't have a USB interface - so it's all done in software. TBH you're lucky it gets as far as it does. I have never been a fan of bit-banged USB like that. It's nasty. – Majenko Sep 27 '18 at 9:19
  • @Majenko I can use the Digispark as a USB HID keyboard, so the banging of the bits do work :o) – hpekristiansen Sep 27 '18 at 10:25
  • You can only bit-bang low-speed USB. Low-speed is only intended for use with keyboard and mouse. CDC/ACM really requires full- or high-speed, so trying to use it over low-speed is "undefined". – Majenko Sep 27 '18 at 10:26
  • @Majenko: I appreciate the support. I would be happy with any low speed way of sending a string from my computer to the Digispark. If it is not possible, do you know of a chip, that I can add to the ATtiny85 to give it hardware USB? – hpekristiansen Sep 27 '18 at 15:11
  • Unfortunately, it's a known issue on mac os that has no solution at the moment. digiUSB is mentioned on one forum as a workaround. However, sending and receiving is done via python scripts with this method of communication. If you want hardware USB in the same board format, you can try ATMega32U4-based "beetle" boards available for ~5 USD on ebay. – ex-punctis Sep 27 '18 at 19:42
0

SoftSerial and a real serial port on the mac will work. Or if you are careful use the DigiKeyboard and print the debug to the HID keyboard REMEMBERING to switch to a notepad equivalent window on the mac to receive and display the debugging text and not have it overwriting the arduino sketch by mistake. DigiCDC is a kludge that does not work properly on modern operating systems sorry!

  • Thanks for your input, but I do not understand what you mean by " ...a real serial port on the mac ..."? Do you mean something like this plugable.com/2011/07/12/… ?What debug are you referring to? HID works perfectly, but I want serial communication from and to the Digispark. – hpekristiansen Oct 16 '18 at 15:26
  • presumably no modern Mac has a builtin RS232 interface so you'd need a USB to RS232 interface yes like in that article you link to. There are a few common chips that are used in the devices PL2303, CH340/CH341, FT232RL and so on. There is a software serial emulation library that works on the Attiny85 digispark boards and uses 1 or 2 or the IO pins obviously there are certain limitations with software emulation but it does work adequately. Serial is often used to output debugging messages with arduinos when developing sketches. – tech-head-uk Oct 17 '18 at 22:54

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.