Skip to content

Instantly share code, notes, and snippets.

@rafalw
Created November 30, 2012 16:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafalw/4176861 to your computer and use it in GitHub Desktop.
Save rafalw/4176861 to your computer and use it in GitHub Desktop.
Test ATmega48P - BASCOM
' Test mikrokontrolera ATmega48P
' - zapalające się kolejno diody LED...
$regfile = "m48pdef.dat"
$Crystal=4000000
$hwstack=40
$swstack=16
$framesize=32
Config Timer1 = Timer , Prescale = 64
Config Portc = &B0111111
Portc = &B0000000
Enable Interrupts
Enable Timer1
On Timer1 Do_light
Dim A As Byte
Do
' Nic się tu nie dzieje...
Loop
End
Do_light:
If A = 0 Then
Portc = &B0000001
Elseif A = 1 Then
Portc = &B0000010
Else
Portc = &B0000100
End If
Incr A
A = A Mod 3
Return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment