ZappBots wishes a warm welcome to everyone.

Especially our visitors from
Savage///Circuits and Parallax!!!


Please take a look our new forums, we hope you register and become an active user.

The ZappBots forums are being run on phpBB 3.1.4 software which is different then the vBulletin used on the Savage///Circuits and Parallax forums.
Therefore, things look and work a little different, especially creating posts and uploading images / attachments.


The important thing is we have a place toTalk, Learn and Showcase our projects.

Programing an ATTINY26 microcontroller using the BASCOM-AVR BASIC compiler

This is the place to talk about Atmel AVR Microcontrollers, including the ATtiny & ATmega series.
User avatar
zappman
Administrator
Administrator
Posts: 120
Joined: Wed May 06, 2015 12:31 am
Contact:

Programing an ATTINY26 microcontroller using the BASCOM-AVR BASIC compiler

Postby zappman » Sat May 23, 2015 12:50 pm

Originally posted on the Savage///Circuits Forums
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:
Image

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
Image
butlh ghajbogh nuv'e' yIHo'.
Admire the person with dirt under his fingernails.

Return to “Atmel AVR”

Who is online

Users browsing this forum: No registered users and 1 guest