Please use only blank ATmega8 (or ATmega8A) at 16MHz with lfuse=0x3f and hfuse=0xc0 in depicted layout(old rev.2)
Do NOT lock ANY bits (use default lockbits=0x3f), or update feature will not work properly!
If you already use tinyUSBboard goto update section instead
In order to test the boards solder joints and connections, this firmware first rotates all red LEDs. (Check for shorts/cold joints)
This rotation will stop after about 1sec, when a proper host (conntected to the USB) is found. This step won't require any drivers, since USB-HID is used. However, if no USB host is found, or the USB host doesn't support simple boot HID protocol: Cycling the leds never will end.
If an USB connection is detected, all four red LEDs blink for about one second and an animated countdown for about 20sec starts.
(The leds stop flashing one after another until no one is left.)
An USB HID keyboard is emulated during this period:
If the PROG button is pressed (or PD6 is grounded) during the countdown, the countdown is reset.
When PROG (PD6 from GND) is released then, a greetings message starts typing while the leds are cycling again. (This time inverted.)
If the keyboard LED state (NUM-, CAPS- and SCROLL- lock) is changing, the countdown is reset, too. However a message won't be typed.
At the end of the countdown, the bootloader is invoked to enter PROGMODE: This default firmware then has stopped execution and the board is ready to receive new firmware.
In cases an error occurs, two diagonal LEDs are flashing alternating, all other functions stop and the USB becomes disconnected.
Please connect CS <--> PB2 (SS) , DI <--> PB3 (MOSI) , DO <--> PB4 (MISO) , SK <--> PB5 (SCK) and make sure eeprom has proper Vcc, GND and ORG pulled to GND
USBasp programming
tinyUSBboard as USBasp programming hardware precompiled (atmega8) firmware: here, Rev.2 (or older): here ATmega328P tinyUSBboard version as USBasp programmer: here (for other AVRs: atmega328, atmega168P, atmega168, atmega88P, atmega88)
Improved version! (Provides 4MHz rectangular clock at PB1 and implements software switchable ISP speed: -B10 in avrdude)
White cable is optional 4MHz rectangular clock. Black is RST (SS), brown MOSI, orange MISO, green SCK, red 5V power and blue is GND.
AVR C demo with PWM (for RGB-LED), analog read and two line hd44780 LC-Display (source code)
As analog input PIN23 (PC0/ADC0) is used
PIN15 (PB1/OC1A) is used for 8bit fast PWM red (R)
PIN16 (PB2/OC1B) is used for 8bit fast PWM green (G)
PIN17 (PB3/OC2) is used for 8bit fast PWM blue (B)
The hd44780 LCD data pins D0 to D3 are not used
The hd44780 LCD data pins D4 to D7 are connected to PIN25 to PIN28
The hd44780 LCD E, RS and RW are connected to PIN6, PIN11 and PIN14
You can download precompiled hex-files for LCD and without LCD here.
As usual for this kind of examples the code is linked to start at address 0xC00 to conserve upper flash memory. (See avr-assembler files for: LCD and without LCD)
VUSB skeleton/example with corresponding linux, windows (delphi) and platform independent GTK libusb program
use onboard USB interface to exchange data with your computer
for Windows you may need at least GTK+ runtime installed to enable GUI