P. 1
Introduction to Practical Electronics Microcontrollers and Software Design

Introduction to Practical Electronics Microcontrollers and Software Design

|Views: 507|Likes:
Published by Stefanvnv
An Introduction to
Practical Electronics,
Microcontrollers and
Software Design
An Introduction to
Practical Electronics,
Microcontrollers and
Software Design

More info:

Published by: Stefanvnv on Feb 22, 2013
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

08/19/2013

pdf

text

original

The code for the ATmega48 is similar to the ATTiny461; the code changes are underlined below
'Flash1led.bas for the ATMEGA48
'B.Collis June 1009

$regfile = "m48def.dat" ' bascom needs to know our micro
$crystal = 1000000 ' bascom needs to know how fast it is
going

Config Portb = Output 'make these 8 micro pins outputs
Const Flashdelay = 100 ' preset how long a wait will be

Do

Set PortB.7 ‘ LED 7 on
Waitms Flashdelay ‘wait a preset time
Reset PortB.7 ‘LED 7 off
Waitms Flashdelay 'wait a preset time
Loop 'return to do and start again
End

940

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->