How to program a CJMCU with the Arduino IDE.
Background:
The Microcontroller in the CJMCU is an ATTiny85, which is a smaller brother of the chip used in the standard Arduino Uno or Nano board.
It can do most of the same things, but it just has a smaller pin count. 8 in total, 6 usable I/O pins with large loop connections for using conductive sewing thread for wearable applications.
Pinouts:
-
All pins can be used as Digital I/O
-
Pin 0 → I2C SDA, PWM (LED on Model B)
-
Pin 1 → PWM (LED on Model A)
-
Pin 2 → I2C SCK, Analog In
-
Pin 3 → Analog In (also used for USB+ when USB is in use)
-
Pin 4 → PWM, Analog (also used for USB- when USB is in use)
-
Pin 5 → Analog In
It can also be programmed with the Arduino IDE. It just does some magic to trick the computer into thinking it’s a USB device for programming.
Basic setup steps:
- add the address to the “Additional Boards Manager URL’s” in the preferences of the Arduino IDE: http://digistump.com/package_digistump_index.json
- install the “Digistump AVR” boards through the Arduino Boards Manager. And computer drivers when requested.
- Choose the correct Digistump board: “Digispark (Default – 16.5mhz)”
- Code away as usual.
- upload and connect the device to the computer via. USB when the output terminal says.
- all done
There is a great tutorial on the entire process on the Digistump WiKi