October 29th, 2013, 11:50 PM
by Zappman
I have been successful programing an ATTINY26 microcontroller using the BASCOM-AVR BASIC compiler http://www.mcselec.com/?option=com_content&task=view&id=14&Itemid=41

Granz, was very generous and sent me an ATTINY 2313, ATTINY 26, a prototype of his tiny-2313-experimenters-board http://projects.granzeier.com/2012/11/29/tiny-2313-experimenters-board/ and several of his stores component packs http://zenstore.granzeier.com/index.php ... oducts_all.
I have a Pololu USB AVR Programer, http://www.pololu.com/catalog/product/1300, but I had never used it.
I have been searching the web for information about programming the ATTINY 2313 / ATTINY 26 using BASCOM and found this really nice "Getting Started with Atmel AVR and BASCOM" tutorial at; http://www.instructables.com/id/Getting-Started-with-Atmel-AVR-and-BASCOM/?ALLSTEPS
I down loaded and installed the BASCOM-AVR BASIC compiler http://www.mcselec.com/index.php?option=com_docman&task=doc_download&gid=139&Itemid=54, wired up the ATTINY 26 chip on my (Basic Stamp) Parallax Professional Development Board (Serial) , I used some jumper wires to connect the AVR Programer to the breadboard, and was able to program the ATTINY26 microcontroller.
I started by connecting up and blinking a single LED, then worked my way up to having 8 LEDs connected and flashing in sequence.
I finished up by flashing the 8 LEDs back and forth "Knight Rider, KITT-Scanning" style.
I know I have a lot more to learn, but I have met my first goal about learning to program ATTINY AVR microcontrollers.
Below is a photo of my set-up:

Below is my messy code, it grew out of a blink 3 LED program. It was created to test my hardware set-up, not to be an example of good code.
Code: Select all
'-----------------------------------------------------------------------------------------
'name : LED-Flash8b.bas
'written by : M.Sapp
'date : 2013_10_30
'purpose : 8 LED Sequencer Demo
'micro : ATTINY26
'suited for demo : yes
'commercial addon needed : no
'-----------------------------------------------------------------------------------------
$regfile = "attiny26.dat"
$crystal = 1000000
$hwstack = 32
$swstack = 8
$framesize = 24
Config Porta = Output
Config Portb = Output
Zer Alias Portb.0
One Alias Portb.1
Two Alias Portb.2
Thr Alias Portb.3
Fou Alias Portb.4
Fve Alias Portb.5
Six Alias Portb.6
Svn Alias Porta.0
Begin:
Zer = 1 : One = 0 : Two = 0 : Thr = 0 : Fou = 0 : Fve = 0 : Six = 0 : Svn = 0
Wait 1
Zer = 0 : One = 1 : Two = 0 : Thr = 0 : Fou = 0 : Fve = 0 : Six = 0 : Svn = 0
Wait 1
Zer = 0 : One = 0 : Two = 1 : Thr = 0 : Fou = 0 : Fve = 0 : Six = 0 : Svn = 0
Wait 1
Zer = 0 : One = 0 : Two = 0 : Thr = 1 : Fou = 0 : Fve = 0 : Six = 0 : Svn = 0
Wait 1
Zer = 0 : One = 0 : Two = 0 : Thr = 0 : Fou = 1 : Fve = 0 : Six = 0 : Svn = 0
Wait 1
Zer = 0 : One = 0 : Two = 0 : Thr = 0 : Fou = 0 : Fve = 1 : Six = 0 : Svn = 0
Wait 1
Zer = 0 : One = 0 : Two = 0 : Thr = 0 : Fou = 0 : Fve = 0 : Six = 1 : Svn = 0
Wait 1
Zer = 0 : One = 0 : Two = 0 : Thr = 0 : Fou = 0 : Fve = 0 : Six = 0 : Svn = 1
Wait 1
Zer = 0 : One = 0 : Two = 0 : Thr = 0 : Fou = 0 : Fve = 0 : Six = 1 : Svn = 0
Wait 1
Zer = 0 : One = 0 : Two = 0 : Thr = 0 : Fou = 0 : Fve = 1 : Six = 0 : Svn = 0
Wait 1
Zer = 0 : One = 0 : Two = 0 : Thr = 0 : Fou = 1 : Fve = 0 : Six = 0 : Svn = 0
Wait 1
Zer = 0 : One = 0 : Two = 0 : Thr = 1 : Fou = 0 : Fve = 0 : Six = 0 : Svn = 0
Wait 1
Zer = 0 : One = 0 : Two = 1 : Thr = 0 : Fou = 0 : Fve = 0 : Six = 0 : Svn = 0
Wait 1
Zer = 0 : One = 1 : Two = 0 : Thr = 0 : Fou = 0 : Fve = 0 : Six = 0 : Svn = 0
Wait 1
Goto Begin