sp3ots-p
  M
 

'Freq miernik max ok 35MHz 10Hz
'2009.07.31
'działa
'Bascom AVR 1.11.8.1
'Ustawienia Fuse bit:
'Fusebit C 1:Divide clock by 8 disabled
'Fusebit B 1:Output clock on CKOUT pin disabled
'Fusebit KL 10:6 CK, 64 mS delay
'Fusebit A987 1110:1110 external XTAL
$prog &HFF , &HEE , &HDF , &H00       'Nowe fuse bity.
$regfile = "attiny2313.dat"
Config Lcdpin = Pin , Db7 = Pb.2 , Db6 = Pb.3 , Db5 = Pb.4 , Db4 = Pb.5 , E = Pb.6 , Rs = Pb.7
Config Lcd = 16 * 2
'$crystal = 10000000
'$crystal = 12280000
$crystal = 14745600

Dim Ccount As Byte
Dim Maincounter As Long
Dim C_counter As Word

Cls
Cursor Off

Config Timer0 = Timer , Prescale = 8
Config Timer1 = Counter , Edge = Falling , Noise Cancel = 1
C_counter = 0

Enable Timer0
Enable Interrupts
On Timer0 Timint
Enable Timer1
Ccount = 0

On Timer1 Int_0
Start Timer0
Start Timer1
Timer1 = 0

Do
Loop

Timint:
Incr C_counter
'If C_counter = 4883 Then       'Q=10,000 preskaler/8 - 1sek
'If C_counter = 6000 Then       'Q=12,288 preskaler/8 - 1sek
If C_counter = 7200 Then       'Q=14,7456 preskaler/8 - 1sek
Stop Timer1
Stop Timer0
Maincounter = Ccount * 65536
Maincounter = Maincounter + Timer1

If Maincounter = 1 Then
Maincounter = 0
End If
Ccount = 0
Timer0 = 0

If Maincounter > 10 Then Cls
If Maincounter >= 10 Then
Locate 2 , 7
Else
Cls
End If
Locate 2 , 8
If Maincounter >= 100 Then Locate 2 , 6
If Maincounter >= 1000 Then Locate 2 , 5
If Maincounter >= 10000 Then Locate 2 , 4
If Maincounter >= 100000 Then Locate 2 , 3
If Maincounter >= 1000000 Then Locate 2 , 2
If Maincounter >= 10000000 Then Locate 2 , 1

Lcd Maincounter
Locate 2 , 9
Lcd "0 Hz    "

Locate 1 , 1
Lcd "  Freq miernik  "
C_counter = 0
Maincounter = 0
Timer1 = 0
Start Timer0
Start Timer1

End If
Return

Int_0:
Incr Ccount
Return
End

------------------------------------------------
PLIK HEX:

:1000000012C0189518951895189575C149C018957E
:100010001895189518951895189518951895189578
:100020001895189518958FED8DBFC8EBE0EA4E2E08
:10003000DD275D2EA89584B7082E877F84BF88E1D1
:10004000992781BD91BDEEE7F0E0A0E6B0E08827FA
:100050008D933197E9F7B5D166249FD18CE0F9D122
:1000600082E083BF80E080BF80E08FBD86E88EBDE8
:1000700080E090E0A5E68D939C9379B7726079BF9C
:10008000789479B7706879BF80E08093600082E0EF
:1000900083BF86E88EBD80E090E09DBD8CBDFFCF24
:1000A0000F921F922F923F924F925F927F92AF9248
:1000B000BF920F931F932F933F934F935F936F9331
:1000C0007F938F939F93AF93BF93CF93DF93EF93E0
:1000D000FF938FB78F93A5E64BD1A5E60D911C91A9
:1000E00000325CE1150709F0EAC08EB5887F8EBD4D
:1000F000882783BFA0E60C9111272227332740E0F1
:1001000050E061E070E0C5D1A1E60D931D932D9301
:100110003D93A1E60D911D912D913C91ACE44D9143
:100120005C91662777271AD2A1E60D931D932D9334
:100130003D9341E050E060E070E0A1E60D911D913B
:100140002D913C9110D209F009C000E010E020E0B0
:1001500030E0A1E60D931D932D933C9380E08093B6
:10016000600070E072BF4AE050E060E070E0A1E63D
:100170000D911D912D913C91F6D114F009F001C023
:1001800001C00BD14AE050E060E070E0A1E60D91C3
:100190001D912D913C91E7D10CF001C004C08FEB73
:1001A00017E00AD101C0F9D08FEB18E005D144E681
:1001B00050E060E070E0A1E60D911D912D913C9121
:1001C000D2D10CF001C003C08FEB16E0F5D048EEA1
:1001D00053E060E070E0A1E60D911D912D913C91FE
:1001E000C2D10CF001C003C08FEB15E0E5D040E1B7
:1001F00057E260E070E0A1E60D911D912D913C91D8
:10020000B2D10CF001C003C08FEB14E0D5D040EAAE
:1002100056E861E070E0A1E60D911D912D913C91B1
:10022000A2D10CF001C003C08FEB13E0C5D040E4B5
:1002300052E46FE070E0A1E60D911D912D913C918B
:1002400092D10CF001C003C08FEB12E0B5D040E8B2
:1002500056E968E970E0A1E60D911D912D913C9160
:1002600082D10CF001C003C08FEB11E0A5D0A8E84B
:10027000B0E0E1E6F0E08DD182D08FEB19E09CD0C8
:10028000EEE3F6E084D08FE711E096D0E8E4F6E004
:100290007ED080E090E0A5E68D939C9300E010E096
:1002A00020E030E0A1E60D931D932D933C9380E078
:1002B00090E09DBD8CBD82E083BF86E88EBD8F91AE
:1002C0008FBFFF91EF91DF91CF91BF91AF919F9140
:1002D0008F917F916F915F914F913F912F911F91DE
:1002E0000F91BF90AF907F905F904F903F902F9075
:1002F0001F900F9018950F921F922F923F924F923E
:100300005F927F92AF92BF920F931F932F933F9371
:100310004F935F936F937F938F939F93AF93BF930D
:10032000CF93DF93EF93FF938FB78F93A0E68C91DA
:100330008F5F8C938F918FBFFF91EF91DF91CF9162
:10034000BF91AF919F918F917F916F915F914F91ED
:100350003F912F911F910F91BF90AF907F905F9031
:100360004F903F902F901F900F901895F894FFCFCB
:10037000ED91FC91EF5FFF4FFC93EE930895A8E899
:10038000B0E08D91882311F05ED0FBCF0895E2D0CC
:10039000802D11F058D0FBCF089581E05AD00ED0B7
:1003A00080E857C08FE7213039F08FEB223021F001
:1003B0008FE8233009F08FEC810F4BC083E0992741
:1003C000BAC08AEF90E0B7D0BA9ABB9ABC9ABD9AED
:1003D000BE9ABF9AC79885E090E0ADD0C698C29803
:1003E000C398C49AC59AC69AEF93FF93EDE6F1E0DD
:1003F00096D0FF91EF91C6989BD0C69AEF93FF934A
:10040000EDE6F1E08CD0FF91EF91C69891D0C69ABD
:10041000EF93FF93EDE6F1E082D0FF91EF91C69864
:1004200087D0C598C69AEF93FF93EDE6F1E077D0B9
:10043000FF91EF91C6987CD088E20BD08EE009D076
:1004400086E007D00895C79A829505D004D070D071
:100450000895C798F9CF859510F4C59A01C0C5983D
:10046000859510F4C49A01C0C498859510F4C39A78
:1004700001C0C398859510F4C29A01C0C298C69A6B
:10048000EF93FF93EDE6F1E04AD0FF91EF91C6982C
:10049000089522D006D000FC01D0089528D030D095
:1004A0000895842F952FA62FB72F44275527662709
:1004B0007727F1E2889409C020F4480F591F6A1F7A
:1004C0007B1F76956795579547953795279517958F
:1004D0000795FA9589F708950024E89477FF02C0FC
:1004E00006D0689400F809D010F80124089512D0BD
:1004F0004F5F5F4F6F4F7F4F0895E89437FF089528
:1005000000951095209530950F5F1F4F2F4F3F4F4F
:100510006894089540955095609570950895319729
:10052000F1F70895689462F80895E89462F80895E0
:1005300081E090E000C0EF93FF93EE27E82BE92BDA
:1005400031F0E6E6FEE03197F1F70197D1F7FF9140
:10055000EF910895C895319600200895040F151F56
:10056000261F371F08950417150726073707089514
:10057000000F111F221F331F08950095109520951D
:1005800030950F5F1F4F2F4F3F4F089501911081FE
:100590000EC001911191219130810BC00191108108
:1005A00017FF05C03FEF2FEF04C00081112722275E
:1005B000332737FF03C0E1DF8DE28D93CF93DF93C5
:1005C000CF92DF92EF92AA24BB24CC24DD24EE2428
:1005D00040E2CAE0DD2755E093E38881890F87FD7B
:1005E0009F7083FD907F891B89935A95A9F7C0DF7F
:1005F000AA1CBB1CCC1CDD1CEE1C4A9551F7E894D0
:10060000EFE0FF2782910ED0EB30E0F71EF0689408
:100610008A2D0CD088278D93EF90DF90CF90DF91BB
:10062000CF910895982F829501D0892F8F70805D8A
:1006300026F0803309F4089568948D93089530204E
:10064000487A202020200000202046726571206D0D
:0A0650006965726E696B20200000DE
:00000001FF



 
   
 
=> Chcesz darmową stronę ? Kliknij tutaj! <=