/programy/HC08/test/Demo_S08QG8_Test/P&E_FCS.ini |
---|
File deleted |
/programy/HC08/test/Demo_S08QG8_Test/cmd/SofTec_Startup.cmd |
---|
File deleted |
/programy/HC08/test/Demo_S08QG8_Test/cmd/P&E_FCS_Reset.cmd |
---|
File deleted |
/programy/HC08/test/Demo_S08QG8_Test/cmd/Monitor_Startup.cmd |
---|
File deleted |
/programy/HC08/test/Demo_S08QG8_Test/cmd/P&E_FCS_Postload.cmd |
---|
File deleted |
/programy/HC08/test/Demo_S08QG8_Test/cmd/P&E_FCS_Preload.cmd |
---|
File deleted |
/programy/HC08/test/Demo_S08QG8_Test/cmd/P&E_ICD_Startup.cmd |
---|
File deleted |
/programy/HC08/test/Demo_S08QG8_Test/cmd/SofTec_Reset.cmd |
---|
File deleted |
/programy/HC08/test/Demo_S08QG8_Test/cmd/P&E_FCS_Startup.cmd |
---|
File deleted |
/programy/HC08/test/Demo_S08QG8_Test/cmd/SofTec_Postload.cmd |
---|
File deleted |
/programy/HC08/test/Demo_S08QG8_Test/cmd/SofTec_Preload.cmd |
---|
File deleted |
/programy/HC08/test/Demo_S08QG8_Test/cmd/Monitor_Reset.cmd |
---|
File deleted |
/programy/HC08/test/Demo_S08QG8_Test/cmd/P&E_ICD_Reset.cmd |
---|
File deleted |
/programy/HC08/test/Demo_S08QG8_Test/cmd/Monitor_Postload.cmd |
---|
File deleted |
/programy/HC08/test/Demo_S08QG8_Test/cmd/Monitor_Preload.cmd |
---|
File deleted |
/programy/HC08/test/Demo_S08QG8_Test/cmd/P&E_ICD_Postload.cmd |
---|
File deleted |
/programy/HC08/test/Demo_S08QG8_Test/cmd/P&E_ICD_Preload.cmd |
---|
File deleted |
/programy/HC08/test/Demo_S08QG8_Test/Sources/demo9S08QG8.h |
---|
File deleted |
\ No newline at end of file |
/programy/HC08/test/Demo_S08QG8_Test/Sources/Start08.c |
---|
File deleted |
/programy/HC08/test/Demo_S08QG8_Test/Sources/demo9S08QG8_test.c |
---|
File deleted |
/programy/HC08/test/Demo_S08QG8_Test/Monitor.ini |
---|
File deleted |
/programy/HC08/test/Demo_S08QG8_Test/Demo_S08QG8_Test_Data/CWSettingsWindows.stg |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/HC08/test/Demo_S08QG8_Test/Demo_S08QG8_Test_Data/SofTec/TargetDataWindows.tdt |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/HC08/test/Demo_S08QG8_Test/Demo_S08QG8_Test_Data/P&E_FCS/TargetDataWindows.tdt |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/HC08/test/Demo_S08QG8_Test/Demo_S08QG8_Test_Data/Monitor/TargetDataWindows.tdt |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/HC08/test/Demo_S08QG8_Test/Demo_S08QG8_Test_Data/P&E_ICD/ObjectCode/MC9S08QG8.C.o |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/HC08/test/Demo_S08QG8_Test/Demo_S08QG8_Test_Data/P&E_ICD/ObjectCode/Start08.c.o |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/HC08/test/Demo_S08QG8_Test/Demo_S08QG8_Test_Data/P&E_ICD/ObjectCode/demo9S08QG8_test.c.o |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/HC08/test/Demo_S08QG8_Test/Demo_S08QG8_Test_Data/P&E_ICD/TargetDataWindows.tdt |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/HC08/test/Demo_S08QG8_Test/P&E_ICD.ini |
---|
File deleted |
/programy/HC08/test/Demo_S08QG8_Test/C_Layout.hwl |
---|
File deleted |
/programy/HC08/test/Demo_S08QG8_Test/bin/Monitor.abs.s19 |
---|
File deleted |
/programy/HC08/test/Demo_S08QG8_Test/bin/SofTec.abs |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/HC08/test/Demo_S08QG8_Test/bin/P&E_ICD.abs.s19 |
---|
File deleted |
/programy/HC08/test/Demo_S08QG8_Test/bin/P&E_FCS.abs |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/HC08/test/Demo_S08QG8_Test/bin/Monitor.abs |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/HC08/test/Demo_S08QG8_Test/bin/P&E_ICD.abs |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/HC08/test/Demo_S08QG8_Test/bin/P&E_ICD.bpt |
---|
File deleted |
/programy/HC08/test/Demo_S08QG8_Test/bin/SofTec.map |
---|
File deleted |
/programy/HC08/test/Demo_S08QG8_Test/bin/P&E_ICD.mrk |
---|
File deleted |
/programy/HC08/test/Demo_S08QG8_Test/bin/P&E_FCS.map |
---|
File deleted |
/programy/HC08/test/Demo_S08QG8_Test/bin/SofTec.abs.s19 |
---|
File deleted |
/programy/HC08/test/Demo_S08QG8_Test/bin/Monitor.map |
---|
File deleted |
/programy/HC08/test/Demo_S08QG8_Test/bin/P&E_FCS.abs.s19 |
---|
File deleted |
/programy/HC08/test/Demo_S08QG8_Test/bin/P&E_ICD.map |
---|
File deleted |
/programy/HC08/test/Demo_S08QG8_Test/readme.txt |
---|
File deleted |
/programy/HC08/test/Demo_S08QG8_Test/Demo_S08QG8_Test.mcp |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/HC08/test/Demo_S08QG8_Test/prm/SofTec_linker.prm |
---|
File deleted |
/programy/HC08/test/Demo_S08QG8_Test/prm/P&E_FCS_linker.prm |
---|
File deleted |
/programy/HC08/test/Demo_S08QG8_Test/prm/Monitor_linker.prm |
---|
File deleted |
/programy/HC08/test/Demo_S08QG8_Test/prm/P&E_ICD_linker.prm |
---|
File deleted |
/programy/HC08/test/Demo_S08QG8_Test/prm/burner.bbl |
---|
File deleted |
/programy/HC08/test/Demo_S08QG8_Test/Default.mem |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/HC08/test/Demo_S08QG8_Test/SofTec.ini |
---|
File deleted |
/programy/PIC_C/motory/DC/regulator_letadlo/main.c |
---|
File deleted |
/programy/PIC_C/motory/DC/regulator_letadlo/main.LST |
---|
File deleted |
/programy/PIC_C/motory/DC/regulator_letadlo/main.HEX |
---|
File deleted |
/programy/PIC_C/motory/DC/regulator_letadlo/main.cod |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/motory/DC/regulator_letadlo/main.h |
---|
File deleted |
/programy/PIC_C/motory/DC/regulator_letadlo/main.sta |
---|
File deleted |
/programy/PIC_C/motory/DC/regulator_letadlo/main.err |
---|
File deleted |
/programy/PIC_C/motory/DC/regulator_letadlo/main.SYM |
---|
File deleted |
/programy/PIC_C/motory/DC/regulator_letadlo/main.tre |
---|
File deleted |
/programy/PIC_C/motory/DC/regulator_letadlo/prg.bat |
---|
File deleted |
\ No newline at end of file |
/programy/PIC_C/motory/DC/regulator_letadlo/vssver.scc |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/motory/DC/regulator_letadlo/main.PJT |
---|
File deleted |
/programy/PIC_C/motory/DC/regulator_letadlo/main.BAK |
---|
File deleted |
/programy/PIC_C/motory/krokac/A.BAT |
---|
File deleted |
/programy/PIC_C/motory/krokac/KROKAC.PJT |
---|
File deleted |
/programy/PIC_C/motory/krokac/KROKAC.LST |
---|
File deleted |
/programy/PIC_C/motory/krokac/KROKAC.C |
---|
File deleted |
/programy/PIC_C/motory/krokac/KROKAC.HEX |
---|
File deleted |
/programy/PIC_C/motory/krokac/KROKAC.H |
---|
File deleted |
/programy/PIC_C/motory/hodinovy/vssver.scc |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/motory/hodinovy/main.PJT |
---|
File deleted |
/programy/PIC_C/motory/hodinovy/main.BAK |
---|
File deleted |
/programy/PIC_C/motory/hodinovy/main.c |
---|
File deleted |
/programy/PIC_C/motory/hodinovy/main.LST |
---|
File deleted |
/programy/PIC_C/motory/hodinovy/main.HEX |
---|
File deleted |
/programy/PIC_C/motory/hodinovy/main.cod |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/motory/hodinovy/Run.BAT |
---|
File deleted |
\ No newline at end of file |
/programy/PIC_C/motory/hodinovy/main.h |
---|
File deleted |
/programy/PIC_C/motory/hodinovy/main.sta |
---|
File deleted |
/programy/PIC_C/motory/hodinovy/main.err |
---|
File deleted |
/programy/PIC_C/motory/hodinovy/main.SYM |
---|
File deleted |
/programy/PIC_C/motory/hodinovy/main.tre |
---|
File deleted |
/programy/PIC_C/motory/hodinovy/prg.bat |
---|
File deleted |
\ No newline at end of file |
/programy/PIC_C/motory/menice/main.c |
---|
File deleted |
/programy/PIC_C/motory/menice/main.LST |
---|
File deleted |
/programy/PIC_C/motory/menice/main.HEX |
---|
File deleted |
/programy/PIC_C/motory/menice/main.cod |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/motory/menice/Run.BAT |
---|
File deleted |
\ No newline at end of file |
/programy/PIC_C/motory/menice/main.h |
---|
File deleted |
/programy/PIC_C/motory/menice/main.sta |
---|
File deleted |
/programy/PIC_C/motory/menice/main.err |
---|
File deleted |
/programy/PIC_C/motory/menice/main.SYM |
---|
File deleted |
/programy/PIC_C/motory/menice/main.tre |
---|
File deleted |
/programy/PIC_C/motory/menice/prg.bat |
---|
File deleted |
\ No newline at end of file |
/programy/PIC_C/motory/menice/vssver.scc |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/motory/menice/main.PJT |
---|
File deleted |
/programy/PIC_C/motory/menice/main.BAK |
---|
File deleted |
/programy/PIC_C/PICcam/876/camerus.PJT |
---|
File deleted |
/programy/PIC_C/PICcam/876/camerus.c |
---|
File deleted |
/programy/PIC_C/PICcam/876/camerus.h |
---|
File deleted |
/programy/PIC_C/PICcam/873/camerus.err |
---|
File deleted |
/programy/PIC_C/PICcam/873/camerus.sym |
---|
File deleted |
/programy/PIC_C/PICcam/873/camerus.tre |
---|
File deleted |
/programy/PIC_C/PICcam/873/camerus.BAK |
---|
File deleted |
/programy/PIC_C/PICcam/873/camerus.PJT |
---|
File deleted |
/programy/PIC_C/PICcam/873/camerus.c |
---|
File deleted |
/programy/PIC_C/PICcam/873/camerus.lst |
---|
File deleted |
/programy/PIC_C/PICcam/873/camerus.hex |
---|
File deleted |
/programy/PIC_C/PICcam/873/camerus.cof |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/PICcam/873/camerus.h |
---|
File deleted |
/programy/PIC_C/PICcam/873/camerus.sta |
---|
File deleted |
/programy/PIC_C/mereni/geiger/geiger.c |
---|
File deleted |
/programy/PIC_C/mereni/geiger/geiger.lst |
---|
File deleted |
/programy/PIC_C/mereni/geiger/geiger.hex |
---|
File deleted |
/programy/PIC_C/mereni/geiger/geiger.h |
---|
File deleted |
/programy/PIC_C/mereni/geiger/geiger.cof |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/mereni/geiger/geiger.sta |
---|
File deleted |
/programy/PIC_C/mereni/geiger/bez_GPS/geiger.hex |
---|
File deleted |
/programy/PIC_C/mereni/geiger/bez_GPS/geiger.h |
---|
File deleted |
/programy/PIC_C/mereni/geiger/bez_GPS/geiger.cof |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/mereni/geiger/bez_GPS/geiger.sta |
---|
File deleted |
/programy/PIC_C/mereni/geiger/bez_GPS/geiger.err |
---|
File deleted |
/programy/PIC_C/mereni/geiger/bez_GPS/geiger.sym |
---|
File deleted |
/programy/PIC_C/mereni/geiger/bez_GPS/geiger.tre |
---|
File deleted |
/programy/PIC_C/mereni/geiger/bez_GPS/geiger.BAK |
---|
File deleted |
/programy/PIC_C/mereni/geiger/bez_GPS/geiger.PJT |
---|
File deleted |
/programy/PIC_C/mereni/geiger/bez_GPS/geiger.c |
---|
File deleted |
/programy/PIC_C/mereni/geiger/bez_GPS/geiger.lst |
---|
File deleted |
/programy/PIC_C/mereni/geiger/geiger.err |
---|
File deleted |
/programy/PIC_C/mereni/geiger/geiger.sym |
---|
File deleted |
/programy/PIC_C/mereni/geiger/geiger.tre |
---|
File deleted |
/programy/PIC_C/mereni/geiger/geiger.BAK |
---|
File deleted |
/programy/PIC_C/mereni/geiger/geiger.PJT |
---|
File deleted |
/programy/PIC_C/mereni/geiger/nmea.c |
---|
File deleted |
/programy/PIC_C/mereni/zavora/main.c |
---|
File deleted |
/programy/PIC_C/mereni/zavora/main.LST |
---|
File deleted |
/programy/PIC_C/mereni/zavora/main.HEX |
---|
File deleted |
/programy/PIC_C/mereni/zavora/main.cod |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/mereni/zavora/run.bat |
---|
File deleted |
\ No newline at end of file |
/programy/PIC_C/mereni/zavora/main.h |
---|
File deleted |
/programy/PIC_C/mereni/zavora/main.sta |
---|
File deleted |
/programy/PIC_C/mereni/zavora/main.err |
---|
File deleted |
/programy/PIC_C/mereni/zavora/main.SYM |
---|
File deleted |
/programy/PIC_C/mereni/zavora/main.tre |
---|
File deleted |
/programy/PIC_C/mereni/zavora/prg.bat |
---|
File deleted |
\ No newline at end of file |
/programy/PIC_C/mereni/zavora/vssver.scc |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/mereni/zavora/main.PJT |
---|
File deleted |
/programy/PIC_C/mereni/zavora/main.BAK |
---|
File deleted |
/programy/PIC_C/mereni/otmer/otmer.LST |
---|
File deleted |
/programy/PIC_C/mereni/otmer/otmer.cof |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/mereni/otmer/otmer.SYM |
---|
File deleted |
/programy/PIC_C/mereni/otmer/16F873/otmer.HEX |
---|
File deleted |
/programy/PIC_C/mereni/otmer/16F873/otmer.sta |
---|
File deleted |
/programy/PIC_C/mereni/otmer/16F873/otmer.h |
---|
File deleted |
/programy/PIC_C/mereni/otmer/16F873/otmer.cof |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/mereni/otmer/16F873/otmer.err |
---|
File deleted |
/programy/PIC_C/mereni/otmer/16F873/otmer.SYM |
---|
File deleted |
/programy/PIC_C/mereni/otmer/16F873/otmer.tre |
---|
File deleted |
/programy/PIC_C/mereni/otmer/16F873/otmer.BAK |
---|
File deleted |
/programy/PIC_C/mereni/otmer/16F873/otmer.PJT |
---|
File deleted |
/programy/PIC_C/mereni/otmer/16F873/LCD.C |
---|
File deleted |
/programy/PIC_C/mereni/otmer/16F873/otmer.LST |
---|
File deleted |
/programy/PIC_C/mereni/otmer/16F873/otmer.c |
---|
File deleted |
/programy/PIC_C/mereni/otmer/vssver.scc |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/mereni/otmer/shift_reg.BAK |
---|
File deleted |
/programy/PIC_C/mereni/otmer/otmer.c |
---|
File deleted |
/programy/PIC_C/mereni/otmer/otmer.HEX |
---|
File deleted |
/programy/PIC_C/mereni/otmer/Kopie - otackomer.c |
---|
File deleted |
/programy/PIC_C/mereni/otmer/otmer.sta |
---|
File deleted |
/programy/PIC_C/mereni/otmer/otmer.h |
---|
File deleted |
/programy/PIC_C/mereni/otmer/Kopie - otmer.c |
---|
File deleted |
/programy/PIC_C/mereni/otmer/otmer.err |
---|
File deleted |
/programy/PIC_C/mereni/otmer/otmer.tre |
---|
File deleted |
/programy/PIC_C/mereni/otmer/otmer.PJT |
---|
File deleted |
/programy/PIC_C/mereni/otmer/otmer.BAK |
---|
File deleted |
/programy/PIC_C/mereni/tester serv/blikac.LST |
---|
File deleted |
/programy/PIC_C/mereni/tester serv/blikac.c |
---|
File deleted |
/programy/PIC_C/mereni/tester serv/blikac.HEX |
---|
File deleted |
/programy/PIC_C/mereni/tester serv/Run.BAT |
---|
File deleted |
\ No newline at end of file |
/programy/PIC_C/mereni/tester serv/blikac.cod |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/mereni/tester serv/blikac.sta |
---|
File deleted |
/programy/PIC_C/mereni/tester serv/blikac.h |
---|
File deleted |
/programy/PIC_C/mereni/tester serv/blikac.err |
---|
File deleted |
/programy/PIC_C/mereni/tester serv/blikac.SYM |
---|
File deleted |
/programy/PIC_C/mereni/tester serv/PRG.BAT |
---|
File deleted |
\ No newline at end of file |
/programy/PIC_C/mereni/tester serv/blikac.tre |
---|
File deleted |
/programy/PIC_C/mereni/tester serv/vssver.scc |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/mereni/tester serv/blikac.BAK |
---|
File deleted |
/programy/PIC_C/mereni/tester serv/blikac.PJT |
---|
File deleted |
/programy/PIC_C/mereni/mys/mys.JPG |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/mereni/mys/PIC16F88/mys.HEX |
---|
File deleted |
/programy/PIC_C/mereni/mys/PIC16F88/mys.cof |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/mereni/mys/PIC16F88/mys.h |
---|
File deleted |
/programy/PIC_C/mereni/mys/PIC16F88/mys.sta |
---|
File deleted |
/programy/PIC_C/mereni/mys/PIC16F88/mys.SYM |
---|
File deleted |
/programy/PIC_C/mereni/mys/PIC16F88/mys.err |
---|
File deleted |
/programy/PIC_C/mereni/mys/PIC16F88/mys.tre |
---|
File deleted |
/programy/PIC_C/mereni/mys/PIC16F88/mys.BAK |
---|
File deleted |
/programy/PIC_C/mereni/mys/PIC16F88/mys.PJT |
---|
File deleted |
/programy/PIC_C/mereni/mys/PIC16F88/mys.LST |
---|
File deleted |
/programy/PIC_C/mereni/mys/PIC16F88/mys.c |
---|
File deleted |
/programy/PIC_C/mereni/PS2mys/PIC16F84/main.err |
---|
File deleted |
/programy/PIC_C/mereni/PS2mys/PIC16F84/main.tre |
---|
File deleted |
/programy/PIC_C/mereni/PS2mys/PIC16F84/main.PJT |
---|
File deleted |
/programy/PIC_C/mereni/PS2mys/PIC16F84/main.BAK |
---|
File deleted |
/programy/PIC_C/mereni/PS2mys/PIC16F84/RUN.PIF |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/mereni/PS2mys/PIC16F84/main.LST |
---|
File deleted |
/programy/PIC_C/mereni/PS2mys/PIC16F84/main.cod |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/mereni/PS2mys/PIC16F84/main.SYM |
---|
File deleted |
/programy/PIC_C/mereni/PS2mys/PIC16F84/prg.bat |
---|
File deleted |
\ No newline at end of file |
/programy/PIC_C/mereni/PS2mys/PIC16F84/ps2mouse.c |
---|
File deleted |
/programy/PIC_C/mereni/PS2mys/PIC16F84/vssver.scc |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/mereni/PS2mys/PIC16F84/ps2.BAK |
---|
File deleted |
/programy/PIC_C/mereni/PS2mys/PIC16F84/ps2mouse.h |
---|
File deleted |
/programy/PIC_C/mereni/PS2mys/PIC16F84/main.c |
---|
File deleted |
/programy/PIC_C/mereni/PS2mys/PIC16F84/main.HEX |
---|
File deleted |
/programy/PIC_C/mereni/PS2mys/PIC16F84/Run.BAT |
---|
File deleted |
\ No newline at end of file |
/programy/PIC_C/mereni/PS2mys/PIC16F84/ps2mouse.BAK |
---|
File deleted |
/programy/PIC_C/mereni/PS2mys/PIC16F84/main.h |
---|
File deleted |
/programy/PIC_C/mereni/PS2mys/PIC16F84/main.sta |
---|
File deleted |
/programy/PIC_C/mereni/PS2mys/PIC16F88/mys.LST |
---|
File deleted |
/programy/PIC_C/mereni/PS2mys/PIC16F88/mys.c |
---|
File deleted |
/programy/PIC_C/mereni/PS2mys/PIC16F88/mys.HEX |
---|
File deleted |
/programy/PIC_C/mereni/PS2mys/PIC16F88/mys.cof |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/mereni/PS2mys/PIC16F88/mys.h |
---|
File deleted |
/programy/PIC_C/mereni/PS2mys/PIC16F88/mys.sta |
---|
File deleted |
/programy/PIC_C/mereni/PS2mys/PIC16F88/mys.SYM |
---|
File deleted |
/programy/PIC_C/mereni/PS2mys/PIC16F88/mys.err |
---|
File deleted |
/programy/PIC_C/mereni/PS2mys/PIC16F88/mys.tre |
---|
File deleted |
/programy/PIC_C/mereni/PS2mys/PIC16F88/mys.BAK |
---|
File deleted |
/programy/PIC_C/mereni/PS2mys/PIC16F88/mys.PJT |
---|
File deleted |
/programy/PIC_C/mereni/gmetr/gmetr.tre |
---|
File deleted |
/programy/PIC_C/mereni/gmetr/gmetr.BAK |
---|
File deleted |
/programy/PIC_C/mereni/gmetr/gmetr.PJT |
---|
File deleted |
/programy/PIC_C/mereni/gmetr/vssver.scc |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/mereni/gmetr/gmetr.LST |
---|
File deleted |
/programy/PIC_C/mereni/gmetr/gmetr.c |
---|
File deleted |
/programy/PIC_C/mereni/gmetr/gmetr.HEX |
---|
File deleted |
/programy/PIC_C/mereni/gmetr/gmetr.h |
---|
File deleted |
/programy/PIC_C/mereni/gmetr/gmetr.cof |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/mereni/gmetr/gmetr.sta |
---|
File deleted |
/programy/PIC_C/mereni/gmetr/gmetr.SYM |
---|
File deleted |
/programy/PIC_C/mereni/gmetr/gmetr.err |
---|
File deleted |
/programy/PIC_C/mereni/piezo_cidlo/PRG.PIF |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/mereni/piezo_cidlo/piezo.c |
---|
File deleted |
/programy/PIC_C/mereni/piezo_cidlo/piezo.HEX |
---|
File deleted |
/programy/PIC_C/mereni/piezo_cidlo/Run.BAT |
---|
File deleted |
\ No newline at end of file |
/programy/PIC_C/mereni/piezo_cidlo/piezo.sta |
---|
File deleted |
/programy/PIC_C/mereni/piezo_cidlo/piezo.h |
---|
File deleted |
/programy/PIC_C/mereni/piezo_cidlo/piezo.err |
---|
File deleted |
/programy/PIC_C/mereni/piezo_cidlo/piezo.tre |
---|
File deleted |
/programy/PIC_C/mereni/piezo_cidlo/RUN.PIF |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/mereni/piezo_cidlo/piezo.BAK |
---|
File deleted |
/programy/PIC_C/mereni/piezo_cidlo/piezo.PJT |
---|
File deleted |
/programy/PIC_C/mereni/piezo_cidlo/piezo.LST |
---|
File deleted |
/programy/PIC_C/mereni/piezo_cidlo/piezo.cod |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/mereni/piezo_cidlo/PRG.BAT |
---|
File deleted |
\ No newline at end of file |
/programy/PIC_C/mereni/piezo_cidlo/piezo.SYM |
---|
File deleted |
/programy/PIC_C/mereni/piezo_cidlo/vssver.scc |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/mereni/mereni_ultraz/main.HEX |
---|
File deleted |
/programy/PIC_C/mereni/mereni_ultraz/main.cod |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/mereni/mereni_ultraz/Run.BAT |
---|
File deleted |
\ No newline at end of file |
/programy/PIC_C/mereni/mereni_ultraz/main.h |
---|
File deleted |
/programy/PIC_C/mereni/mereni_ultraz/main.sta |
---|
File deleted |
/programy/PIC_C/mereni/mereni_ultraz/main.err |
---|
File deleted |
/programy/PIC_C/mereni/mereni_ultraz/main.SYM |
---|
File deleted |
/programy/PIC_C/mereni/mereni_ultraz/main.tre |
---|
File deleted |
/programy/PIC_C/mereni/mereni_ultraz/prg.bat |
---|
File deleted |
\ No newline at end of file |
/programy/PIC_C/mereni/mereni_ultraz/vssver.scc |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/mereni/mereni_ultraz/main.PJT |
---|
File deleted |
/programy/PIC_C/mereni/mereni_ultraz/main.BAK |
---|
File deleted |
/programy/PIC_C/mereni/mereni_ultraz/RUN.PIF |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/mereni/mereni_ultraz/main.c |
---|
File deleted |
/programy/PIC_C/mereni/mereni_ultraz/main.LST |
---|
File deleted |
/programy/PIC_C/mereni/vyskomer_drak/main.LST |
---|
File deleted |
/programy/PIC_C/mereni/vyskomer_drak/main.cod |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/mereni/vyskomer_drak/main.SYM |
---|
File deleted |
/programy/PIC_C/mereni/vyskomer_drak/prg.bat |
---|
File deleted |
\ No newline at end of file |
/programy/PIC_C/mereni/vyskomer_drak/ms5534a.BAK |
---|
File deleted |
/programy/PIC_C/mereni/vyskomer_drak/vssver.scc |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/mereni/vyskomer_drak/main.c |
---|
File deleted |
/programy/PIC_C/mereni/vyskomer_drak/main.HEX |
---|
File deleted |
/programy/PIC_C/mereni/vyskomer_drak/run.bat |
---|
File deleted |
\ No newline at end of file |
/programy/PIC_C/mereni/vyskomer_drak/main.h |
---|
File deleted |
/programy/PIC_C/mereni/vyskomer_drak/main.sta |
---|
File deleted |
/programy/PIC_C/mereni/vyskomer_drak/main.err |
---|
File deleted |
/programy/PIC_C/mereni/vyskomer_drak/main.tre |
---|
File deleted |
/programy/PIC_C/mereni/vyskomer_drak/main.PJT |
---|
File deleted |
/programy/PIC_C/mereni/vyskomer_drak/main.BAK |
---|
File deleted |
/programy/PIC_C/mereni/vyskomer_drak/ms5534a.c |
---|
File deleted |
/programy/PIC_C/mereni/serva/PIC16F88/tester.tre |
---|
File deleted |
/programy/PIC_C/mereni/serva/PIC16F88/tester.BAK |
---|
File deleted |
/programy/PIC_C/mereni/serva/PIC16F88/tester.PJT |
---|
File deleted |
/programy/PIC_C/mereni/serva/PIC16F88/tester.LST |
---|
File deleted |
/programy/PIC_C/mereni/serva/PIC16F88/tester.c |
---|
File deleted |
/programy/PIC_C/mereni/serva/PIC16F88/tester.HEX |
---|
File deleted |
/programy/PIC_C/mereni/serva/PIC16F88/tester.h |
---|
File deleted |
/programy/PIC_C/mereni/serva/PIC16F88/tester.cof |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/mereni/serva/PIC16F88/tester.sta |
---|
File deleted |
/programy/PIC_C/mereni/serva/PIC16F88/tester.err |
---|
File deleted |
/programy/PIC_C/mereni/serva/PIC16F88/tester.SYM |
---|
File deleted |
/programy/PIC_C/mereni/serva/PIC16F84/main.tre |
---|
File deleted |
/programy/PIC_C/mereni/serva/PIC16F84/prg.bat |
---|
File deleted |
\ No newline at end of file |
/programy/PIC_C/mereni/serva/PIC16F84/vssver.scc |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/mereni/serva/PIC16F84/main.PJT |
---|
File deleted |
/programy/PIC_C/mereni/serva/PIC16F84/main.BAK |
---|
File deleted |
/programy/PIC_C/mereni/serva/PIC16F84/main.c |
---|
File deleted |
/programy/PIC_C/mereni/serva/PIC16F84/main.LST |
---|
File deleted |
/programy/PIC_C/mereni/serva/PIC16F84/main.HEX |
---|
File deleted |
/programy/PIC_C/mereni/serva/PIC16F84/main.cod |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/mereni/serva/PIC16F84/main.h |
---|
File deleted |
/programy/PIC_C/mereni/serva/PIC16F84/main.sta |
---|
File deleted |
/programy/PIC_C/mereni/serva/PIC16F84/main.err |
---|
File deleted |
/programy/PIC_C/mereni/serva/PIC16F84/main.SYM |
---|
File deleted |
/programy/PIC_C/test/C16F876A/blik/blik.c |
---|
File deleted |
/programy/PIC_C/test/C16F876A/blik/blik.lst |
---|
File deleted |
/programy/PIC_C/test/C16F876A/blik/blik.hex |
---|
File deleted |
/programy/PIC_C/test/C16F876A/blik/blik.cof |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/test/C16F876A/blik/blik.h |
---|
File deleted |
/programy/PIC_C/test/C16F876A/blik/blik.sta |
---|
File deleted |
/programy/PIC_C/test/C16F876A/blik/blik.sym |
---|
File deleted |
/programy/PIC_C/test/C16F876A/blik/blik.err |
---|
File deleted |
/programy/PIC_C/test/C16F876A/blik/blik.tre |
---|
File deleted |
/programy/PIC_C/test/C16F876A/blik/blik.BAK |
---|
File deleted |
/programy/PIC_C/test/C16F876A/blik/blik.PJT |
---|
File deleted |
/programy/PIC_C/test/PIC16F84A/blik/blik.c |
---|
File deleted |
/programy/PIC_C/test/PIC16F84A/blik/blik.lst |
---|
File deleted |
/programy/PIC_C/test/PIC16F84A/blik/blik.hex |
---|
File deleted |
/programy/PIC_C/test/PIC16F84A/blik/blik.cof |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/test/PIC16F84A/blik/blik.h |
---|
File deleted |
/programy/PIC_C/test/PIC16F84A/blik/blik.sta |
---|
File deleted |
/programy/PIC_C/test/PIC16F84A/blik/blik.sym |
---|
File deleted |
/programy/PIC_C/test/PIC16F84A/blik/blik.err |
---|
File deleted |
/programy/PIC_C/test/PIC16F84A/blik/blik.tre |
---|
File deleted |
/programy/PIC_C/test/PIC16F84A/blik/blik.BAK |
---|
File deleted |
/programy/PIC_C/test/PIC16F84A/blik/blik.PJT |
---|
File deleted |
/programy/PIC_C/test/PIC16F84A/blik/prg.bat |
---|
File deleted |
/programy/PIC_C/test/PIC16F88/blik/blik.c |
---|
File deleted |
/programy/PIC_C/test/PIC16F88/blik/blik.lst |
---|
File deleted |
/programy/PIC_C/test/PIC16F88/blik/blik.hex |
---|
File deleted |
/programy/PIC_C/test/PIC16F88/blik/blik.cof |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/test/PIC16F88/blik/blik.h |
---|
File deleted |
/programy/PIC_C/test/PIC16F88/blik/blik.sta |
---|
File deleted |
/programy/PIC_C/test/PIC16F88/blik/blik.sym |
---|
File deleted |
/programy/PIC_C/test/PIC16F88/blik/blik.err |
---|
File deleted |
/programy/PIC_C/test/PIC16F88/blik/blik.tre |
---|
File deleted |
/programy/PIC_C/test/PIC16F88/blik/blik.BAK |
---|
File deleted |
/programy/PIC_C/test/PIC16F88/blik/blik.PJT |
---|
File deleted |
/programy/PIC_C/test/PIC16F88/blik/prg.bat |
---|
File deleted |
/programy/PIC_C/hack/hack.LST |
---|
File deleted |
/programy/PIC_C/hack/hack.c |
---|
File deleted |
/programy/PIC_C/hack/hack.HEX |
---|
File deleted |
/programy/PIC_C/hack/hack.sta |
---|
File deleted |
/programy/PIC_C/hack/hack.cof |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/PIC_C/hack/hack.h |
---|
File deleted |
/programy/PIC_C/hack/hack.err |
---|
File deleted |
/programy/PIC_C/hack/hack.SYM |
---|
File deleted |
/programy/PIC_C/hack/hack.tre |
---|
File deleted |
/programy/PIC_C/hack/hack.BAK |
---|
File deleted |
/programy/PIC_C/hack/hack.PJT |
---|
File deleted |
/programy/mips/indi/Config.in |
---|
File deleted |
/programy/mips/indi/ipkg/indiserver.control |
---|
File deleted |
/programy/mips/indi/Makefile |
---|
File deleted |
/programy/mips/indi/patches/indiserver-0.5.patch |
---|
File deleted |
/programy/mips/hello/main.c |
---|
File deleted |
/programy/mips/hello/Makefile |
---|
File deleted |
/programy/avr/Blik/prg_read_uc |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programy/avr/Blik/README.txt |
---|
File deleted |
/programy/avr/Blik/avrm8ledtest_pre.hex |
---|
File deleted |
/programy/avr/Blik/Makefile |
---|
File deleted |
/programy/avr/Blik/prg_load_uc |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programy/avr/Blik/avrm8ledtest.map |
---|
File deleted |
/programy/avr/Blik/prg_fusebit_uc |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programy/avr/Blik/avrm8ledtest.c |
---|
File deleted |
/programy/avr/Blik/avrm8ledtest.hex |
---|
File deleted |
/programy/avr/Blik/avrm8ledtest.out |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr/SFR08/SRF08 Ultra sonic range finder.htm |
---|
File deleted |
/programy/avr/SFR08/test_srf08.c |
---|
File deleted |
/programy/avr/SFR08/test_lcd.c |
---|
File deleted |
/programy/avr/SFR08/i2c.h |
---|
File deleted |
/programy/avr/SFR08/srf08.c |
---|
File deleted |
/programy/avr/SFR08/srf08.h |
---|
File deleted |
/programy/avr/SFR08/lcd_io.c |
---|
File deleted |
/programy/avr/SFR08/Readme.txt |
---|
File deleted |
/programy/avr/SFR08/SRF08 Ultra sonic range finder_files/srf08con.jpg |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr/SFR08/makefile |
---|
File deleted |
/programy/avr/SFR08/i2c.c |
---|
File deleted |
/programy/avr/SFR08/lcd_io.h |
---|
File deleted |
/programy/avr/RS232toRS485/rs485.aws |
---|
File deleted |
/programy/avr/RS232toRS485/default/rs485.hex |
---|
File deleted |
/programy/avr/RS232toRS485/default/rs485.elf |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr/RS232toRS485/default/Makefile |
---|
File deleted |
/programy/avr/RS232toRS485/rs485.aps |
---|
File deleted |
/programy/avr/RS232toRS485/P232.c |
---|
File deleted |
/programy/avr/AVRcam/Main.d |
---|
File deleted |
/programy/avr/AVRcam/AVRcam.kdevses |
---|
File deleted |
/programy/avr/AVRcam/I2CInterface.c |
---|
File deleted |
/programy/avr/AVRcam/CommonDefs.h |
---|
File deleted |
/programy/avr/AVRcam/I2CInterface.d |
---|
File deleted |
/programy/avr/AVRcam/AVRcam.eep |
---|
File deleted |
/programy/avr/AVRcam/CamInterface.S |
---|
File deleted |
/programy/avr/AVRcam/CamInterfaceAsm.lst |
---|
File deleted |
/programy/avr/AVRcam/Utility.c |
---|
File deleted |
/programy/avr/AVRcam/I2CInterface.h |
---|
File deleted |
/programy/avr/AVRcam/AVRcam.map |
---|
File deleted |
/programy/avr/AVRcam/Utility.d |
---|
File deleted |
/programy/avr/AVRcam/Main.lst |
---|
File deleted |
/programy/avr/AVRcam/DebugInterface.c |
---|
File deleted |
/programy/avr/AVRcam/Utility.h |
---|
File deleted |
/programy/avr/AVRcam/DebugInterface.d |
---|
File deleted |
/programy/avr/AVRcam/AVRcam.hex |
---|
File deleted |
/programy/avr/AVRcam/DebugInterface.h |
---|
File deleted |
/programy/avr/AVRcam/I2CInterface.lst |
---|
File deleted |
/programy/avr/AVRcam/CamInterface.c |
---|
File deleted |
/programy/avr/AVRcam/CamInterface.d |
---|
File deleted |
/programy/avr/AVRcam/Utility.lst |
---|
File deleted |
/programy/avr/AVRcam/UIMgr.c |
---|
File deleted |
/programy/avr/AVRcam/UIMgr.d |
---|
File deleted |
/programy/avr/AVRcam/CamInterface.h |
---|
File deleted |
/programy/avr/AVRcam/CamConfig.c |
---|
File deleted |
/programy/avr/AVRcam/DebugInterface.lst |
---|
File deleted |
/programy/avr/AVRcam/CamConfig.d |
---|
File deleted |
/programy/avr/AVRcam/UIMgr.h |
---|
File deleted |
/programy/avr/AVRcam/AVRcam.lss |
---|
File deleted |
/programy/avr/AVRcam/README.txt |
---|
File deleted |
\ No newline at end of file |
/programy/avr/AVRcam/CamConfig.h |
---|
File deleted |
/programy/avr/AVRcam/UartInterface.c |
---|
File deleted |
/programy/avr/AVRcam/makefile |
---|
File deleted |
/programy/avr/AVRcam/UartInterface.d |
---|
File deleted |
/programy/avr/AVRcam/FrameMgr_for_line_following.c |
---|
File deleted |
/programy/avr/AVRcam/AVRcam.elf |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr/AVRcam/FrameMgr.c |
---|
File deleted |
/programy/avr/AVRcam/AVRcam.kdevelop |
---|
File deleted |
/programy/avr/AVRcam/FrameMgr.d |
---|
File deleted |
/programy/avr/AVRcam/CamInterface.lst |
---|
File deleted |
/programy/avr/AVRcam/Executive.c |
---|
File deleted |
/programy/avr/AVRcam/UartInterface.h |
---|
File deleted |
/programy/avr/AVRcam/Doxyfile |
---|
File deleted |
/programy/avr/AVRcam/CamInterfaceAsm.S |
---|
File deleted |
/programy/avr/AVRcam/Executive.d |
---|
File deleted |
/programy/avr/AVRcam/UIMgr.lst |
---|
File deleted |
/programy/avr/AVRcam/FrameMgr.h |
---|
File deleted |
/programy/avr/AVRcam/Executive.h |
---|
File deleted |
/programy/avr/AVRcam/CamConfig.lst |
---|
File deleted |
/programy/avr/AVRcam/Events.h |
---|
File deleted |
/programy/avr/AVRcam/AVRcam.kdevelop.filelist |
---|
File deleted |
/programy/avr/AVRcam/UartInterface.lst |
---|
File deleted |
/programy/avr/AVRcam/FrameMgr.lst |
---|
File deleted |
/programy/avr/AVRcam/Executive.lst |
---|
File deleted |
/programy/avr/AVRcam/Main.c |
---|
File deleted |
/programy/avr/AVRcam/AVRcam.kdevelop.pcs |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr32/BoardController/BoardController |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr32/BoardController/BoardController.cpp |
---|
File deleted |
/programy/avr32/BoardController/Makefile |
---|
File deleted |
/programy/avr32/linux-kernel/config |
---|
File deleted |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/modules.ccwmap |
---|
File deleted |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/modules.inputmap |
---|
File deleted |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/modules.seriomap |
---|
File deleted |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/modules.ofmap |
---|
File deleted |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/modules.ieee1394map |
---|
File deleted |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/modules.usbmap |
---|
File deleted |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/modules.isapnpmap |
---|
File deleted |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/build |
---|
File deleted |
\ No newline at end of file |
Property changes: |
Deleted: svn:special |
-* |
\ No newline at end of property |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/modules.symbols |
---|
File deleted |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/modules.dep |
---|
File deleted |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/ppp_generic.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/ppp_async.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/ppp_mppe.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/pppoe.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/ppp_deflate.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/bsd_comp.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/pppox.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/tun.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/slhc.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/usb/gadget/g_file_storage.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/usb/gadget/g_ether.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/usb/gadget/gadgetfs.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/usb/gadget/g_serial.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/usb/gadget/g_zero.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/block/nbd.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/block/rd.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/block/loop.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/spi/spidev.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/crypto/pcbc.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/crypto/ecb.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/crypto/arc4.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/lib/crc-ccitt.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/sound/ac97_bus.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/sound/pci/ac97/snd-ac97-codec.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/sound/avr32/snd-atmel-ac97.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/fs/vfat/vfat.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/fs/fuse/fuse.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/fs/cifs/cifs.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/fs/msdos/msdos.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/fs/smbfs/smbfs.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/fs/fat/fat.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/source |
---|
File deleted |
\ No newline at end of file |
Property changes: |
Deleted: svn:special |
-* |
\ No newline at end of property |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/modules.pcimap |
---|
File deleted |
/programy/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/modules.alias |
---|
File deleted |
/programy/avr32/linux-kernel/rootfs/uImage |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr32/linux-kernel/kernel/arch/avr32/boards/atngw100/setup.c |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programy/avr32/SID/sidd |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr32/SID/sidd.c |
---|
File deleted |
/programy/avr32/SID/sidd.conf |
---|
File deleted |
/programy/avr32/SID/fftw3/compile |
---|
File deleted |
/programy/avr32/SID/README |
---|
File deleted |
/programy/avr32/SFR08/SFR08.cpp |
---|
File deleted |
/programy/avr32/hello/Makefile |
---|
File deleted |
/programy/avr32/hello/hello.c |
---|
File deleted |
/programy/avr32/hello/hello.elf |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/avr32/cmps03/main.cpp |
---|
File deleted |
/programy/avr32/cmps03/compass.c |
---|
File deleted |
/programy/C/HC08/test/Demo_S08QG8_Test/C_Layout.hwl |
---|
0,0 → 1,20 |
OPEN source 0 0 60 39 |
Source < attributes MARKS off |
OPEN assembly 60 0 40 31 |
Assembly < attributes ADR on,CODE off,ABSADR on,SYMB off,TOPPC 0xF88C |
OPEN procedure 0 39 60 17 |
Procedure < attributes VALUES on,TYPES off |
OPEN register 60 31 40 25 |
Register < attributes FORMAT AUTO,COMPLEMENT None |
OPEN memory 60 56 40 22 |
Memory < attributes FORMAT hex,COMPLEMENT None,WORD 1,ASC on,ADR on,ADDRESS 0x80 |
OPEN data 0 56 60 22 |
Data:1 < attributes SCOPE global,COMPLEMENT None,FORMAT Symb,MODE automatic,UPDATERATE 10,NAMEWIDTH 16 |
OPEN data 0 78 60 22 |
Data:2 < attributes SCOPE local,COMPLEMENT None,FORMAT Symb,MODE automatic,UPDATERATE 10,NAMEWIDTH 16 |
OPEN command 60 78 40 22 |
Command < attributes CACHESIZE 1000 |
bckcolor 50331647 |
font 'Courier New' 9 BLACK |
AUTOSIZE on |
ACTIVATE Data:2 Command Procedure Data:1 Source Register Assembly Memory |
/programy/C/HC08/test/Demo_S08QG8_Test/Default.mem |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/HC08/test/Demo_S08QG8_Test/Demo_S08QG8_Test.mcp |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/HC08/test/Demo_S08QG8_Test/Demo_S08QG8_Test_Data/CWSettingsWindows.stg |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/HC08/test/Demo_S08QG8_Test/Demo_S08QG8_Test_Data/Monitor/TargetDataWindows.tdt |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/HC08/test/Demo_S08QG8_Test/Demo_S08QG8_Test_Data/P&E_FCS/TargetDataWindows.tdt |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/HC08/test/Demo_S08QG8_Test/Demo_S08QG8_Test_Data/P&E_ICD/ObjectCode/MC9S08QG8.C.o |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/HC08/test/Demo_S08QG8_Test/Demo_S08QG8_Test_Data/P&E_ICD/ObjectCode/Start08.c.o |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/HC08/test/Demo_S08QG8_Test/Demo_S08QG8_Test_Data/P&E_ICD/ObjectCode/demo9S08QG8_test.c.o |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/HC08/test/Demo_S08QG8_Test/Demo_S08QG8_Test_Data/P&E_ICD/TargetDataWindows.tdt |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/HC08/test/Demo_S08QG8_Test/Demo_S08QG8_Test_Data/SofTec/TargetDataWindows.tdt |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/HC08/test/Demo_S08QG8_Test/Monitor.ini |
---|
0,0 → 1,32 |
[Environment Variables] |
GENPATH={Compiler}lib\hc08c\src;{Compiler}lib\hc08c\include;{Compiler}lib\hc08c\lib |
LIBPATH={Compiler}lib\hc08c\include |
OBJPATH={Project}bin |
TEXTPATH={Project}bin |
ABSPATH={Project}bin |
[HI-WAVE] |
Target=GDI |
Layout=C_layout.hwl |
[GDI] |
COMSETTINGS=SETCOMM DRIVER NOPROTOCOL NOPERIODICAL "hcs08serialmon.dll" |
[MONITOR-HCS08_GDI_SETTINGS] |
CMDFILE0=CMDFILE STARTUP ON ".\cmd\monitor_startup.cmd" |
CMDFILE1=CMDFILE RESET ON ".\cmd\monitor_reset.cmd" |
CMDFILE2=CMDFILE PRELOAD ON ".\cmd\monitor_preload.cmd" |
CMDFILE3=CMDFILE POSTLOAD ON ".\cmd\monitor_postload.cmd" |
/*$MULPART$*/ |
[MONITOR_HCS08_STATE] |
COMPORT=1 |
BAUDRATE=115200 |
DEVICEID0002_ENABLEVECTORMIRRORING=1 |
DEVICEID0002_MONITORSTARTADDRESS=0xFC00 |
DEVICEID0002_RESERVEDVECTORS=19,18,17,5,2 |
DEVICEID0003_ENABLEVECTORMIRRORING=1 |
DEVICEID0003_MONITORSTARTADDRESS=0xFC00 |
DEVICEID0003_RESERVEDVECTORS=10,9,8,2 |
DEVICEID0004_ENABLEVECTORMIRRORING=1 |
DEVICEID0004_MONITORSTARTADDRESS=0xFC00 |
DEVICEID0004_RESERVEDVECTORS=10,9,8,2 |
/programy/C/HC08/test/Demo_S08QG8_Test/P&E_FCS.ini |
---|
0,0 → 1,18 |
[Environment Variables] |
GENPATH={Compiler}lib\hc08c\src;{Compiler}lib\hc08c\include;{Compiler}lib\hc08c\lib |
LIBPATH={Compiler}lib\hc08c\include |
OBJPATH={Project}bin |
TEXTPATH={Project}bin |
ABSPATH={Project}bin |
[HI-WAVE] |
Target=PEDEBUG |
Layout=C_layout.hwl |
[PEDEBUG] |
CURRENTDEVICE=9S08QG8 |
CURRENTMODE=1 |
CMDFILE0=CMDFILE STARTUP ON ".\cmd\p&e_FCS_startup.cmd" |
CMDFILE1=CMDFILE RESET ON ".\cmd\p&e_FCS_reset.cmd" |
CMDFILE2=CMDFILE PRELOAD ON ".\cmd\p&e_FCS_preload.cmd" |
CMDFILE3=CMDFILE POSTLOAD ON ".\cmd\p&e_FCS_postload.cmd" |
/programy/C/HC08/test/Demo_S08QG8_Test/P&E_ICD.ini |
---|
0,0 → 1,62 |
[Environment Variables] |
GENPATH={Compiler}lib\hc08c\src;{Compiler}lib\hc08c\include;{Compiler}lib\hc08c\lib |
LIBPATH={Compiler}lib\hc08c\include |
OBJPATH={Project}bin |
TEXTPATH={Project}bin |
ABSPATH={Project}bin |
[HI-WAVE] |
Target=PEDEBUG |
Layout=C_layout.hwl |
MainFrame=2,3,-1,-1,-1,-1,0,-1,812,611 |
TOOLBAR=57600 57601 32795 0 57635 57634 57637 0 57671 57669 0 32777 32776 32782 32780 32781 32778 0 32806 |
[PEDEBUG] |
CURRENTDEVICE=9S08QG8 |
CURRENTMODE=1 |
CMDFILE0=CMDFILE STARTUP ON ".\cmd\p&e_ICD_startup.cmd" |
CMDFILE1=CMDFILE RESET ON ".\cmd\p&e_ICD_reset.cmd" |
CMDFILE2=CMDFILE PRELOAD ON ".\cmd\p&e_ICD_preload.cmd" |
CMDFILE3=CMDFILE POSTLOAD ON ".\cmd\p&e_ICD_postload.cmd" |
SHOWPROT=0 |
DBG0=DBG GENERAL DISARM_ON PROTECT_OFF ANALYZE_ON STEPATRUN_ON |
DBG1=DBG USER 0x0 0x0 |
DBG2=DBG PREDEFINED SELECT 0 END STOP 0x0 |
ASK_BEFORE_ERASING_FLASH=1 |
AUTO_SYNC=1 |
TRACE_ENABLEDISABLESTATE=0 |
[DEVICE] |
CHIPMODE=9S08QG8 |
[STARTUP12] |
show_hstep_assembly_details=0 |
[STARTUP] |
CPUTARGETTYPE=0 |
IO_DELAY_SET=0 |
USE_RESET_PIN=0 |
IO_DELAY_CNT=29 |
PCI_DELAY=2 |
RESET_DELAY=0 |
PORT=21 |
interface_selection=1 |
SHOWDIALOG=1 |
USE_CYCLONEPRO_RELAYS=0 |
CyclonePro_poweroffonexit=0 |
CyclonePro_currentvoltage=255 |
CyclonePro_PowerDownDelay=250 |
CyclonePro_PowerUpDelay=250 |
[PORT] |
IP= |
[SETTINGS] |
DEFAULT_SOURCE_PATH=C:\Program Files\Metrowerks\CW08 V3.1\prog |
MEMORYSTART2=0 |
MEMORYSTART1=96 |
[SAVESETTINGS] |
S19FILENAME= |
PRGFILENAME= |
PRGFILEPATH=C:\Program Files\Metrowerks\CW08 V3.1\prog |
SERIALFILENAME= |
[9S08QG8] |
PROGRAMMING_ALGORITHM=0 |
DOTRIM=1 |
[CycleWin] |
XTAL=4000000 |
/programy/C/HC08/test/Demo_S08QG8_Test/SofTec.ini |
---|
0,0 → 1,23 |
[Environment Variables] |
GENPATH={Compiler}lib\hc08c\src;{Compiler}lib\hc08c\include;{Compiler}lib\hc08c\lib |
LIBPATH={Compiler}lib\hc08c\include |
OBJPATH={Project}bin |
TEXTPATH={Project}bin |
ABSPATH={Project}bin |
[HI-WAVE] |
Target=GDI |
Layout=C_layout.hwl |
[GDI] |
COMSETTINGS=SETCOMM DRIVER NOPROTOCOL NOPERIODICAL "SofTec_BDC08.dll" |
[SofTec_Microsystems_GdiHCS08] |
Hardware=inDART-HCS08 |
DeviceName=MC9S08QG8 |
[&SofTec-HCS08_GDI_SETTINGS] |
CMDFILE0=CMDFILE STARTUP ON ".\cmd\softec_startup.cmd" |
CMDFILE1=CMDFILE RESET ON ".\cmd\softec_reset.cmd" |
CMDFILE2=CMDFILE PRELOAD ON ".\cmd\softec_preload.cmd" |
CMDFILE3=CMDFILE POSTLOAD ON ".\cmd\softec_postload.cmd" |
/programy/C/HC08/test/Demo_S08QG8_Test/Sources/Start08.c |
---|
0,0 → 1,284 |
/****************************************************************************** |
FILE : start08.c |
PURPOSE : 68HC08 standard startup code |
LANGUAGE : ANSI-C / INLINE ASSEMBLER |
---------------------------------------------------------------------------- |
HISTORY |
22 oct 93 Created. |
04/17/97 Also C++ constructors called in Init(). |
******************************************************************************/ |
/**********************************************************************/ |
/* NOTE: */ |
/* This version of the startup code does assumes that main */ |
/* does never return (saving the 2 byte return address of _Startup on */ |
/* the stack). */ |
/**********************************************************************/ |
#define __NO_FLAGS_OFFSET /* we do not need the flags field in the startup data descriptor */ |
#define __NO_MAIN_OFFSET /* we do not need the main field in the startup data descriptor */ |
#include <start08.h> |
#ifdef __cplusplus |
#define __EXTERN_C extern "C" |
#else |
#define __EXTERN_C |
#endif |
/**********************************************************************/ |
/* __ONLY_INIT_SP define: */ |
/* This define selects an shorter version of the startup code */ |
/* which only loads the stack pointer and directly afterwards calls */ |
/* main. This version does however NOT initialized global variables */ |
/* (So this version is not ANSI compliant!) */ |
/**********************************************************************/ |
#ifndef __ONLY_INIT_SP |
#pragma DATA_SEG FAR _STARTUP |
struct _tagStartup _startupData; /* read-only: |
_startupData is allocated in ROM and |
initialized by the linker */ |
#pragma MESSAGE DISABLE C20001 /* Warning C20001: Different value of stackpointer depending on control-flow */ |
/* the function _COPY_L releases some bytes from the stack internally */ |
#ifdef __OPTIMIZE_FOR_SIZE__ |
#pragma NO_ENTRY |
#pragma NO_EXIT |
#pragma NO_FRAME |
/*lint -esym(528, loadByte) inhibit warning about not referenced loadByte function */ |
static void near loadByte(void) { |
asm { |
PSHH |
PSHX |
#ifdef __HCS08__ |
LDHX 5,SP |
LDA 0,X |
AIX #1 |
STHX 5,SP |
#else |
LDA 5,SP |
PSHA |
LDX 7,SP |
PULH |
LDA 0,X |
AIX #1 |
STX 6,SP |
PSHH |
PULX |
STX 5,SP |
#endif |
PULX |
PULH |
RTS |
} |
} |
#endif /* __OPTIMIZE_FOR_SIZE__ */ |
/*lint -esym(752,_COPY_L) inhibit message on dunction declared, but not used (it is used in HLI) */ |
__EXTERN_C extern void _COPY_L(void); |
/* DESC: copy very large structures (>= 256 bytes) in 16 bit address space (stack incl.) |
IN: TOS count, TOS(2) @dest, H:X @src |
OUT: |
WRITTEN: X,H */ |
#ifdef __ELF_OBJECT_FILE_FORMAT__ |
#define toCopyDownBegOffs 0 |
#else |
#define toCopyDownBegOffs 2 /* for the hiware format, the toCopyDownBeg field is a long. Because the HC08 is big endian, we have to use an offset of 2 */ |
#endif |
static void Init(void) { |
/* purpose: 1) zero out RAM-areas where data is allocated |
2) init run-time data |
3) copy initialization data from ROM to RAM |
*/ |
/*lint -esym(529,p,i) inhibit warning about symbols not used: it is used in HLI below */ |
int i; |
int *far p; |
asm { |
ZeroOut: ; |
LDA _startupData.nofZeroOuts:1 ; nofZeroOuts |
INCA |
STA i:1 ; i is counter for number of zero outs |
LDA _startupData.nofZeroOuts:0 ; nofZeroOuts |
INCA |
STA i:0 |
LDHX _startupData.pZeroOut ; *pZeroOut |
BRA Zero_5 |
Zero_3: ; |
; CLR i:1 is already 0 |
Zero_4: ; |
; { HX == _pZeroOut } |
PSHX |
PSHH |
; { nof bytes in (int)2,X } |
; { address in (int)0,X } |
LDA 0,X |
PSHA |
LDA 2,X |
INCA |
STA p ; p:0 is used for high byte of byte counter |
LDA 3,X |
LDX 1,X |
PULH |
INCA |
BRA Zero_0 |
Zero_1: ; |
; CLRA A is already 0, so we do not have to clear it |
Zero_2: ; |
CLR 0,X |
AIX #1 |
Zero_0: ; |
DBNZA Zero_2 |
Zero_6: |
DBNZ p, Zero_1 |
PULH |
PULX ; restore *pZeroOut |
AIX #4 ; advance *pZeroOut |
Zero_5: ; |
DBNZ i:1, Zero_4 |
DBNZ i:0, Zero_3 |
; |
CopyDown: ; |
} |
/* copy down */ |
/* _startupData.toCopyDownBeg ---> {nof(16) dstAddr(16) {bytes(8)}^nof} Zero(16) */ |
#if defined(__OPTIMIZE_FOR_SIZE__) |
asm { |
#ifdef __HCS08__ |
LDHX _startupData.toCopyDownBeg:toCopyDownBegOffs |
PSHX |
PSHH |
#else |
LDA _startupData.toCopyDownBeg:(1+toCopyDownBegOffs) |
PSHA |
LDA _startupData.toCopyDownBeg:(0+toCopyDownBegOffs) |
PSHA |
#endif |
Loop0: |
JSR loadByte ; load high byte counter |
TAX ; save for compare |
INCA |
STA i |
JSR loadByte ; load low byte counter |
INCA |
STA i:1 |
DECA |
BNE notfinished |
CBEQX #0, finished |
notfinished: |
JSR loadByte ; load high byte ptr |
PSHA |
PULH |
JSR loadByte ; load low byte ptr |
TAX ; HX is now destination pointer |
BRA Loop1 |
Loop3: |
Loop2: |
JSR loadByte ; load data byte |
STA 0,X |
AIX #1 |
Loop1: |
DBNZ i:1, Loop2 |
DBNZ i:0, Loop3 |
BRA Loop0 |
finished: |
AIS #2 |
}; |
#else /* defined(__OPTIMIZE_FOR_SIZE__) time optimized asm version. */ |
asm { |
#ifdef __HCS08__ |
LDHX _startupData.toCopyDownBeg:toCopyDownBegOffs |
#else |
LDX _startupData.toCopyDownBeg:(0+toCopyDownBegOffs) |
PSHX |
PULH |
LDX _startupData.toCopyDownBeg:(1+toCopyDownBegOffs) |
#endif |
next: |
LDA 0,X ; list is terminated by 2 zero bytes |
ORA 1,X |
BEQ copydone |
PSHX ; store current position |
PSHH |
LDA 3,X ; psh dest low |
PSHA |
LDA 2,X ; psh dest high |
PSHA |
LDA 1,X ; psh cnt low |
PSHA |
LDA 0,X ; psh cnt high |
PSHA |
AIX #4 |
JSR _COPY_L ; copy one block |
PULH |
PULX |
TXA |
ADD 1,X ; add low |
PSHA |
PSHH |
PULA |
ADC 0,X ; add high |
PSHA |
PULH |
PULX |
AIX #4 |
BRA next |
copydone: |
}; |
#endif /* defined(__OPTIMIZE_FOR_SIZE__) */ |
/* FuncInits: for C++, this are the global constructors */ |
#ifdef __cplusplus |
#ifdef __ELF_OBJECT_FILE_FORMAT__ |
i = (int)(_startupData.nofInitBodies - 1); |
while (i >= 0) { |
(&_startupData.initBodies->initFunc)[i](); /* call C++ constructors */ |
i--; |
} |
#else /* __ELF_OBJECT_FILE_FORMAT__ */ |
/* HIWARE object file format */ |
if (_startupData.mInits != NULL) { |
_PFunc *fktPtr; |
fktPtr = _startupData.mInits; |
while(*fktPtr != NULL) { |
(**fktPtr)(); /* call constructor */ |
fktPtr++; |
} |
} |
#endif /* __ELF_OBJECT_FILE_FORMAT__ */ |
#endif /* __cplusplus */ |
/* implement ROM libraries initialization here (see startup.c) */ |
} |
#endif /* __ONLY_INIT_SP */ |
__EXTERN_C extern void main(void); /* prototype of main function */ |
#pragma NO_EXIT |
__EXTERN_C void _Startup(void) { |
/* set the reset vector to _Startup in the linker parameter file (*.prm): |
'VECTOR 0 _Startup' |
purpose: 1) initialize the stack |
2) initialize run-time, ... |
initialize the RAM, copy down init dat etc (Init) |
3) call main; |
called from: _PRESTART-code generated by the Linker |
*/ |
INIT_SP_FROM_STARTUP_DESC(); |
#ifndef __ONLY_INIT_SP |
Init(); |
#endif |
__asm JMP main; /* with a C style main(); we would push the return address on the stack wasting 2 RAM bytes */ |
} |
/programy/C/HC08/test/Demo_S08QG8_Test/Sources/demo9S08QG8.h |
---|
0,0 → 1,48 |
/****************************************************************************** |
*Copyright (C) 2003 Freescale Semiconductor, Inc. |
*All Rights Reserved |
* |
* Filename: DEMO9S08QG8.h |
* Author: r1aald |
* Revision: 1.0a |
* |
* Description: 9S08QG8 Demo Board Header File |
* Notes: Used in Projects QG8_Test.mcp, DEMO9S08QG8_APP.mcp |
*******************************************************************************/ |
/* include peripheral declarations */ |
#include <MC9S08QG8.h> /* include peripheral declarations */ |
/* define value for LED's when on and off */ |
#define ON 0 |
#define OFF 1 |
/* define value for switches when up (not pressed) and down (pressed) */ |
#define UP 1 |
#define DOWN 0 |
/* define LED's */ |
#define LED1 PTBD_PTBD6 |
#define LED1_DDR PTBDD_PTBDD6 |
#define LED1_MASK PTBD_PTBD6_MASK |
#define LED2 PTBD_PTBD7 |
#define LED2_DDR PTBDD_PTBDD7 |
#define LED2_MASK PTBD_PTBD7_MASK |
/* define SW's */ |
#define SW1 PTAD_PTAD2 |
#define SW1_DDR PTADD_PTADD2 |
#define SW1_MASK PTAD_PTAD2_MASK |
#define SW2 PTAD_PTAD3 |
#define SW2_DDR PTADD_PTADD3 |
#define SW2_MASK PTAD_PTAD3_MASK |
/* define ATD Inputs */ |
#define POT APCTL1_ADPC0 |
#define POT_MASK APCTL1_ADPC0_MASK |
#define PHOTO APCTL1_ADPC1 |
#define PHOTO_MASK APCTL1_ADPC1_MASK |
/* define COM_EN */ |
#define COM_EN PTAD_PTAD4 |
#define COM_EN_DDR PTADD_PTADD4 |
#define COM_EN_MASK PTADD_PTADD4_MASK |
/programy/C/HC08/test/Demo_S08QG8_Test/Sources/demo9S08QG8_test.c |
---|
0,0 → 1,69 |
/****************************************************************************** |
* Copyright (C) 2005 Freescale Semiconductor, Inc. |
* All Rights Reserved |
* |
* Filename: DEMO9S08QG8_Test.c |
* Author: r1aald |
* Revision: 1.0 |
* |
* Description: This is the test code that will reside in the QG8 demo |
* to provide an out of the box experience. This simple code |
* blinks LED2 and toggles LED1 when SW1 is pressed. |
* |
* Notes: Also serves as an example for the 9S08QG8 demo board. |
* Created using CodeWarrior 3.1 for HC(S)08. |
******************************************************************************/ |
#include <hidef.h> /* for EnableInterrupts macro */ |
#include <MC9S08QG8.h> /* include peripheral declarations */ |
#include "demo9S08QG8.h" /*include demo board declarations */ |
void main(void) { |
EnableInterrupts; /* enable interrupts */ |
/* include your code here */ |
ICSC2_BDIV = 3; |
LED1 =0; |
LED2 =0; //Port B7 is connected to LED 2 |
PTBDD_PTBDD7 = 1; //Set PTB7 as an output |
PTBDD_PTBDD6 = 1; |
//mtim_setup |
MTIMCLK_PS = 8; |
MTIMCLK_CLKS = 0; |
MTIMMOD = 112; |
MTIMMOD = 0; //modulo = 50 |
MTIMSC = 0x60; //reset and start MTIM, enable ints |
//KBI Set Up foe SW1 |
KBIPE_KBIPE2 =1; //Enable Keyboard Pin |
KBISC_KBIE = 1; //Enable Keyboard Interrupts |
KBISC_KBACK = 1; //Clear Pending Keyboard Interrupts |
PTAPE_PTAPE2 = 1; //Enable Pullup for Keyboard pin |
for(;;) { |
__RESET_WATCHDOG(); /* feeds the dog */ |
} /* loop forever */ |
/* please make sure that you never leave this function */ |
} |
//KBI ISR |
interrupt 18 void KBI_ISR(void) { |
KBISC_KBACK = 1; //Clear Pending Keyboard Interrupts |
LED1 = ~LED1; // toggle Port |
} |
/* MTIM_ISR - ISR that accompanies the MTIM PWM routine. */ |
interrupt 12 void MTIM_ISR(void) { |
MTIMSC_TOF=0; // clear TOF |
LED2 = ~LED2; // toggle Port |
} |
/programy/C/HC08/test/Demo_S08QG8_Test/bin/Monitor.abs |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/HC08/test/Demo_S08QG8_Test/bin/Monitor.abs.s19 |
---|
0,0 → 1,13 |
S0470000443A5C50726F66696C65735C723161616C642E46534C5C4465736B746F705C576F726B5C44656D6F5F5330385147385F546573745C62696E5C4D6F6E69746F722E616273BA |
S123E0008B899EFE05F6AF019EFF05888A81A7FCC6E0854C95E701C6E0844CF732E08620B0 |
S123E0201F898BF687E6024C9EE706E603EE018A4C20037FAF014BFB9E6B05F78A88AF045D |
S123E0409E6B02DD9E6B01D932E088898BADB1974C9EE703ADAA4C9EE7044A260351001872 |
S123E060AD9E878AAD9A972005AD95F7AF019E6B04F79E6B03F320D5A7068145015094AD57 |
S123E0808DCCE0920000E08AE0DF00000000000000009AB639AAC0B7391D021F021E031C28 |
S123E0A003B63DA4F0AA08B73DB63DA4CFB73D6E703F3F3F6E603C140D120C140C45184031 |
S123E0C0F6AA04F7C7180020FB8B140CB602A840B7028A808B1F3CB602A880B7028A800010 |
S104E0E0003B |
S105FFDAE0C978 |
S105FFE6E0D461 |
S105FFFEE07BA2 |
S9030000FC |
/programy/C/HC08/test/Demo_S08QG8_Test/bin/Monitor.map |
---|
0,0 → 1,596 |
PROGRAM "D:\Profiles\r1aald.FSL\Desktop\Work\Demo_S08QG8_Test\bin\Monitor.abs" |
********************************************************************************************* |
TARGET SECTION |
--------------------------------------------------------------------------------------------- |
Processor : Freescale HC08 |
Memory Model: SMALL |
File Format : ELF\Dwarf 2.0 |
Linker : SmartLinker V-5.0.24 Build 4210, Jul 29 2004 |
********************************************************************************************* |
FILE SECTION |
--------------------------------------------------------------------------------------------- |
Start08.c.o Model: SMALL, Lang: ANSI-C |
MC9S08QG8.C.o Model: SMALL, Lang: ANSI-C |
demo9S08QG8_test.c.o Model: SMALL, Lang: ANSI-C |
********************************************************************************************* |
STARTUP SECTION |
--------------------------------------------------------------------------------------------- |
Entry point: 0xE07B (_Startup) |
_startupData is allocated at 0xE084 and uses 6 Bytes |
extern struct _tagStartup { |
unsigned nofZeroOut 0 |
_Copy *toCopyDownBeg 0xE0DF |
} _startupData; |
********************************************************************************************* |
SECTION-ALLOCATION SECTION |
Section Name Size Type From To Segment |
--------------------------------------------------------------------------------------------- |
.text 77 R 0xE092 0xE0DE ROM |
.abs_section_0 1 N/I 0x0 0x0 .absSeg0 |
.abs_section_1 1 N/I 0x1 0x1 .absSeg1 |
.abs_section_2 1 N/I 0x2 0x2 .absSeg2 |
.abs_section_3 1 N/I 0x3 0x3 .absSeg3 |
.abs_section_c 1 N/I 0xC 0xC .absSeg4 |
.abs_section_d 1 N/I 0xD 0xD .absSeg5 |
.abs_section_e 1 N/I 0xE 0xE .absSeg6 |
.abs_section_f 1 N/I 0xF 0xF .absSeg7 |
.abs_section_10 1 N/I 0x10 0x10 .absSeg8 |
.abs_section_11 1 N/I 0x11 0x11 .absSeg9 |
.abs_section_16 1 N/I 0x16 0x16 .absSeg10 |
.abs_section_17 1 N/I 0x17 0x17 .absSeg11 |
.abs_section_1a 1 N/I 0x1A 0x1A .absSeg12 |
.abs_section_22 1 N/I 0x22 0x22 .absSeg13 |
.abs_section_23 1 N/I 0x23 0x23 .absSeg14 |
.abs_section_24 1 N/I 0x24 0x24 .absSeg15 |
.abs_section_25 1 N/I 0x25 0x25 .absSeg16 |
.abs_section_26 1 N/I 0x26 0x26 .absSeg17 |
.abs_section_27 1 N/I 0x27 0x27 .absSeg18 |
.abs_section_28 1 N/I 0x28 0x28 .absSeg19 |
.abs_section_29 1 N/I 0x29 0x29 .absSeg20 |
.abs_section_2a 1 N/I 0x2A 0x2A .absSeg21 |
.abs_section_2b 1 N/I 0x2B 0x2B .absSeg22 |
.abs_section_2d 1 N/I 0x2D 0x2D .absSeg23 |
.abs_section_30 1 N/I 0x30 0x30 .absSeg24 |
.abs_section_31 1 N/I 0x31 0x31 .absSeg25 |
.abs_section_32 1 N/I 0x32 0x32 .absSeg26 |
.abs_section_33 1 N/I 0x33 0x33 .absSeg27 |
.abs_section_34 1 N/I 0x34 0x34 .absSeg28 |
.abs_section_38 1 N/I 0x38 0x38 .absSeg29 |
.abs_section_39 1 N/I 0x39 0x39 .absSeg30 |
.abs_section_3a 1 N/I 0x3A 0x3A .absSeg31 |
.abs_section_3b 1 N/I 0x3B 0x3B .absSeg32 |
.abs_section_3c 1 N/I 0x3C 0x3C .absSeg33 |
.abs_section_3d 1 N/I 0x3D 0x3D .absSeg34 |
.abs_section_3e 1 N/I 0x3E 0x3E .absSeg35 |
.abs_section_3f 1 N/I 0x3F 0x3F .absSeg36 |
.abs_section_40 1 N/I 0x40 0x40 .absSeg37 |
.abs_section_45 1 N/I 0x45 0x45 .absSeg38 |
.abs_section_48 1 N/I 0x48 0x48 .absSeg39 |
.abs_section_1800 1 N/I 0x1800 0x1800 .absSeg40 |
.abs_section_1801 1 N/I 0x1801 0x1801 .absSeg41 |
.abs_section_1802 1 N/I 0x1802 0x1802 .absSeg42 |
.abs_section_1803 1 N/I 0x1803 0x1803 .absSeg43 |
.abs_section_1808 1 N/I 0x1808 0x1808 .absSeg44 |
.abs_section_1809 1 N/I 0x1809 0x1809 .absSeg45 |
.abs_section_180a 1 N/I 0x180A 0x180A .absSeg46 |
.abs_section_180c 1 N/I 0x180C 0x180C .absSeg47 |
.abs_section_1810 1 N/I 0x1810 0x1810 .absSeg48 |
.abs_section_1811 1 N/I 0x1811 0x1811 .absSeg49 |
.abs_section_1812 1 N/I 0x1812 0x1812 .absSeg50 |
.abs_section_1813 1 N/I 0x1813 0x1813 .absSeg51 |
.abs_section_1816 1 N/I 0x1816 0x1816 .absSeg52 |
.abs_section_1817 1 N/I 0x1817 0x1817 .absSeg53 |
.abs_section_1818 1 N/I 0x1818 0x1818 .absSeg54 |
.abs_section_1820 1 N/I 0x1820 0x1820 .absSeg55 |
.abs_section_1821 1 N/I 0x1821 0x1821 .absSeg56 |
.abs_section_1823 1 N/I 0x1823 0x1823 .absSeg57 |
.abs_section_1824 1 N/I 0x1824 0x1824 .absSeg58 |
.abs_section_1825 1 N/I 0x1825 0x1825 .absSeg59 |
.abs_section_1826 1 N/I 0x1826 0x1826 .absSeg60 |
.abs_section_1840 1 N/I 0x1840 0x1840 .absSeg61 |
.abs_section_1841 1 N/I 0x1841 0x1841 .absSeg62 |
.abs_section_1842 1 N/I 0x1842 0x1842 .absSeg63 |
.abs_section_1844 1 N/I 0x1844 0x1844 .absSeg64 |
.abs_section_1845 1 N/I 0x1845 0x1845 .absSeg65 |
.abs_section_1846 1 N/I 0x1846 0x1846 .absSeg66 |
.abs_section_ffb0 1 N/I 0xFFB0 0xFFB0 .absSeg67 |
.abs_section_ffb1 1 N/I 0xFFB1 0xFFB1 .absSeg68 |
.abs_section_ffb2 1 N/I 0xFFB2 0xFFB2 .absSeg69 |
.abs_section_ffb3 1 N/I 0xFFB3 0xFFB3 .absSeg70 |
.abs_section_ffb4 1 N/I 0xFFB4 0xFFB4 .absSeg71 |
.abs_section_ffb5 1 N/I 0xFFB5 0xFFB5 .absSeg72 |
.abs_section_ffb6 1 N/I 0xFFB6 0xFFB6 .absSeg73 |
.abs_section_ffb7 1 N/I 0xFFB7 0xFFB7 .absSeg74 |
.abs_section_ffbd 1 N/I 0xFFBD 0xFFBD .absSeg75 |
.abs_section_ffbf 1 N/I 0xFFBF 0xFFBF .absSeg76 |
.abs_section_12 2 N/I 0x12 0x13 .absSeg77 |
.abs_section_14 2 N/I 0x14 0x15 .absSeg78 |
.abs_section_20 2 N/I 0x20 0x21 .absSeg79 |
.abs_section_41 2 N/I 0x41 0x42 .absSeg80 |
.abs_section_43 2 N/I 0x43 0x44 .absSeg81 |
.abs_section_46 2 N/I 0x46 0x47 .absSeg82 |
.abs_section_49 2 N/I 0x49 0x4A .absSeg83 |
.abs_section_1806 2 N/I 0x1806 0x1807 .absSeg84 |
.abs_section_1814 2 N/I 0x1814 0x1815 .absSeg85 |
.abs_section_ffda 2 R 0xFFDA 0xFFDB .absSeg86 |
.abs_section_ffe6 2 R 0xFFE6 0xFFE7 .absSeg87 |
.startData 14 R 0xE084 0xE091 ROM |
.init 132 R 0xE000 0xE083 ROM |
.stack 80 R/W 0x100 0x14F RAM |
.copy 2 R 0xE0DF 0xE0E0 ROM |
.vectSeg88_vect 2 R 0xFFFE 0xFFFF .vectSeg88 |
Summary of section sizes per section type: |
READ_ONLY (R): E7 (dec: 231) |
READ_WRITE (R/W): 50 (dec: 80) |
NO_INIT (N/I): 5F (dec: 95) |
********************************************************************************************* |
VECTOR-ALLOCATION SECTION |
Address InitValue InitFunction |
--------------------------------------------------------------------------------------------- |
0xFFFE 0xE07B _Startup |
********************************************************************************************* |
OBJECT-ALLOCATION SECTION |
Name Module Addr hSize dSize Ref Section RLIB |
--------------------------------------------------------------------------------------------- |
MODULE: -- Start08.c.o -- |
- PROCEDURES: |
loadByte E000 E 14 5 .init |
Init E00E 6D 109 1 .init |
_Startup E07B 9 9 0 .init |
- VARIABLES: |
_startupData E084 6 6 4 .startData |
- LABELS: |
__SEG_END_SSTACK 150 0 0 1 |
MODULE: -- MC9S08QG8.C.o -- |
- PROCEDURES: |
- VARIABLES: |
_PTAD 0 1 1 0 .abs_section_0 |
_PTADD 1 1 1 0 .abs_section_1 |
_PTBD 2 1 1 6 .abs_section_2 |
_PTBDD 3 1 1 2 .abs_section_3 |
_KBISC C 1 1 3 .abs_section_c |
_KBIPE D 1 1 1 .abs_section_d |
_KBIES E 1 1 0 .abs_section_e |
_IRQSC F 1 1 0 .abs_section_f |
_ADCSC1 10 1 1 0 .abs_section_10 |
_ADCSC2 11 1 1 0 .abs_section_11 |
_ADCCFG 16 1 1 0 .abs_section_16 |
_APCTL1 17 1 1 0 .abs_section_17 |
_ACMPSC 1A 1 1 0 .abs_section_1a |
_SCIC1 22 1 1 0 .abs_section_22 |
_SCIC2 23 1 1 0 .abs_section_23 |
_SCIS1 24 1 1 0 .abs_section_24 |
_SCIS2 25 1 1 0 .abs_section_25 |
_SCIC3 26 1 1 0 .abs_section_26 |
_SCID 27 1 1 0 .abs_section_27 |
_SPIC1 28 1 1 0 .abs_section_28 |
_SPIC2 29 1 1 0 .abs_section_29 |
_SPIBR 2A 1 1 0 .abs_section_2a |
_SPIS 2B 1 1 0 .abs_section_2b |
_SPID 2D 1 1 0 .abs_section_2d |
_IICA 30 1 1 0 .abs_section_30 |
_IICF 31 1 1 0 .abs_section_31 |
_IICC 32 1 1 0 .abs_section_32 |
_IICS 33 1 1 0 .abs_section_33 |
_IICD 34 1 1 0 .abs_section_34 |
_ICSC1 38 1 1 0 .abs_section_38 |
_ICSC2 39 1 1 2 .abs_section_39 |
_ICSTRM 3A 1 1 0 .abs_section_3a |
_ICSSC 3B 1 1 0 .abs_section_3b |
_MTIMSC 3C 1 1 2 .abs_section_3c |
_MTIMCLK 3D 1 1 4 .abs_section_3d |
_MTIMCNT 3E 1 1 0 .abs_section_3e |
_MTIMMOD 3F 1 1 2 .abs_section_3f |
_TPMSC 40 1 1 0 .abs_section_40 |
_TPMC0SC 45 1 1 0 .abs_section_45 |
_TPMC1SC 48 1 1 0 .abs_section_48 |
_SRS 1800 1 1 1 .abs_section_1800 |
_SBDFR 1801 1 1 0 .abs_section_1801 |
_SOPT1 1802 1 1 0 .abs_section_1802 |
_SOPT2 1803 1 1 0 .abs_section_1803 |
_SRTISC 1808 1 1 0 .abs_section_1808 |
_SPMSC1 1809 1 1 0 .abs_section_1809 |
_SPMSC2 180A 1 1 0 .abs_section_180a |
_SPMSC3 180C 1 1 0 .abs_section_180c |
_DBGCAH 1810 1 1 0 .abs_section_1810 |
_DBGCAL 1811 1 1 0 .abs_section_1811 |
_DBGCBH 1812 1 1 0 .abs_section_1812 |
_DBGCBL 1813 1 1 0 .abs_section_1813 |
_DBGC 1816 1 1 0 .abs_section_1816 |
_DBGT 1817 1 1 0 .abs_section_1817 |
_DBGS 1818 1 1 0 .abs_section_1818 |
_FCDIV 1820 1 1 0 .abs_section_1820 |
_FOPT 1821 1 1 0 .abs_section_1821 |
_FCNFG 1823 1 1 0 .abs_section_1823 |
_FPROT 1824 1 1 0 .abs_section_1824 |
_FSTAT 1825 1 1 0 .abs_section_1825 |
_FCMD 1826 1 1 0 .abs_section_1826 |
_PTAPE 1840 1 1 1 .abs_section_1840 |
_PTASE 1841 1 1 0 .abs_section_1841 |
_PTADS 1842 1 1 0 .abs_section_1842 |
_PTBPE 1844 1 1 0 .abs_section_1844 |
_PTBSE 1845 1 1 0 .abs_section_1845 |
_PTBDS 1846 1 1 0 .abs_section_1846 |
_BAKEY0 FFB0 1 1 0 .abs_section_ffb0 |
_BAKEY1 FFB1 1 1 0 .abs_section_ffb1 |
_BAKEY2 FFB2 1 1 0 .abs_section_ffb2 |
_BAKEY3 FFB3 1 1 0 .abs_section_ffb3 |
_BAKEY4 FFB4 1 1 0 .abs_section_ffb4 |
_BAKEY5 FFB5 1 1 0 .abs_section_ffb5 |
_BAKEY6 FFB6 1 1 0 .abs_section_ffb6 |
_BAKEY7 FFB7 1 1 0 .abs_section_ffb7 |
_NVPROT FFBD 1 1 0 .abs_section_ffbd |
_NVOPT FFBF 1 1 0 .abs_section_ffbf |
_ADCR 12 2 2 0 .abs_section_12 |
_ADCCV 14 2 2 0 .abs_section_14 |
_SCIBD 20 2 2 0 .abs_section_20 |
_TPMCNT 41 2 2 0 .abs_section_41 |
_TPMMOD 43 2 2 0 .abs_section_43 |
_TPMC0V 46 2 2 0 .abs_section_46 |
_TPMC1V 49 2 2 0 .abs_section_49 |
_SDID 1806 2 2 0 .abs_section_1806 |
_DBGF 1814 2 2 0 .abs_section_1814 |
MODULE: -- demo9S08QG8_test.c.o -- |
- PROCEDURES: |
main E092 37 55 1 .text |
KBI_ISR E0C9 B 11 1 .text |
MTIM_ISR E0D4 B 11 1 .text |
- VARIABLES: |
_Vector_18 FFDA 2 2 0 .abs_section_ffda |
_Vector_12 FFE6 2 2 0 .abs_section_ffe6 |
********************************************************************************************* |
MODULE STATISTIC |
Name Data Code Const |
--------------------------------------------------------------------------------------------- |
Start08.c.o 0 132 0 |
MC9S08QG8.C.o 95 0 0 |
demo9S08QG8_test.c.o 0 77 4 |
other 80 16 2 |
********************************************************************************************* |
SECTION USE IN OBJECT-ALLOCATION SECTION |
--------------------------------------------------------------------------------------------- |
SECTION: ".text" |
main KBI_ISR MTIM_ISR |
SECTION: ".init" |
loadByte Init _Startup |
SECTION: ".abs_section_0" |
_PTAD |
SECTION: ".abs_section_1" |
_PTADD |
SECTION: ".abs_section_2" |
_PTBD |
SECTION: ".abs_section_3" |
_PTBDD |
SECTION: ".abs_section_c" |
_KBISC |
SECTION: ".abs_section_d" |
_KBIPE |
SECTION: ".abs_section_e" |
_KBIES |
SECTION: ".abs_section_f" |
_IRQSC |
SECTION: ".abs_section_10" |
_ADCSC1 |
SECTION: ".abs_section_11" |
_ADCSC2 |
SECTION: ".abs_section_16" |
_ADCCFG |
SECTION: ".abs_section_17" |
_APCTL1 |
SECTION: ".abs_section_1a" |
_ACMPSC |
SECTION: ".abs_section_22" |
_SCIC1 |
SECTION: ".abs_section_23" |
_SCIC2 |
SECTION: ".abs_section_24" |
_SCIS1 |
SECTION: ".abs_section_25" |
_SCIS2 |
SECTION: ".abs_section_26" |
_SCIC3 |
SECTION: ".abs_section_27" |
_SCID |
SECTION: ".abs_section_28" |
_SPIC1 |
SECTION: ".abs_section_29" |
_SPIC2 |
SECTION: ".abs_section_2a" |
_SPIBR |
SECTION: ".abs_section_2b" |
_SPIS |
SECTION: ".abs_section_2d" |
_SPID |
SECTION: ".abs_section_30" |
_IICA |
SECTION: ".abs_section_31" |
_IICF |
SECTION: ".abs_section_32" |
_IICC |
SECTION: ".abs_section_33" |
_IICS |
SECTION: ".abs_section_34" |
_IICD |
SECTION: ".abs_section_38" |
_ICSC1 |
SECTION: ".abs_section_39" |
_ICSC2 |
SECTION: ".abs_section_3a" |
_ICSTRM |
SECTION: ".abs_section_3b" |
_ICSSC |
SECTION: ".abs_section_3c" |
_MTIMSC |
SECTION: ".abs_section_3d" |
_MTIMCLK |
SECTION: ".abs_section_3e" |
_MTIMCNT |
SECTION: ".abs_section_3f" |
_MTIMMOD |
SECTION: ".abs_section_40" |
_TPMSC |
SECTION: ".abs_section_45" |
_TPMC0SC |
SECTION: ".abs_section_48" |
_TPMC1SC |
SECTION: ".abs_section_1800" |
_SRS |
SECTION: ".abs_section_1801" |
_SBDFR |
SECTION: ".abs_section_1802" |
_SOPT1 |
SECTION: ".abs_section_1803" |
_SOPT2 |
SECTION: ".abs_section_1808" |
_SRTISC |
SECTION: ".abs_section_1809" |
_SPMSC1 |
SECTION: ".abs_section_180a" |
_SPMSC2 |
SECTION: ".abs_section_180c" |
_SPMSC3 |
SECTION: ".abs_section_1810" |
_DBGCAH |
SECTION: ".abs_section_1811" |
_DBGCAL |
SECTION: ".abs_section_1812" |
_DBGCBH |
SECTION: ".abs_section_1813" |
_DBGCBL |
SECTION: ".abs_section_1816" |
_DBGC |
SECTION: ".abs_section_1817" |
_DBGT |
SECTION: ".abs_section_1818" |
_DBGS |
SECTION: ".abs_section_1820" |
_FCDIV |
SECTION: ".abs_section_1821" |
_FOPT |
SECTION: ".abs_section_1823" |
_FCNFG |
SECTION: ".abs_section_1824" |
_FPROT |
SECTION: ".abs_section_1825" |
_FSTAT |
SECTION: ".abs_section_1826" |
_FCMD |
SECTION: ".abs_section_1840" |
_PTAPE |
SECTION: ".abs_section_1841" |
_PTASE |
SECTION: ".abs_section_1842" |
_PTADS |
SECTION: ".abs_section_1844" |
_PTBPE |
SECTION: ".abs_section_1845" |
_PTBSE |
SECTION: ".abs_section_1846" |
_PTBDS |
SECTION: ".abs_section_ffb0" |
_BAKEY0 |
SECTION: ".abs_section_ffb1" |
_BAKEY1 |
SECTION: ".abs_section_ffb2" |
_BAKEY2 |
SECTION: ".abs_section_ffb3" |
_BAKEY3 |
SECTION: ".abs_section_ffb4" |
_BAKEY4 |
SECTION: ".abs_section_ffb5" |
_BAKEY5 |
SECTION: ".abs_section_ffb6" |
_BAKEY6 |
SECTION: ".abs_section_ffb7" |
_BAKEY7 |
SECTION: ".abs_section_ffbd" |
_NVPROT |
SECTION: ".abs_section_ffbf" |
_NVOPT |
SECTION: ".abs_section_12" |
_ADCR |
SECTION: ".abs_section_14" |
_ADCCV |
SECTION: ".abs_section_20" |
_SCIBD |
SECTION: ".abs_section_41" |
_TPMCNT |
SECTION: ".abs_section_43" |
_TPMMOD |
SECTION: ".abs_section_46" |
_TPMC0V |
SECTION: ".abs_section_49" |
_TPMC1V |
SECTION: ".abs_section_1806" |
_SDID |
SECTION: ".abs_section_1814" |
_DBGF |
SECTION: ".abs_section_ffda" |
_Vector_18 |
SECTION: ".abs_section_ffe6" |
_Vector_12 |
********************************************************************************************* |
OBJECT LIST SORTED BY ADDRESS |
Name Addr hSize dSize Ref Section RLIB |
--------------------------------------------------------------------------------------------- |
_PTAD 0 1 1 0 .abs_section_0 |
_PTADD 1 1 1 0 .abs_section_1 |
_PTBD 2 1 1 6 .abs_section_2 |
_PTBDD 3 1 1 2 .abs_section_3 |
_KBISC C 1 1 3 .abs_section_c |
_KBIPE D 1 1 1 .abs_section_d |
_KBIES E 1 1 0 .abs_section_e |
_IRQSC F 1 1 0 .abs_section_f |
_ADCSC1 10 1 1 0 .abs_section_10 |
_ADCSC2 11 1 1 0 .abs_section_11 |
_ADCR 12 2 2 0 .abs_section_12 |
_ADCCV 14 2 2 0 .abs_section_14 |
_ADCCFG 16 1 1 0 .abs_section_16 |
_APCTL1 17 1 1 0 .abs_section_17 |
_ACMPSC 1A 1 1 0 .abs_section_1a |
_SCIBD 20 2 2 0 .abs_section_20 |
_SCIC1 22 1 1 0 .abs_section_22 |
_SCIC2 23 1 1 0 .abs_section_23 |
_SCIS1 24 1 1 0 .abs_section_24 |
_SCIS2 25 1 1 0 .abs_section_25 |
_SCIC3 26 1 1 0 .abs_section_26 |
_SCID 27 1 1 0 .abs_section_27 |
_SPIC1 28 1 1 0 .abs_section_28 |
_SPIC2 29 1 1 0 .abs_section_29 |
_SPIBR 2A 1 1 0 .abs_section_2a |
_SPIS 2B 1 1 0 .abs_section_2b |
_SPID 2D 1 1 0 .abs_section_2d |
_IICA 30 1 1 0 .abs_section_30 |
_IICF 31 1 1 0 .abs_section_31 |
_IICC 32 1 1 0 .abs_section_32 |
_IICS 33 1 1 0 .abs_section_33 |
_IICD 34 1 1 0 .abs_section_34 |
_ICSC1 38 1 1 0 .abs_section_38 |
_ICSC2 39 1 1 2 .abs_section_39 |
_ICSTRM 3A 1 1 0 .abs_section_3a |
_ICSSC 3B 1 1 0 .abs_section_3b |
_MTIMSC 3C 1 1 2 .abs_section_3c |
_MTIMCLK 3D 1 1 4 .abs_section_3d |
_MTIMCNT 3E 1 1 0 .abs_section_3e |
_MTIMMOD 3F 1 1 2 .abs_section_3f |
_TPMSC 40 1 1 0 .abs_section_40 |
_TPMCNT 41 2 2 0 .abs_section_41 |
_TPMMOD 43 2 2 0 .abs_section_43 |
_TPMC0SC 45 1 1 0 .abs_section_45 |
_TPMC0V 46 2 2 0 .abs_section_46 |
_TPMC1SC 48 1 1 0 .abs_section_48 |
_TPMC1V 49 2 2 0 .abs_section_49 |
_SRS 1800 1 1 1 .abs_section_1800 |
_SBDFR 1801 1 1 0 .abs_section_1801 |
_SOPT1 1802 1 1 0 .abs_section_1802 |
_SOPT2 1803 1 1 0 .abs_section_1803 |
_SDID 1806 2 2 0 .abs_section_1806 |
_SRTISC 1808 1 1 0 .abs_section_1808 |
_SPMSC1 1809 1 1 0 .abs_section_1809 |
_SPMSC2 180A 1 1 0 .abs_section_180a |
_SPMSC3 180C 1 1 0 .abs_section_180c |
_DBGCAH 1810 1 1 0 .abs_section_1810 |
_DBGCAL 1811 1 1 0 .abs_section_1811 |
_DBGCBH 1812 1 1 0 .abs_section_1812 |
_DBGCBL 1813 1 1 0 .abs_section_1813 |
_DBGF 1814 2 2 0 .abs_section_1814 |
_DBGC 1816 1 1 0 .abs_section_1816 |
_DBGT 1817 1 1 0 .abs_section_1817 |
_DBGS 1818 1 1 0 .abs_section_1818 |
_FCDIV 1820 1 1 0 .abs_section_1820 |
_FOPT 1821 1 1 0 .abs_section_1821 |
_FCNFG 1823 1 1 0 .abs_section_1823 |
_FPROT 1824 1 1 0 .abs_section_1824 |
_FSTAT 1825 1 1 0 .abs_section_1825 |
_FCMD 1826 1 1 0 .abs_section_1826 |
_PTAPE 1840 1 1 1 .abs_section_1840 |
_PTASE 1841 1 1 0 .abs_section_1841 |
_PTADS 1842 1 1 0 .abs_section_1842 |
_PTBPE 1844 1 1 0 .abs_section_1844 |
_PTBSE 1845 1 1 0 .abs_section_1845 |
_PTBDS 1846 1 1 0 .abs_section_1846 |
loadByte E000 E 14 5 .init |
Init E00E 6D 109 1 .init |
_Startup E07B 9 9 0 .init |
main E092 37 55 1 .text |
KBI_ISR E0C9 B 11 1 .text |
MTIM_ISR E0D4 B 11 1 .text |
_BAKEY0 FFB0 1 1 0 .abs_section_ffb0 |
_BAKEY1 FFB1 1 1 0 .abs_section_ffb1 |
_BAKEY2 FFB2 1 1 0 .abs_section_ffb2 |
_BAKEY3 FFB3 1 1 0 .abs_section_ffb3 |
_BAKEY4 FFB4 1 1 0 .abs_section_ffb4 |
_BAKEY5 FFB5 1 1 0 .abs_section_ffb5 |
_BAKEY6 FFB6 1 1 0 .abs_section_ffb6 |
_BAKEY7 FFB7 1 1 0 .abs_section_ffb7 |
_NVPROT FFBD 1 1 0 .abs_section_ffbd |
_NVOPT FFBF 1 1 0 .abs_section_ffbf |
_Vector_18 FFDA 2 2 0 .abs_section_ffda |
_Vector_12 FFE6 2 2 0 .abs_section_ffe6 |
********************************************************************************************* |
UNUSED-OBJECTS SECTION |
--------------------------------------------------------------------------------------------- |
********************************************************************************************* |
COPYDOWN SECTION |
--------------------------------------------------------------------------------------------- |
------- ROM-ADDRESS: 0xE0DF ---- SIZE 2 --- |
Filling bytes inserted |
0000 |
********************************************************************************************* |
OBJECT-DEPENDENCIES SECTION |
--------------------------------------------------------------------------------------------- |
Init USES _startupData loadByte |
_Startup USES __SEG_END_SSTACK Init main |
main USES _ICSC2 _PTBD _PTBDD _MTIMCLK _MTIMMOD _MTIMSC |
_KBIPE _KBISC _PTAPE _SRS |
KBI_ISR USES _KBISC _PTBD |
MTIM_ISR USES _MTIMSC _PTBD |
_Vector_18 USES KBI_ISR |
_Vector_12 USES MTIM_ISR |
********************************************************************************************* |
DEPENDENCY TREE |
********************************************************************************************* |
main and _Startup Group |
| |
+- main |
| |
+- _Startup |
| |
+- Init |
| | |
| +- loadByte |
| |
+- main (see above) |
_Vector_18 |
| |
+- KBI_ISR |
_Vector_12 |
| |
+- MTIM_ISR |
********************************************************************************************* |
STATISTIC SECTION |
--------------------------------------------------------------------------------------------- |
ExeFile: |
-------- |
Number of blocks to be downloaded: 6 |
Total size of all blocks to be downloaded: 231 |
/programy/C/HC08/test/Demo_S08QG8_Test/bin/P&E_FCS.abs |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/HC08/test/Demo_S08QG8_Test/bin/P&E_FCS.abs.s19 |
---|
0,0 → 1,13 |
S0470000443A5C50726F66696C65735C723161616C642E46534C5C4465736B746F705C576F726B5C44656D6F5F5330385147385F546573745C62696E5C5026455F4643532E616273AC |
S123E0008B899EFE05F6AF019EFF05888A81A7FCC6E0854C95E701C6E0844CF732E08620B0 |
S123E0201F898BF687E6024C9EE706E603EE018A4C20037FAF014BFB9E6B05F78A88AF045D |
S123E0409E6B02DD9E6B01D932E088898BADB1974C9EE703ADAA4C9EE7044A260351001872 |
S123E060AD9E878AAD9A972005AD95F7AF019E6B04F79E6B03F320D5A7068145015094AD57 |
S123E0808DCCE0920000E08AE0DF00000000000000009AB639AAC0B7391D021F021E031C28 |
S123E0A003B63DA4F0AA08B73DB63DA4CFB73D6E703F3F3F6E603C140D120C140C45184031 |
S123E0C0F6AA04F7C7180020FB8B140CB602A840B7028A808B1F3CB602A880B7028A800010 |
S104E0E0003B |
S105FFDAE0C978 |
S105FFE6E0D461 |
S105FFFEE07BA2 |
S9030000FC |
/programy/C/HC08/test/Demo_S08QG8_Test/bin/P&E_FCS.map |
---|
0,0 → 1,596 |
PROGRAM "D:\Profiles\r1aald.FSL\Desktop\Work\Demo_S08QG8_Test\bin\P&E_FCS.abs" |
********************************************************************************************* |
TARGET SECTION |
--------------------------------------------------------------------------------------------- |
Processor : Freescale HC08 |
Memory Model: SMALL |
File Format : ELF\Dwarf 2.0 |
Linker : SmartLinker V-5.0.24 Build 4210, Jul 29 2004 |
********************************************************************************************* |
FILE SECTION |
--------------------------------------------------------------------------------------------- |
Start08.c.o Model: SMALL, Lang: ANSI-C |
MC9S08QG8.C.o Model: SMALL, Lang: ANSI-C |
demo9S08QG8_test.c.o Model: SMALL, Lang: ANSI-C |
********************************************************************************************* |
STARTUP SECTION |
--------------------------------------------------------------------------------------------- |
Entry point: 0xE07B (_Startup) |
_startupData is allocated at 0xE084 and uses 6 Bytes |
extern struct _tagStartup { |
unsigned nofZeroOut 0 |
_Copy *toCopyDownBeg 0xE0DF |
} _startupData; |
********************************************************************************************* |
SECTION-ALLOCATION SECTION |
Section Name Size Type From To Segment |
--------------------------------------------------------------------------------------------- |
.text 77 R 0xE092 0xE0DE ROM |
.abs_section_0 1 N/I 0x0 0x0 .absSeg0 |
.abs_section_1 1 N/I 0x1 0x1 .absSeg1 |
.abs_section_2 1 N/I 0x2 0x2 .absSeg2 |
.abs_section_3 1 N/I 0x3 0x3 .absSeg3 |
.abs_section_c 1 N/I 0xC 0xC .absSeg4 |
.abs_section_d 1 N/I 0xD 0xD .absSeg5 |
.abs_section_e 1 N/I 0xE 0xE .absSeg6 |
.abs_section_f 1 N/I 0xF 0xF .absSeg7 |
.abs_section_10 1 N/I 0x10 0x10 .absSeg8 |
.abs_section_11 1 N/I 0x11 0x11 .absSeg9 |
.abs_section_16 1 N/I 0x16 0x16 .absSeg10 |
.abs_section_17 1 N/I 0x17 0x17 .absSeg11 |
.abs_section_1a 1 N/I 0x1A 0x1A .absSeg12 |
.abs_section_22 1 N/I 0x22 0x22 .absSeg13 |
.abs_section_23 1 N/I 0x23 0x23 .absSeg14 |
.abs_section_24 1 N/I 0x24 0x24 .absSeg15 |
.abs_section_25 1 N/I 0x25 0x25 .absSeg16 |
.abs_section_26 1 N/I 0x26 0x26 .absSeg17 |
.abs_section_27 1 N/I 0x27 0x27 .absSeg18 |
.abs_section_28 1 N/I 0x28 0x28 .absSeg19 |
.abs_section_29 1 N/I 0x29 0x29 .absSeg20 |
.abs_section_2a 1 N/I 0x2A 0x2A .absSeg21 |
.abs_section_2b 1 N/I 0x2B 0x2B .absSeg22 |
.abs_section_2d 1 N/I 0x2D 0x2D .absSeg23 |
.abs_section_30 1 N/I 0x30 0x30 .absSeg24 |
.abs_section_31 1 N/I 0x31 0x31 .absSeg25 |
.abs_section_32 1 N/I 0x32 0x32 .absSeg26 |
.abs_section_33 1 N/I 0x33 0x33 .absSeg27 |
.abs_section_34 1 N/I 0x34 0x34 .absSeg28 |
.abs_section_38 1 N/I 0x38 0x38 .absSeg29 |
.abs_section_39 1 N/I 0x39 0x39 .absSeg30 |
.abs_section_3a 1 N/I 0x3A 0x3A .absSeg31 |
.abs_section_3b 1 N/I 0x3B 0x3B .absSeg32 |
.abs_section_3c 1 N/I 0x3C 0x3C .absSeg33 |
.abs_section_3d 1 N/I 0x3D 0x3D .absSeg34 |
.abs_section_3e 1 N/I 0x3E 0x3E .absSeg35 |
.abs_section_3f 1 N/I 0x3F 0x3F .absSeg36 |
.abs_section_40 1 N/I 0x40 0x40 .absSeg37 |
.abs_section_45 1 N/I 0x45 0x45 .absSeg38 |
.abs_section_48 1 N/I 0x48 0x48 .absSeg39 |
.abs_section_1800 1 N/I 0x1800 0x1800 .absSeg40 |
.abs_section_1801 1 N/I 0x1801 0x1801 .absSeg41 |
.abs_section_1802 1 N/I 0x1802 0x1802 .absSeg42 |
.abs_section_1803 1 N/I 0x1803 0x1803 .absSeg43 |
.abs_section_1808 1 N/I 0x1808 0x1808 .absSeg44 |
.abs_section_1809 1 N/I 0x1809 0x1809 .absSeg45 |
.abs_section_180a 1 N/I 0x180A 0x180A .absSeg46 |
.abs_section_180c 1 N/I 0x180C 0x180C .absSeg47 |
.abs_section_1810 1 N/I 0x1810 0x1810 .absSeg48 |
.abs_section_1811 1 N/I 0x1811 0x1811 .absSeg49 |
.abs_section_1812 1 N/I 0x1812 0x1812 .absSeg50 |
.abs_section_1813 1 N/I 0x1813 0x1813 .absSeg51 |
.abs_section_1816 1 N/I 0x1816 0x1816 .absSeg52 |
.abs_section_1817 1 N/I 0x1817 0x1817 .absSeg53 |
.abs_section_1818 1 N/I 0x1818 0x1818 .absSeg54 |
.abs_section_1820 1 N/I 0x1820 0x1820 .absSeg55 |
.abs_section_1821 1 N/I 0x1821 0x1821 .absSeg56 |
.abs_section_1823 1 N/I 0x1823 0x1823 .absSeg57 |
.abs_section_1824 1 N/I 0x1824 0x1824 .absSeg58 |
.abs_section_1825 1 N/I 0x1825 0x1825 .absSeg59 |
.abs_section_1826 1 N/I 0x1826 0x1826 .absSeg60 |
.abs_section_1840 1 N/I 0x1840 0x1840 .absSeg61 |
.abs_section_1841 1 N/I 0x1841 0x1841 .absSeg62 |
.abs_section_1842 1 N/I 0x1842 0x1842 .absSeg63 |
.abs_section_1844 1 N/I 0x1844 0x1844 .absSeg64 |
.abs_section_1845 1 N/I 0x1845 0x1845 .absSeg65 |
.abs_section_1846 1 N/I 0x1846 0x1846 .absSeg66 |
.abs_section_ffb0 1 N/I 0xFFB0 0xFFB0 .absSeg67 |
.abs_section_ffb1 1 N/I 0xFFB1 0xFFB1 .absSeg68 |
.abs_section_ffb2 1 N/I 0xFFB2 0xFFB2 .absSeg69 |
.abs_section_ffb3 1 N/I 0xFFB3 0xFFB3 .absSeg70 |
.abs_section_ffb4 1 N/I 0xFFB4 0xFFB4 .absSeg71 |
.abs_section_ffb5 1 N/I 0xFFB5 0xFFB5 .absSeg72 |
.abs_section_ffb6 1 N/I 0xFFB6 0xFFB6 .absSeg73 |
.abs_section_ffb7 1 N/I 0xFFB7 0xFFB7 .absSeg74 |
.abs_section_ffbd 1 N/I 0xFFBD 0xFFBD .absSeg75 |
.abs_section_ffbf 1 N/I 0xFFBF 0xFFBF .absSeg76 |
.abs_section_12 2 N/I 0x12 0x13 .absSeg77 |
.abs_section_14 2 N/I 0x14 0x15 .absSeg78 |
.abs_section_20 2 N/I 0x20 0x21 .absSeg79 |
.abs_section_41 2 N/I 0x41 0x42 .absSeg80 |
.abs_section_43 2 N/I 0x43 0x44 .absSeg81 |
.abs_section_46 2 N/I 0x46 0x47 .absSeg82 |
.abs_section_49 2 N/I 0x49 0x4A .absSeg83 |
.abs_section_1806 2 N/I 0x1806 0x1807 .absSeg84 |
.abs_section_1814 2 N/I 0x1814 0x1815 .absSeg85 |
.abs_section_ffda 2 R 0xFFDA 0xFFDB .absSeg86 |
.abs_section_ffe6 2 R 0xFFE6 0xFFE7 .absSeg87 |
.startData 14 R 0xE084 0xE091 ROM |
.init 132 R 0xE000 0xE083 ROM |
.stack 80 R/W 0x100 0x14F RAM |
.copy 2 R 0xE0DF 0xE0E0 ROM |
.vectSeg88_vect 2 R 0xFFFE 0xFFFF .vectSeg88 |
Summary of section sizes per section type: |
READ_ONLY (R): E7 (dec: 231) |
READ_WRITE (R/W): 50 (dec: 80) |
NO_INIT (N/I): 5F (dec: 95) |
********************************************************************************************* |
VECTOR-ALLOCATION SECTION |
Address InitValue InitFunction |
--------------------------------------------------------------------------------------------- |
0xFFFE 0xE07B _Startup |
********************************************************************************************* |
OBJECT-ALLOCATION SECTION |
Name Module Addr hSize dSize Ref Section RLIB |
--------------------------------------------------------------------------------------------- |
MODULE: -- Start08.c.o -- |
- PROCEDURES: |
loadByte E000 E 14 5 .init |
Init E00E 6D 109 1 .init |
_Startup E07B 9 9 0 .init |
- VARIABLES: |
_startupData E084 6 6 4 .startData |
- LABELS: |
__SEG_END_SSTACK 150 0 0 1 |
MODULE: -- MC9S08QG8.C.o -- |
- PROCEDURES: |
- VARIABLES: |
_PTAD 0 1 1 0 .abs_section_0 |
_PTADD 1 1 1 0 .abs_section_1 |
_PTBD 2 1 1 6 .abs_section_2 |
_PTBDD 3 1 1 2 .abs_section_3 |
_KBISC C 1 1 3 .abs_section_c |
_KBIPE D 1 1 1 .abs_section_d |
_KBIES E 1 1 0 .abs_section_e |
_IRQSC F 1 1 0 .abs_section_f |
_ADCSC1 10 1 1 0 .abs_section_10 |
_ADCSC2 11 1 1 0 .abs_section_11 |
_ADCCFG 16 1 1 0 .abs_section_16 |
_APCTL1 17 1 1 0 .abs_section_17 |
_ACMPSC 1A 1 1 0 .abs_section_1a |
_SCIC1 22 1 1 0 .abs_section_22 |
_SCIC2 23 1 1 0 .abs_section_23 |
_SCIS1 24 1 1 0 .abs_section_24 |
_SCIS2 25 1 1 0 .abs_section_25 |
_SCIC3 26 1 1 0 .abs_section_26 |
_SCID 27 1 1 0 .abs_section_27 |
_SPIC1 28 1 1 0 .abs_section_28 |
_SPIC2 29 1 1 0 .abs_section_29 |
_SPIBR 2A 1 1 0 .abs_section_2a |
_SPIS 2B 1 1 0 .abs_section_2b |
_SPID 2D 1 1 0 .abs_section_2d |
_IICA 30 1 1 0 .abs_section_30 |
_IICF 31 1 1 0 .abs_section_31 |
_IICC 32 1 1 0 .abs_section_32 |
_IICS 33 1 1 0 .abs_section_33 |
_IICD 34 1 1 0 .abs_section_34 |
_ICSC1 38 1 1 0 .abs_section_38 |
_ICSC2 39 1 1 2 .abs_section_39 |
_ICSTRM 3A 1 1 0 .abs_section_3a |
_ICSSC 3B 1 1 0 .abs_section_3b |
_MTIMSC 3C 1 1 2 .abs_section_3c |
_MTIMCLK 3D 1 1 4 .abs_section_3d |
_MTIMCNT 3E 1 1 0 .abs_section_3e |
_MTIMMOD 3F 1 1 2 .abs_section_3f |
_TPMSC 40 1 1 0 .abs_section_40 |
_TPMC0SC 45 1 1 0 .abs_section_45 |
_TPMC1SC 48 1 1 0 .abs_section_48 |
_SRS 1800 1 1 1 .abs_section_1800 |
_SBDFR 1801 1 1 0 .abs_section_1801 |
_SOPT1 1802 1 1 0 .abs_section_1802 |
_SOPT2 1803 1 1 0 .abs_section_1803 |
_SRTISC 1808 1 1 0 .abs_section_1808 |
_SPMSC1 1809 1 1 0 .abs_section_1809 |
_SPMSC2 180A 1 1 0 .abs_section_180a |
_SPMSC3 180C 1 1 0 .abs_section_180c |
_DBGCAH 1810 1 1 0 .abs_section_1810 |
_DBGCAL 1811 1 1 0 .abs_section_1811 |
_DBGCBH 1812 1 1 0 .abs_section_1812 |
_DBGCBL 1813 1 1 0 .abs_section_1813 |
_DBGC 1816 1 1 0 .abs_section_1816 |
_DBGT 1817 1 1 0 .abs_section_1817 |
_DBGS 1818 1 1 0 .abs_section_1818 |
_FCDIV 1820 1 1 0 .abs_section_1820 |
_FOPT 1821 1 1 0 .abs_section_1821 |
_FCNFG 1823 1 1 0 .abs_section_1823 |
_FPROT 1824 1 1 0 .abs_section_1824 |
_FSTAT 1825 1 1 0 .abs_section_1825 |
_FCMD 1826 1 1 0 .abs_section_1826 |
_PTAPE 1840 1 1 1 .abs_section_1840 |
_PTASE 1841 1 1 0 .abs_section_1841 |
_PTADS 1842 1 1 0 .abs_section_1842 |
_PTBPE 1844 1 1 0 .abs_section_1844 |
_PTBSE 1845 1 1 0 .abs_section_1845 |
_PTBDS 1846 1 1 0 .abs_section_1846 |
_BAKEY0 FFB0 1 1 0 .abs_section_ffb0 |
_BAKEY1 FFB1 1 1 0 .abs_section_ffb1 |
_BAKEY2 FFB2 1 1 0 .abs_section_ffb2 |
_BAKEY3 FFB3 1 1 0 .abs_section_ffb3 |
_BAKEY4 FFB4 1 1 0 .abs_section_ffb4 |
_BAKEY5 FFB5 1 1 0 .abs_section_ffb5 |
_BAKEY6 FFB6 1 1 0 .abs_section_ffb6 |
_BAKEY7 FFB7 1 1 0 .abs_section_ffb7 |
_NVPROT FFBD 1 1 0 .abs_section_ffbd |
_NVOPT FFBF 1 1 0 .abs_section_ffbf |
_ADCR 12 2 2 0 .abs_section_12 |
_ADCCV 14 2 2 0 .abs_section_14 |
_SCIBD 20 2 2 0 .abs_section_20 |
_TPMCNT 41 2 2 0 .abs_section_41 |
_TPMMOD 43 2 2 0 .abs_section_43 |
_TPMC0V 46 2 2 0 .abs_section_46 |
_TPMC1V 49 2 2 0 .abs_section_49 |
_SDID 1806 2 2 0 .abs_section_1806 |
_DBGF 1814 2 2 0 .abs_section_1814 |
MODULE: -- demo9S08QG8_test.c.o -- |
- PROCEDURES: |
main E092 37 55 1 .text |
KBI_ISR E0C9 B 11 1 .text |
MTIM_ISR E0D4 B 11 1 .text |
- VARIABLES: |
_Vector_18 FFDA 2 2 0 .abs_section_ffda |
_Vector_12 FFE6 2 2 0 .abs_section_ffe6 |
********************************************************************************************* |
MODULE STATISTIC |
Name Data Code Const |
--------------------------------------------------------------------------------------------- |
Start08.c.o 0 132 0 |
MC9S08QG8.C.o 95 0 0 |
demo9S08QG8_test.c.o 0 77 4 |
other 80 16 2 |
********************************************************************************************* |
SECTION USE IN OBJECT-ALLOCATION SECTION |
--------------------------------------------------------------------------------------------- |
SECTION: ".text" |
main KBI_ISR MTIM_ISR |
SECTION: ".init" |
loadByte Init _Startup |
SECTION: ".abs_section_0" |
_PTAD |
SECTION: ".abs_section_1" |
_PTADD |
SECTION: ".abs_section_2" |
_PTBD |
SECTION: ".abs_section_3" |
_PTBDD |
SECTION: ".abs_section_c" |
_KBISC |
SECTION: ".abs_section_d" |
_KBIPE |
SECTION: ".abs_section_e" |
_KBIES |
SECTION: ".abs_section_f" |
_IRQSC |
SECTION: ".abs_section_10" |
_ADCSC1 |
SECTION: ".abs_section_11" |
_ADCSC2 |
SECTION: ".abs_section_16" |
_ADCCFG |
SECTION: ".abs_section_17" |
_APCTL1 |
SECTION: ".abs_section_1a" |
_ACMPSC |
SECTION: ".abs_section_22" |
_SCIC1 |
SECTION: ".abs_section_23" |
_SCIC2 |
SECTION: ".abs_section_24" |
_SCIS1 |
SECTION: ".abs_section_25" |
_SCIS2 |
SECTION: ".abs_section_26" |
_SCIC3 |
SECTION: ".abs_section_27" |
_SCID |
SECTION: ".abs_section_28" |
_SPIC1 |
SECTION: ".abs_section_29" |
_SPIC2 |
SECTION: ".abs_section_2a" |
_SPIBR |
SECTION: ".abs_section_2b" |
_SPIS |
SECTION: ".abs_section_2d" |
_SPID |
SECTION: ".abs_section_30" |
_IICA |
SECTION: ".abs_section_31" |
_IICF |
SECTION: ".abs_section_32" |
_IICC |
SECTION: ".abs_section_33" |
_IICS |
SECTION: ".abs_section_34" |
_IICD |
SECTION: ".abs_section_38" |
_ICSC1 |
SECTION: ".abs_section_39" |
_ICSC2 |
SECTION: ".abs_section_3a" |
_ICSTRM |
SECTION: ".abs_section_3b" |
_ICSSC |
SECTION: ".abs_section_3c" |
_MTIMSC |
SECTION: ".abs_section_3d" |
_MTIMCLK |
SECTION: ".abs_section_3e" |
_MTIMCNT |
SECTION: ".abs_section_3f" |
_MTIMMOD |
SECTION: ".abs_section_40" |
_TPMSC |
SECTION: ".abs_section_45" |
_TPMC0SC |
SECTION: ".abs_section_48" |
_TPMC1SC |
SECTION: ".abs_section_1800" |
_SRS |
SECTION: ".abs_section_1801" |
_SBDFR |
SECTION: ".abs_section_1802" |
_SOPT1 |
SECTION: ".abs_section_1803" |
_SOPT2 |
SECTION: ".abs_section_1808" |
_SRTISC |
SECTION: ".abs_section_1809" |
_SPMSC1 |
SECTION: ".abs_section_180a" |
_SPMSC2 |
SECTION: ".abs_section_180c" |
_SPMSC3 |
SECTION: ".abs_section_1810" |
_DBGCAH |
SECTION: ".abs_section_1811" |
_DBGCAL |
SECTION: ".abs_section_1812" |
_DBGCBH |
SECTION: ".abs_section_1813" |
_DBGCBL |
SECTION: ".abs_section_1816" |
_DBGC |
SECTION: ".abs_section_1817" |
_DBGT |
SECTION: ".abs_section_1818" |
_DBGS |
SECTION: ".abs_section_1820" |
_FCDIV |
SECTION: ".abs_section_1821" |
_FOPT |
SECTION: ".abs_section_1823" |
_FCNFG |
SECTION: ".abs_section_1824" |
_FPROT |
SECTION: ".abs_section_1825" |
_FSTAT |
SECTION: ".abs_section_1826" |
_FCMD |
SECTION: ".abs_section_1840" |
_PTAPE |
SECTION: ".abs_section_1841" |
_PTASE |
SECTION: ".abs_section_1842" |
_PTADS |
SECTION: ".abs_section_1844" |
_PTBPE |
SECTION: ".abs_section_1845" |
_PTBSE |
SECTION: ".abs_section_1846" |
_PTBDS |
SECTION: ".abs_section_ffb0" |
_BAKEY0 |
SECTION: ".abs_section_ffb1" |
_BAKEY1 |
SECTION: ".abs_section_ffb2" |
_BAKEY2 |
SECTION: ".abs_section_ffb3" |
_BAKEY3 |
SECTION: ".abs_section_ffb4" |
_BAKEY4 |
SECTION: ".abs_section_ffb5" |
_BAKEY5 |
SECTION: ".abs_section_ffb6" |
_BAKEY6 |
SECTION: ".abs_section_ffb7" |
_BAKEY7 |
SECTION: ".abs_section_ffbd" |
_NVPROT |
SECTION: ".abs_section_ffbf" |
_NVOPT |
SECTION: ".abs_section_12" |
_ADCR |
SECTION: ".abs_section_14" |
_ADCCV |
SECTION: ".abs_section_20" |
_SCIBD |
SECTION: ".abs_section_41" |
_TPMCNT |
SECTION: ".abs_section_43" |
_TPMMOD |
SECTION: ".abs_section_46" |
_TPMC0V |
SECTION: ".abs_section_49" |
_TPMC1V |
SECTION: ".abs_section_1806" |
_SDID |
SECTION: ".abs_section_1814" |
_DBGF |
SECTION: ".abs_section_ffda" |
_Vector_18 |
SECTION: ".abs_section_ffe6" |
_Vector_12 |
********************************************************************************************* |
OBJECT LIST SORTED BY ADDRESS |
Name Addr hSize dSize Ref Section RLIB |
--------------------------------------------------------------------------------------------- |
_PTAD 0 1 1 0 .abs_section_0 |
_PTADD 1 1 1 0 .abs_section_1 |
_PTBD 2 1 1 6 .abs_section_2 |
_PTBDD 3 1 1 2 .abs_section_3 |
_KBISC C 1 1 3 .abs_section_c |
_KBIPE D 1 1 1 .abs_section_d |
_KBIES E 1 1 0 .abs_section_e |
_IRQSC F 1 1 0 .abs_section_f |
_ADCSC1 10 1 1 0 .abs_section_10 |
_ADCSC2 11 1 1 0 .abs_section_11 |
_ADCR 12 2 2 0 .abs_section_12 |
_ADCCV 14 2 2 0 .abs_section_14 |
_ADCCFG 16 1 1 0 .abs_section_16 |
_APCTL1 17 1 1 0 .abs_section_17 |
_ACMPSC 1A 1 1 0 .abs_section_1a |
_SCIBD 20 2 2 0 .abs_section_20 |
_SCIC1 22 1 1 0 .abs_section_22 |
_SCIC2 23 1 1 0 .abs_section_23 |
_SCIS1 24 1 1 0 .abs_section_24 |
_SCIS2 25 1 1 0 .abs_section_25 |
_SCIC3 26 1 1 0 .abs_section_26 |
_SCID 27 1 1 0 .abs_section_27 |
_SPIC1 28 1 1 0 .abs_section_28 |
_SPIC2 29 1 1 0 .abs_section_29 |
_SPIBR 2A 1 1 0 .abs_section_2a |
_SPIS 2B 1 1 0 .abs_section_2b |
_SPID 2D 1 1 0 .abs_section_2d |
_IICA 30 1 1 0 .abs_section_30 |
_IICF 31 1 1 0 .abs_section_31 |
_IICC 32 1 1 0 .abs_section_32 |
_IICS 33 1 1 0 .abs_section_33 |
_IICD 34 1 1 0 .abs_section_34 |
_ICSC1 38 1 1 0 .abs_section_38 |
_ICSC2 39 1 1 2 .abs_section_39 |
_ICSTRM 3A 1 1 0 .abs_section_3a |
_ICSSC 3B 1 1 0 .abs_section_3b |
_MTIMSC 3C 1 1 2 .abs_section_3c |
_MTIMCLK 3D 1 1 4 .abs_section_3d |
_MTIMCNT 3E 1 1 0 .abs_section_3e |
_MTIMMOD 3F 1 1 2 .abs_section_3f |
_TPMSC 40 1 1 0 .abs_section_40 |
_TPMCNT 41 2 2 0 .abs_section_41 |
_TPMMOD 43 2 2 0 .abs_section_43 |
_TPMC0SC 45 1 1 0 .abs_section_45 |
_TPMC0V 46 2 2 0 .abs_section_46 |
_TPMC1SC 48 1 1 0 .abs_section_48 |
_TPMC1V 49 2 2 0 .abs_section_49 |
_SRS 1800 1 1 1 .abs_section_1800 |
_SBDFR 1801 1 1 0 .abs_section_1801 |
_SOPT1 1802 1 1 0 .abs_section_1802 |
_SOPT2 1803 1 1 0 .abs_section_1803 |
_SDID 1806 2 2 0 .abs_section_1806 |
_SRTISC 1808 1 1 0 .abs_section_1808 |
_SPMSC1 1809 1 1 0 .abs_section_1809 |
_SPMSC2 180A 1 1 0 .abs_section_180a |
_SPMSC3 180C 1 1 0 .abs_section_180c |
_DBGCAH 1810 1 1 0 .abs_section_1810 |
_DBGCAL 1811 1 1 0 .abs_section_1811 |
_DBGCBH 1812 1 1 0 .abs_section_1812 |
_DBGCBL 1813 1 1 0 .abs_section_1813 |
_DBGF 1814 2 2 0 .abs_section_1814 |
_DBGC 1816 1 1 0 .abs_section_1816 |
_DBGT 1817 1 1 0 .abs_section_1817 |
_DBGS 1818 1 1 0 .abs_section_1818 |
_FCDIV 1820 1 1 0 .abs_section_1820 |
_FOPT 1821 1 1 0 .abs_section_1821 |
_FCNFG 1823 1 1 0 .abs_section_1823 |
_FPROT 1824 1 1 0 .abs_section_1824 |
_FSTAT 1825 1 1 0 .abs_section_1825 |
_FCMD 1826 1 1 0 .abs_section_1826 |
_PTAPE 1840 1 1 1 .abs_section_1840 |
_PTASE 1841 1 1 0 .abs_section_1841 |
_PTADS 1842 1 1 0 .abs_section_1842 |
_PTBPE 1844 1 1 0 .abs_section_1844 |
_PTBSE 1845 1 1 0 .abs_section_1845 |
_PTBDS 1846 1 1 0 .abs_section_1846 |
loadByte E000 E 14 5 .init |
Init E00E 6D 109 1 .init |
_Startup E07B 9 9 0 .init |
main E092 37 55 1 .text |
KBI_ISR E0C9 B 11 1 .text |
MTIM_ISR E0D4 B 11 1 .text |
_BAKEY0 FFB0 1 1 0 .abs_section_ffb0 |
_BAKEY1 FFB1 1 1 0 .abs_section_ffb1 |
_BAKEY2 FFB2 1 1 0 .abs_section_ffb2 |
_BAKEY3 FFB3 1 1 0 .abs_section_ffb3 |
_BAKEY4 FFB4 1 1 0 .abs_section_ffb4 |
_BAKEY5 FFB5 1 1 0 .abs_section_ffb5 |
_BAKEY6 FFB6 1 1 0 .abs_section_ffb6 |
_BAKEY7 FFB7 1 1 0 .abs_section_ffb7 |
_NVPROT FFBD 1 1 0 .abs_section_ffbd |
_NVOPT FFBF 1 1 0 .abs_section_ffbf |
_Vector_18 FFDA 2 2 0 .abs_section_ffda |
_Vector_12 FFE6 2 2 0 .abs_section_ffe6 |
********************************************************************************************* |
UNUSED-OBJECTS SECTION |
--------------------------------------------------------------------------------------------- |
********************************************************************************************* |
COPYDOWN SECTION |
--------------------------------------------------------------------------------------------- |
------- ROM-ADDRESS: 0xE0DF ---- SIZE 2 --- |
Filling bytes inserted |
0000 |
********************************************************************************************* |
OBJECT-DEPENDENCIES SECTION |
--------------------------------------------------------------------------------------------- |
Init USES _startupData loadByte |
_Startup USES __SEG_END_SSTACK Init main |
main USES _ICSC2 _PTBD _PTBDD _MTIMCLK _MTIMMOD _MTIMSC |
_KBIPE _KBISC _PTAPE _SRS |
KBI_ISR USES _KBISC _PTBD |
MTIM_ISR USES _MTIMSC _PTBD |
_Vector_18 USES KBI_ISR |
_Vector_12 USES MTIM_ISR |
********************************************************************************************* |
DEPENDENCY TREE |
********************************************************************************************* |
main and _Startup Group |
| |
+- main |
| |
+- _Startup |
| |
+- Init |
| | |
| +- loadByte |
| |
+- main (see above) |
_Vector_18 |
| |
+- KBI_ISR |
_Vector_12 |
| |
+- MTIM_ISR |
********************************************************************************************* |
STATISTIC SECTION |
--------------------------------------------------------------------------------------------- |
ExeFile: |
-------- |
Number of blocks to be downloaded: 6 |
Total size of all blocks to be downloaded: 231 |
/programy/C/HC08/test/Demo_S08QG8_Test/bin/P&E_ICD.abs |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/HC08/test/Demo_S08QG8_Test/bin/P&E_ICD.abs.s19 |
---|
0,0 → 1,13 |
S0470000443A5C4B414B4C494B5C70726F6772616D795C436F646557617272696F725C746573745C44656D6F5F5330385147385F546573745C62696E5C5026455F4943442E61627378 |
S123E0008B899EFE05F6AF019EFF05888A81A7FCC6E0854C95E701C6E0844CF732E08620B0 |
S123E0201F898BF687E6024C9EE706E603EE018A4C20037FAF014BFB9E6B05F78A88AF045D |
S123E0409E6B02DD9E6B01D932E088898BADB1974C9EE703ADAA4C9EE7044A260351001872 |
S123E060AD9E878AAD9A972005AD95F7AF019E6B04F79E6B03F320D5A7068145015094AD57 |
S123E0808DCCE0920000E08AE0DF00000000000000009AB639AAC0B7391D021F021E031C28 |
S123E0A003B63DA4F0AA08B73DB63DA4CFB73D6E703F3F3F6E603C140D120C140C45184031 |
S123E0C0F6AA04F7C7180020FB8B140CB602A840B7028A808B1F3CB602A880B7028A800010 |
S104E0E0003B |
S105FFDAE0C978 |
S105FFE6E0D461 |
S105FFFEE07BA2 |
S9030000FC |
/programy/C/HC08/test/Demo_S08QG8_Test/bin/P&E_ICD.bpt |
---|
0,0 → 1,0 |
savebp off |
/programy/C/HC08/test/Demo_S08QG8_Test/bin/P&E_ICD.map |
---|
0,0 → 1,546 |
*** EVALUATION *** |
PROGRAM "D:\KAKLIK\programy\CodeWarrior\test\Demo_S08QG8_Test\bin\P&E_ICD.abs" |
********************************************************************************************* |
TARGET SECTION |
--------------------------------------------------------------------------------------------- |
Processor : Freescale HC08 |
Memory Model: SMALL |
File Format : ELF\Dwarf 2.0 |
Linker : SmartLinker V-5.0.24 Build 4210, Jul 29 2004 |
********************************************************************************************* |
FILE SECTION |
--------------------------------------------------------------------------------------------- |
Start08.c.o Model: SMALL, Lang: ANSI-C |
MC9S08QG8.C.o Model: SMALL, Lang: ANSI-C |
demo9S08QG8_test.c.o Model: SMALL, Lang: ANSI-C |
********************************************************************************************* |
STARTUP SECTION |
--------------------------------------------------------------------------------------------- |
Entry point: 0xE07B (_Startup) |
_startupData is allocated at 0xE084 and uses 6 Bytes |
extern struct _tagStartup { |
unsigned nofZeroOut 0 |
_Copy *toCopyDownBeg 0xE0DF |
} _startupData; |
********************************************************************************************* |
SECTION-ALLOCATION SECTION |
Section Name Size Type From To Segment |
--------------------------------------------------------------------------------------------- |
.text 77 R 0xE092 0xE0DE ROM |
.abs_section_0 1 N/I 0x0 0x0 .absSeg0 |
.abs_section_1 1 N/I 0x1 0x1 .absSeg1 |
.abs_section_2 1 N/I 0x2 0x2 .absSeg2 |
.abs_section_3 1 N/I 0x3 0x3 .absSeg3 |
.abs_section_c 1 N/I 0xC 0xC .absSeg4 |
.abs_section_d 1 N/I 0xD 0xD .absSeg5 |
.abs_section_e 1 N/I 0xE 0xE .absSeg6 |
.abs_section_f 1 N/I 0xF 0xF .absSeg7 |
.abs_section_10 1 N/I 0x10 0x10 .absSeg8 |
.abs_section_11 1 N/I 0x11 0x11 .absSeg9 |
.abs_section_16 1 N/I 0x16 0x16 .absSeg10 |
.abs_section_17 1 N/I 0x17 0x17 .absSeg11 |
.abs_section_1a 1 N/I 0x1A 0x1A .absSeg12 |
.abs_section_22 1 N/I 0x22 0x22 .absSeg13 |
.abs_section_23 1 N/I 0x23 0x23 .absSeg14 |
.abs_section_24 1 N/I 0x24 0x24 .absSeg15 |
.abs_section_25 1 N/I 0x25 0x25 .absSeg16 |
.abs_section_26 1 N/I 0x26 0x26 .absSeg17 |
.abs_section_27 1 N/I 0x27 0x27 .absSeg18 |
.abs_section_28 1 N/I 0x28 0x28 .absSeg19 |
.abs_section_29 1 N/I 0x29 0x29 .absSeg20 |
.abs_section_2a 1 N/I 0x2A 0x2A .absSeg21 |
.abs_section_2b 1 N/I 0x2B 0x2B .absSeg22 |
.abs_section_2d 1 N/I 0x2D 0x2D .absSeg23 |
.abs_section_30 1 N/I 0x30 0x30 .absSeg24 |
.abs_section_31 1 N/I 0x31 0x31 .absSeg25 |
.abs_section_32 1 N/I 0x32 0x32 .absSeg26 |
.abs_section_33 1 N/I 0x33 0x33 .absSeg27 |
.abs_section_34 1 N/I 0x34 0x34 .absSeg28 |
.abs_section_38 1 N/I 0x38 0x38 .absSeg29 |
.abs_section_39 1 N/I 0x39 0x39 .absSeg30 |
.abs_section_3a 1 N/I 0x3A 0x3A .absSeg31 |
.abs_section_3b 1 N/I 0x3B 0x3B .absSeg32 |
.abs_section_3c 1 N/I 0x3C 0x3C .absSeg33 |
.abs_section_3d 1 N/I 0x3D 0x3D .absSeg34 |
.abs_section_3e 1 N/I 0x3E 0x3E .absSeg35 |
.abs_section_3f 1 N/I 0x3F 0x3F .absSeg36 |
.abs_section_40 1 N/I 0x40 0x40 .absSeg37 |
.abs_section_45 1 N/I 0x45 0x45 .absSeg38 |
.abs_section_48 1 N/I 0x48 0x48 .absSeg39 |
.abs_section_1800 1 N/I 0x1800 0x1800 .absSeg40 |
.abs_section_1801 1 N/I 0x1801 0x1801 .absSeg41 |
.abs_section_1802 1 N/I 0x1802 0x1802 .absSeg42 |
.abs_section_1803 1 N/I 0x1803 0x1803 .absSeg43 |
.abs_section_1808 1 N/I 0x1808 0x1808 .absSeg44 |
.abs_section_1809 1 N/I 0x1809 0x1809 .absSeg45 |
.abs_section_180a 1 N/I 0x180A 0x180A .absSeg46 |
.abs_section_180c 1 N/I 0x180C 0x180C .absSeg47 |
.abs_section_1810 1 N/I 0x1810 0x1810 .absSeg48 |
.abs_section_1811 1 N/I 0x1811 0x1811 .absSeg49 |
.abs_section_1812 1 N/I 0x1812 0x1812 .absSeg50 |
.abs_section_1813 1 N/I 0x1813 0x1813 .absSeg51 |
.abs_section_1816 1 N/I 0x1816 0x1816 .absSeg52 |
.abs_section_1817 1 N/I 0x1817 0x1817 .absSeg53 |
.abs_section_1818 1 N/I 0x1818 0x1818 .absSeg54 |
.abs_section_1820 1 N/I 0x1820 0x1820 .absSeg55 |
.abs_section_1821 1 N/I 0x1821 0x1821 .absSeg56 |
.abs_section_1823 1 N/I 0x1823 0x1823 .absSeg57 |
.abs_section_1824 1 N/I 0x1824 0x1824 .absSeg58 |
.abs_section_1825 1 N/I 0x1825 0x1825 .absSeg59 |
.abs_section_1826 1 N/I 0x1826 0x1826 .absSeg60 |
.abs_section_1840 1 N/I 0x1840 0x1840 .absSeg61 |
.abs_section_1841 1 N/I 0x1841 0x1841 .absSeg62 |
.abs_section_1842 1 N/I 0x1842 0x1842 .absSeg63 |
.abs_section_1844 1 N/I 0x1844 0x1844 .absSeg64 |
.abs_section_1845 1 N/I 0x1845 0x1845 .absSeg65 |
.abs_section_1846 1 N/I 0x1846 0x1846 .absSeg66 |
.abs_section_12 2 N/I 0x12 0x13 .absSeg67 |
.abs_section_14 2 N/I 0x14 0x15 .absSeg68 |
.abs_section_20 2 N/I 0x20 0x21 .absSeg69 |
.abs_section_41 2 N/I 0x41 0x42 .absSeg70 |
.abs_section_43 2 N/I 0x43 0x44 .absSeg71 |
.abs_section_46 2 N/I 0x46 0x47 .absSeg72 |
.abs_section_49 2 N/I 0x49 0x4A .absSeg73 |
.abs_section_1806 2 N/I 0x1806 0x1807 .absSeg74 |
.abs_section_1814 2 N/I 0x1814 0x1815 .absSeg75 |
.abs_section_ffda 2 R 0xFFDA 0xFFDB .absSeg76 |
.abs_section_ffe6 2 R 0xFFE6 0xFFE7 .absSeg77 |
.startData 14 R 0xE084 0xE091 ROM |
.init 132 R 0xE000 0xE083 ROM |
.stack 80 R/W 0x100 0x14F RAM |
.copy 2 R 0xE0DF 0xE0E0 ROM |
.vectSeg78_vect 2 R 0xFFFE 0xFFFF .vectSeg78 |
Summary of section sizes per section type: |
READ_ONLY (R): E7 (dec: 231) |
READ_WRITE (R/W): 50 (dec: 80) |
NO_INIT (N/I): 55 (dec: 85) |
********************************************************************************************* |
VECTOR-ALLOCATION SECTION |
Address InitValue InitFunction |
--------------------------------------------------------------------------------------------- |
0xFFFE 0xE07B _Startup |
********************************************************************************************* |
OBJECT-ALLOCATION SECTION |
Name Module Addr hSize dSize Ref Section RLIB |
--------------------------------------------------------------------------------------------- |
MODULE: -- Start08.c.o -- |
- PROCEDURES: |
loadByte E000 E 14 5 .init |
Init E00E 6D 109 1 .init |
_Startup E07B 9 9 0 .init |
- VARIABLES: |
_startupData E084 6 6 4 .startData |
- LABELS: |
__SEG_END_SSTACK 150 0 0 1 |
MODULE: -- MC9S08QG8.C.o -- |
- PROCEDURES: |
- VARIABLES: |
_PTAD 0 1 1 0 .abs_section_0 |
_PTADD 1 1 1 0 .abs_section_1 |
_PTBD 2 1 1 6 .abs_section_2 |
_PTBDD 3 1 1 2 .abs_section_3 |
_KBISC C 1 1 3 .abs_section_c |
_KBIPE D 1 1 1 .abs_section_d |
_KBIES E 1 1 0 .abs_section_e |
_IRQSC F 1 1 0 .abs_section_f |
_ADCSC1 10 1 1 0 .abs_section_10 |
_ADCSC2 11 1 1 0 .abs_section_11 |
_ADCCFG 16 1 1 0 .abs_section_16 |
_APCTL1 17 1 1 0 .abs_section_17 |
_ACMPSC 1A 1 1 0 .abs_section_1a |
_SCIC1 22 1 1 0 .abs_section_22 |
_SCIC2 23 1 1 0 .abs_section_23 |
_SCIS1 24 1 1 0 .abs_section_24 |
_SCIS2 25 1 1 0 .abs_section_25 |
_SCIC3 26 1 1 0 .abs_section_26 |
_SCID 27 1 1 0 .abs_section_27 |
_SPIC1 28 1 1 0 .abs_section_28 |
_SPIC2 29 1 1 0 .abs_section_29 |
_SPIBR 2A 1 1 0 .abs_section_2a |
_SPIS 2B 1 1 0 .abs_section_2b |
_SPID 2D 1 1 0 .abs_section_2d |
_IICA 30 1 1 0 .abs_section_30 |
_IICF 31 1 1 0 .abs_section_31 |
_IICC 32 1 1 0 .abs_section_32 |
_IICS 33 1 1 0 .abs_section_33 |
_IICD 34 1 1 0 .abs_section_34 |
_ICSC1 38 1 1 0 .abs_section_38 |
_ICSC2 39 1 1 2 .abs_section_39 |
_ICSTRM 3A 1 1 0 .abs_section_3a |
_ICSSC 3B 1 1 0 .abs_section_3b |
_MTIMSC 3C 1 1 2 .abs_section_3c |
_MTIMCLK 3D 1 1 4 .abs_section_3d |
_MTIMCNT 3E 1 1 0 .abs_section_3e |
_MTIMMOD 3F 1 1 2 .abs_section_3f |
_TPMSC 40 1 1 0 .abs_section_40 |
_TPMC0SC 45 1 1 0 .abs_section_45 |
_TPMC1SC 48 1 1 0 .abs_section_48 |
_SRS 1800 1 1 1 .abs_section_1800 |
_SBDFR 1801 1 1 0 .abs_section_1801 |
_SOPT1 1802 1 1 0 .abs_section_1802 |
_SOPT2 1803 1 1 0 .abs_section_1803 |
_SRTISC 1808 1 1 0 .abs_section_1808 |
_SPMSC1 1809 1 1 0 .abs_section_1809 |
_SPMSC2 180A 1 1 0 .abs_section_180a |
_SPMSC3 180C 1 1 0 .abs_section_180c |
_DBGCAH 1810 1 1 0 .abs_section_1810 |
_DBGCAL 1811 1 1 0 .abs_section_1811 |
_DBGCBH 1812 1 1 0 .abs_section_1812 |
_DBGCBL 1813 1 1 0 .abs_section_1813 |
_DBGC 1816 1 1 0 .abs_section_1816 |
_DBGT 1817 1 1 0 .abs_section_1817 |
_DBGS 1818 1 1 0 .abs_section_1818 |
_FCDIV 1820 1 1 0 .abs_section_1820 |
_FOPT 1821 1 1 0 .abs_section_1821 |
_FCNFG 1823 1 1 0 .abs_section_1823 |
_FPROT 1824 1 1 0 .abs_section_1824 |
_FSTAT 1825 1 1 0 .abs_section_1825 |
_FCMD 1826 1 1 0 .abs_section_1826 |
_PTAPE 1840 1 1 1 .abs_section_1840 |
_PTASE 1841 1 1 0 .abs_section_1841 |
_PTADS 1842 1 1 0 .abs_section_1842 |
_PTBPE 1844 1 1 0 .abs_section_1844 |
_PTBSE 1845 1 1 0 .abs_section_1845 |
_PTBDS 1846 1 1 0 .abs_section_1846 |
_ADCR 12 2 2 0 .abs_section_12 |
_ADCCV 14 2 2 0 .abs_section_14 |
_SCIBD 20 2 2 0 .abs_section_20 |
_TPMCNT 41 2 2 0 .abs_section_41 |
_TPMMOD 43 2 2 0 .abs_section_43 |
_TPMC0V 46 2 2 0 .abs_section_46 |
_TPMC1V 49 2 2 0 .abs_section_49 |
_SDID 1806 2 2 0 .abs_section_1806 |
_DBGF 1814 2 2 0 .abs_section_1814 |
MODULE: -- demo9S08QG8_test.c.o -- |
- PROCEDURES: |
main E092 37 55 1 .text |
KBI_ISR E0C9 B 11 1 .text |
MTIM_ISR E0D4 B 11 1 .text |
- VARIABLES: |
_Vector_18 FFDA 2 2 0 .abs_section_ffda |
_Vector_12 FFE6 2 2 0 .abs_section_ffe6 |
********************************************************************************************* |
MODULE STATISTIC |
Name Data Code Const |
--------------------------------------------------------------------------------------------- |
Start08.c.o 0 132 0 |
MC9S08QG8.C.o 85 0 0 |
demo9S08QG8_test.c.o 0 77 4 |
other 80 16 2 |
********************************************************************************************* |
SECTION USE IN OBJECT-ALLOCATION SECTION |
--------------------------------------------------------------------------------------------- |
SECTION: ".text" |
main KBI_ISR MTIM_ISR |
SECTION: ".init" |
loadByte Init _Startup |
SECTION: ".abs_section_0" |
_PTAD |
SECTION: ".abs_section_1" |
_PTADD |
SECTION: ".abs_section_2" |
_PTBD |
SECTION: ".abs_section_3" |
_PTBDD |
SECTION: ".abs_section_c" |
_KBISC |
SECTION: ".abs_section_d" |
_KBIPE |
SECTION: ".abs_section_e" |
_KBIES |
SECTION: ".abs_section_f" |
_IRQSC |
SECTION: ".abs_section_10" |
_ADCSC1 |
SECTION: ".abs_section_11" |
_ADCSC2 |
SECTION: ".abs_section_16" |
_ADCCFG |
SECTION: ".abs_section_17" |
_APCTL1 |
SECTION: ".abs_section_1a" |
_ACMPSC |
SECTION: ".abs_section_22" |
_SCIC1 |
SECTION: ".abs_section_23" |
_SCIC2 |
SECTION: ".abs_section_24" |
_SCIS1 |
SECTION: ".abs_section_25" |
_SCIS2 |
SECTION: ".abs_section_26" |
_SCIC3 |
SECTION: ".abs_section_27" |
_SCID |
SECTION: ".abs_section_28" |
_SPIC1 |
SECTION: ".abs_section_29" |
_SPIC2 |
SECTION: ".abs_section_2a" |
_SPIBR |
SECTION: ".abs_section_2b" |
_SPIS |
SECTION: ".abs_section_2d" |
_SPID |
SECTION: ".abs_section_30" |
_IICA |
SECTION: ".abs_section_31" |
_IICF |
SECTION: ".abs_section_32" |
_IICC |
SECTION: ".abs_section_33" |
_IICS |
SECTION: ".abs_section_34" |
_IICD |
SECTION: ".abs_section_38" |
_ICSC1 |
SECTION: ".abs_section_39" |
_ICSC2 |
SECTION: ".abs_section_3a" |
_ICSTRM |
SECTION: ".abs_section_3b" |
_ICSSC |
SECTION: ".abs_section_3c" |
_MTIMSC |
SECTION: ".abs_section_3d" |
_MTIMCLK |
SECTION: ".abs_section_3e" |
_MTIMCNT |
SECTION: ".abs_section_3f" |
_MTIMMOD |
SECTION: ".abs_section_40" |
_TPMSC |
SECTION: ".abs_section_45" |
_TPMC0SC |
SECTION: ".abs_section_48" |
_TPMC1SC |
SECTION: ".abs_section_1800" |
_SRS |
SECTION: ".abs_section_1801" |
_SBDFR |
SECTION: ".abs_section_1802" |
_SOPT1 |
SECTION: ".abs_section_1803" |
_SOPT2 |
SECTION: ".abs_section_1808" |
_SRTISC |
SECTION: ".abs_section_1809" |
_SPMSC1 |
SECTION: ".abs_section_180a" |
_SPMSC2 |
SECTION: ".abs_section_180c" |
_SPMSC3 |
SECTION: ".abs_section_1810" |
_DBGCAH |
SECTION: ".abs_section_1811" |
_DBGCAL |
SECTION: ".abs_section_1812" |
_DBGCBH |
SECTION: ".abs_section_1813" |
_DBGCBL |
SECTION: ".abs_section_1816" |
_DBGC |
SECTION: ".abs_section_1817" |
_DBGT |
SECTION: ".abs_section_1818" |
_DBGS |
SECTION: ".abs_section_1820" |
_FCDIV |
SECTION: ".abs_section_1821" |
_FOPT |
SECTION: ".abs_section_1823" |
_FCNFG |
SECTION: ".abs_section_1824" |
_FPROT |
SECTION: ".abs_section_1825" |
_FSTAT |
SECTION: ".abs_section_1826" |
_FCMD |
SECTION: ".abs_section_1840" |
_PTAPE |
SECTION: ".abs_section_1841" |
_PTASE |
SECTION: ".abs_section_1842" |
_PTADS |
SECTION: ".abs_section_1844" |
_PTBPE |
SECTION: ".abs_section_1845" |
_PTBSE |
SECTION: ".abs_section_1846" |
_PTBDS |
SECTION: ".abs_section_12" |
_ADCR |
SECTION: ".abs_section_14" |
_ADCCV |
SECTION: ".abs_section_20" |
_SCIBD |
SECTION: ".abs_section_41" |
_TPMCNT |
SECTION: ".abs_section_43" |
_TPMMOD |
SECTION: ".abs_section_46" |
_TPMC0V |
SECTION: ".abs_section_49" |
_TPMC1V |
SECTION: ".abs_section_1806" |
_SDID |
SECTION: ".abs_section_1814" |
_DBGF |
SECTION: ".abs_section_ffda" |
_Vector_18 |
SECTION: ".abs_section_ffe6" |
_Vector_12 |
********************************************************************************************* |
OBJECT LIST SORTED BY ADDRESS |
Name Addr hSize dSize Ref Section RLIB |
--------------------------------------------------------------------------------------------- |
_PTAD 0 1 1 0 .abs_section_0 |
_PTADD 1 1 1 0 .abs_section_1 |
_PTBD 2 1 1 6 .abs_section_2 |
_PTBDD 3 1 1 2 .abs_section_3 |
_KBISC C 1 1 3 .abs_section_c |
_KBIPE D 1 1 1 .abs_section_d |
_KBIES E 1 1 0 .abs_section_e |
_IRQSC F 1 1 0 .abs_section_f |
_ADCSC1 10 1 1 0 .abs_section_10 |
_ADCSC2 11 1 1 0 .abs_section_11 |
_ADCR 12 2 2 0 .abs_section_12 |
_ADCCV 14 2 2 0 .abs_section_14 |
_ADCCFG 16 1 1 0 .abs_section_16 |
_APCTL1 17 1 1 0 .abs_section_17 |
_ACMPSC 1A 1 1 0 .abs_section_1a |
_SCIBD 20 2 2 0 .abs_section_20 |
_SCIC1 22 1 1 0 .abs_section_22 |
_SCIC2 23 1 1 0 .abs_section_23 |
_SCIS1 24 1 1 0 .abs_section_24 |
_SCIS2 25 1 1 0 .abs_section_25 |
_SCIC3 26 1 1 0 .abs_section_26 |
_SCID 27 1 1 0 .abs_section_27 |
_SPIC1 28 1 1 0 .abs_section_28 |
_SPIC2 29 1 1 0 .abs_section_29 |
_SPIBR 2A 1 1 0 .abs_section_2a |
_SPIS 2B 1 1 0 .abs_section_2b |
_SPID 2D 1 1 0 .abs_section_2d |
_IICA 30 1 1 0 .abs_section_30 |
_IICF 31 1 1 0 .abs_section_31 |
_IICC 32 1 1 0 .abs_section_32 |
_IICS 33 1 1 0 .abs_section_33 |
_IICD 34 1 1 0 .abs_section_34 |
_ICSC1 38 1 1 0 .abs_section_38 |
_ICSC2 39 1 1 2 .abs_section_39 |
_ICSTRM 3A 1 1 0 .abs_section_3a |
_ICSSC 3B 1 1 0 .abs_section_3b |
_MTIMSC 3C 1 1 2 .abs_section_3c |
_MTIMCLK 3D 1 1 4 .abs_section_3d |
_MTIMCNT 3E 1 1 0 .abs_section_3e |
_MTIMMOD 3F 1 1 2 .abs_section_3f |
_TPMSC 40 1 1 0 .abs_section_40 |
_TPMCNT 41 2 2 0 .abs_section_41 |
_TPMMOD 43 2 2 0 .abs_section_43 |
_TPMC0SC 45 1 1 0 .abs_section_45 |
_TPMC0V 46 2 2 0 .abs_section_46 |
_TPMC1SC 48 1 1 0 .abs_section_48 |
_TPMC1V 49 2 2 0 .abs_section_49 |
_SRS 1800 1 1 1 .abs_section_1800 |
_SBDFR 1801 1 1 0 .abs_section_1801 |
_SOPT1 1802 1 1 0 .abs_section_1802 |
_SOPT2 1803 1 1 0 .abs_section_1803 |
_SDID 1806 2 2 0 .abs_section_1806 |
_SRTISC 1808 1 1 0 .abs_section_1808 |
_SPMSC1 1809 1 1 0 .abs_section_1809 |
_SPMSC2 180A 1 1 0 .abs_section_180a |
_SPMSC3 180C 1 1 0 .abs_section_180c |
_DBGCAH 1810 1 1 0 .abs_section_1810 |
_DBGCAL 1811 1 1 0 .abs_section_1811 |
_DBGCBH 1812 1 1 0 .abs_section_1812 |
_DBGCBL 1813 1 1 0 .abs_section_1813 |
_DBGF 1814 2 2 0 .abs_section_1814 |
_DBGC 1816 1 1 0 .abs_section_1816 |
_DBGT 1817 1 1 0 .abs_section_1817 |
_DBGS 1818 1 1 0 .abs_section_1818 |
_FCDIV 1820 1 1 0 .abs_section_1820 |
_FOPT 1821 1 1 0 .abs_section_1821 |
_FCNFG 1823 1 1 0 .abs_section_1823 |
_FPROT 1824 1 1 0 .abs_section_1824 |
_FSTAT 1825 1 1 0 .abs_section_1825 |
_FCMD 1826 1 1 0 .abs_section_1826 |
_PTAPE 1840 1 1 1 .abs_section_1840 |
_PTASE 1841 1 1 0 .abs_section_1841 |
_PTADS 1842 1 1 0 .abs_section_1842 |
_PTBPE 1844 1 1 0 .abs_section_1844 |
_PTBSE 1845 1 1 0 .abs_section_1845 |
_PTBDS 1846 1 1 0 .abs_section_1846 |
loadByte E000 E 14 5 .init |
Init E00E 6D 109 1 .init |
_Startup E07B 9 9 0 .init |
main E092 37 55 1 .text |
KBI_ISR E0C9 B 11 1 .text |
MTIM_ISR E0D4 B 11 1 .text |
_Vector_18 FFDA 2 2 0 .abs_section_ffda |
_Vector_12 FFE6 2 2 0 .abs_section_ffe6 |
********************************************************************************************* |
UNUSED-OBJECTS SECTION |
--------------------------------------------------------------------------------------------- |
********************************************************************************************* |
COPYDOWN SECTION |
--------------------------------------------------------------------------------------------- |
------- ROM-ADDRESS: 0xE0DF ---- SIZE 2 --- |
Filling bytes inserted |
0000 |
********************************************************************************************* |
OBJECT-DEPENDENCIES SECTION |
--------------------------------------------------------------------------------------------- |
Init USES _startupData loadByte |
_Startup USES __SEG_END_SSTACK Init main |
main USES _ICSC2 _PTBD _PTBDD _MTIMCLK _MTIMMOD _MTIMSC |
_KBIPE _KBISC _PTAPE _SRS |
KBI_ISR USES _KBISC _PTBD |
MTIM_ISR USES _MTIMSC _PTBD |
_Vector_18 USES KBI_ISR |
_Vector_12 USES MTIM_ISR |
********************************************************************************************* |
DEPENDENCY TREE |
********************************************************************************************* |
main and _Startup Group |
| |
+- main |
| |
+- _Startup |
| |
+- Init |
| | |
| +- loadByte |
| |
+- main (see above) |
_Vector_18 |
| |
+- KBI_ISR |
_Vector_12 |
| |
+- MTIM_ISR |
********************************************************************************************* |
STATISTIC SECTION |
--------------------------------------------------------------------------------------------- |
ExeFile: |
-------- |
Number of blocks to be downloaded: 6 |
Total size of all blocks to be downloaded: 231 |
/programy/C/HC08/test/Demo_S08QG8_Test/bin/P&E_ICD.mrk |
---|
0,0 → 1,0 |
MARKPOINTS SAVE OFF |
/programy/C/HC08/test/Demo_S08QG8_Test/bin/SofTec.abs |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/HC08/test/Demo_S08QG8_Test/bin/SofTec.abs.s19 |
---|
0,0 → 1,13 |
S0460000443A5C50726F66696C65735C723161616C642E46534C5C4465736B746F705C576F726B5C44656D6F5F5330385147385F546573745C62696E5C536F665465632E6162735F |
S123E0008B899EFE05F6AF019EFF05888A81A7FCC6E0854C95E701C6E0844CF732E08620B0 |
S123E0201F898BF687E6024C9EE706E603EE018A4C20037FAF014BFB9E6B05F78A88AF045D |
S123E0409E6B02DD9E6B01D932E088898BADB1974C9EE703ADAA4C9EE7044A260351001872 |
S123E060AD9E878AAD9A972005AD95F7AF019E6B04F79E6B03F320D5A7068145015094AD57 |
S123E0808DCCE0920000E08AE0DF00000000000000009AB639AAC0B7391D021F021E031C28 |
S123E0A003B63DA4F0AA08B73DB63DA4CFB73D6E703F3F3F6E603C140D120C140C45184031 |
S123E0C0F6AA04F7C7180020FB8B140CB602A840B7028A808B1F3CB602A880B7028A800010 |
S104E0E0003B |
S105FFDAE0C978 |
S105FFE6E0D461 |
S105FFFEE07BA2 |
S9030000FC |
/programy/C/HC08/test/Demo_S08QG8_Test/bin/SofTec.map |
---|
0,0 → 1,596 |
PROGRAM "D:\Profiles\r1aald.FSL\Desktop\Work\Demo_S08QG8_Test\bin\SofTec.abs" |
********************************************************************************************* |
TARGET SECTION |
--------------------------------------------------------------------------------------------- |
Processor : Freescale HC08 |
Memory Model: SMALL |
File Format : ELF\Dwarf 2.0 |
Linker : SmartLinker V-5.0.24 Build 4210, Jul 29 2004 |
********************************************************************************************* |
FILE SECTION |
--------------------------------------------------------------------------------------------- |
Start08.c.o Model: SMALL, Lang: ANSI-C |
MC9S08QG8.C.o Model: SMALL, Lang: ANSI-C |
demo9S08QG8_test.c.o Model: SMALL, Lang: ANSI-C |
********************************************************************************************* |
STARTUP SECTION |
--------------------------------------------------------------------------------------------- |
Entry point: 0xE07B (_Startup) |
_startupData is allocated at 0xE084 and uses 6 Bytes |
extern struct _tagStartup { |
unsigned nofZeroOut 0 |
_Copy *toCopyDownBeg 0xE0DF |
} _startupData; |
********************************************************************************************* |
SECTION-ALLOCATION SECTION |
Section Name Size Type From To Segment |
--------------------------------------------------------------------------------------------- |
.text 77 R 0xE092 0xE0DE ROM |
.abs_section_0 1 N/I 0x0 0x0 .absSeg0 |
.abs_section_1 1 N/I 0x1 0x1 .absSeg1 |
.abs_section_2 1 N/I 0x2 0x2 .absSeg2 |
.abs_section_3 1 N/I 0x3 0x3 .absSeg3 |
.abs_section_c 1 N/I 0xC 0xC .absSeg4 |
.abs_section_d 1 N/I 0xD 0xD .absSeg5 |
.abs_section_e 1 N/I 0xE 0xE .absSeg6 |
.abs_section_f 1 N/I 0xF 0xF .absSeg7 |
.abs_section_10 1 N/I 0x10 0x10 .absSeg8 |
.abs_section_11 1 N/I 0x11 0x11 .absSeg9 |
.abs_section_16 1 N/I 0x16 0x16 .absSeg10 |
.abs_section_17 1 N/I 0x17 0x17 .absSeg11 |
.abs_section_1a 1 N/I 0x1A 0x1A .absSeg12 |
.abs_section_22 1 N/I 0x22 0x22 .absSeg13 |
.abs_section_23 1 N/I 0x23 0x23 .absSeg14 |
.abs_section_24 1 N/I 0x24 0x24 .absSeg15 |
.abs_section_25 1 N/I 0x25 0x25 .absSeg16 |
.abs_section_26 1 N/I 0x26 0x26 .absSeg17 |
.abs_section_27 1 N/I 0x27 0x27 .absSeg18 |
.abs_section_28 1 N/I 0x28 0x28 .absSeg19 |
.abs_section_29 1 N/I 0x29 0x29 .absSeg20 |
.abs_section_2a 1 N/I 0x2A 0x2A .absSeg21 |
.abs_section_2b 1 N/I 0x2B 0x2B .absSeg22 |
.abs_section_2d 1 N/I 0x2D 0x2D .absSeg23 |
.abs_section_30 1 N/I 0x30 0x30 .absSeg24 |
.abs_section_31 1 N/I 0x31 0x31 .absSeg25 |
.abs_section_32 1 N/I 0x32 0x32 .absSeg26 |
.abs_section_33 1 N/I 0x33 0x33 .absSeg27 |
.abs_section_34 1 N/I 0x34 0x34 .absSeg28 |
.abs_section_38 1 N/I 0x38 0x38 .absSeg29 |
.abs_section_39 1 N/I 0x39 0x39 .absSeg30 |
.abs_section_3a 1 N/I 0x3A 0x3A .absSeg31 |
.abs_section_3b 1 N/I 0x3B 0x3B .absSeg32 |
.abs_section_3c 1 N/I 0x3C 0x3C .absSeg33 |
.abs_section_3d 1 N/I 0x3D 0x3D .absSeg34 |
.abs_section_3e 1 N/I 0x3E 0x3E .absSeg35 |
.abs_section_3f 1 N/I 0x3F 0x3F .absSeg36 |
.abs_section_40 1 N/I 0x40 0x40 .absSeg37 |
.abs_section_45 1 N/I 0x45 0x45 .absSeg38 |
.abs_section_48 1 N/I 0x48 0x48 .absSeg39 |
.abs_section_1800 1 N/I 0x1800 0x1800 .absSeg40 |
.abs_section_1801 1 N/I 0x1801 0x1801 .absSeg41 |
.abs_section_1802 1 N/I 0x1802 0x1802 .absSeg42 |
.abs_section_1803 1 N/I 0x1803 0x1803 .absSeg43 |
.abs_section_1808 1 N/I 0x1808 0x1808 .absSeg44 |
.abs_section_1809 1 N/I 0x1809 0x1809 .absSeg45 |
.abs_section_180a 1 N/I 0x180A 0x180A .absSeg46 |
.abs_section_180c 1 N/I 0x180C 0x180C .absSeg47 |
.abs_section_1810 1 N/I 0x1810 0x1810 .absSeg48 |
.abs_section_1811 1 N/I 0x1811 0x1811 .absSeg49 |
.abs_section_1812 1 N/I 0x1812 0x1812 .absSeg50 |
.abs_section_1813 1 N/I 0x1813 0x1813 .absSeg51 |
.abs_section_1816 1 N/I 0x1816 0x1816 .absSeg52 |
.abs_section_1817 1 N/I 0x1817 0x1817 .absSeg53 |
.abs_section_1818 1 N/I 0x1818 0x1818 .absSeg54 |
.abs_section_1820 1 N/I 0x1820 0x1820 .absSeg55 |
.abs_section_1821 1 N/I 0x1821 0x1821 .absSeg56 |
.abs_section_1823 1 N/I 0x1823 0x1823 .absSeg57 |
.abs_section_1824 1 N/I 0x1824 0x1824 .absSeg58 |
.abs_section_1825 1 N/I 0x1825 0x1825 .absSeg59 |
.abs_section_1826 1 N/I 0x1826 0x1826 .absSeg60 |
.abs_section_1840 1 N/I 0x1840 0x1840 .absSeg61 |
.abs_section_1841 1 N/I 0x1841 0x1841 .absSeg62 |
.abs_section_1842 1 N/I 0x1842 0x1842 .absSeg63 |
.abs_section_1844 1 N/I 0x1844 0x1844 .absSeg64 |
.abs_section_1845 1 N/I 0x1845 0x1845 .absSeg65 |
.abs_section_1846 1 N/I 0x1846 0x1846 .absSeg66 |
.abs_section_ffb0 1 N/I 0xFFB0 0xFFB0 .absSeg67 |
.abs_section_ffb1 1 N/I 0xFFB1 0xFFB1 .absSeg68 |
.abs_section_ffb2 1 N/I 0xFFB2 0xFFB2 .absSeg69 |
.abs_section_ffb3 1 N/I 0xFFB3 0xFFB3 .absSeg70 |
.abs_section_ffb4 1 N/I 0xFFB4 0xFFB4 .absSeg71 |
.abs_section_ffb5 1 N/I 0xFFB5 0xFFB5 .absSeg72 |
.abs_section_ffb6 1 N/I 0xFFB6 0xFFB6 .absSeg73 |
.abs_section_ffb7 1 N/I 0xFFB7 0xFFB7 .absSeg74 |
.abs_section_ffbd 1 N/I 0xFFBD 0xFFBD .absSeg75 |
.abs_section_ffbf 1 N/I 0xFFBF 0xFFBF .absSeg76 |
.abs_section_12 2 N/I 0x12 0x13 .absSeg77 |
.abs_section_14 2 N/I 0x14 0x15 .absSeg78 |
.abs_section_20 2 N/I 0x20 0x21 .absSeg79 |
.abs_section_41 2 N/I 0x41 0x42 .absSeg80 |
.abs_section_43 2 N/I 0x43 0x44 .absSeg81 |
.abs_section_46 2 N/I 0x46 0x47 .absSeg82 |
.abs_section_49 2 N/I 0x49 0x4A .absSeg83 |
.abs_section_1806 2 N/I 0x1806 0x1807 .absSeg84 |
.abs_section_1814 2 N/I 0x1814 0x1815 .absSeg85 |
.abs_section_ffda 2 R 0xFFDA 0xFFDB .absSeg86 |
.abs_section_ffe6 2 R 0xFFE6 0xFFE7 .absSeg87 |
.startData 14 R 0xE084 0xE091 ROM |
.init 132 R 0xE000 0xE083 ROM |
.stack 80 R/W 0x100 0x14F RAM |
.copy 2 R 0xE0DF 0xE0E0 ROM |
.vectSeg88_vect 2 R 0xFFFE 0xFFFF .vectSeg88 |
Summary of section sizes per section type: |
READ_ONLY (R): E7 (dec: 231) |
READ_WRITE (R/W): 50 (dec: 80) |
NO_INIT (N/I): 5F (dec: 95) |
********************************************************************************************* |
VECTOR-ALLOCATION SECTION |
Address InitValue InitFunction |
--------------------------------------------------------------------------------------------- |
0xFFFE 0xE07B _Startup |
********************************************************************************************* |
OBJECT-ALLOCATION SECTION |
Name Module Addr hSize dSize Ref Section RLIB |
--------------------------------------------------------------------------------------------- |
MODULE: -- Start08.c.o -- |
- PROCEDURES: |
loadByte E000 E 14 5 .init |
Init E00E 6D 109 1 .init |
_Startup E07B 9 9 0 .init |
- VARIABLES: |
_startupData E084 6 6 4 .startData |
- LABELS: |
__SEG_END_SSTACK 150 0 0 1 |
MODULE: -- MC9S08QG8.C.o -- |
- PROCEDURES: |
- VARIABLES: |
_PTAD 0 1 1 0 .abs_section_0 |
_PTADD 1 1 1 0 .abs_section_1 |
_PTBD 2 1 1 6 .abs_section_2 |
_PTBDD 3 1 1 2 .abs_section_3 |
_KBISC C 1 1 3 .abs_section_c |
_KBIPE D 1 1 1 .abs_section_d |
_KBIES E 1 1 0 .abs_section_e |
_IRQSC F 1 1 0 .abs_section_f |
_ADCSC1 10 1 1 0 .abs_section_10 |
_ADCSC2 11 1 1 0 .abs_section_11 |
_ADCCFG 16 1 1 0 .abs_section_16 |
_APCTL1 17 1 1 0 .abs_section_17 |
_ACMPSC 1A 1 1 0 .abs_section_1a |
_SCIC1 22 1 1 0 .abs_section_22 |
_SCIC2 23 1 1 0 .abs_section_23 |
_SCIS1 24 1 1 0 .abs_section_24 |
_SCIS2 25 1 1 0 .abs_section_25 |
_SCIC3 26 1 1 0 .abs_section_26 |
_SCID 27 1 1 0 .abs_section_27 |
_SPIC1 28 1 1 0 .abs_section_28 |
_SPIC2 29 1 1 0 .abs_section_29 |
_SPIBR 2A 1 1 0 .abs_section_2a |
_SPIS 2B 1 1 0 .abs_section_2b |
_SPID 2D 1 1 0 .abs_section_2d |
_IICA 30 1 1 0 .abs_section_30 |
_IICF 31 1 1 0 .abs_section_31 |
_IICC 32 1 1 0 .abs_section_32 |
_IICS 33 1 1 0 .abs_section_33 |
_IICD 34 1 1 0 .abs_section_34 |
_ICSC1 38 1 1 0 .abs_section_38 |
_ICSC2 39 1 1 2 .abs_section_39 |
_ICSTRM 3A 1 1 0 .abs_section_3a |
_ICSSC 3B 1 1 0 .abs_section_3b |
_MTIMSC 3C 1 1 2 .abs_section_3c |
_MTIMCLK 3D 1 1 4 .abs_section_3d |
_MTIMCNT 3E 1 1 0 .abs_section_3e |
_MTIMMOD 3F 1 1 2 .abs_section_3f |
_TPMSC 40 1 1 0 .abs_section_40 |
_TPMC0SC 45 1 1 0 .abs_section_45 |
_TPMC1SC 48 1 1 0 .abs_section_48 |
_SRS 1800 1 1 1 .abs_section_1800 |
_SBDFR 1801 1 1 0 .abs_section_1801 |
_SOPT1 1802 1 1 0 .abs_section_1802 |
_SOPT2 1803 1 1 0 .abs_section_1803 |
_SRTISC 1808 1 1 0 .abs_section_1808 |
_SPMSC1 1809 1 1 0 .abs_section_1809 |
_SPMSC2 180A 1 1 0 .abs_section_180a |
_SPMSC3 180C 1 1 0 .abs_section_180c |
_DBGCAH 1810 1 1 0 .abs_section_1810 |
_DBGCAL 1811 1 1 0 .abs_section_1811 |
_DBGCBH 1812 1 1 0 .abs_section_1812 |
_DBGCBL 1813 1 1 0 .abs_section_1813 |
_DBGC 1816 1 1 0 .abs_section_1816 |
_DBGT 1817 1 1 0 .abs_section_1817 |
_DBGS 1818 1 1 0 .abs_section_1818 |
_FCDIV 1820 1 1 0 .abs_section_1820 |
_FOPT 1821 1 1 0 .abs_section_1821 |
_FCNFG 1823 1 1 0 .abs_section_1823 |
_FPROT 1824 1 1 0 .abs_section_1824 |
_FSTAT 1825 1 1 0 .abs_section_1825 |
_FCMD 1826 1 1 0 .abs_section_1826 |
_PTAPE 1840 1 1 1 .abs_section_1840 |
_PTASE 1841 1 1 0 .abs_section_1841 |
_PTADS 1842 1 1 0 .abs_section_1842 |
_PTBPE 1844 1 1 0 .abs_section_1844 |
_PTBSE 1845 1 1 0 .abs_section_1845 |
_PTBDS 1846 1 1 0 .abs_section_1846 |
_BAKEY0 FFB0 1 1 0 .abs_section_ffb0 |
_BAKEY1 FFB1 1 1 0 .abs_section_ffb1 |
_BAKEY2 FFB2 1 1 0 .abs_section_ffb2 |
_BAKEY3 FFB3 1 1 0 .abs_section_ffb3 |
_BAKEY4 FFB4 1 1 0 .abs_section_ffb4 |
_BAKEY5 FFB5 1 1 0 .abs_section_ffb5 |
_BAKEY6 FFB6 1 1 0 .abs_section_ffb6 |
_BAKEY7 FFB7 1 1 0 .abs_section_ffb7 |
_NVPROT FFBD 1 1 0 .abs_section_ffbd |
_NVOPT FFBF 1 1 0 .abs_section_ffbf |
_ADCR 12 2 2 0 .abs_section_12 |
_ADCCV 14 2 2 0 .abs_section_14 |
_SCIBD 20 2 2 0 .abs_section_20 |
_TPMCNT 41 2 2 0 .abs_section_41 |
_TPMMOD 43 2 2 0 .abs_section_43 |
_TPMC0V 46 2 2 0 .abs_section_46 |
_TPMC1V 49 2 2 0 .abs_section_49 |
_SDID 1806 2 2 0 .abs_section_1806 |
_DBGF 1814 2 2 0 .abs_section_1814 |
MODULE: -- demo9S08QG8_test.c.o -- |
- PROCEDURES: |
main E092 37 55 1 .text |
KBI_ISR E0C9 B 11 1 .text |
MTIM_ISR E0D4 B 11 1 .text |
- VARIABLES: |
_Vector_18 FFDA 2 2 0 .abs_section_ffda |
_Vector_12 FFE6 2 2 0 .abs_section_ffe6 |
********************************************************************************************* |
MODULE STATISTIC |
Name Data Code Const |
--------------------------------------------------------------------------------------------- |
Start08.c.o 0 132 0 |
MC9S08QG8.C.o 95 0 0 |
demo9S08QG8_test.c.o 0 77 4 |
other 80 16 2 |
********************************************************************************************* |
SECTION USE IN OBJECT-ALLOCATION SECTION |
--------------------------------------------------------------------------------------------- |
SECTION: ".text" |
main KBI_ISR MTIM_ISR |
SECTION: ".init" |
loadByte Init _Startup |
SECTION: ".abs_section_0" |
_PTAD |
SECTION: ".abs_section_1" |
_PTADD |
SECTION: ".abs_section_2" |
_PTBD |
SECTION: ".abs_section_3" |
_PTBDD |
SECTION: ".abs_section_c" |
_KBISC |
SECTION: ".abs_section_d" |
_KBIPE |
SECTION: ".abs_section_e" |
_KBIES |
SECTION: ".abs_section_f" |
_IRQSC |
SECTION: ".abs_section_10" |
_ADCSC1 |
SECTION: ".abs_section_11" |
_ADCSC2 |
SECTION: ".abs_section_16" |
_ADCCFG |
SECTION: ".abs_section_17" |
_APCTL1 |
SECTION: ".abs_section_1a" |
_ACMPSC |
SECTION: ".abs_section_22" |
_SCIC1 |
SECTION: ".abs_section_23" |
_SCIC2 |
SECTION: ".abs_section_24" |
_SCIS1 |
SECTION: ".abs_section_25" |
_SCIS2 |
SECTION: ".abs_section_26" |
_SCIC3 |
SECTION: ".abs_section_27" |
_SCID |
SECTION: ".abs_section_28" |
_SPIC1 |
SECTION: ".abs_section_29" |
_SPIC2 |
SECTION: ".abs_section_2a" |
_SPIBR |
SECTION: ".abs_section_2b" |
_SPIS |
SECTION: ".abs_section_2d" |
_SPID |
SECTION: ".abs_section_30" |
_IICA |
SECTION: ".abs_section_31" |
_IICF |
SECTION: ".abs_section_32" |
_IICC |
SECTION: ".abs_section_33" |
_IICS |
SECTION: ".abs_section_34" |
_IICD |
SECTION: ".abs_section_38" |
_ICSC1 |
SECTION: ".abs_section_39" |
_ICSC2 |
SECTION: ".abs_section_3a" |
_ICSTRM |
SECTION: ".abs_section_3b" |
_ICSSC |
SECTION: ".abs_section_3c" |
_MTIMSC |
SECTION: ".abs_section_3d" |
_MTIMCLK |
SECTION: ".abs_section_3e" |
_MTIMCNT |
SECTION: ".abs_section_3f" |
_MTIMMOD |
SECTION: ".abs_section_40" |
_TPMSC |
SECTION: ".abs_section_45" |
_TPMC0SC |
SECTION: ".abs_section_48" |
_TPMC1SC |
SECTION: ".abs_section_1800" |
_SRS |
SECTION: ".abs_section_1801" |
_SBDFR |
SECTION: ".abs_section_1802" |
_SOPT1 |
SECTION: ".abs_section_1803" |
_SOPT2 |
SECTION: ".abs_section_1808" |
_SRTISC |
SECTION: ".abs_section_1809" |
_SPMSC1 |
SECTION: ".abs_section_180a" |
_SPMSC2 |
SECTION: ".abs_section_180c" |
_SPMSC3 |
SECTION: ".abs_section_1810" |
_DBGCAH |
SECTION: ".abs_section_1811" |
_DBGCAL |
SECTION: ".abs_section_1812" |
_DBGCBH |
SECTION: ".abs_section_1813" |
_DBGCBL |
SECTION: ".abs_section_1816" |
_DBGC |
SECTION: ".abs_section_1817" |
_DBGT |
SECTION: ".abs_section_1818" |
_DBGS |
SECTION: ".abs_section_1820" |
_FCDIV |
SECTION: ".abs_section_1821" |
_FOPT |
SECTION: ".abs_section_1823" |
_FCNFG |
SECTION: ".abs_section_1824" |
_FPROT |
SECTION: ".abs_section_1825" |
_FSTAT |
SECTION: ".abs_section_1826" |
_FCMD |
SECTION: ".abs_section_1840" |
_PTAPE |
SECTION: ".abs_section_1841" |
_PTASE |
SECTION: ".abs_section_1842" |
_PTADS |
SECTION: ".abs_section_1844" |
_PTBPE |
SECTION: ".abs_section_1845" |
_PTBSE |
SECTION: ".abs_section_1846" |
_PTBDS |
SECTION: ".abs_section_ffb0" |
_BAKEY0 |
SECTION: ".abs_section_ffb1" |
_BAKEY1 |
SECTION: ".abs_section_ffb2" |
_BAKEY2 |
SECTION: ".abs_section_ffb3" |
_BAKEY3 |
SECTION: ".abs_section_ffb4" |
_BAKEY4 |
SECTION: ".abs_section_ffb5" |
_BAKEY5 |
SECTION: ".abs_section_ffb6" |
_BAKEY6 |
SECTION: ".abs_section_ffb7" |
_BAKEY7 |
SECTION: ".abs_section_ffbd" |
_NVPROT |
SECTION: ".abs_section_ffbf" |
_NVOPT |
SECTION: ".abs_section_12" |
_ADCR |
SECTION: ".abs_section_14" |
_ADCCV |
SECTION: ".abs_section_20" |
_SCIBD |
SECTION: ".abs_section_41" |
_TPMCNT |
SECTION: ".abs_section_43" |
_TPMMOD |
SECTION: ".abs_section_46" |
_TPMC0V |
SECTION: ".abs_section_49" |
_TPMC1V |
SECTION: ".abs_section_1806" |
_SDID |
SECTION: ".abs_section_1814" |
_DBGF |
SECTION: ".abs_section_ffda" |
_Vector_18 |
SECTION: ".abs_section_ffe6" |
_Vector_12 |
********************************************************************************************* |
OBJECT LIST SORTED BY ADDRESS |
Name Addr hSize dSize Ref Section RLIB |
--------------------------------------------------------------------------------------------- |
_PTAD 0 1 1 0 .abs_section_0 |
_PTADD 1 1 1 0 .abs_section_1 |
_PTBD 2 1 1 6 .abs_section_2 |
_PTBDD 3 1 1 2 .abs_section_3 |
_KBISC C 1 1 3 .abs_section_c |
_KBIPE D 1 1 1 .abs_section_d |
_KBIES E 1 1 0 .abs_section_e |
_IRQSC F 1 1 0 .abs_section_f |
_ADCSC1 10 1 1 0 .abs_section_10 |
_ADCSC2 11 1 1 0 .abs_section_11 |
_ADCR 12 2 2 0 .abs_section_12 |
_ADCCV 14 2 2 0 .abs_section_14 |
_ADCCFG 16 1 1 0 .abs_section_16 |
_APCTL1 17 1 1 0 .abs_section_17 |
_ACMPSC 1A 1 1 0 .abs_section_1a |
_SCIBD 20 2 2 0 .abs_section_20 |
_SCIC1 22 1 1 0 .abs_section_22 |
_SCIC2 23 1 1 0 .abs_section_23 |
_SCIS1 24 1 1 0 .abs_section_24 |
_SCIS2 25 1 1 0 .abs_section_25 |
_SCIC3 26 1 1 0 .abs_section_26 |
_SCID 27 1 1 0 .abs_section_27 |
_SPIC1 28 1 1 0 .abs_section_28 |
_SPIC2 29 1 1 0 .abs_section_29 |
_SPIBR 2A 1 1 0 .abs_section_2a |
_SPIS 2B 1 1 0 .abs_section_2b |
_SPID 2D 1 1 0 .abs_section_2d |
_IICA 30 1 1 0 .abs_section_30 |
_IICF 31 1 1 0 .abs_section_31 |
_IICC 32 1 1 0 .abs_section_32 |
_IICS 33 1 1 0 .abs_section_33 |
_IICD 34 1 1 0 .abs_section_34 |
_ICSC1 38 1 1 0 .abs_section_38 |
_ICSC2 39 1 1 2 .abs_section_39 |
_ICSTRM 3A 1 1 0 .abs_section_3a |
_ICSSC 3B 1 1 0 .abs_section_3b |
_MTIMSC 3C 1 1 2 .abs_section_3c |
_MTIMCLK 3D 1 1 4 .abs_section_3d |
_MTIMCNT 3E 1 1 0 .abs_section_3e |
_MTIMMOD 3F 1 1 2 .abs_section_3f |
_TPMSC 40 1 1 0 .abs_section_40 |
_TPMCNT 41 2 2 0 .abs_section_41 |
_TPMMOD 43 2 2 0 .abs_section_43 |
_TPMC0SC 45 1 1 0 .abs_section_45 |
_TPMC0V 46 2 2 0 .abs_section_46 |
_TPMC1SC 48 1 1 0 .abs_section_48 |
_TPMC1V 49 2 2 0 .abs_section_49 |
_SRS 1800 1 1 1 .abs_section_1800 |
_SBDFR 1801 1 1 0 .abs_section_1801 |
_SOPT1 1802 1 1 0 .abs_section_1802 |
_SOPT2 1803 1 1 0 .abs_section_1803 |
_SDID 1806 2 2 0 .abs_section_1806 |
_SRTISC 1808 1 1 0 .abs_section_1808 |
_SPMSC1 1809 1 1 0 .abs_section_1809 |
_SPMSC2 180A 1 1 0 .abs_section_180a |
_SPMSC3 180C 1 1 0 .abs_section_180c |
_DBGCAH 1810 1 1 0 .abs_section_1810 |
_DBGCAL 1811 1 1 0 .abs_section_1811 |
_DBGCBH 1812 1 1 0 .abs_section_1812 |
_DBGCBL 1813 1 1 0 .abs_section_1813 |
_DBGF 1814 2 2 0 .abs_section_1814 |
_DBGC 1816 1 1 0 .abs_section_1816 |
_DBGT 1817 1 1 0 .abs_section_1817 |
_DBGS 1818 1 1 0 .abs_section_1818 |
_FCDIV 1820 1 1 0 .abs_section_1820 |
_FOPT 1821 1 1 0 .abs_section_1821 |
_FCNFG 1823 1 1 0 .abs_section_1823 |
_FPROT 1824 1 1 0 .abs_section_1824 |
_FSTAT 1825 1 1 0 .abs_section_1825 |
_FCMD 1826 1 1 0 .abs_section_1826 |
_PTAPE 1840 1 1 1 .abs_section_1840 |
_PTASE 1841 1 1 0 .abs_section_1841 |
_PTADS 1842 1 1 0 .abs_section_1842 |
_PTBPE 1844 1 1 0 .abs_section_1844 |
_PTBSE 1845 1 1 0 .abs_section_1845 |
_PTBDS 1846 1 1 0 .abs_section_1846 |
loadByte E000 E 14 5 .init |
Init E00E 6D 109 1 .init |
_Startup E07B 9 9 0 .init |
main E092 37 55 1 .text |
KBI_ISR E0C9 B 11 1 .text |
MTIM_ISR E0D4 B 11 1 .text |
_BAKEY0 FFB0 1 1 0 .abs_section_ffb0 |
_BAKEY1 FFB1 1 1 0 .abs_section_ffb1 |
_BAKEY2 FFB2 1 1 0 .abs_section_ffb2 |
_BAKEY3 FFB3 1 1 0 .abs_section_ffb3 |
_BAKEY4 FFB4 1 1 0 .abs_section_ffb4 |
_BAKEY5 FFB5 1 1 0 .abs_section_ffb5 |
_BAKEY6 FFB6 1 1 0 .abs_section_ffb6 |
_BAKEY7 FFB7 1 1 0 .abs_section_ffb7 |
_NVPROT FFBD 1 1 0 .abs_section_ffbd |
_NVOPT FFBF 1 1 0 .abs_section_ffbf |
_Vector_18 FFDA 2 2 0 .abs_section_ffda |
_Vector_12 FFE6 2 2 0 .abs_section_ffe6 |
********************************************************************************************* |
UNUSED-OBJECTS SECTION |
--------------------------------------------------------------------------------------------- |
********************************************************************************************* |
COPYDOWN SECTION |
--------------------------------------------------------------------------------------------- |
------- ROM-ADDRESS: 0xE0DF ---- SIZE 2 --- |
Filling bytes inserted |
0000 |
********************************************************************************************* |
OBJECT-DEPENDENCIES SECTION |
--------------------------------------------------------------------------------------------- |
Init USES _startupData loadByte |
_Startup USES __SEG_END_SSTACK Init main |
main USES _ICSC2 _PTBD _PTBDD _MTIMCLK _MTIMMOD _MTIMSC |
_KBIPE _KBISC _PTAPE _SRS |
KBI_ISR USES _KBISC _PTBD |
MTIM_ISR USES _MTIMSC _PTBD |
_Vector_18 USES KBI_ISR |
_Vector_12 USES MTIM_ISR |
********************************************************************************************* |
DEPENDENCY TREE |
********************************************************************************************* |
main and _Startup Group |
| |
+- main |
| |
+- _Startup |
| |
+- Init |
| | |
| +- loadByte |
| |
+- main (see above) |
_Vector_18 |
| |
+- KBI_ISR |
_Vector_12 |
| |
+- MTIM_ISR |
********************************************************************************************* |
STATISTIC SECTION |
--------------------------------------------------------------------------------------------- |
ExeFile: |
-------- |
Number of blocks to be downloaded: 6 |
Total size of all blocks to be downloaded: 231 |
/programy/C/HC08/test/Demo_S08QG8_Test/cmd/Monitor_Postload.cmd |
---|
0,0 → 1,3 |
// After load the commands written below will be executed |
// show main function after loading |
Findproc main |
/programy/C/HC08/test/Demo_S08QG8_Test/cmd/Monitor_Preload.cmd |
---|
0,0 → 1,2 |
// Before load the commands written below will be executed |
GDI erase |
/programy/C/HC08/test/Demo_S08QG8_Test/cmd/Monitor_Reset.cmd |
---|
0,0 → 1,0 |
// After reset the commands written below will be executed |
/programy/C/HC08/test/Demo_S08QG8_Test/cmd/Monitor_Startup.cmd |
---|
0,0 → 1,0 |
// At startup the commands written below will be executed |
/programy/C/HC08/test/Demo_S08QG8_Test/cmd/P&E_FCS_Postload.cmd |
---|
0,0 → 1,3 |
// After load the commands written below will be executed |
// show main function after loading |
Findproc main |
/programy/C/HC08/test/Demo_S08QG8_Test/cmd/P&E_FCS_Preload.cmd |
---|
0,0 → 1,0 |
// Before load the commands written below will be executed |
/programy/C/HC08/test/Demo_S08QG8_Test/cmd/P&E_FCS_Reset.cmd |
---|
0,0 → 1,0 |
// After reset the commands written below will be executed |
/programy/C/HC08/test/Demo_S08QG8_Test/cmd/P&E_FCS_Startup.cmd |
---|
0,0 → 1,0 |
// At startup the commands written below will be executed |
/programy/C/HC08/test/Demo_S08QG8_Test/cmd/P&E_ICD_Postload.cmd |
---|
0,0 → 1,3 |
// After load the commands written below will be executed |
// show main function after loading |
Findproc main |
/programy/C/HC08/test/Demo_S08QG8_Test/cmd/P&E_ICD_Preload.cmd |
---|
0,0 → 1,0 |
// Before load the commands written below will be executed |
/programy/C/HC08/test/Demo_S08QG8_Test/cmd/P&E_ICD_Reset.cmd |
---|
0,0 → 1,0 |
// After reset the commands written below will be executed |
/programy/C/HC08/test/Demo_S08QG8_Test/cmd/P&E_ICD_Startup.cmd |
---|
0,0 → 1,0 |
// At startup the commands written below will be executed |
/programy/C/HC08/test/Demo_S08QG8_Test/cmd/SofTec_Postload.cmd |
---|
0,0 → 1,3 |
// After load the commands written below will be executed |
// show main function after loading |
Findproc main |
/programy/C/HC08/test/Demo_S08QG8_Test/cmd/SofTec_Preload.cmd |
---|
0,0 → 1,0 |
// Before load the commands written below will be executed |
/programy/C/HC08/test/Demo_S08QG8_Test/cmd/SofTec_Reset.cmd |
---|
0,0 → 1,0 |
// After reset the commands written below will be executed |
/programy/C/HC08/test/Demo_S08QG8_Test/cmd/SofTec_Startup.cmd |
---|
0,0 → 1,0 |
// At startup the commands written below will be executed |
/programy/C/HC08/test/Demo_S08QG8_Test/prm/Monitor_linker.prm |
---|
0,0 → 1,22 |
/* This is a linker parameter file for the QG8 */ |
NAMES END /* CodeWarrior will pass all the needed files to the linker by command line. But here you may add your own files too. */ |
SEGMENTS /* Here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */ |
ROM = READ_ONLY 0xE000 TO 0xFFAF; |
Z_RAM = READ_WRITE 0x0060 TO 0x00FF; |
RAM = READ_WRITE 0x0100 TO 0x025F; |
ROM1 = READ_ONLY 0xFFC0 TO 0xFFCF; |
END |
PLACEMENT /* Here all predefined and user segments are placed into the SEGMENTS defined above. */ |
DEFAULT_RAM INTO RAM; |
_DATA_ZEROPAGE, MY_ZEROPAGE INTO Z_RAM; |
DEFAULT_ROM, ROM_VAR, STRINGS INTO ROM; /*,ROM1*/ /* in case you want to use ROM1 here as well, add option -OnB=b to the compiler. */ |
END |
STACKSIZE 0x50 |
VECTOR 0 _Startup /* Reset vector: this is the default entry point for a C/C++ application. */ |
//VECTOR 0 Entry /* Reset vector: this is the default entry point for an Assembly application. */ |
//INIT Entry /* For assembly applications: that this is as well the initialization entry point */ |
/programy/C/HC08/test/Demo_S08QG8_Test/prm/P&E_FCS_linker.prm |
---|
0,0 → 1,22 |
/* This is a linker parameter file for the QG8 */ |
NAMES END /* CodeWarrior will pass all the needed files to the linker by command line. But here you may add your own files too. */ |
SEGMENTS /* Here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */ |
ROM = READ_ONLY 0xE000 TO 0xFFAF; |
Z_RAM = READ_WRITE 0x0060 TO 0x00FF; |
RAM = READ_WRITE 0x0100 TO 0x025F; |
ROM1 = READ_ONLY 0xFFC0 TO 0xFFCF; |
END |
PLACEMENT /* Here all predefined and user segments are placed into the SEGMENTS defined above. */ |
DEFAULT_RAM INTO RAM; |
_DATA_ZEROPAGE, MY_ZEROPAGE INTO Z_RAM; |
DEFAULT_ROM, ROM_VAR, STRINGS INTO ROM; /*,ROM1*/ /* in case you want to use ROM1 here as well, add option -OnB=b to the compiler. */ |
END |
STACKSIZE 0x50 |
VECTOR 0 _Startup /* Reset vector: this is the default entry point for a C/C++ application. */ |
//VECTOR 0 Entry /* Reset vector: this is the default entry point for an Assembly application. */ |
//INIT Entry /* For assembly applications: that this is as well the initialization entry point */ |
/programy/C/HC08/test/Demo_S08QG8_Test/prm/P&E_ICD_linker.prm |
---|
0,0 → 1,22 |
/* This is a linker parameter file for the QG8 */ |
NAMES END /* CodeWarrior will pass all the needed files to the linker by command line. But here you may add your own files too. */ |
SEGMENTS /* Here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */ |
ROM = READ_ONLY 0xE000 TO 0xFFAF; |
Z_RAM = READ_WRITE 0x0060 TO 0x00FF; |
RAM = READ_WRITE 0x0100 TO 0x025F; |
ROM1 = READ_ONLY 0xFFC0 TO 0xFFCF; |
END |
PLACEMENT /* Here all predefined and user segments are placed into the SEGMENTS defined above. */ |
DEFAULT_RAM INTO RAM; |
_DATA_ZEROPAGE, MY_ZEROPAGE INTO Z_RAM; |
DEFAULT_ROM, ROM_VAR, STRINGS INTO ROM; /*,ROM1*/ /* in case you want to use ROM1 here as well, add option -OnB=b to the compiler. */ |
END |
STACKSIZE 0x50 |
VECTOR 0 _Startup /* Reset vector: this is the default entry point for a C/C++ application. */ |
//VECTOR 0 Entry /* Reset vector: this is the default entry point for an Assembly application. */ |
//INIT Entry /* For assembly applications: that this is as well the initialization entry point */ |
/programy/C/HC08/test/Demo_S08QG8_Test/prm/SofTec_linker.prm |
---|
0,0 → 1,22 |
/* This is a linker parameter file for the QG8 */ |
NAMES END /* CodeWarrior will pass all the needed files to the linker by command line. But here you may add your own files too. */ |
SEGMENTS /* Here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */ |
ROM = READ_ONLY 0xE000 TO 0xFFAF; |
Z_RAM = READ_WRITE 0x0060 TO 0x00FF; |
RAM = READ_WRITE 0x0100 TO 0x025F; |
ROM1 = READ_ONLY 0xFFC0 TO 0xFFCF; |
END |
PLACEMENT /* Here all predefined and user segments are placed into the SEGMENTS defined above. */ |
DEFAULT_RAM INTO RAM; |
_DATA_ZEROPAGE, MY_ZEROPAGE INTO Z_RAM; |
DEFAULT_ROM, ROM_VAR, STRINGS INTO ROM; /*,ROM1*/ /* in case you want to use ROM1 here as well, add option -OnB=b to the compiler. */ |
END |
STACKSIZE 0x50 |
VECTOR 0 _Startup /* Reset vector: this is the default entry point for a C/C++ application. */ |
//VECTOR 0 Entry /* Reset vector: this is the default entry point for an Assembly application. */ |
//INIT Entry /* For assembly applications: that this is as well the initialization entry point */ |
/programy/C/HC08/test/Demo_S08QG8_Test/prm/burner.bbl |
---|
0,0 → 1,9 |
OPENFILE "%ABS_FILE%.s19" |
format=motorola |
busWidth=1 |
origin=0 |
len=0x10000 |
destination=0 |
SRECORD=Sx |
SENDBYTE 1 "%ABS_FILE%" |
CLOSE |
/programy/C/HC08/test/Demo_S08QG8_Test/readme.txt |
---|
0,0 → 1,105 |
//------------------------------------------------------------------------ |
// Readme.txt |
//------------------------------------------------------------------------ |
This project stationery is designed to get you up and running |
quickly with CodeWarrior for MC9S08QG8. |
It is set up for the selected CPU and target connection, |
but can be easily modified. |
Sample code for the following language(s) is at your disposal: |
- C |
The wizard has prepared CodeWarrior target(s) with the connection methods of |
your choice: |
- P&E FCS: |
This interface/target is prepared to use the FCS (Full Chip Simulation) |
from P&E. Note that you can switch to hardware debugging in a seamless way, |
using the menu PEDebug > Mode in the debugger. |
- P&E ICD: |
This interface/target is prepared to use the ICD (In-Circuit |
Debugging/Programming) from P&E. Note that you can switch to simulation in |
a seamless way, using the menu PEDebug > Mode in the debugger. Depending on |
your hardware type, you will need to configure the communication settings |
(class of device, baud rate, etc). |
Please consult your hardware documentation for additional details. |
- Freescale Serial Monitor: |
This interface/target connects to the on-chip Freescale serial monitor. |
This monitor uses on-chip resources and the SCI. See Freescale application |
note AN2140 for details. |
The debugger is using GDI (Generic Debugging Interface) to connect to the |
serial monitor. Using the on-chip DBG module of HCS08 devices, |
trace is supported as well. You can load the trace component |
using the menu Component > Open in the debugger. |
- SofTec: |
This target interface connects to any of the USB-based SofTec Microsystems tools for HC(S)08. |
For the HC08 derivatives, when using inDART-HC08 (MON08 protocol based connection): |
----------------------------------------------------------------------------------- |
If your hardware supports stopping the application while running, |
an additional interrupt service routine is required for the IRQ vector. |
Please see "Stop Command Handling" section in inDART-HC08 In-Circuit Debugger/Programmer |
for Freescale HC08 Family FLASH Devices User Manual from SofTec for further details. |
Additional connections can be chosen in the simulator/debugger, |
use the menu Component > Set Target. |
//------------------------------------------------------------------------ |
// Getting Started |
//------------------------------------------------------------------------ |
To build/debug your project, use the menu Project > Debug or press F5. |
This will open the simulator/debugger. |
Press again F5 in the debugger (or menu Run > Start/Continue) to start |
the application. The menu Run > Halt or F6 stops the application. |
In the debugger menu Component > Open you can load additional components. |
//------------------------------------------------------------------------ |
// Project structure |
//------------------------------------------------------------------------ |
The project generated contains various files/folders: |
- readme.txt: this file |
- Sources: folder with the application source code |
- Startup Code: C/C++ startup code (initializing stack pointer and doing |
global variable initialization). If you want to only do stack pointer |
initialization, add -D__ONLY_INIT_SP to the compiler command line.- Prm: |
- burner.bbl file to generate S-Records |
- the linker .prm file |
- the .map file generated by the linker |
- Libs: needed library files (ANSI, derivative header/implementation files) |
- Debugger Project File: contains a .ini file for the debugger for each |
connection |
- Debugger Cmd Files: contains sub-folders for each connection with command |
files |
//------------------------------------------------------------------------ |
// Adding your own code |
//------------------------------------------------------------------------ |
Once everything is working as expected, you can begin adding your own code |
to the project. Keep in mind that we provide this as an example of how to |
get up and running quickly with CodeWarrior. There are certainly other |
ways to handle interrupts and set up your linker command file. Feel free |
to modify any of the source provided. |
//------------------------------------------------------------------------ |
// Simulator/Debugger: Additional components |
//------------------------------------------------------------------------ |
In the simulator/debugger, you can load additional components. Try the menu |
Component > Open. |
//------------------------------------------------------------------------ |
// Additional documentation |
//------------------------------------------------------------------------ |
Check out the online documentation provided. Use in CodeWarrior IDE the |
menu Help > CodeWarrior Help. |
//------------------------------------------------------------------------ |
// Contacting Metrowerks |
//------------------------------------------------------------------------ |
For bug reports, technical questions, and suggestions, please use the |
forms in the Release Notes folder installed, and send them to: |
USA: support@metrowerks.com |
EUROPE: support_europe@metrowerks.com |
ASIA/PACIFIC: j-emb-sup@metrowerks.com |
/programy/C/PIC_C/mereni/gmetr/gmetr.BAK |
---|
0,0 → 1,65 |
#include ".\gmetr.h" |
#define LCD_RS PIN_B1 // rizeni registru LCD displeje |
#define LCD_E PIN_B0 // enable LCD displeje |
#define LCD_DATA_LSB PIN_C4 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou) |
#include "C:\library\CCS\lcd.c" |
void main() |
{ |
signed int16 stred; |
signed int8 hodnota; |
unsigned int8 i, offset; |
setup_adc_ports(ALL_ANALOG); |
setup_adc(ADC_CLOCK_DIV_2); |
setup_spi(FALSE); |
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
setup_timer_1(T1_DISABLED); |
setup_timer_2(T2_DISABLED,0,1); |
lcd_init(); |
Delay_ms(100); |
set_adc_channel(1); |
LCD_gotoxy(1,1); |
printf(lcd_putc,"Gmetr 0.1.2 Beta"); |
LCD_gotoxy(1,2); |
printf(lcd_putc,"Kaklik@mlab.cz"); |
Delay_ms(500); |
LCD_clr(); |
LCD_gotoxy(1,1); |
printf(lcd_putc,"Clibration..."); |
stred = 0; |
for(i=0;i<=127;i++) |
{ |
Delay_ms(10); |
stred = stred + read_adc(); |
} |
stred = stred >> 7; |
while(true) |
{ |
hodnota = read_adc(); |
Delay_ms(50); |
LCD_clr(); |
LCD_gotoxy(6,1); |
printf(lcd_putc," %03ld ",(stred - hodnota)); |
if (hodnota > stred) |
{ |
offset = hodnota - stred; |
offset = (offset >> 5) + 8; |
} |
else |
{ |
offset = stred - hodnota; |
offset = offset >> 5; |
} |
LCD_gotoxy(offset,2); |
printf(lcd_putc,"*"); |
} |
} |
/programy/C/PIC_C/mereni/gmetr/gmetr.HEX |
---|
0,0 → 1,87 |
:1000000000308A00842900000A108A100A11820731 |
:1000100028340C34013406340A108A100A1182077D |
:1000200047346D34653474347234203430342E34B3 |
:1000300031342E34323420344234653474346134F3 |
:1000400000340A108A100A1182074B3461346B3471 |
:100050006C3469346B3440346D346C3461346234E4 |
:100060002E3463347A3400340A108A100A1182075D |
:1000700043346C34693462347234613474346934B6 |
:100080006F346E342E342E342E3400340A108A101D |
:100090000A1182072A34003436308400000803191C |
:1000A00060280130A100A001A00B5428A10B532807 |
:1000B0004A30A000A00B5A2800000000800B5128F5 |
:1000C000003407080F39BD003C0EA000F030A00539 |
:1000D0002008F0393D04870006148316061000003E |
:1000E000831206108316061083120034BA08031D0B |
:1000F0007B2886107C288614831686108312BB0EFC |
:100100003B08BC006120BB0E3B08BC0061200D30E9 |
:10011000A000A00B892800341430B6004C200F300A |
:1001200083168705831286108316861083120610A5 |
:10013000831606108312AB012B08023C031CA8286F |
:100140000230B6004C200330BC006120AB0A9C2872 |
:100150000D30A000A00BAA280230BC0061200D3099 |
:10016000A000A00BB128AB012B08023C031CC42843 |
:100170002B080420AC00BA012C08BB00762002300A |
:10018000B6004C20AB0AB4288A11BD2901303602D2 |
:10019000B8003708023C031DCF284030B8073808A4 |
:1001A0008038B900BA013908BB0076200034350820 |
:1001B0000C3A0319E528063A0319ED28073A031902 |
:1001C000F328053A0319F828FD28BA010130BB00CD |
:1001D00076200230B6004C2009290130B6000230EA |
:1001E000B700C62009290130B600B700C62009298A |
:1001F000BA011030BB007620092935081F3C031CCA |
:1002000003290730B5050130BA003508BB00762058 |
:10021000092900340C30B500D72000340408B4009C |
:10022000AE1F1A29B417341EB40AAD09AE09AD0ABF |
:100230000319AE0A2E0EF038B000B007E23EB1004E |
:10024000323EB3002E080F39B107B107B307E93EBC |
:10025000B200B207B2072D0E0F39B207B307B20DC5 |
:10026000B30DB309B30D2D080F39B307B00D073027 |
:10027000AF000A30B307B203031C3A29B207B10337 |
:10028000031C3E29B107B003031C4229B007AF038A |
:10029000031C46292F3084000730340534138403AF |
:1002A0003405031D5A29341A840A341A5A29203075 |
:1002B000A00077298407333004020319341700089B |
:1002C000A000031D6B29341B6B29341A7F29B41934 |
:1002D0006B2920307629B41F73292D30A0008403A8 |
:1002E0003413B4137729B41534123030A007AE019B |
:1002F0000408AD002008B500D7202D088400840A2A |
:10030000341F5B298A11472A84011F308305831615 |
:100310001F149F141F159F11FF308312A500831611 |
:100320001F109F101F119F1183121F139F138316FD |
:100330009F1783121F149412A51225088316870095 |
:10034000831225162508831687008312A511250818 |
:1003500083168700003083129400831694000108EE |
:10036000C73908388100831290010030A100920043 |
:1003700000308316920083128C286430B6004C2023 |
:100380000830A1001F08C73921049F000130B600C2 |
:10039000B700C620AB012B080C2000380319D42964 |
:1003A000AB0AB500D720CB290130B6000230B70028 |
:1003B000C620AB012B08212000380319E329AB0A22 |
:1003C000B500D720DA290230AB00FA30B6004C2055 |
:1003D000AB0BE5290A210130B600B700C620AB01FE |
:1003E0002B08342000380319F929AB0AB500D720AF |
:1003F000F029A701A601A90129087F3C031C102AA6 |
:100400000A30B6004C201F151F19042A83161E0837 |
:100410008312A6070318A70A1E08A707A90AFC2922 |
:10042000A70CA60CA70CA60CA70CA60CA70CA60C38 |
:10043000A70CA60CA70CA60CA70CA60C0130A705B0 |
:100440001F151F19212A83161E088312A800323097 |
:10045000B6004C200A210630B6000130B700C62095 |
:10046000A3012808A000A81BA3032602AB002708AD |
:10047000AC002308031C230FAC022030B500D720AA |
:100480000B3084002C08AE002B08AD000E29203064 |
:10049000B500D720A3012808A000A01BA303A1003A |
:1004A000A71F552AA31F612A572AA31B782A2708AA |
:1004B0002302031C782A031D612A26082102031C3B |
:1004C000782AA3012808A81BA303A100260821025B |
:1004D000A0002708031C270FA3022008AA002A0E49 |
:1004E000A000A00C0730A0052008083EAA008C2A16 |
:1004F000A3012808A81BA3032602A0002308031CAD |
:10050000230F842A2708852A2702A3002008AA008F |
:10051000AA0EAA0C0730AA052A08B6000230B700B6 |
:10052000C620AB012B084620003803199B2AAB0AD2 |
:0A053000B500D720922A202A6300AC |
:02400E00393F38 |
:00000001FF |
;PIC16F873 |
/programy/C/PIC_C/mereni/gmetr/gmetr.LST |
---|
0,0 → 1,885 |
CCS PCM C Compiler, Version 3.245, 27853 27-VI-07 00:22 |
Filename: D:\KAKLIK\projekty\programy\PIC_C\mereni\gmetr\gmetr.lst |
ROM used: 669 words (16%) |
Largest free fragment is 2048 |
RAM used: 13 (7%) at main() level |
31 (16%) worst case |
Stack: 5 locations |
* |
0000: MOVLW 00 |
0001: MOVWF 0A |
0002: GOTO 184 |
0003: NOP |
.................... #include ".\gmetr.h" |
.................... #include <16F873.h> |
.................... //////// Standard Header file for the PIC16F873 device //////////////// |
.................... #device PIC16F873 |
.................... #list |
.................... |
.................... #device adc=10 |
.................... #fuses NOWDT,XT, NOPUT, NOPROTECT, NOBROWNOUT, NOLVP, NOCPD, NOWRT, NODEBUG |
.................... #use delay(clock=4000000) |
* |
004C: MOVLW 36 |
004D: MOVWF 04 |
004E: MOVF 00,W |
004F: BTFSC 03.2 |
0050: GOTO 060 |
0051: MOVLW 01 |
0052: MOVWF 21 |
0053: CLRF 20 |
0054: DECFSZ 20,F |
0055: GOTO 054 |
0056: DECFSZ 21,F |
0057: GOTO 053 |
0058: MOVLW 4A |
0059: MOVWF 20 |
005A: DECFSZ 20,F |
005B: GOTO 05A |
005C: NOP |
005D: NOP |
005E: DECFSZ 00,F |
005F: GOTO 051 |
0060: RETLW 00 |
.................... |
.................... |
.................... |
.................... #define LCD_RS PIN_B1 // rizeni registru LCD displeje |
.................... #define LCD_E PIN_B0 // enable LCD displeje |
.................... #define LCD_DATA_LSB PIN_C4 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou) |
.................... |
.................... #include "C:\library\CCS\lcd.c" |
.................... // LCD modul pro ovladani dvouradkoveho LCD modulu se standardnim Hitachi radicem |
.................... // (c)miho 2002,2005 |
.................... // |
.................... // Historie: |
.................... // |
.................... // 0.00 Uvodni verze se snadnou definici portu LCD displeje |
.................... // 0.01 Oprava portu (zapomenute stare identifikatory) |
.................... // 0.02 Doplnena moznost pripojeni datoveho portu LCD na libovolne porty |
.................... // 0.03 Doplnena procedura lcd_clr pro smazani displeje |
.................... // |
.................... // |
.................... // Funkce: |
.................... // |
.................... // lcd_init() inicializuje LCD displej a porty, nutno volat jako prvni |
.................... // |
.................... // lcd_putc(c) zapis snaku do lcd displeje, zpracovava nasledujici ridici znaky |
.................... // \f = \x0C - nova stranka - smazani displeje |
.................... // \n = \x0A - odradkovani (prechod na druhou radku) |
.................... // \b = \x08 - backspace - posunuti kurzoru o 1 pozici zpet |
.................... // \r = \x0D - goto home to position 1,1 |
.................... // \0 .. \7 - definovatelne znaky v pozicich 0 az 7 v CGRAM |
.................... // \20 .. \27 - alternativne zapsane znaky (oktalove) v pozicich 0 az 7 CGRAM |
.................... // Pozor na to, ze funkce printf konci tisk pokud narazi na \0 (konec retezce) |
.................... // |
.................... // lcd_gotoxy(x,y) presune kurzor na uvedenou adresu |
.................... // nekontroluje parametry |
.................... // |
.................... // lcd_cursor_on zapne kurzor |
.................... // lcd_cursor_off vypne kurzor |
.................... // |
.................... // lcd_clr smaze displej |
.................... // |
.................... // lcd_define_char(Index, Def) Makro, ktere definuje znaky od pozice Index obsahem definicniho |
.................... // retezce Def. Kazdych 8 znaku retezce Def definuje dalsi znak v CGRAM. |
.................... // Kapacita CGRAM je celkem 8 znaku s indexem 0 az 7. |
.................... // Na konci se provede lcd_gotoxy(1,1). |
.................... // Na konci teto knihovny je priklad pouziti definovanych znaku |
.................... // |
.................... // |
.................... // Definice portu: // Datovy port displeje pripojeny na 4 bity za sebou na jeden port |
.................... // |
.................... // #define LCD_RS PIN_B2 // rizeni registru LCD displeje |
.................... // #define LCD_E PIN_B1 // enable LCD displeje |
.................... // #define LCD_DATA_LSB PIN_C2 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou) |
.................... // |
.................... // |
.................... // Alternativni definice: // Datovy port displeje pripojeny na libovolne 4 bitove porty (vede na kod delsi asi o 25 slov) |
.................... // |
.................... // #define LCD_RS PIN_B2 // rizeni registru LCD displeje |
.................... // #define LCD_E PIN_B1 // enable LCD displeje |
.................... // #define LCD_D0 PIN_C2 // D0 - datove bity pripojene na libovolne porty |
.................... // #define LCD_D1 PIN_C3 // D1 |
.................... // #define LCD_D2 PIN_C4 // D2 |
.................... // #define LCD_D3 PIN_C5 // D3 |
.................... |
.................... |
.................... |
.................... |
.................... // Privatni sekce, cist jen v pripade, ze neco nefunguje |
.................... |
.................... |
.................... |
.................... |
.................... #ifdef LCD_DATA_LSB |
.................... // Generovane defince portu pro ucely teto knihovny aby kod generoval spravne IO operace a soucasne |
.................... // bylo mozne jednoduse deklarovat pripojene piny LCD displeje pri pouziti teto knihovny. Problem spociva |
.................... // v tom, ze se musi spravne ridit smery portu a soucasne datovy port zabira jen 4 bity ze zadaneho portu |
.................... // |
.................... #define LCD_SHIFT (LCD_DATA_LSB&7) // pocet bitu posuvu datoveho kanalu v datovem portu |
.................... #define LCD_PORT (LCD_DATA_LSB>>3) // adresa LCD datoveho portu |
.................... #define LCD_TRIS (LCD_PORT+0x80) // adresa prislusneho TRIS registru |
.................... #define LCD_MASK (0xF<<LCD_SHIFT) // maska platnych bitu |
.................... // |
.................... #if LCD_SHIFT>4 // kontrola mezi |
.................... #error LCD data port LSB bit not in range 0..4 |
.................... #endif |
.................... #endif |
.................... |
.................... |
.................... // Definice konstant pro LCD display |
.................... // |
.................... #define LCD_CURSOR_ON_ 0x0E // kurzor jako blikajici radka pod znakem |
.................... #define LCD_CURSOR_OFF_ 0x0C // zadny kurzor |
.................... #define LCD_LINE_2 0x40 // adresa 1. znaku 2. radky |
.................... |
.................... |
.................... // Definice rezimu LCD displeje |
.................... // |
.................... BYTE const LCD_INIT_STRING[4] = |
.................... { |
.................... 0x28, // intrfejs 4 bity, 2 radky, font 5x7 |
.................... LCD_CURSOR_OFF_, // display on, kurzor off, |
.................... 0x01, // clear displeje |
.................... 0x06 // inkrement pozice kurzoru (posun kurzoru doprava) |
.................... }; |
.................... |
.................... |
.................... // Odesle nibble do displeje (posle data a klikne signalem e) |
.................... // |
.................... void lcd_send_nibble( BYTE n ) |
.................... { |
.................... #ifdef LCD_DATA_LSB |
.................... // data jsou za sebou na 4 bitech jednoho portu |
.................... *LCD_PORT = (*LCD_PORT & ~LCD_MASK) | ((n << LCD_SHIFT) & LCD_MASK); // nastav datove bity portu a ostatni zachovej |
0061: MOVF 07,W |
0062: ANDLW 0F |
0063: MOVWF 3D |
0064: SWAPF 3C,W |
0065: MOVWF 20 |
0066: MOVLW F0 |
0067: ANDWF 20,F |
0068: MOVF 20,W |
0069: ANDLW F0 |
006A: IORWF 3D,W |
006B: MOVWF 07 |
.................... #else |
.................... // data jsou na libovolnych 4 bitech libovolnych portu |
.................... output_bit(LCD_D0,bit_test(n,0)); |
.................... output_bit(LCD_D1,bit_test(n,1)); |
.................... output_bit(LCD_D2,bit_test(n,2)); |
.................... output_bit(LCD_D3,bit_test(n,3)); |
.................... #endif |
.................... output_bit(LCD_E,1); // vzestupna hrana |
006C: BSF 06.0 |
006D: BSF 03.5 |
006E: BCF 06.0 |
.................... delay_us(1); // pockej alespon 450ns od e nebo alespon 195ns od dat |
006F: NOP |
.................... output_bit(LCD_E,0); // sestupna hrana (minimalni perioda e je 1us) |
0070: BCF 03.5 |
0071: BCF 06.0 |
0072: BSF 03.5 |
0073: BCF 06.0 |
.................... } |
0074: BCF 03.5 |
0075: RETLW 00 |
.................... |
.................... |
.................... // Odesle bajt do registru LCD |
.................... // |
.................... // Pokud je Adr=0 .. instrukcni registr |
.................... // Pokud je Adr=1 .. datovy registr |
.................... // |
.................... void lcd_send_byte( BOOLEAN Adr, BYTE n ) |
.................... { |
.................... output_bit(LCD_RS,Adr); // vyber registr |
0076: MOVF 3A,F |
0077: BTFSS 03.2 |
0078: GOTO 07B |
0079: BCF 06.1 |
007A: GOTO 07C |
007B: BSF 06.1 |
007C: BSF 03.5 |
007D: BCF 06.1 |
.................... swap(n); |
007E: BCF 03.5 |
007F: SWAPF 3B,F |
.................... lcd_send_nibble(n); // posli horni pulku bajtu |
0080: MOVF 3B,W |
0081: MOVWF 3C |
0082: CALL 061 |
.................... swap(n); |
0083: SWAPF 3B,F |
.................... lcd_send_nibble(n); // posli spodni pulku bajtu |
0084: MOVF 3B,W |
0085: MOVWF 3C |
0086: CALL 061 |
.................... delay_us(40); // minimalni doba na provedeni prikazu |
0087: MOVLW 0D |
0088: MOVWF 20 |
0089: DECFSZ 20,F |
008A: GOTO 089 |
.................... } |
008B: RETLW 00 |
.................... |
.................... |
.................... // Provede inicializaci LCD displeje, smaze obsah a nastavi mod displeje |
.................... // |
.................... // Tato procedura se musi volat pred pouzitim ostatnich lcd_ procedur |
.................... // |
.................... void lcd_init() |
.................... { |
.................... |
.................... int i; // pocitadlo cyklu |
.................... |
.................... delay_ms(20); // spozdeni pro provedeni startu displeje po zapnuti napajeni |
008C: MOVLW 14 |
008D: MOVWF 36 |
008E: CALL 04C |
.................... |
.................... #ifdef LCD_DATA_LSB |
.................... // data jsou na 4 bitech za sebou, nastav smer pro vsechny dalsi prenosy |
.................... *LCD_TRIS = *LCD_TRIS & ~LCD_MASK; // nuluj odpovidajici bity tris registru datoveho portu LCD |
008F: MOVLW 0F |
0090: BSF 03.5 |
0091: ANDWF 07,F |
.................... #endif |
.................... |
.................... output_bit(LCD_RS,0); // nastav jako vystup a nastav klidovy stav |
0092: BCF 03.5 |
0093: BCF 06.1 |
0094: BSF 03.5 |
0095: BCF 06.1 |
.................... output_bit(LCD_E, 0); // nastav jako vystup a nastav klidovy stav |
0096: BCF 03.5 |
0097: BCF 06.0 |
0098: BSF 03.5 |
0099: BCF 06.0 |
.................... |
.................... for (i=0; i<3; i++) // nastav lcd do rezimu 8 bitu sbernice |
009A: BCF 03.5 |
009B: CLRF 2B |
009C: MOVF 2B,W |
009D: SUBLW 02 |
009E: BTFSS 03.0 |
009F: GOTO 0A8 |
.................... { |
.................... delay_ms(2); // muze byt rozdelany prenos dat (2x 4 bity) nebo pomaly povel |
00A0: MOVLW 02 |
00A1: MOVWF 36 |
00A2: CALL 04C |
.................... lcd_send_nibble(3); // rezim 8 bitu |
00A3: MOVLW 03 |
00A4: MOVWF 3C |
00A5: CALL 061 |
.................... } |
00A6: INCF 2B,F |
00A7: GOTO 09C |
.................... |
.................... delay_us(40); // cas na zpracovani |
00A8: MOVLW 0D |
00A9: MOVWF 20 |
00AA: DECFSZ 20,F |
00AB: GOTO 0AA |
.................... lcd_send_nibble(2); // nastav rezim 4 bitu (plati od nasledujiciho prenosu) |
00AC: MOVLW 02 |
00AD: MOVWF 3C |
00AE: CALL 061 |
.................... delay_us(40); // cas na zpracovani |
00AF: MOVLW 0D |
00B0: MOVWF 20 |
00B1: DECFSZ 20,F |
00B2: GOTO 0B1 |
.................... |
.................... for (i=0;i<3;i++) // proved inicializaci (nastaveni modu, smazani apod) |
00B3: CLRF 2B |
00B4: MOVF 2B,W |
00B5: SUBLW 02 |
00B6: BTFSS 03.0 |
00B7: GOTO 0C4 |
.................... { |
.................... lcd_send_byte(0,LCD_INIT_STRING[i]); |
00B8: MOVF 2B,W |
00B9: CALL 004 |
00BA: MOVWF 2C |
00BB: CLRF 3A |
00BC: MOVF 2C,W |
00BD: MOVWF 3B |
00BE: CALL 076 |
.................... delay_ms(2); |
00BF: MOVLW 02 |
00C0: MOVWF 36 |
00C1: CALL 04C |
.................... } |
00C2: INCF 2B,F |
00C3: GOTO 0B4 |
.................... } |
00C4: BCF 0A.3 |
00C5: GOTO 1BD (RETURN) |
.................... |
.................... |
.................... // Proved presun kurzoru |
.................... // |
.................... // Pozice 1.1 je domu |
.................... // |
.................... void lcd_gotoxy( BYTE x, BYTE y) |
.................... { |
.................... |
.................... BYTE Adr; |
.................... |
.................... Adr=x-1; |
00C6: MOVLW 01 |
00C7: SUBWF 36,W |
00C8: MOVWF 38 |
.................... if(y==2) |
00C9: MOVF 37,W |
00CA: SUBLW 02 |
00CB: BTFSS 03.2 |
00CC: GOTO 0CF |
.................... Adr+=LCD_LINE_2; |
00CD: MOVLW 40 |
00CE: ADDWF 38,F |
.................... |
.................... lcd_send_byte(0,0x80|Adr); |
00CF: MOVF 38,W |
00D0: IORLW 80 |
00D1: MOVWF 39 |
00D2: CLRF 3A |
00D3: MOVF 39,W |
00D4: MOVWF 3B |
00D5: CALL 076 |
.................... } |
00D6: RETLW 00 |
.................... |
.................... |
.................... // Zapis znaku na displej, zpracovani ridicich znaku |
.................... // |
.................... void lcd_putc( char c) |
.................... { |
.................... |
.................... switch (c) |
.................... { |
00D7: MOVF 35,W |
00D8: XORLW 0C |
00D9: BTFSC 03.2 |
00DA: GOTO 0E5 |
00DB: XORLW 06 |
00DC: BTFSC 03.2 |
00DD: GOTO 0ED |
00DE: XORLW 07 |
00DF: BTFSC 03.2 |
00E0: GOTO 0F3 |
00E1: XORLW 05 |
00E2: BTFSC 03.2 |
00E3: GOTO 0F8 |
00E4: GOTO 0FD |
.................... case '\f' : lcd_send_byte(0,1); // smaz displej |
00E5: CLRF 3A |
00E6: MOVLW 01 |
00E7: MOVWF 3B |
00E8: CALL 076 |
.................... delay_ms(2); |
00E9: MOVLW 02 |
00EA: MOVWF 36 |
00EB: CALL 04C |
.................... break; |
00EC: GOTO 109 |
.................... case '\n' : lcd_gotoxy(1,2); break; // presun se na 1. znak 2. radky |
00ED: MOVLW 01 |
00EE: MOVWF 36 |
00EF: MOVLW 02 |
00F0: MOVWF 37 |
00F1: CALL 0C6 |
00F2: GOTO 109 |
.................... case '\r' : lcd_gotoxy(1,1); break; // presun home |
00F3: MOVLW 01 |
00F4: MOVWF 36 |
00F5: MOVWF 37 |
00F6: CALL 0C6 |
00F7: GOTO 109 |
.................... case '\b' : lcd_send_byte(0,0x10); break; // posun kurzor o 1 zpet |
00F8: CLRF 3A |
00F9: MOVLW 10 |
00FA: MOVWF 3B |
00FB: CALL 076 |
00FC: GOTO 109 |
.................... default : if (c<0x20) c&=0x7; // preklopeni definovatelnych znaku na rozsah 0 az 0x1F |
00FD: MOVF 35,W |
00FE: SUBLW 1F |
00FF: BTFSS 03.0 |
0100: GOTO 103 |
0101: MOVLW 07 |
0102: ANDWF 35,F |
.................... lcd_send_byte(1,c); break; // zapis znak |
0103: MOVLW 01 |
0104: MOVWF 3A |
0105: MOVF 35,W |
0106: MOVWF 3B |
0107: CALL 076 |
0108: GOTO 109 |
.................... } |
.................... } |
0109: RETLW 00 |
.................... |
.................... |
.................... // Zapni kurzor |
.................... // |
.................... void lcd_cursor_on() |
.................... { |
.................... lcd_send_byte(0,LCD_CURSOR_ON_); |
.................... } |
.................... |
.................... |
.................... // Vypni kurzor |
.................... // |
.................... void lcd_cursor_off() |
.................... { |
.................... lcd_send_byte(0,LCD_CURSOR_OFF_); |
.................... } |
.................... |
.................... |
.................... // Smaz displej |
.................... // |
.................... void lcd_clr() |
.................... { |
.................... lcd_putc('\f'); |
010A: MOVLW 0C |
010B: MOVWF 35 |
010C: CALL 0D7 |
.................... } |
010D: RETLW 00 |
.................... |
.................... |
.................... // Definice vlastnich fontu |
.................... // |
.................... // Vlastnich definic muze byt jen 8 do pozic 0 az 7 pameti CGRAM radice lcd displeje |
.................... // Pro snadne definovani jsou pripraveny nasledujici definice a na konci souboru je uveden |
.................... // priklad pouziti definovanych znaku. |
.................... |
.................... |
.................... // Pomocna procedura pro posilani ridicich dat do radice displeje |
.................... // |
.................... void lcd_putc2(int Data) |
.................... { |
.................... lcd_send_byte(1,Data); |
.................... } |
.................... |
.................... |
.................... // Pomocne definice pro programovani obsahu CGRAM |
.................... // |
.................... #define lcd_define_start(Code) lcd_send_byte(0,0x40+(Code<<3)); delay_ms(2) |
.................... #define lcd_define_def(String) printf(lcd_putc2,String); |
.................... #define lcd_define_end() lcd_send_byte(0,3); delay_ms(2) |
.................... |
.................... |
.................... // Vlastni vykonne makro pro definovani fontu do pozice Index CGRAM s definicnim retezcem Def |
.................... // |
.................... #define lcd_define_char(Index, Def) lcd_define_start(Index); lcd_define_def(Def); lcd_define_end(); |
.................... |
.................... |
.................... // Pripravene definice fontu vybranych znaku |
.................... // V tabulce nesmi byt 00 (konec retezce v printf()), misto toho davame 80 |
.................... // |
.................... #define LCD_CHAR_BAT100 "\x0E\x1F\x1F\x1F\x1F\x1F\x1F\x1F" /* symbol plne baterie */ |
.................... #define LCD_CHAR_BAT50 "\x0E\x1F\x11\x11\x13\x17\x1F\x1F" /* symbol polovicni baterie */ |
.................... #define LCD_CHAR_BAT0 "\x0E\x1F\x11\x11\x11\x11\x11\x1F" /* symbol vybite baterie */ |
.................... #define LCD_CHAR_UP "\x80\x04\x0E\x15\x04\x04\x04\x80" /* symbol sipka nahoru */ |
.................... #define LCD_CHAR_DOWN "\x80\x04\x04\x04\x15\x0E\x04\x80" /* symbol Sipka dolu */ |
.................... #define LCD_CHAR_LUA "\x04\x0E\x11\x11\x1F\x11\x11\x80" /* A s carkou */ |
.................... #define LCD_CHAR_LLA "\x01\x02\x0E\x01\x1F\x11\x0F\x80" /* a s carkou */ |
.................... #define LCD_CHAR_HUC "\x0A\x0E\x11\x10\x10\x11\x0E\x80" /* C s hackem */ |
.................... #define LCD_CHAR_HLC "\x0A\x04\x0E\x10\x10\x11\x0E\x80" /* c s hackem */ |
.................... #define LCD_CHAR_HUD "\x0A\x1C\x12\x11\x11\x12\x1C\x80" /* D s hackem */ |
.................... #define LCD_CHAR_HLD "\x05\x03\x0D\x13\x11\x11\x0F\x80" /* d s hackem */ |
.................... #define LCD_CHAR_LUE "\x04\x1F\x10\x10\x1E\x10\x1F\x80" /* E s carkou */ |
.................... #define LCD_CHAR_LLE "\x01\x02\x0E\x11\x1F\x10\x0E\x80" /* e s carkou */ |
.................... #define LCD_CHAR_HUE "\x0A\x1F\x10\x1E\x10\x10\x1F\x80" /* E s hackem */ |
.................... #define LCD_CHAR_HLE "\x0A\x04\x0E\x11\x1F\x10\x0E\x80" /* e s hackem */ |
.................... #define LCD_CHAR_LUI "\x04\x0E\x04\x04\x04\x04\x0E\x80" /* I s carkou */ |
.................... #define LCD_CHAR_LLI "\x02\x04\x80\x0C\x04\x04\x0E\x80" /* i s carkou */ |
.................... #define LCD_CHAR_HUN "\x0A\x15\x11\x19\x15\x13\x11\x80" /* N s hackem */ |
.................... #define LCD_CHAR_HLN "\x0A\x04\x16\x19\x11\x11\x11\x80" /* n s hackem */ |
.................... #define LCD_CHAR_LUO "\x04\x0E\x11\x11\x11\x11\x0E\x80" /* O s carkou */ |
.................... #define LCD_CHAR_LLO "\x02\x04\x0E\x11\x11\x11\x0E\x80" /* o s carkou */ |
.................... #define LCD_CHAR_HUR "\x0A\x1E\x11\x1E\x14\x12\x11\x80" /* R s hackem */ |
.................... #define LCD_CHAR_HLR "\x0A\x04\x16\x19\x10\x10\x10\x80" /* r s hackem */ |
.................... #define LCD_CHAR_HUS "\x0A\x0F\x10\x0E\x01\x01\x1E\x80" /* S s hackem */ |
.................... #define LCD_CHAR_HLS "\x0A\x04\x0E\x10\x0E\x01\x1E\x80" /* s s hackem */ |
.................... #define LCD_CHAR_HUT "\x0A\x1F\x04\x04\x04\x04\x04\x80" /* T s hackem */ |
.................... #define LCD_CHAR_HLT "\x0A\x0C\x1C\x08\x08\x09\x06\x80" /* t s hackem */ |
.................... #define LCD_CHAR_LUU "\x02\x15\x11\x11\x11\x11\x0E\x80" /* U s carkou */ |
.................... #define LCD_CHAR_LLU "\x02\x04\x11\x11\x11\x13\x0D\x80" /* u s carkou */ |
.................... #define LCD_CHAR_CUU "\x06\x17\x11\x11\x11\x11\x0E\x80" /* U s krouzkem */ |
.................... #define LCD_CHAR_CLU "\x06\x06\x11\x11\x11\x11\x0E\x80" /* u s krouzkem */ |
.................... #define LCD_CHAR_LUY "\x02\x15\x11\x0A\x04\x04\x04\x80" /* Y s carkou */ |
.................... #define LCD_CHAR_LLY "\x02\x04\x11\x11\x0F\x01\x0E\x80" /* y s carkou */ |
.................... #define LCD_CHAR_HUZ "\x0A\x1F\x01\x02\x04\x08\x1F\x80" /* Z s hackem */ |
.................... #define LCD_CHAR_HLZ "\x0A\x04\x1F\x02\x04\x08\x1F\x80" /* z s hackem */ |
.................... |
.................... |
.................... // Priklad pouziti definovanych znaku |
.................... // |
.................... // |
.................... //void lcd_sample() |
.................... //{ |
.................... // lcd_define_char(0,LCD_CHAR_BAT50); // Priklad definice znaku baterie do pozice 0 |
.................... // lcd_define_char(2,LCD_CHAR_HLE LCD_CHAR_LUI); // Priklad definice znaku e s hackem a I s carkou od pozice 2 |
.................... // // vsimnete si, ze neni carka mezi retezci s definici (oba retezce definuji |
.................... // // jediny definicni retezec) |
.................... // printf(lcd_putc,"\fZnaky:\20\22\23"); // priklad vypisu znaku z pozice 0, 2 a 3 |
.................... // delay_ms(1000); |
.................... // lcd_define_char(0,LCD_CHAR_BAT0); // Predefinovani tvaru znaku v pozici 0 |
.................... // delay_ms(1000); |
.................... //} |
.................... |
.................... |
.................... |
.................... void main() |
.................... { |
* |
0184: CLRF 04 |
0185: MOVLW 1F |
0186: ANDWF 03,F |
0187: BSF 03.5 |
0188: BSF 1F.0 |
0189: BSF 1F.1 |
018A: BSF 1F.2 |
018B: BCF 1F.3 |
.................... signed int16 stred; |
.................... signed int8 hodnota; |
.................... unsigned int8 i, offset; |
.................... |
.................... setup_adc_ports(ALL_ANALOG); |
* |
018F: BSF 03.5 |
0190: BCF 1F.0 |
0191: BCF 1F.1 |
0192: BCF 1F.2 |
0193: BCF 1F.3 |
.................... setup_adc(ADC_CLOCK_DIV_2); |
0194: BCF 03.5 |
0195: BCF 1F.6 |
0196: BCF 1F.7 |
0197: BSF 03.5 |
0198: BSF 1F.7 |
0199: BCF 03.5 |
019A: BSF 1F.0 |
.................... setup_spi(FALSE); |
* |
018C: MOVLW FF |
018D: BCF 03.5 |
018E: MOVWF 25 |
* |
019B: BCF 14.5 |
019C: BCF 25.5 |
019D: MOVF 25,W |
019E: BSF 03.5 |
019F: MOVWF 07 |
01A0: BCF 03.5 |
01A1: BSF 25.4 |
01A2: MOVF 25,W |
01A3: BSF 03.5 |
01A4: MOVWF 07 |
01A5: BCF 03.5 |
01A6: BCF 25.3 |
01A7: MOVF 25,W |
01A8: BSF 03.5 |
01A9: MOVWF 07 |
01AA: MOVLW 00 |
01AB: BCF 03.5 |
01AC: MOVWF 14 |
01AD: BSF 03.5 |
01AE: MOVWF 14 |
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
01AF: MOVF 01,W |
01B0: ANDLW C7 |
01B1: IORLW 08 |
01B2: MOVWF 01 |
.................... setup_timer_1(T1_DISABLED); |
01B3: BCF 03.5 |
01B4: CLRF 10 |
.................... setup_timer_2(T2_DISABLED,0,1); |
01B5: MOVLW 00 |
01B6: MOVWF 21 |
01B7: MOVWF 12 |
01B8: MOVLW 00 |
01B9: BSF 03.5 |
01BA: MOVWF 12 |
.................... |
.................... lcd_init(); |
01BB: BCF 03.5 |
01BC: GOTO 08C |
.................... Delay_ms(100); |
01BD: MOVLW 64 |
01BE: MOVWF 36 |
01BF: CALL 04C |
.................... set_adc_channel(1); |
01C0: MOVLW 08 |
01C1: MOVWF 21 |
01C2: MOVF 1F,W |
01C3: ANDLW C7 |
01C4: IORWF 21,W |
01C5: MOVWF 1F |
.................... |
.................... LCD_gotoxy(1,1); |
01C6: MOVLW 01 |
01C7: MOVWF 36 |
01C8: MOVWF 37 |
01C9: CALL 0C6 |
.................... printf(lcd_putc,"Gmetr 0.1.2 Beta"); |
01CA: CLRF 2B |
01CB: MOVF 2B,W |
01CC: CALL 00C |
01CD: IORLW 00 |
01CE: BTFSC 03.2 |
01CF: GOTO 1D4 |
01D0: INCF 2B,F |
01D1: MOVWF 35 |
01D2: CALL 0D7 |
01D3: GOTO 1CB |
.................... LCD_gotoxy(1,2); |
01D4: MOVLW 01 |
01D5: MOVWF 36 |
01D6: MOVLW 02 |
01D7: MOVWF 37 |
01D8: CALL 0C6 |
.................... printf(lcd_putc,"Kaklik@mlab.cz"); |
01D9: CLRF 2B |
01DA: MOVF 2B,W |
01DB: CALL 021 |
01DC: IORLW 00 |
01DD: BTFSC 03.2 |
01DE: GOTO 1E3 |
01DF: INCF 2B,F |
01E0: MOVWF 35 |
01E1: CALL 0D7 |
01E2: GOTO 1DA |
.................... Delay_ms(500); |
01E3: MOVLW 02 |
01E4: MOVWF 2B |
01E5: MOVLW FA |
01E6: MOVWF 36 |
01E7: CALL 04C |
01E8: DECFSZ 2B,F |
01E9: GOTO 1E5 |
.................... |
.................... LCD_clr(); |
01EA: CALL 10A |
.................... LCD_gotoxy(1,1); |
01EB: MOVLW 01 |
01EC: MOVWF 36 |
01ED: MOVWF 37 |
01EE: CALL 0C6 |
.................... printf(lcd_putc,"Clibration..."); |
01EF: CLRF 2B |
01F0: MOVF 2B,W |
01F1: CALL 034 |
01F2: IORLW 00 |
01F3: BTFSC 03.2 |
01F4: GOTO 1F9 |
01F5: INCF 2B,F |
01F6: MOVWF 35 |
01F7: CALL 0D7 |
01F8: GOTO 1F0 |
.................... |
.................... stred = 0; |
01F9: CLRF 27 |
01FA: CLRF 26 |
.................... for(i=0;i<=127;i++) |
01FB: CLRF 29 |
01FC: MOVF 29,W |
01FD: SUBLW 7F |
01FE: BTFSS 03.0 |
01FF: GOTO 210 |
.................... { |
.................... Delay_ms(10); |
0200: MOVLW 0A |
0201: MOVWF 36 |
0202: CALL 04C |
.................... stred = stred + read_adc(); |
0203: BSF 1F.2 |
0204: BTFSC 1F.2 |
0205: GOTO 204 |
0206: BSF 03.5 |
0207: MOVF 1E,W |
0208: BCF 03.5 |
0209: ADDWF 26,F |
020A: BTFSC 03.0 |
020B: INCF 27,F |
020C: MOVF 1E,W |
020D: ADDWF 27,F |
.................... } |
020E: INCF 29,F |
020F: GOTO 1FC |
.................... stred = stred >> 7; |
0210: RRF 27,F |
0211: RRF 26,F |
0212: RRF 27,F |
0213: RRF 26,F |
0214: RRF 27,F |
0215: RRF 26,F |
0216: RRF 27,F |
0217: RRF 26,F |
0218: RRF 27,F |
0219: RRF 26,F |
021A: RRF 27,F |
021B: RRF 26,F |
021C: RRF 27,F |
021D: RRF 26,F |
021E: MOVLW 01 |
021F: ANDWF 27,F |
.................... |
.................... while(true) |
.................... { |
.................... hodnota = read_adc(); |
0220: BSF 1F.2 |
0221: BTFSC 1F.2 |
0222: GOTO 221 |
0223: BSF 03.5 |
0224: MOVF 1E,W |
0225: BCF 03.5 |
0226: MOVWF 28 |
.................... Delay_ms(50); |
0227: MOVLW 32 |
0228: MOVWF 36 |
0229: CALL 04C |
.................... LCD_clr(); |
022A: CALL 10A |
.................... LCD_gotoxy(6,1); |
022B: MOVLW 06 |
022C: MOVWF 36 |
022D: MOVLW 01 |
022E: MOVWF 37 |
022F: CALL 0C6 |
.................... printf(lcd_putc," %03ld ",(stred - hodnota)); |
0230: CLRF 23 |
0231: MOVF 28,W |
0232: MOVWF 20 |
0233: BTFSC 28.7 |
0234: DECF 23,F |
0235: SUBWF 26,W |
0236: MOVWF 2B |
0237: MOVF 27,W |
0238: MOVWF 2C |
0239: MOVF 23,W |
023A: BTFSS 03.0 |
023B: INCFSZ 23,W |
023C: SUBWF 2C,F |
023D: MOVLW 20 |
023E: MOVWF 35 |
023F: CALL 0D7 |
0240: MOVLW 0B |
0241: MOVWF 04 |
0242: MOVF 2C,W |
0243: MOVWF 2E |
0244: MOVF 2B,W |
0245: MOVWF 2D |
0246: GOTO 10E |
0247: MOVLW 20 |
0248: MOVWF 35 |
0249: CALL 0D7 |
.................... if (hodnota >= stred) |
024A: CLRF 23 |
024B: MOVF 28,W |
024C: MOVWF 20 |
024D: BTFSC 20.7 |
024E: DECF 23,F |
024F: MOVWF 21 |
0250: BTFSS 27.7 |
0251: GOTO 255 |
0252: BTFSS 23.7 |
0253: GOTO 261 |
0254: GOTO 257 |
0255: BTFSC 23.7 |
0256: GOTO 278 |
0257: MOVF 27,W |
0258: SUBWF 23,W |
0259: BTFSS 03.0 |
025A: GOTO 278 |
025B: BTFSS 03.2 |
025C: GOTO 261 |
025D: MOVF 26,W |
025E: SUBWF 21,W |
025F: BTFSS 03.0 |
0260: GOTO 278 |
.................... { |
.................... offset = hodnota - stred; |
0261: CLRF 23 |
0262: MOVF 28,W |
0263: BTFSC 28.7 |
0264: DECF 23,F |
0265: MOVWF 21 |
0266: MOVF 26,W |
0267: SUBWF 21,W |
0268: MOVWF 20 |
0269: MOVF 27,W |
026A: BTFSS 03.0 |
026B: INCFSZ 27,W |
026C: SUBWF 23,F |
026D: MOVF 20,W |
026E: MOVWF 2A |
.................... offset = (offset >> 5) + 8; |
026F: SWAPF 2A,W |
0270: MOVWF 20 |
0271: RRF 20,F |
0272: MOVLW 07 |
0273: ANDWF 20,F |
0274: MOVF 20,W |
0275: ADDLW 08 |
0276: MOVWF 2A |
.................... } |
.................... else |
0277: GOTO 28C |
.................... { |
.................... offset = stred - hodnota; |
0278: CLRF 23 |
0279: MOVF 28,W |
027A: BTFSC 28.7 |
027B: DECF 23,F |
027C: SUBWF 26,W |
027D: MOVWF 20 |
027E: MOVF 23,W |
027F: BTFSS 03.0 |
0280: INCFSZ 23,W |
0281: GOTO 284 |
0282: MOVF 27,W |
0283: GOTO 285 |
0284: SUBWF 27,W |
0285: MOVWF 23 |
0286: MOVF 20,W |
0287: MOVWF 2A |
.................... offset = offset >> 5; |
0288: SWAPF 2A,F |
0289: RRF 2A,F |
028A: MOVLW 07 |
028B: ANDWF 2A,F |
.................... } |
.................... LCD_gotoxy(offset,2); |
028C: MOVF 2A,W |
028D: MOVWF 36 |
028E: MOVLW 02 |
028F: MOVWF 37 |
0290: CALL 0C6 |
.................... printf(lcd_putc,"*"); |
0291: CLRF 2B |
0292: MOVF 2B,W |
0293: CALL 046 |
0294: IORLW 00 |
0295: BTFSC 03.2 |
0296: GOTO 29B |
0297: INCF 2B,F |
0298: MOVWF 35 |
0299: CALL 0D7 |
029A: GOTO 292 |
.................... } |
029B: GOTO 220 |
.................... } |
029C: SLEEP |
Configuration Fuses: |
Word 1: 3F39 XT NOWDT NOPUT NOPROTECT NOBROWNOUT NOLVP NOCPD NOWRT NODEBUG |
/programy/C/PIC_C/mereni/gmetr/gmetr.PJT |
---|
0,0 → 1,41 |
[PROJECT] |
Target=gmetr.HEX |
Development_Mode= |
Processor=0x873F |
ToolSuite=CCS |
[Directories] |
Include=C:\Program Files\PICC\devices\;C:\Program Files\PICC\dr |
Library= |
LinkerScript= |
[Target Data] |
FileList=D:\KAKLIK\projekty\programy\PIC_C\mereni\gmetr\gmetr.c |
BuildTool=C-COMPILER |
OptionString=+FM |
AdditionalOptionString= |
BuildRequired=1 |
[gmetr.c] |
Type=4 |
Path= |
FileList= |
BuildTool= |
OptionString= |
AdditionalOptionString= |
[mru-list] |
1=gmetr.c |
[Windows] |
0=0000 gmetr.c 0 0 796 451 3 0 |
[Opened Files] |
1=D:\KAKLIK\projekty\programy\PIC_C\mereni\gmetr\gmetr.c |
2=C:\library\CCS\lcd.c |
3=C:\Program Files\PICC\devices\16F873.h |
4= |
5= |
[Units] |
Count=1 |
1=D:\KAKLIK\projekty\programy\PIC_C\mereni\gmetr\gmetr.c (main) |
/programy/C/PIC_C/mereni/gmetr/gmetr.SYM |
---|
0,0 → 1,80 |
015 CCP_1_LOW |
015-016 CCP_1 |
016 CCP_1_HIGH |
01B CCP_2_LOW |
01B-01C CCP_2 |
01C CCP_2_HIGH |
020 @SCRATCH |
021 @SCRATCH |
021 _RETURN_ |
022 @SCRATCH |
023 @SCRATCH |
024 @SCRATCH |
025 @TRIS_C |
026-027 main.stred |
028 main.hodnota |
029 main.i |
02A main.offset |
02B lcd_init.i |
02B main.@SCRATCH |
02C lcd_init.@SCRATCH |
02C main.@SCRATCH |
02D-02E @PRINTF_LD_273.P1 |
02F @PRINTF_LD_273.@SCRATCH |
030 @PRINTF_LD_273.@SCRATCH |
031 @PRINTF_LD_273.@SCRATCH |
032 @PRINTF_LD_273.@SCRATCH |
033 @PRINTF_LD_273.@SCRATCH |
034 @PRINTF_LD_273.@SCRATCH |
035 lcd_putc.c |
036 lcd_gotoxy.x |
036 @delay_ms1.P1 |
037 lcd_gotoxy.y |
038 lcd_gotoxy.Adr |
039 lcd_gotoxy.@SCRATCH |
03A lcd_send_byte.Adr |
03B lcd_send_byte.n |
03C lcd_send_nibble.n |
03D lcd_send_nibble.@SCRATCH |
03E lcd_send_nibble.@SCRATCH |
004C @delay_ms1 |
0004 @const35 |
0061 lcd_send_nibble |
0076 lcd_send_byte |
008C lcd_init |
00C6 lcd_gotoxy |
00D7 lcd_putc |
010A lcd_clr |
0184 main |
000C @const10098 |
0021 @const10103 |
0034 @const10109 |
010E @PRINTF_LD_273 |
0046 @const10155 |
0184 @cinit |
Project Files: |
D:\KAKLIK\projekty\programy\PIC_C\mereni\gmetr\gmetr.c |
D:\KAKLIK\projekty\programy\PIC_C\mereni\gmetr\gmetr.h |
C:\Program Files\PICC\devices\16F873.h |
C:\library\CCS\lcd.c |
Units: |
D:\KAKLIK\projekty\programy\PIC_C\mereni\gmetr\gmetr.c (main) |
Compiler Settings: |
Processor: PIC16F873 |
Pointer Size: 8 |
ADC Range: 0-1023 |
Opt Level: 9 |
Short,Int,Long: 1,8,16 |
Output Files: |
Errors: D:\KAKLIK\projekty\programy\PIC_C\mereni\gmetr\gmetr.err |
INHX8: D:\KAKLIK\projekty\programy\PIC_C\mereni\gmetr\gmetr.hex |
Symbols: D:\KAKLIK\projekty\programy\PIC_C\mereni\gmetr\gmetr.sym |
List: D:\KAKLIK\projekty\programy\PIC_C\mereni\gmetr\gmetr.lst |
Debug/COFF: D:\KAKLIK\projekty\programy\PIC_C\mereni\gmetr\gmetr.cof |
Call Tree: D:\KAKLIK\projekty\programy\PIC_C\mereni\gmetr\gmetr.tre |
Statistics: D:\KAKLIK\projekty\programy\PIC_C\mereni\gmetr\gmetr.sta |
/programy/C/PIC_C/mereni/gmetr/gmetr.c |
---|
0,0 → 1,65 |
#include ".\gmetr.h" |
#define LCD_RS PIN_B1 // rizeni registru LCD displeje |
#define LCD_E PIN_B0 // enable LCD displeje |
#define LCD_DATA_LSB PIN_C4 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou) |
#include "C:\library\CCS\lcd.c" |
void main() |
{ |
signed int16 stred; |
signed int8 hodnota; |
unsigned int8 i, offset; |
setup_adc_ports(ALL_ANALOG); |
setup_adc(ADC_CLOCK_DIV_2); |
setup_spi(FALSE); |
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
setup_timer_1(T1_DISABLED); |
setup_timer_2(T2_DISABLED,0,1); |
lcd_init(); |
Delay_ms(100); |
set_adc_channel(1); |
LCD_gotoxy(1,1); |
printf(lcd_putc,"Gmetr 0.1.2 Beta"); |
LCD_gotoxy(1,2); |
printf(lcd_putc,"Kaklik@mlab.cz"); |
Delay_ms(500); |
LCD_clr(); |
LCD_gotoxy(1,1); |
printf(lcd_putc,"Clibration..."); |
stred = 0; |
for(i=0;i<=127;i++) |
{ |
Delay_ms(10); |
stred = stred + read_adc(); |
} |
stred = stred >> 7; |
while(true) |
{ |
hodnota = read_adc(); |
Delay_ms(50); |
LCD_clr(); |
LCD_gotoxy(6,1); |
printf(lcd_putc," %03ld ",(stred - hodnota)); |
if (hodnota >= stred) |
{ |
offset = hodnota - stred; |
offset = (offset >> 5) + 8; |
} |
else |
{ |
offset = stred - hodnota; |
offset = offset >> 5; |
} |
LCD_gotoxy(offset,2); |
printf(lcd_putc,"*"); |
} |
} |
/programy/C/PIC_C/mereni/gmetr/gmetr.cof |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/mereni/gmetr/gmetr.err |
---|
0,0 → 1,2 |
No Errors |
0 Errors, 0 Warnings. |
/programy/C/PIC_C/mereni/gmetr/gmetr.sta |
---|
0,0 → 1,42 |
ROM used: 669 (16%) |
669 (16%) including unused fragments |
1 Average locations per line |
8 Average locations per statement |
RAM used: 13 (7%) at main() level |
31 (16%) worst case |
Lines Stmts % Files |
----- ----- --- ----- |
66 39 45 D:\KAKLIK\projekty\programy\PIC_C\mereni\gmetr\gmetr.c |
6 0 0 D:\KAKLIK\projekty\programy\PIC_C\mereni\gmetr\gmetr.h |
244 0 0 C:\Program Files\PICC\devices\16F873.h |
312 47 38 C:\library\CCS\lcd.c |
----- ----- |
1256 172 Total |
Page ROM % RAM Functions: |
---- --- --- --- ---------- |
0 21 3 1 @delay_ms1 |
0 8 1 0 @const35 |
0 21 3 3 lcd_send_nibble |
0 22 3 2 lcd_send_byte |
0 58 9 2 lcd_init |
0 17 3 4 lcd_gotoxy |
0 51 8 1 lcd_putc |
0 4 1 0 lcd_clr |
0 281 42 7 main |
0 21 3 0 @const10098 |
0 19 3 0 @const10103 |
0 18 3 0 @const10109 |
0 118 18 8 @PRINTF_LD_273 |
0 6 1 0 @const10155 |
Segment Used Free |
--------- ---- ---- |
00000-00003 4 0 |
00004-007FF 665 1379 |
00800-00FFF 0 2048 |
/programy/C/PIC_C/mereni/gmetr/gmetr.tre |
---|
0,0 → 1,215 |
ÀÄgmetr |
ÀÄmain 0/281 Ram=7 |
ÃÄ??0?? |
ÃÄlcd_init 0/58 Ram=2 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ÃÄ@const35 0/8 Ram=0 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÀÄ@delay_ms1 0/21 Ram=1 |
ÃÄ@delay_ms1 0/21 Ram=1 |
ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ÀÄlcd_send_nibble 0/21 Ram=3 |
ÃÄ@const10098 0/21 Ram=0 |
ÃÄlcd_putc 0/51 Ram=1 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ÀÄlcd_send_nibble 0/21 Ram=3 |
ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ÀÄlcd_send_nibble 0/21 Ram=3 |
ÃÄ@const10103 0/19 Ram=0 |
ÃÄlcd_putc 0/51 Ram=1 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ÀÄlcd_send_nibble 0/21 Ram=3 |
ÃÄ@delay_ms1 0/21 Ram=1 |
ÃÄlcd_clr 0/4 Ram=0 |
³ ÀÄlcd_putc 0/51 Ram=1 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ÀÄlcd_send_nibble 0/21 Ram=3 |
ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ÀÄlcd_send_nibble 0/21 Ram=3 |
ÃÄ@const10109 0/18 Ram=0 |
ÃÄlcd_putc 0/51 Ram=1 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ÀÄlcd_send_nibble 0/21 Ram=3 |
ÃÄ@delay_ms1 0/21 Ram=1 |
ÃÄ@delay_ms1 0/21 Ram=1 |
ÃÄlcd_clr 0/4 Ram=0 |
³ ÀÄlcd_putc 0/51 Ram=1 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ÀÄlcd_send_nibble 0/21 Ram=3 |
ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ÀÄlcd_send_nibble 0/21 Ram=3 |
ÃÄlcd_putc 0/51 Ram=1 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ÀÄlcd_send_nibble 0/21 Ram=3 |
ÃÄ@PRINTF_LD_273 0/118 Ram=8 |
³ ÀÄlcd_putc 0/51 Ram=1 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ÀÄlcd_send_nibble 0/21 Ram=3 |
ÃÄlcd_putc 0/51 Ram=1 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ÀÄlcd_send_nibble 0/21 Ram=3 |
ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ÀÄlcd_send_nibble 0/21 Ram=3 |
ÃÄ@const10155 0/6 Ram=0 |
ÀÄlcd_putc 0/51 Ram=1 |
ÃÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ÀÄlcd_send_nibble 0/21 Ram=3 |
ÃÄ@delay_ms1 0/21 Ram=1 |
ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ÀÄlcd_send_nibble 0/21 Ram=3 |
ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ÀÄlcd_send_nibble 0/21 Ram=3 |
ÃÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ÀÄlcd_send_nibble 0/21 Ram=3 |
ÀÄlcd_send_byte 0/22 Ram=2 |
ÃÄlcd_send_nibble 0/21 Ram=3 |
ÀÄlcd_send_nibble 0/21 Ram=3 |
/programy/C/PIC_C/mereni/gmetr/gmetr.h |
---|
0,0 → 1,5 |
#include <16F873.h> |
#device adc=10 |
#fuses NOWDT,XT, NOPUT, NOPROTECT, NOBROWNOUT, NOLVP, NOCPD, NOWRT, NODEBUG |
#use delay(clock=4000000) |
/programy/C/PIC_C/mereni/gmetr/vssver.scc |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/mereni/PS2mys/PIC16F84/RUN.PIF |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/mereni/PS2mys/PIC16F84/Run.BAT |
---|
0,0 → 1,8 |
@echo off |
:loop |
picpgr reset PIC16F84 lpt2 |
picpgr run lpt2 |
pause |
picpgr stop lpt2 |
pause |
goto loop |
/programy/C/PIC_C/mereni/PS2mys/PIC16F84/main.BAK |
---|
0,0 → 1,57 |
#include "main.h" |
#include "c:\library\kaklik\CSS\PS2.c" |
#define SIGN_X 4 |
void trigger() |
{ |
output_high(PIN_A0); |
output_low(PIN_A0); |
delay_us(100); |
output_high(PIN_A0); |
} |
void flash_red() // blikne ledkou |
{ |
output_high(LED_red); |
Delay_ms(BLIK); |
output_low(LED_red); |
} |
void flash_yellow() // blikne ledkou |
{ |
output_high(LED_yellow); |
Delay_ms(BLIK); |
output_low(LED_yellow); |
} |
void main() |
{ |
int8 X,y,tl=0; |
int8 X_old,y_old,tl_old=0; |
Delay_ms(500); |
send(ENABLE_DATA_REPORTING); |
while(true) |
{ |
tl = read_byte(PRVNI); |
x = read_byte(DRUHY); |
y = read_byte(TRETI); |
trigger(); |
if (bit_test(tl, SIGN_X)) |
{ |
output_high(LED_red); |
output_low(LED_yellow); |
} |
else |
{ |
output_high(LED_yellow); |
output_low(LED_red); |
} |
} |
} |
/programy/C/PIC_C/mereni/PS2mys/PIC16F84/main.HEX |
---|
0,0 → 1,38 |
:1000000000308A00D128000016308400000803194F |
:10001000182801308D008C018C0B0C288D0B0B28BF |
:100020004A308C008C0B122800000000800B09283D |
:10003000DB28970183160614861083128610213060 |
:100040008C008C0B212883160610831206100630B4 |
:100050008C008C0B29280000831686148312861CC2 |
:100060002C2896011608073C031C52288316861478 |
:1000700083128618362815080139003A031D4228D4 |
:10008000061043280614831606108312150801393A |
:1000900097070310950C831686148312861C4B2831 |
:1000A000960A322883168614831286185228170857 |
:1000B000FF3A0139003A031D5F2806106028061434 |
:1000C0008316061086148312861868288316622801 |
:1000D00069288316861483128618692806148316E5 |
:1000E00006108614831286187728831671287828BC |
:1000F000831606148312E0289601160203188D2831 |
:10010000831686148312861C8A288316061483128B |
:1001100006188B289601960A7D288316861483126A |
:1001200086188D2883160614831206188D288316C8 |
:1001300086148312861C9728950196011608073CA1 |
:10014000031CBD288316861483128618A228031068 |
:10015000950C8316061400308312061801308C00AB |
:100160000C0C8C0103188C170C089504831686144C |
:100170008312861CB628960A9E2815088D00003426 |
:1001800083160510831205148316051083120510BB |
:1001900021308C008C0BCA2883160510831205149D |
:1001A000FC2884011F3083059101940102309500E1 |
:1001B000FA3096000428950BD828F43095001928B9 |
:1001C000E83083160317FF00831203137C200D0809 |
:1001D0009100023083160317FF00831203137C2063 |
:1001E0000D088F00023083160317FF0083120313DC |
:1001F0007C200D089000C028111E072983160511C8 |
:100200008312051583168511831285110F29831614 |
:100210008511831285158316051183120511E028B7 |
:02022000630079 |
:02400E00F93F78 |
:00000001FF |
;PIC16F84 |
/programy/C/PIC_C/mereni/PS2mys/PIC16F84/main.LST |
---|
0,0 → 1,474 |
CCS PCW C Compiler, Version 3.110, 15448 |
Filename: d:\@kaklik\programy\pic_c\ps2mys\main.LST |
ROM used: 273 (27%) |
Largest free fragment is 751 |
RAM used: 9 (13%) at main() level |
12 (18%) worst case |
Stack: 1 locations |
* |
0000: MOVLW 00 |
0001: MOVWF 0A |
0002: GOTO 0D1 |
0003: NOP |
.................... #include "D:\@Kaklik\programy\PIC_C\PS2mys\main.h" |
.................... #include <16F84.h> |
.................... //////// Standard Header file for the PIC16F84 device //////////////// |
.................... #device PIC16F84 |
.................... #list |
.................... |
.................... #use delay(clock=4000000) |
0004: MOVLW 16 |
0005: MOVWF 04 |
0006: MOVF 00,W |
0007: BTFSC 03.2 |
0008: GOTO 018 |
0009: MOVLW 01 |
000A: MOVWF 0D |
000B: CLRF 0C |
000C: DECFSZ 0C,F |
000D: GOTO 00C |
000E: DECFSZ 0D,F |
000F: GOTO 00B |
0010: MOVLW 4A |
0011: MOVWF 0C |
0012: DECFSZ 0C,F |
0013: GOTO 012 |
0014: NOP |
0015: NOP |
0016: DECFSZ 00,F |
0017: GOTO 009 |
0018: GOTO 0DB (RETURN) |
.................... #fuses XT,NOWDT |
.................... |
.................... #DEFINE DATA PIN_B0 // musi byt definovan kanal DATA |
.................... #DEFINE CLK PIN_B1 // a taky hodiny CLK |
.................... |
.................... #define PRVNI 1000 // nastaveni prodlevy pred zacatkem vysilani bajtu |
.................... #define DRUHY 2 |
.................... #define TRETI DRUHY |
.................... |
.................... // prikazy |
.................... #define RESET 0xFF |
.................... #define ENABLE_DATA_REPORTING 0xF4 |
.................... #define READ_DATA 0xEB |
.................... #define STATUS_REQUEST 0xE9 |
.................... #define SET_REMOTE_MODE 0xF0 |
.................... #define SET_STREAM_MODE 0xEA |
.................... #define GET_DEVICE_ID 0xF2 |
.................... |
.................... #DEFINE LED_yellow PIN_A3 |
.................... #DEFINE LED_red PIN_A2 |
.................... |
.................... #DEFINE BLIK 120 // doba rozsviceni led |
.................... |
.................... #include "PS2.c" |
.................... // Modul pro komunikaci s Mysi |
.................... |
.................... void send(byte command) |
.................... { |
.................... int n; |
0019: CLRF 17 |
.................... int parity=0; |
.................... |
.................... //Request-to-send |
.................... output_float(DATA); |
001A: BSF 03.5 |
001B: BSF 06.0 |
.................... output_low(CLK); |
001C: BCF 06.1 |
001D: BCF 03.5 |
001E: BCF 06.1 |
.................... delay_us(100); |
001F: MOVLW 21 |
0020: MOVWF 0C |
0021: DECFSZ 0C,F |
0022: GOTO 021 |
.................... // start bit |
.................... output_low(DATA); |
0023: BSF 03.5 |
0024: BCF 06.0 |
0025: BCF 03.5 |
0026: BCF 06.0 |
.................... delay_us(20); |
0027: MOVLW 06 |
0028: MOVWF 0C |
0029: DECFSZ 0C,F |
002A: GOTO 029 |
002B: NOP |
.................... while(!input(CLK)); |
002C: BSF 03.5 |
002D: BSF 06.1 |
002E: BCF 03.5 |
002F: BTFSS 06.1 |
0030: GOTO 02C |
.................... // 8 bitu |
.................... for(n=0; n<8; n++) |
0031: CLRF 16 |
0032: MOVF 16,W |
0033: SUBLW 07 |
0034: BTFSS 03.0 |
0035: GOTO 052 |
.................... { |
.................... while(input(CLK)); |
0036: BSF 03.5 |
0037: BSF 06.1 |
0038: BCF 03.5 |
0039: BTFSC 06.1 |
003A: GOTO 036 |
.................... output_bit(DATA, command & 1); |
003B: MOVF 15,W |
003C: ANDLW 01 |
003D: XORLW 00 |
003E: BTFSS 03.2 |
003F: GOTO 042 |
0040: BCF 06.0 |
0041: GOTO 043 |
0042: BSF 06.0 |
0043: BSF 03.5 |
0044: BCF 06.0 |
.................... parity += command & 1; |
0045: BCF 03.5 |
0046: MOVF 15,W |
0047: ANDLW 01 |
0048: ADDWF 17,F |
.................... command>>=1; |
0049: BCF 03.0 |
004A: RRF 15,F |
.................... while(!input(CLK)); |
004B: BSF 03.5 |
004C: BSF 06.1 |
004D: BCF 03.5 |
004E: BTFSS 06.1 |
004F: GOTO 04B |
.................... }; |
0050: INCF 16,F |
0051: GOTO 032 |
.................... // parita |
.................... while(input(CLK)); |
0052: BSF 03.5 |
0053: BSF 06.1 |
0054: BCF 03.5 |
0055: BTFSC 06.1 |
0056: GOTO 052 |
.................... output_bit(DATA, ~parity & 1); |
0057: MOVF 17,W |
0058: XORLW FF |
0059: ANDLW 01 |
005A: XORLW 00 |
005B: BTFSS 03.2 |
005C: GOTO 05F |
005D: BCF 06.0 |
005E: GOTO 060 |
005F: BSF 06.0 |
0060: BSF 03.5 |
0061: BCF 06.0 |
.................... while(!input(CLK)); |
0062: BSF 06.1 |
0063: BCF 03.5 |
0064: BTFSC 06.1 |
0065: GOTO 068 |
0066: BSF 03.5 |
0067: GOTO 062 |
0068: GOTO 069 |
.................... // stop bit |
.................... while(input(CLK)); |
0069: BSF 03.5 |
006A: BSF 06.1 |
006B: BCF 03.5 |
006C: BTFSC 06.1 |
006D: GOTO 069 |
.................... output_bit(DATA, 1); |
006E: BSF 06.0 |
006F: BSF 03.5 |
0070: BCF 06.0 |
.................... while(!input(CLK)); |
0071: BSF 06.1 |
0072: BCF 03.5 |
0073: BTFSC 06.1 |
0074: GOTO 077 |
0075: BSF 03.5 |
0076: GOTO 071 |
0077: GOTO 078 |
.................... output_float(DATA); |
0078: BSF 03.5 |
0079: BSF 06.0 |
007A: BCF 03.5 |
007B: GOTO 0E0 (RETURN) |
.................... } |
.................... |
.................... |
.................... int8 read_byte(int8 const poradi) |
.................... { |
.................... int8 bajt; |
.................... int8 i; |
.................... |
.................... // cekani na komunikacni klid |
.................... for (i=0; i<poradi; i++) |
007C: CLRF 16 |
007D: SUBWF 16,W |
007E: BTFSC 03.0 |
007F: GOTO 08D |
.................... { |
.................... if (!input(CLK) || !input(DATA)) i=0; |
0080: BSF 03.5 |
0081: BSF 06.1 |
0082: BCF 03.5 |
0083: BTFSS 06.1 |
0084: GOTO 08A |
0085: BSF 03.5 |
0086: BSF 06.0 |
0087: BCF 03.5 |
0088: BTFSC 06.0 |
0089: GOTO 08B |
008A: CLRF 16 |
.................... }; |
008B: INCF 16,F |
008C: GOTO 07D |
.................... |
.................... // cekani na startbit |
.................... while(input(CLK) || input(DATA)); |
008D: BSF 03.5 |
008E: BSF 06.1 |
008F: BCF 03.5 |
0090: BTFSC 06.1 |
0091: GOTO 08D |
0092: BSF 03.5 |
0093: BSF 06.0 |
0094: BCF 03.5 |
0095: BTFSC 06.0 |
0096: GOTO 08D |
.................... while(!input(CLK)); |
0097: BSF 03.5 |
0098: BSF 06.1 |
0099: BCF 03.5 |
009A: BTFSS 06.1 |
009B: GOTO 097 |
.................... |
.................... bajt = 0; |
009C: CLRF 15 |
.................... for(i=0; i<8; i++) |
009D: CLRF 16 |
009E: MOVF 16,W |
009F: SUBLW 07 |
00A0: BTFSS 03.0 |
00A1: GOTO 0BD |
.................... { |
.................... while(input(CLK)); // ceka na nulu hodin |
00A2: BSF 03.5 |
00A3: BSF 06.1 |
00A4: BCF 03.5 |
00A5: BTFSC 06.1 |
00A6: GOTO 0A2 |
.................... |
.................... bajt >>= 1; |
00A7: BCF 03.0 |
00A8: RRF 15,F |
.................... bajt |= input(DATA) << 7; |
00A9: BSF 03.5 |
00AA: BSF 06.0 |
00AB: MOVLW 00 |
00AC: BCF 03.5 |
00AD: BTFSC 06.0 |
00AE: MOVLW 01 |
00AF: MOVWF 0C |
00B0: RRF 0C,W |
00B1: CLRF 0C |
00B2: BTFSC 03.0 |
00B3: BSF 0C.7 |
00B4: MOVF 0C,W |
00B5: IORWF 15,F |
.................... |
.................... while(!input(CLK)); // ceka na jednicku hodin |
00B6: BSF 03.5 |
00B7: BSF 06.1 |
00B8: BCF 03.5 |
00B9: BTFSS 06.1 |
00BA: GOTO 0B6 |
.................... }; |
00BB: INCF 16,F |
00BC: GOTO 09E |
.................... return (bajt); |
00BD: MOVF 15,W |
00BE: MOVWF 0D |
00BF: RETLW 00 |
.................... } |
.................... |
.................... |
.................... /*void read_all_byte(int8*st,*nd,*rd) // precte 3 bajty |
.................... { |
.................... int8 i; |
.................... |
.................... // *st=read_byte(1st); |
.................... |
.................... // cekani na startbit |
.................... while(input(CLK) || input(DATA)); |
.................... while(!input(CLK)); |
.................... *nd = 0; |
.................... for(i=0; i<8; i++) |
.................... { |
.................... while(input(CLK)); // ceka na nulu hodin |
.................... |
.................... *nd |= input(DATA) << 7; |
.................... *nd >>= 1; |
.................... |
.................... while(!input(CLK)); // ceka na jednicku hodin |
.................... }; |
.................... |
.................... // cekani na startbit |
.................... while(input(CLK) || input(DATA)); |
.................... while(!input(CLK)); |
.................... *rd = 0; |
.................... for(i=0; i<8; i++) |
.................... { |
.................... while(input(CLK)); // ceka na nulu hodin |
.................... |
.................... *rd |= input(DATA) << 7; |
.................... *rd >>= 1; |
.................... |
.................... while(!input(CLK)); // ceka na jednicku hodin |
.................... }; |
.................... }*/ |
.................... |
.................... |
.................... #define SIGN_X 4 |
.................... |
.................... void trigger() |
.................... { |
.................... output_high(PIN_A0); |
00C0: BSF 03.5 |
00C1: BCF 05.0 |
00C2: BCF 03.5 |
00C3: BSF 05.0 |
.................... output_low(PIN_A0); |
00C4: BSF 03.5 |
00C5: BCF 05.0 |
00C6: BCF 03.5 |
00C7: BCF 05.0 |
.................... delay_us(100); |
00C8: MOVLW 21 |
00C9: MOVWF 0C |
00CA: DECFSZ 0C,F |
00CB: GOTO 0CA |
.................... output_high(PIN_A0); |
00CC: BSF 03.5 |
00CD: BCF 05.0 |
00CE: BCF 03.5 |
00CF: BSF 05.0 |
00D0: GOTO 0FC (RETURN) |
.................... } |
.................... |
.................... void flash_red() // blikne ledkou |
.................... { |
.................... output_high(LED_red); |
.................... Delay_ms(BLIK); |
.................... output_low(LED_red); |
.................... } |
.................... |
.................... void flash_yellow() // blikne ledkou |
.................... { |
.................... output_high(LED_yellow); |
.................... Delay_ms(BLIK); |
.................... output_low(LED_yellow); |
.................... } |
.................... |
.................... void main() |
.................... { |
.................... int8 X,y,tl=0; |
* |
00D4: CLRF 11 |
00D5: CLRF 14 |
.................... int8 X_old,y_old,tl_old=0; |
* |
00D1: CLRF 04 |
00D2: MOVLW 1F |
00D3: ANDWF 03,F |
.................... |
.................... Delay_ms(500); |
* |
00D6: MOVLW 02 |
00D7: MOVWF 15 |
00D8: MOVLW FA |
00D9: MOVWF 16 |
00DA: GOTO 004 |
00DB: DECFSZ 15,F |
00DC: GOTO 0D8 |
.................... send(ENABLE_DATA_REPORTING); |
00DD: MOVLW F4 |
00DE: MOVWF 15 |
00DF: GOTO 019 |
.................... |
.................... while(true) |
.................... { |
.................... tl = read_byte(PRVNI); |
00E0: MOVLW E8 |
00E1: BSF 03.5 |
00E2: BSF 03.6 |
00E3: MOVWF 7F |
00E4: BCF 03.5 |
00E5: BCF 03.6 |
00E6: CALL 07C |
00E7: MOVF 0D,W |
00E8: MOVWF 11 |
.................... x = read_byte(DRUHY); |
00E9: MOVLW 02 |
00EA: BSF 03.5 |
00EB: BSF 03.6 |
00EC: MOVWF 7F |
00ED: BCF 03.5 |
00EE: BCF 03.6 |
00EF: CALL 07C |
00F0: MOVF 0D,W |
00F1: MOVWF 0F |
.................... y = read_byte(TRETI); |
00F2: MOVLW 02 |
00F3: BSF 03.5 |
00F4: BSF 03.6 |
00F5: MOVWF 7F |
00F6: BCF 03.5 |
00F7: BCF 03.6 |
00F8: CALL 07C |
00F9: MOVF 0D,W |
00FA: MOVWF 10 |
.................... trigger(); |
00FB: GOTO 0C0 |
.................... |
.................... |
.................... if (bit_test(tl, SIGN_X)) |
00FC: BTFSS 11.4 |
00FD: GOTO 107 |
.................... { |
.................... output_high(LED_red); |
00FE: BSF 03.5 |
00FF: BCF 05.2 |
0100: BCF 03.5 |
0101: BSF 05.2 |
.................... output_low(LED_yellow); |
0102: BSF 03.5 |
0103: BCF 05.3 |
0104: BCF 03.5 |
0105: BCF 05.3 |
.................... } |
.................... else |
0106: GOTO 10F |
.................... { |
.................... output_high(LED_yellow); |
0107: BSF 03.5 |
0108: BCF 05.3 |
0109: BCF 03.5 |
010A: BSF 05.3 |
.................... output_low(LED_red); |
010B: BSF 03.5 |
010C: BCF 05.2 |
010D: BCF 03.5 |
010E: BCF 05.2 |
.................... } |
.................... } |
010F: GOTO 0E0 |
.................... } |
.................... |
0110: SLEEP |
.................... |
.................... |
/programy/C/PIC_C/mereni/PS2mys/PIC16F84/main.PJT |
---|
0,0 → 1,37 |
[PROJECT] |
Target=main.HEX |
Development_Mode= |
Processor=0x684A |
ToolSuite=CCS |
[Directories] |
Include=C:\PROGRAM FILES\PICC\devices\;C:\PROGRAM FILES\PICC\dr |
Library= |
LinkerScript= |
[Target Data] |
FileList=main.c; |
BuildTool=C-COMPILER |
OptionString=+FM |
AdditionalOptionString= |
BuildRequired=1 |
[main.c] |
Type=4 |
Path= |
FileList= |
BuildTool= |
OptionString= |
AdditionalOptionString= |
[mru-list] |
1=main.c |
[Windows] |
0=0000 main.c 0 0 796 451 3 0 |
[Opened Files] |
1=D:\KAKLIK\programy\PIC_C\mereni\PS2mys\PIC16F84\main.c |
2=C:\PROGRAM FILES\PICC\devices\16F84.h |
3=c:\library\kaklik\CCS\PS2.c |
4= |
/programy/C/PIC_C/mereni/PS2mys/PIC16F84/main.SYM |
---|
0,0 → 1,32 |
00C @SCRATCH |
00D @SCRATCH |
00D _RETURN_ |
00F main.X |
010 main.y |
011 main.tl |
012 main.X_old |
013 main.y_old |
014 main.tl_old |
015 send.command |
015 read_byte.bajt |
015 main.@SCRATCH |
016 delay_ms.P1 |
016 send.n |
016 read_byte.i |
017 send.parity |
017 read_byte.@SCRATCH |
018 send.@SCRATCH |
delay_us.P1 |
read_byte.poradi |
0004 delay_ms |
0019 send |
007C read_byte |
00C0 trigger |
00D1 main |
Project Files: |
d:\@kaklik\programy\pic_c\ps2mys\main.c |
D:\@Kaklik\programy\PIC_C\PS2mys\main.h |
C:\PROGRAM FILES\PICC\devices\16F84.h |
d:\@kaklik\programy\pic_c\ps2mys\PS2.c |
/programy/C/PIC_C/mereni/PS2mys/PIC16F84/main.c |
---|
0,0 → 1,57 |
#include "main.h" |
#include "c:\library\kaklik\CCS\PS2.c" |
#define SIGN_X 4 |
void trigger() |
{ |
output_high(PIN_A0); |
output_low(PIN_A0); |
delay_us(100); |
output_high(PIN_A0); |
} |
void flash_red() // blikne ledkou |
{ |
output_high(LED_red); |
Delay_ms(BLIK); |
output_low(LED_red); |
} |
void flash_yellow() // blikne ledkou |
{ |
output_high(LED_yellow); |
Delay_ms(BLIK); |
output_low(LED_yellow); |
} |
void main() |
{ |
int8 X,y,tl=0; |
int8 X_old,y_old,tl_old=0; |
Delay_ms(500); |
send(ENABLE_DATA_REPORTING); |
while(true) |
{ |
tl = read_byte(PRVNI); |
x = read_byte(DRUHY); |
y = read_byte(TRETI); |
trigger(); |
if (bit_test(tl, SIGN_X)) |
{ |
output_high(LED_red); |
output_low(LED_yellow); |
} |
else |
{ |
output_high(LED_yellow); |
output_low(LED_red); |
} |
} |
} |
/programy/C/PIC_C/mereni/PS2mys/PIC16F84/main.cod |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/mereni/PS2mys/PIC16F84/main.err |
---|
0,0 → 1,0 |
Error[51] c:\library\kaklik\CCS\PS2.c 48 : A numeric expression must appear here |
/programy/C/PIC_C/mereni/PS2mys/PIC16F84/main.h |
---|
0,0 → 1,24 |
#include <16F84.h> |
#use delay(clock=4000000) |
#fuses XT,NOWDT |
#DEFINE DATA PIN_B0 // musi byt definovan kanal DATA |
#DEFINE CLK PIN_B1 // a taky hodiny CLK |
#define PRVNI 1000 // nastaveni prodlevy pred zacatkem vysilani bajtu |
#define DRUHY 2 |
#define TRETI DRUHY |
// prikazy |
#define RESET 0xFF |
#define ENABLE_DATA_REPORTING 0xF4 |
#define READ_DATA 0xEB |
#define STATUS_REQUEST 0xE9 |
#define SET_REMOTE_MODE 0xF0 |
#define SET_STREAM_MODE 0xEA |
#define GET_DEVICE_ID 0xF2 |
#DEFINE LED_yellow PIN_A3 |
#DEFINE LED_red PIN_A2 |
#DEFINE BLIK 120 // doba rozsviceni led |
/programy/C/PIC_C/mereni/PS2mys/PIC16F84/main.sta |
---|
0,0 → 1,32 |
ROM used: 273 (27%) |
751 (73%) including unused fragments |
1 Average locations per line |
4 Average locations per statement |
RAM used: 9 (13%) at main() level |
12 (18%) worst case |
Lines Stmts % Files |
----- ----- --- ----- |
58 25 34 d:\@kaklik\programy\pic_c\ps2mys\main.c |
25 0 0 D:\@Kaklik\programy\PIC_C\PS2mys\main.h |
111 0 0 C:\PROGRAM FILES\PICC\devices\16F84.h |
100 48 49 d:\@kaklik\programy\pic_c\ps2mys\PS2.c |
----- ----- |
588 146 Total |
Page ROM % RAM Functions: |
---- --- --- --- ---------- |
0 21 8 1 delay_ms |
0 99 36 4 send |
0 68 25 4 read_byte |
0 17 6 0 trigger |
0 64 23 7 main |
Segment Used Free |
--------- ---- ---- |
0000-0003 4 0 |
0004-03FF 269 751 |
/programy/C/PIC_C/mereni/PS2mys/PIC16F84/main.tre |
---|
0,0 → 1,9 |
ÀÄmain |
ÀÄmain 0/64 Ram=7 |
ÃÄ??0?? |
ÃÄdelay_ms 0/21 Ram=1 |
ÃÄsend 0/99 Ram=4 |
ÃÄread_byte 0/68 Ram=4 |
ÃÄread_byte 0/68 Ram=4 |
ÃÄread_byte 0/68 Ram=4 |
ÀÄtrigger 0/17 Ram=0 |
/programy/C/PIC_C/mereni/PS2mys/PIC16F84/prg.bat |
---|
0,0 → 1,6 |
call picpgr stop |
call picpgr erase pic16f84 |
call picpgr program main.hex hex pic16f84 |
call picpgr run |
pause |
call picpgr stop |
/programy/C/PIC_C/mereni/PS2mys/PIC16F84/ps2.BAK |
---|
0,0 → 1,99 |
// Modul pro komunikaci s Mysi |
void send(byte command) |
{ |
int n; |
int parity=0; |
//Request-to-send |
// output_float(DATA); |
output_low(CLK); |
delay_us(100); |
// start bit |
output_low(DATA); |
delay_us(20); |
while(!input(CLK)); |
// 8 bitu |
for(n=0; n<8; n++) |
{ |
while(input(CLK)); |
output_bit(DATA, command & 1); |
parity += command & 1; |
command>>=1; |
while(!input(CLK)); |
}; |
// parita |
while(input(CLK)); |
output_bit(DATA, ~parity & 1); |
while(!input(CLK)); |
// stop bit |
while(input(CLK)); |
output_bit(DATA, 1); |
while(!input(CLK)); |
output_float(DATA); |
} |
int8 read_byte(int8 const poradi) |
{ |
int8 bajt; |
int8 i; |
// cekani na komunikacni klid |
for (i=0; i<poradi; i++) |
{ |
if (!input(CLK) || !input(DATA)) i=0; |
}; |
// cekani na startbit |
while(input(CLK) || input(DATA)); |
while(!input(CLK)); |
bajt = 0; |
for(i=0; i<8; i++) |
{ |
while(input(CLK)); // ceka na nulu hodin |
bajt >>= 1; |
bajt |= input(DATA) << 7; |
while(!input(CLK)); // ceka na jednicku hodin |
}; |
return (bajt); |
} |
/*void read_all_byte(int8*st,*nd,*rd) // precte 3 bajty |
{ |
int8 i; |
// *st=read_byte(1st); |
// cekani na startbit |
while(input(CLK) || input(DATA)); |
while(!input(CLK)); |
*nd = 0; |
for(i=0; i<8; i++) |
{ |
while(input(CLK)); // ceka na nulu hodin |
*nd |= input(DATA) << 7; |
*nd >>= 1; |
while(!input(CLK)); // ceka na jednicku hodin |
}; |
// cekani na startbit |
while(input(CLK) || input(DATA)); |
while(!input(CLK)); |
*rd = 0; |
for(i=0; i<8; i++) |
{ |
while(input(CLK)); // ceka na nulu hodin |
*rd |= input(DATA) << 7; |
*rd >>= 1; |
while(!input(CLK)); // ceka na jednicku hodin |
}; |
}*/ |
/programy/C/PIC_C/mereni/PS2mys/PIC16F84/ps2mouse.BAK |
---|
0,0 → 1,100 |
#include "main.h" |
#include "ps2mouse.h" |
void send(byte command) |
{ |
int n; |
int parity=0; |
//Request-to-send |
input(DATA); |
output_low(CLK); |
delay_us(100); |
// start bit |
output_low(DATA); |
delay_us(20); |
while(!input(CLK)); |
// 8 bitu |
for(n=0; n<8; n++) |
{ |
while(input(CLK)); |
output_bit(DATA, command & 1); |
parity += command & 1; |
command>>=1; |
while(!input(CLK)); |
}; |
// parita |
while(input(CLK)); |
output_bit(DATA, ~parity & 1); |
while(!input(CLK)); |
// stop bit |
while(input(CLK)); |
output_bit(DATA, 1); |
while(!input(CLK)); |
output_float(DATA); |
} |
int8 read_byte(int8 const poradi) |
{ |
int8 bajt; |
int8 i; |
// cekani na komunikacni klid |
for (i=0; i<poradi; i++) |
{ |
if (!input(CLK) || !input(DATA)) i=0; |
}; |
// cekani na startbit |
while(input(CLK) || input(DATA)); |
while(!input(CLK)); |
bajt = 0; |
for(i=0; i<8; i++) |
{ |
while(input(CLK)); // ceka na nulu hodin |
bajt >>= 1; |
bajt |= input(DATA) << 7; |
while(!input(CLK)); // ceka na jednicku hodin |
}; |
return (bajt); |
} |
/*void read_all_byte(int8*st,*nd,*rd) // precte 3 bajty |
{ |
int8 i; |
// *st=read_byte(1st); |
// cekani na startbit |
while(input(CLK) || input(DATA)); |
while(!input(CLK)); |
*nd = 0; |
for(i=0; i<8; i++) |
{ |
while(input(CLK)); // ceka na nulu hodin |
*nd |= input(DATA) << 7; |
*nd >>= 1; |
while(!input(CLK)); // ceka na jednicku hodin |
}; |
// cekani na startbit |
while(input(CLK) || input(DATA)); |
while(!input(CLK)); |
*rd = 0; |
for(i=0; i<8; i++) |
{ |
while(input(CLK)); // ceka na nulu hodin |
*rd |= input(DATA) << 7; |
*rd >>= 1; |
while(!input(CLK)); // ceka na jednicku hodin |
}; |
}*/ |
/programy/C/PIC_C/mereni/PS2mys/PIC16F84/ps2mouse.c |
---|
0,0 → 1,97 |
void send(byte command) |
{ |
int n; |
int parity=0; |
//Request-to-send |
input(DATA); |
output_low(CLK); |
delay_us(100); |
// start bit |
output_low(DATA); |
delay_us(20); |
while(!input(CLK)); |
// 8 bitu |
for(n=0; n<8; n++) |
{ |
while(input(CLK)); |
output_bit(DATA, command & 1); |
parity += command & 1; |
command>>=1; |
while(!input(CLK)); |
}; |
// parita |
while(input(CLK)); |
output_bit(DATA, ~parity & 1); |
while(!input(CLK)); |
// stop bit |
while(input(CLK)); |
output_bit(DATA, 1); |
while(!input(CLK)); |
output_float(DATA); |
} |
int8 read_byte(int8 const poradi) |
{ |
int8 bajt; |
int8 i; |
// cekani na komunikacni klid |
for (i=0; i<poradi; i++) |
{ |
if (!input(CLK) || !input(DATA)) i=0; |
}; |
// cekani na startbit |
while(input(CLK) || input(DATA)); |
while(!input(CLK)); |
bajt = 0; |
for(i=0; i<8; i++) |
{ |
while(input(CLK)); // ceka na nulu hodin |
bajt >>= 1; |
bajt |= input(DATA) << 7; |
while(!input(CLK)); // ceka na jednicku hodin |
}; |
return (bajt); |
} |
/*void read_all_byte(int8*st,*nd,*rd) // precte 3 bajty |
{ |
int8 i; |
// *st=read_byte(1st); |
// cekani na startbit |
while(input(CLK) || input(DATA)); |
while(!input(CLK)); |
*nd = 0; |
for(i=0; i<8; i++) |
{ |
while(input(CLK)); // ceka na nulu hodin |
*nd |= input(DATA) << 7; |
*nd >>= 1; |
while(!input(CLK)); // ceka na jednicku hodin |
}; |
// cekani na startbit |
while(input(CLK) || input(DATA)); |
while(!input(CLK)); |
*rd = 0; |
for(i=0; i<8; i++) |
{ |
while(input(CLK)); // ceka na nulu hodin |
*rd |= input(DATA) << 7; |
*rd >>= 1; |
while(!input(CLK)); // ceka na jednicku hodin |
}; |
}*/ |
/programy/C/PIC_C/mereni/PS2mys/PIC16F84/ps2mouse.h |
---|
0,0 → 1,18 |
#define PRVNI 1000 // nastaveni prodlevy pred zacatkem vysilani bajtu |
#define DRUHY 2 |
#define TRETI DRUHY |
// prikazy |
#define RESET 0xFF |
#define ENABLE_DATA_REPORTING 0xF4 |
#define READ_DATA 0xEB |
#define STATUS_REQUEST 0xE9 |
#define SET_REMOTE_MODE 0xF0 |
#define SET_STREAM_MODE 0xEA |
#define GET_DEVICE_ID 0xF2 |
void send(byte command); |
int8 read_byte(int8 const poradi); |
/programy/C/PIC_C/mereni/PS2mys/PIC16F84/vssver.scc |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/mereni/PS2mys/PIC16F88/mys.BAK |
---|
0,0 → 1,54 |
#include "D:\KAKLIK\programy\PIC_C\mereni\PS2mys\PIC16F88\mys.h" |
#define LCD_RS PIN_A0 // rizeni registru LCD displeje |
#define LCD_E PIN_A1 // enable LCD displeje |
#define LCD_DATA_LSB PIN_B0 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou) |
#include "C:\library\CCS\lcd.c" |
#define TRIGGER_PIN PIN_B4 |
#DEFINE DATA PIN_B5 // musi byt definovan kanal DATA |
#DEFINE CLK PIN_B6 // a taky hodiny CLK |
#include "C:\library\kaklik\CCS\ps2.c" |
void trigger() |
{ |
output_high(TRIGGER_PIN); |
delay_us(50); |
output_low(TRIGGER_PIN); |
} |
void main() |
{ |
signed int16 x=0,y=0; |
signed int8 hodnota,dx,dy; |
unsigned int8 tl1,tl2,tl3; |
setup_adc_ports(NO_ANALOGS|VSS_VDD); |
setup_adc(ADC_OFF); |
setup_spi(FALSE); |
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
setup_timer_1(T1_DISABLED); |
setup_timer_2(T2_DISABLED,0,1); |
setup_comparator(NC_NC_NC_NC); |
setup_vref(FALSE); |
lcd_init(); |
Delay_ms(500); |
send(SET_REMOTE_MODE); |
while (true) |
{ |
LCD_gotoxy(1,1); |
printf(lcd_putc,"%X X=%ld Y=%ld TL1=%U TL2=%U TL3=%U",hodnota, x,y,tl1,tl2,tl3); |
delay_ms(20); |
send(READ_DATA); |
hodnota=read_byte(); |
read_standard_byte(&dx,&dy,&tl1,&tl2,&tl3); |
x+=dx; |
y+=dy; |
} |
} |
/programy/C/PIC_C/mereni/PS2mys/PIC16F88/mys.HEX |
---|
0,0 → 1,123 |
:1000000000308A00E22A00000A108A100A118207D2 |
:1000100028340C34013406340A108A100A1182077D |
:1000200025345834203458343D3425346C34643409 |
:10003000203459343D3425346C3464342034543401 |
:100040004C3431343D342534553454344C3432340A |
:100050003D3425345534203454344C3433343D3419 |
:1000600025345534003434308400000803194728FF |
:100070000130F800F701F70B3B28F80B3A284A301B |
:10008000F700F70B412800000000800B38280034EF |
:100090000608F039BB003A080F393B048600851486 |
:1000A0008316851000008312851083168510831235 |
:1000B0000034B808031D5E2805105F280514831658 |
:1000C00005108312B90E3908BA004820B90E390854 |
:1000D000BA0048200D30F700F70B6C2800341430BC |
:1000E000B4003320F0308316860583120510831682 |
:1000F000051083128510831685108312AB012B081F |
:10010000023C031C8B280230B40033200330BA00B9 |
:100110004820AB0A7F280D30F700F70B8D280230FE |
:10012000BA0048200D30F700F70B9428AB012B08DC |
:10013000023C031CA7282B080420AC00B8012C08A3 |
:10014000B90059200230B4003320AB0A97288A1135 |
:10015000242BAD0183168616061383120613213055 |
:10016000F700F70BB12883168612831286128316C6 |
:1001700006178312061BB728AC012C08073C031C8A |
:10018000DA28831606178312061BC1282B18CA28E3 |
:100190008612CB2886168316861283122B08013905 |
:1001A000AD070310AB0C831606178312061FD32866 |
:1001B000AC0ABD28831606178312061BDA282D0801 |
:1001C000FF3A0139003A031DE7288612E82886160F |
:1001D0008316861206178312061BF0288316EA2858 |
:1001E0008316861686168312861EF8288316F22832 |
:1001F000831606178312061BF82883160617831228 |
:10020000061FFD28831686168312861EFD280034DD |
:1002100001303402B6003508023C031D112940307C |
:10022000B60736088038B700B8013708B90059203A |
:10023000003433080C3A03192729063A03192F29E9 |
:10024000073A03193529053A03193A293F29B80114 |
:100250000130B90059200230B40033204B2901305D |
:10026000B4000230B50008214B290130B400B500BC |
:1002700008214B29B8011030B90059204B29330807 |
:100280001F3C031C45290730B3050130B800330873 |
:10029000B90059204B290034AC1B5E290F30F70000 |
:1002A0002B0EF7050A307702031859293030F7076B |
:1002B0005B292C08F7077708B30019210F30AB052D |
:1002C0000A302B020318662930306829AC132C0839 |
:1002D000AB072B08B30019218A11372B0408B20091 |
:1002E000AC1F7B292D30B30019218403AB09AC0965 |
:1002F000AB0A0319AC0A2C0EF038AE00AE07E23E92 |
:10030000AF00323EB1002C080F39AF07AF07B1077D |
:10031000E93EB000B007B0072B0E0F39B007B107A8 |
:10032000B00DB10DB109B10D2B080F39B107AE0DEC |
:100330000730AD000A30B107B003031C9B29B0079A |
:10034000AF03031C9F29AF07AE03031CA329AE070D |
:10035000AD03031CA7292D30840007303205840724 |
:10036000313004020319D0290008F700031DBE290B |
:10037000321ACE29B219C0292030C1290830B20062 |
:100380003030F707AC010408AB007708AD00770800 |
:10039000B30019212B0884002D08F700840AB02926 |
:1003A0000008F7003030F7077708B3001921003450 |
:1003B0003208F80131020318E0293108F700EC296E |
:1003C000F7010830B300B10DF70D320877020318BA |
:1003D000F700F80DB30BE32900343013B0122F08E7 |
:1003E000B1006430B200D8217708AF007808031D4F |
:1003F000172AB01A172AB019252A301B052A3018D7 |
:10040000052A3019052AB01B252A301C112AB01BD9 |
:10041000252A301B112A3018252A3019112AB01B21 |
:10042000252A2030301E3030B3001921252AB0167D |
:10043000B01F212A78088000F8002D30B300192160 |
:10044000B01330307807B3001921301B302A2F0841 |
:10045000B1000A30B200D8217708AF003017F62972 |
:10046000B01F352A2D30B300192130302F07B300CB |
:10047000192100343510831606178312061B3B2AF8 |
:10048000831686168312861A3B2A83160617831252 |
:10049000061F452AB301B4013408073C031C7C2A1B |
:1004A000831606178312061B502A0310B30C8316FB |
:1004B000861600308312861A0130F700770CF70198 |
:1004C0000318F7177708B304003035180130B60069 |
:1004D0008316861600308312861A01303606F8001D |
:1004E0007818742A3510752A351483160617831266 |
:1004F000061F752AB40A4C2A831606178312061B98 |
:100500007C2A003035180130B6008316861600307C |
:100510008312861A01303606F8007818912A3510B1 |
:10052000922A3514831606178312061F922A831601 |
:1005300006178312061B972A831606178312061FB7 |
:100540009C2A3308F80000343A227808B0003A2296 |
:100550007808B1003A227808B20030080839083C1F |
:10056000031DB82A2B0884003108003C8000BC2AF7 |
:100570002B0884003108800030081039103C031D1E |
:10058000C72A2C0884003208003C8000CB2A2C08A3 |
:100590008400320880002D08840030080139800072 |
:1005A0002E0884000310300C013980002F088400CD |
:1005B000300CF700F70C3F30F70577080139800061 |
:1005C0008A11A52B84011F30830583161F129F12E9 |
:1005D0001B0880399B0007309C001C0883120D13F8 |
:1005E000603083168F008312A101A201A301A40130 |
:1005F00083161F129F121B0880399B0083121F1045 |
:100600009412831606118614061200308312940089 |
:10061000831694000108C7390838810083129001BD |
:100620000030F800920000308316920007309C00E2 |
:1006300005080330F700F70B1B2B1C0883120D1362 |
:1006400083169D0183126F280230AB00FA30B4008C |
:100650003320AB0B262BF030AB00A9200130B400C7 |
:10066000B50008212508AB003730AC004C292030FC |
:10067000B30019215830B30019213D30B3001921BE |
:10068000103084002208AC002108AB006E2120301D |
:10069000B30019215930B30019213D30B30019219D |
:1006A000103084002408AC002308AB006E210E300B |
:1006B000AB002B080C20AB0AF700B3001921133054 |
:1006C0002B02031D592B2808AF001830B000ED2174 |
:1006D0000330AC002030B3001921AC0B6A2B15306D |
:1006E000AD002D080C20AD0AF700B3001921193018 |
:1006F0002D02031D712B2908AF001830B000ED2129 |
:100700001B30AE002E080C20AE0AF700B3001921F2 |
:1007100020302E02031D822B2A08AF001830B000B3 |
:10072000ED211430B4003320EB30AB00A9203A2285 |
:100730007808A5002630AB002730AC002830AD008B |
:100740002930AE002A30AF00A42AFA012608A61BE1 |
:10075000FA03A1070318A20A7A08A207FA012708D8 |
:10076000A71BFA03A3070318A40A7A08A4072E2BD1 |
:02077000630024 |
:04400E00783FFF3FB9 |
:00000001FF |
;PIC16F88 |
/programy/C/PIC_C/mereni/PS2mys/PIC16F88/mys.LST |
---|
0,0 → 1,1177 |
CCS PCM C Compiler, Version 3.221, 27853 19-XII-05 23:22 |
Filename: D:\KAKLIK\programy\PIC_C\mereni\PS2mys\PIC16F88\mys.LST |
ROM used: 953 words (23%) |
Largest free fragment is 2048 |
RAM used: 19 (11%) at main() level |
33 (19%) worst case |
Stack: 5 locations |
* |
0000: MOVLW 00 |
0001: MOVWF 0A |
0002: GOTO 2E2 |
0003: NOP |
.................... #include "D:\KAKLIK\programy\PIC_C\mereni\PS2mys\PIC16F88\mys.h" |
.................... #include <16F88.h> |
.................... //////// Standard Header file for the PIC16F88 device //////////////// |
.................... #device PIC16F88 |
.................... #list |
.................... |
.................... #device adc=8 |
.................... #fuses NOWDT,INTRC_IO, NOPUT, MCLR, BROWNOUT, NOLVP, NOCPD, NOWRT, NODEBUG, NOPROTECT, FCMEN, IESO |
.................... #use delay(clock=4000000) |
* |
0033: MOVLW 34 |
0034: MOVWF 04 |
0035: MOVF 00,W |
0036: BTFSC 03.2 |
0037: GOTO 047 |
0038: MOVLW 01 |
0039: MOVWF 78 |
003A: CLRF 77 |
003B: DECFSZ 77,F |
003C: GOTO 03B |
003D: DECFSZ 78,F |
003E: GOTO 03A |
003F: MOVLW 4A |
0040: MOVWF 77 |
0041: DECFSZ 77,F |
0042: GOTO 041 |
0043: NOP |
0044: NOP |
0045: DECFSZ 00,F |
0046: GOTO 038 |
0047: RETLW 00 |
.................... |
.................... |
.................... |
.................... #define LCD_RS PIN_A0 // rizeni registru LCD displeje |
.................... #define LCD_E PIN_A1 // enable LCD displeje |
.................... #define LCD_DATA_LSB PIN_B0 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou) |
.................... #include "C:\library\CCS\lcd.c" |
.................... // LCD modul pro ovladani dvouradkoveho LCD modulu se standardnim Hitachi radicem |
.................... // (c)miho 2002,2005 |
.................... // |
.................... // Historie: |
.................... // |
.................... // 0.00 Uvodni verze se snadnou definici portu LCD displeje |
.................... // 0.01 Oprava portu (zapomenute stare identifikatory) |
.................... // 0.02 Doplnena moznost pripojeni datoveho portu LCD na libovolne porty |
.................... // 0.03 Doplnena procedura lcd_clr pro smazani displeje |
.................... // |
.................... // |
.................... // Funkce: |
.................... // |
.................... // lcd_init() inicializuje LCD displej a porty, nutno volat jako prvni |
.................... // |
.................... // lcd_putc(c) zapis snaku do lcd displeje, zpracovava nasledujici ridici znaky |
.................... // \f = \x0C - nova stranka - smazani displeje |
.................... // \n = \x0A - odradkovani (prechod na druhou radku) |
.................... // \b = \x08 - backspace - posunuti kurzoru o 1 pozici zpet |
.................... // \r = \x0D - goto home to position 1,1 |
.................... // \0 .. \7 - definovatelne znaky v pozicich 0 az 7 v CGRAM |
.................... // \20 .. \27 - alternativne zapsane znaky (oktalove) v pozicich 0 az 7 CGRAM |
.................... // Pozor na to, ze funkce printf konci tisk pokud narazi na \0 (konec retezce) |
.................... // |
.................... // lcd_gotoxy(x,y) presune kurzor na uvedenou adresu |
.................... // nekontroluje parametry |
.................... // |
.................... // lcd_cursor_on zapne kurzor |
.................... // lcd_cursor_off vypne kurzor |
.................... // |
.................... // lcd_clr smaze displej |
.................... // |
.................... // lcd_define_char(Index, Def) Makro, ktere definuje znaky od pozice Index obsahem definicniho |
.................... // retezce Def. Kazdych 8 znaku retezce Def definuje dalsi znak v CGRAM. |
.................... // Kapacita CGRAM je celkem 8 znaku s indexem 0 az 7. |
.................... // Na konci se provede lcd_gotoxy(1,1). |
.................... // Na konci teto knihovny je priklad pouziti definovanych znaku |
.................... // |
.................... // |
.................... // Definice portu: // Datovy port displeje pripojeny na 4 bity za sebou na jeden port |
.................... // |
.................... // #define LCD_RS PIN_B2 // rizeni registru LCD displeje |
.................... // #define LCD_E PIN_B1 // enable LCD displeje |
.................... // #define LCD_DATA_LSB PIN_C2 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou) |
.................... // |
.................... // |
.................... // Alternativni definice: // Datovy port displeje pripojeny na libovolne 4 bitove porty (vede na kod delsi asi o 25 slov) |
.................... // |
.................... // #define LCD_RS PIN_B2 // rizeni registru LCD displeje |
.................... // #define LCD_E PIN_B1 // enable LCD displeje |
.................... // #define LCD_D0 PIN_C2 // D0 - datove bity pripojene na libovolne porty |
.................... // #define LCD_D1 PIN_C3 // D1 |
.................... // #define LCD_D2 PIN_C4 // D2 |
.................... // #define LCD_D3 PIN_C5 // D3 |
.................... |
.................... |
.................... |
.................... |
.................... // Privatni sekce, cist jen v pripade, ze neco nefunguje |
.................... |
.................... |
.................... |
.................... |
.................... #ifdef LCD_DATA_LSB |
.................... // Generovane defince portu pro ucely teto knihovny aby kod generoval spravne IO operace a soucasne |
.................... // bylo mozne jednoduse deklarovat pripojene piny LCD displeje pri pouziti teto knihovny. Problem spociva |
.................... // v tom, ze se musi spravne ridit smery portu a soucasne datovy port zabira jen 4 bity ze zadaneho portu |
.................... // |
.................... #define LCD_SHIFT (LCD_DATA_LSB&7) // pocet bitu posuvu datoveho kanalu v datovem portu |
.................... #define LCD_PORT (LCD_DATA_LSB>>3) // adresa LCD datoveho portu |
.................... #define LCD_TRIS (LCD_PORT+0x80) // adresa prislusneho TRIS registru |
.................... #define LCD_MASK (0xF<<LCD_SHIFT) // maska platnych bitu |
.................... // |
.................... #if LCD_SHIFT>4 // kontrola mezi |
.................... #error LCD data port LSB bit not in range 0..4 |
.................... #endif |
.................... #endif |
.................... |
.................... |
.................... // Definice konstant pro LCD display |
.................... // |
.................... #define LCD_CURSOR_ON_ 0x0E // kurzor jako blikajici radka pod znakem |
.................... #define LCD_CURSOR_OFF_ 0x0C // zadny kurzor |
.................... #define LCD_LINE_2 0x40 // adresa 1. znaku 2. radky |
.................... |
.................... |
.................... // Definice rezimu LCD displeje |
.................... // |
.................... BYTE const LCD_INIT_STRING[4] = |
.................... { |
.................... 0x28, // intrfejs 4 bity, 2 radky, font 5x7 |
.................... LCD_CURSOR_OFF_, // display on, kurzor off, |
.................... 0x01, // clear displeje |
.................... 0x06 // inkrement pozice kurzoru (posun kurzoru doprava) |
.................... }; |
.................... |
.................... |
.................... // Odesle nibble do displeje (posle data a klikne signalem e) |
.................... // |
.................... void lcd_send_nibble( BYTE n ) |
.................... { |
.................... #ifdef LCD_DATA_LSB |
.................... // data jsou za sebou na 4 bitech jednoho portu |
.................... *LCD_PORT = (*LCD_PORT & ~LCD_MASK) | ((n << LCD_SHIFT) & LCD_MASK); // nastav datove bity portu a ostatni zachovej |
0048: MOVF 06,W |
0049: ANDLW F0 |
004A: MOVWF 3B |
004B: MOVF 3A,W |
004C: ANDLW 0F |
004D: IORWF 3B,W |
004E: MOVWF 06 |
.................... #else |
.................... // data jsou na libovolnych 4 bitech libovolnych portu |
.................... output_bit(LCD_D0,bit_test(n,0)); |
.................... output_bit(LCD_D1,bit_test(n,1)); |
.................... output_bit(LCD_D2,bit_test(n,2)); |
.................... output_bit(LCD_D3,bit_test(n,3)); |
.................... #endif |
.................... output_bit(LCD_E,1); // vzestupna hrana |
004F: BSF 05.1 |
0050: BSF 03.5 |
0051: BCF 05.1 |
.................... delay_us(1); // pockej alespon 450ns od e nebo alespon 195ns od dat |
0052: NOP |
.................... output_bit(LCD_E,0); // sestupna hrana (minimalni perioda e je 1us) |
0053: BCF 03.5 |
0054: BCF 05.1 |
0055: BSF 03.5 |
0056: BCF 05.1 |
.................... } |
0057: BCF 03.5 |
0058: RETLW 00 |
.................... |
.................... |
.................... // Odesle bajt do registru LCD |
.................... // |
.................... // Pokud je Adr=0 .. instrukcni registr |
.................... // Pokud je Adr=1 .. datovy registr |
.................... // |
.................... void lcd_send_byte( BOOLEAN Adr, BYTE n ) |
.................... { |
.................... output_bit(LCD_RS,Adr); // vyber registr |
0059: MOVF 38,F |
005A: BTFSS 03.2 |
005B: GOTO 05E |
005C: BCF 05.0 |
005D: GOTO 05F |
005E: BSF 05.0 |
005F: BSF 03.5 |
0060: BCF 05.0 |
.................... swap(n); |
0061: BCF 03.5 |
0062: SWAPF 39,F |
.................... lcd_send_nibble(n); // posli horni pulku bajtu |
0063: MOVF 39,W |
0064: MOVWF 3A |
0065: CALL 048 |
.................... swap(n); |
0066: SWAPF 39,F |
.................... lcd_send_nibble(n); // posli spodni pulku bajtu |
0067: MOVF 39,W |
0068: MOVWF 3A |
0069: CALL 048 |
.................... delay_us(40); // minimalni doba na provedeni prikazu |
006A: MOVLW 0D |
006B: MOVWF 77 |
006C: DECFSZ 77,F |
006D: GOTO 06C |
.................... } |
006E: RETLW 00 |
.................... |
.................... |
.................... // Provede inicializaci LCD displeje, smaze obsah a nastavi mod displeje |
.................... // |
.................... // Tato procedura se musi volat pred pouzitim ostatnich lcd_ procedur |
.................... // |
.................... void lcd_init() |
.................... { |
.................... |
.................... int i; // pocitadlo cyklu |
.................... |
.................... delay_ms(20); // spozdeni pro provedeni startu displeje po zapnuti napajeni |
006F: MOVLW 14 |
0070: MOVWF 34 |
0071: CALL 033 |
.................... |
.................... #ifdef LCD_DATA_LSB |
.................... // data jsou na 4 bitech za sebou, nastav smer pro vsechny dalsi prenosy |
.................... *LCD_TRIS = *LCD_TRIS & ~LCD_MASK; // nuluj odpovidajici bity tris registru datoveho portu LCD |
0072: MOVLW F0 |
0073: BSF 03.5 |
0074: ANDWF 06,F |
.................... #endif |
.................... |
.................... output_bit(LCD_RS,0); // nastav jako vystup a nastav klidovy stav |
0075: BCF 03.5 |
0076: BCF 05.0 |
0077: BSF 03.5 |
0078: BCF 05.0 |
.................... output_bit(LCD_E, 0); // nastav jako vystup a nastav klidovy stav |
0079: BCF 03.5 |
007A: BCF 05.1 |
007B: BSF 03.5 |
007C: BCF 05.1 |
.................... |
.................... for (i=0; i<3; i++) // nastav lcd do rezimu 8 bitu sbernice |
007D: BCF 03.5 |
007E: CLRF 2B |
007F: MOVF 2B,W |
0080: SUBLW 02 |
0081: BTFSS 03.0 |
0082: GOTO 08B |
.................... { |
.................... delay_ms(2); // muze byt rozdelany prenos dat (2x 4 bity) nebo pomaly povel |
0083: MOVLW 02 |
0084: MOVWF 34 |
0085: CALL 033 |
.................... lcd_send_nibble(3); // rezim 8 bitu |
0086: MOVLW 03 |
0087: MOVWF 3A |
0088: CALL 048 |
.................... } |
0089: INCF 2B,F |
008A: GOTO 07F |
.................... |
.................... delay_us(40); // cas na zpracovani |
008B: MOVLW 0D |
008C: MOVWF 77 |
008D: DECFSZ 77,F |
008E: GOTO 08D |
.................... lcd_send_nibble(2); // nastav rezim 4 bitu (plati od nasledujiciho prenosu) |
008F: MOVLW 02 |
0090: MOVWF 3A |
0091: CALL 048 |
.................... delay_us(40); // cas na zpracovani |
0092: MOVLW 0D |
0093: MOVWF 77 |
0094: DECFSZ 77,F |
0095: GOTO 094 |
.................... |
.................... for (i=0;i<3;i++) // proved inicializaci (nastaveni modu, smazani apod) |
0096: CLRF 2B |
0097: MOVF 2B,W |
0098: SUBLW 02 |
0099: BTFSS 03.0 |
009A: GOTO 0A7 |
.................... { |
.................... lcd_send_byte(0,LCD_INIT_STRING[i]); |
009B: MOVF 2B,W |
009C: CALL 004 |
009D: MOVWF 2C |
009E: CLRF 38 |
009F: MOVF 2C,W |
00A0: MOVWF 39 |
00A1: CALL 059 |
.................... delay_ms(2); |
00A2: MOVLW 02 |
00A3: MOVWF 34 |
00A4: CALL 033 |
.................... } |
00A5: INCF 2B,F |
00A6: GOTO 097 |
.................... } |
00A7: BCF 0A.3 |
00A8: GOTO 324 (RETURN) |
.................... |
.................... |
.................... // Proved presun kurzoru |
.................... // |
.................... // Pozice 1.1 je domu |
.................... // |
.................... void lcd_gotoxy( BYTE x, BYTE y) |
.................... { |
.................... |
.................... BYTE Adr; |
.................... |
.................... Adr=x-1; |
* |
0108: MOVLW 01 |
0109: SUBWF 34,W |
010A: MOVWF 36 |
.................... if(y==2) |
010B: MOVF 35,W |
010C: SUBLW 02 |
010D: BTFSS 03.2 |
010E: GOTO 111 |
.................... Adr+=LCD_LINE_2; |
010F: MOVLW 40 |
0110: ADDWF 36,F |
.................... |
.................... lcd_send_byte(0,0x80|Adr); |
0111: MOVF 36,W |
0112: IORLW 80 |
0113: MOVWF 37 |
0114: CLRF 38 |
0115: MOVF 37,W |
0116: MOVWF 39 |
0117: CALL 059 |
.................... } |
0118: RETLW 00 |
.................... |
.................... |
.................... // Zapis znaku na displej, zpracovani ridicich znaku |
.................... // |
.................... void lcd_putc( char c) |
.................... { |
.................... |
.................... switch (c) |
.................... { |
0119: MOVF 33,W |
011A: XORLW 0C |
011B: BTFSC 03.2 |
011C: GOTO 127 |
011D: XORLW 06 |
011E: BTFSC 03.2 |
011F: GOTO 12F |
0120: XORLW 07 |
0121: BTFSC 03.2 |
0122: GOTO 135 |
0123: XORLW 05 |
0124: BTFSC 03.2 |
0125: GOTO 13A |
0126: GOTO 13F |
.................... case '\f' : lcd_send_byte(0,1); // smaz displej |
0127: CLRF 38 |
0128: MOVLW 01 |
0129: MOVWF 39 |
012A: CALL 059 |
.................... delay_ms(2); |
012B: MOVLW 02 |
012C: MOVWF 34 |
012D: CALL 033 |
.................... break; |
012E: GOTO 14B |
.................... case '\n' : lcd_gotoxy(1,2); break; // presun se na 1. znak 2. radky |
012F: MOVLW 01 |
0130: MOVWF 34 |
0131: MOVLW 02 |
0132: MOVWF 35 |
0133: CALL 108 |
0134: GOTO 14B |
.................... case '\r' : lcd_gotoxy(1,1); break; // presun home |
0135: MOVLW 01 |
0136: MOVWF 34 |
0137: MOVWF 35 |
0138: CALL 108 |
0139: GOTO 14B |
.................... case '\b' : lcd_send_byte(0,0x10); break; // posun kurzor o 1 zpet |
013A: CLRF 38 |
013B: MOVLW 10 |
013C: MOVWF 39 |
013D: CALL 059 |
013E: GOTO 14B |
.................... default : if (c<0x20) c&=0x7; // preklopeni definovatelnych znaku na rozsah 0 az 0x1F |
013F: MOVF 33,W |
0140: SUBLW 1F |
0141: BTFSS 03.0 |
0142: GOTO 145 |
0143: MOVLW 07 |
0144: ANDWF 33,F |
.................... lcd_send_byte(1,c); break; // zapis znak |
0145: MOVLW 01 |
0146: MOVWF 38 |
0147: MOVF 33,W |
0148: MOVWF 39 |
0149: CALL 059 |
014A: GOTO 14B |
.................... } |
.................... } |
014B: RETLW 00 |
.................... |
.................... |
.................... // Zapni kurzor |
.................... // |
.................... void lcd_cursor_on() |
.................... { |
.................... lcd_send_byte(0,LCD_CURSOR_ON_); |
.................... } |
.................... |
.................... |
.................... // Vypni kurzor |
.................... // |
.................... void lcd_cursor_off() |
.................... { |
.................... lcd_send_byte(0,LCD_CURSOR_OFF_); |
.................... } |
.................... |
.................... |
.................... // Smaz displej |
.................... // |
.................... void lcd_clr() |
.................... { |
.................... lcd_putc('\f'); |
.................... } |
.................... |
.................... |
.................... // Definice vlastnich fontu |
.................... // |
.................... // Vlastnich definic muze byt jen 8 do pozic 0 az 7 pameti CGRAM radice lcd displeje |
.................... // Pro snadne definovani jsou pripraveny nasledujici definice a na konci souboru je uveden |
.................... // priklad pouziti definovanych znaku. |
.................... |
.................... |
.................... // Pomocna procedura pro posilani ridicich dat do radice displeje |
.................... // |
.................... void lcd_putc2(int Data) |
.................... { |
.................... lcd_send_byte(1,Data); |
.................... } |
.................... |
.................... |
.................... // Pomocne definice pro programovani obsahu CGRAM |
.................... // |
.................... #define lcd_define_start(Code) lcd_send_byte(0,0x40+(Code<<3)); delay_ms(2) |
.................... #define lcd_define_def(String) printf(lcd_putc2,String); |
.................... #define lcd_define_end() lcd_send_byte(0,3); delay_ms(2) |
.................... |
.................... |
.................... // Vlastni vykonne makro pro definovani fontu do pozice Index CGRAM s definicnim retezcem Def |
.................... // |
.................... #define lcd_define_char(Index, Def) lcd_define_start(Index); lcd_define_def(Def); lcd_define_end(); |
.................... |
.................... |
.................... // Pripravene definice fontu vybranych znaku |
.................... // V tabulce nesmi byt 00 (konec retezce v printf()), misto toho davame 80 |
.................... // |
.................... #define LCD_CHAR_BAT100 "\x0E\x1F\x1F\x1F\x1F\x1F\x1F\x1F" /* symbol plne baterie */ |
.................... #define LCD_CHAR_BAT50 "\x0E\x1F\x11\x11\x13\x17\x1F\x1F" /* symbol polovicni baterie */ |
.................... #define LCD_CHAR_BAT0 "\x0E\x1F\x11\x11\x11\x11\x11\x1F" /* symbol vybite baterie */ |
.................... #define LCD_CHAR_UP "\x80\x04\x0E\x15\x04\x04\x04\x80" /* symbol sipka nahoru */ |
.................... #define LCD_CHAR_DOWN "\x80\x04\x04\x04\x15\x0E\x04\x80" /* symbol Sipka dolu */ |
.................... #define LCD_CHAR_LUA "\x04\x0E\x11\x11\x1F\x11\x11\x80" /* A s carkou */ |
.................... #define LCD_CHAR_LLA "\x01\x02\x0E\x01\x1F\x11\x0F\x80" /* a s carkou */ |
.................... #define LCD_CHAR_HUC "\x0A\x0E\x11\x10\x10\x11\x0E\x80" /* C s hackem */ |
.................... #define LCD_CHAR_HLC "\x0A\x04\x0E\x10\x10\x11\x0E\x80" /* c s hackem */ |
.................... #define LCD_CHAR_HUD "\x0A\x1C\x12\x11\x11\x12\x1C\x80" /* D s hackem */ |
.................... #define LCD_CHAR_HLD "\x05\x03\x0D\x13\x11\x11\x0F\x80" /* d s hackem */ |
.................... #define LCD_CHAR_LUE "\x04\x1F\x10\x10\x1E\x10\x1F\x80" /* E s carkou */ |
.................... #define LCD_CHAR_LLE "\x01\x02\x0E\x11\x1F\x10\x0E\x80" /* e s carkou */ |
.................... #define LCD_CHAR_HUE "\x0A\x1F\x10\x1E\x10\x10\x1F\x80" /* E s hackem */ |
.................... #define LCD_CHAR_HLE "\x0A\x04\x0E\x11\x1F\x10\x0E\x80" /* e s hackem */ |
.................... #define LCD_CHAR_LUI "\x04\x0E\x04\x04\x04\x04\x0E\x80" /* I s carkou */ |
.................... #define LCD_CHAR_LLI "\x02\x04\x80\x0C\x04\x04\x0E\x80" /* i s carkou */ |
.................... #define LCD_CHAR_HUN "\x0A\x15\x11\x19\x15\x13\x11\x80" /* N s hackem */ |
.................... #define LCD_CHAR_HLN "\x0A\x04\x16\x19\x11\x11\x11\x80" /* n s hackem */ |
.................... #define LCD_CHAR_LUO "\x04\x0E\x11\x11\x11\x11\x0E\x80" /* O s carkou */ |
.................... #define LCD_CHAR_LLO "\x02\x04\x0E\x11\x11\x11\x0E\x80" /* o s carkou */ |
.................... #define LCD_CHAR_HUR "\x0A\x1E\x11\x1E\x14\x12\x11\x80" /* R s hackem */ |
.................... #define LCD_CHAR_HLR "\x0A\x04\x16\x19\x10\x10\x10\x80" /* r s hackem */ |
.................... #define LCD_CHAR_HUS "\x0A\x0F\x10\x0E\x01\x01\x1E\x80" /* S s hackem */ |
.................... #define LCD_CHAR_HLS "\x0A\x04\x0E\x10\x0E\x01\x1E\x80" /* s s hackem */ |
.................... #define LCD_CHAR_HUT "\x0A\x1F\x04\x04\x04\x04\x04\x80" /* T s hackem */ |
.................... #define LCD_CHAR_HLT "\x0A\x0C\x1C\x08\x08\x09\x06\x80" /* t s hackem */ |
.................... #define LCD_CHAR_LUU "\x02\x15\x11\x11\x11\x11\x0E\x80" /* U s carkou */ |
.................... #define LCD_CHAR_LLU "\x02\x04\x11\x11\x11\x13\x0D\x80" /* u s carkou */ |
.................... #define LCD_CHAR_CUU "\x06\x17\x11\x11\x11\x11\x0E\x80" /* U s krouzkem */ |
.................... #define LCD_CHAR_CLU "\x06\x06\x11\x11\x11\x11\x0E\x80" /* u s krouzkem */ |
.................... #define LCD_CHAR_LUY "\x02\x15\x11\x0A\x04\x04\x04\x80" /* Y s carkou */ |
.................... #define LCD_CHAR_LLY "\x02\x04\x11\x11\x0F\x01\x0E\x80" /* y s carkou */ |
.................... #define LCD_CHAR_HUZ "\x0A\x1F\x01\x02\x04\x08\x1F\x80" /* Z s hackem */ |
.................... #define LCD_CHAR_HLZ "\x0A\x04\x1F\x02\x04\x08\x1F\x80" /* z s hackem */ |
.................... |
.................... |
.................... // Priklad pouziti definovanych znaku |
.................... // |
.................... // |
.................... //void lcd_sample() |
.................... //{ |
.................... // lcd_define_char(0,LCD_CHAR_BAT50); // Priklad definice znaku baterie do pozice 0 |
.................... // lcd_define_char(2,LCD_CHAR_HLE LCD_CHAR_LUI); // Priklad definice znaku e s hackem a I s carkou od pozice 2 |
.................... // // vsimnete si, ze neni carka mezi retezci s definici (oba retezce definuji |
.................... // // jediny definicni retezec) |
.................... // printf(lcd_putc,"\fZnaky:\20\22\23"); // priklad vypisu znaku z pozice 0, 2 a 3 |
.................... // delay_ms(1000); |
.................... // lcd_define_char(0,LCD_CHAR_BAT0); // Predefinovani tvaru znaku v pozici 0 |
.................... // delay_ms(1000); |
.................... //} |
.................... |
.................... |
.................... #define TRIGGER_PIN PIN_B4 |
.................... |
.................... #DEFINE DATA PIN_B5 // musi byt definovan kanal DATA |
.................... #DEFINE CLK PIN_B6 // a taky hodiny CLK |
.................... #include "C:\library\kaklik\CCS\ps2.c" |
.................... //////////////////////////////////////////////////////////////////////////////// |
.................... // Modul pro komunikaci s PS/2 mysi |
.................... // |
.................... // #DEFINE DATA PIN_B0 // musi byt definovan kanal DATA |
.................... // #DEFINE CLK PIN_B1 // a taky hodiny CLK |
.................... // |
.................... //////////////////////////////////////////////////////////////////////////////// |
.................... |
.................... #define PRVNI 1000 // nastaveni prodlevy pred zacatkem vysilani bajtu |
.................... #define DRUHY 2 |
.................... #define TRETI DRUHY |
.................... |
.................... // prikazy |
.................... #define RESET 0xFF |
.................... #define ENABLE_DATA_REPORTING 0xF4 |
.................... #define READ_DATA 0xEB |
.................... #define STATUS_REQUEST 0xE9 |
.................... #define SET_REMOTE_MODE 0xF0 |
.................... #define SET_STREAM_MODE 0xEA |
.................... #define GET_DEVICE_ID 0xF2 |
.................... |
.................... |
.................... void send(byte command) |
.................... { |
.................... unsigned int8 n; |
.................... unsigned int8 parity=0; |
* |
00A9: CLRF 2D |
.................... |
.................... //Request-to-send |
.................... output_float(DATA); |
00AA: BSF 03.5 |
00AB: BSF 06.5 |
.................... output_low(CLK); |
00AC: BCF 06.6 |
00AD: BCF 03.5 |
00AE: BCF 06.6 |
.................... delay_us(100); |
00AF: MOVLW 21 |
00B0: MOVWF 77 |
00B1: DECFSZ 77,F |
00B2: GOTO 0B1 |
.................... // start bit |
.................... output_low(DATA); |
00B3: BSF 03.5 |
00B4: BCF 06.5 |
00B5: BCF 03.5 |
00B6: BCF 06.5 |
.................... while(input(CLK)); // ceka se na hodiny od mysi (mys zataha za hodiny) |
00B7: BSF 03.5 |
00B8: BSF 06.6 |
00B9: BCF 03.5 |
00BA: BTFSC 06.6 |
00BB: GOTO 0B7 |
.................... // 8 bitu |
.................... for(n=0; n<8; n++) |
00BC: CLRF 2C |
00BD: MOVF 2C,W |
00BE: SUBLW 07 |
00BF: BTFSS 03.0 |
00C0: GOTO 0DA |
.................... { |
.................... while(input(CLK)); |
00C1: BSF 03.5 |
00C2: BSF 06.6 |
00C3: BCF 03.5 |
00C4: BTFSC 06.6 |
00C5: GOTO 0C1 |
.................... output_bit(DATA, command & 1); |
00C6: BTFSC 2B.0 |
00C7: GOTO 0CA |
00C8: BCF 06.5 |
00C9: GOTO 0CB |
00CA: BSF 06.5 |
00CB: BSF 03.5 |
00CC: BCF 06.5 |
.................... parity += command & 1; |
00CD: BCF 03.5 |
00CE: MOVF 2B,W |
00CF: ANDLW 01 |
00D0: ADDWF 2D,F |
.................... command >>= 1; |
00D1: BCF 03.0 |
00D2: RRF 2B,F |
.................... while(!input(CLK)); |
00D3: BSF 03.5 |
00D4: BSF 06.6 |
00D5: BCF 03.5 |
00D6: BTFSS 06.6 |
00D7: GOTO 0D3 |
.................... }; |
00D8: INCF 2C,F |
00D9: GOTO 0BD |
.................... // parita |
.................... while(input(CLK)); |
00DA: BSF 03.5 |
00DB: BSF 06.6 |
00DC: BCF 03.5 |
00DD: BTFSC 06.6 |
00DE: GOTO 0DA |
.................... output_bit(DATA, ~parity & 1); |
00DF: MOVF 2D,W |
00E0: XORLW FF |
00E1: ANDLW 01 |
00E2: XORLW 00 |
00E3: BTFSS 03.2 |
00E4: GOTO 0E7 |
00E5: BCF 06.5 |
00E6: GOTO 0E8 |
00E7: BSF 06.5 |
00E8: BSF 03.5 |
00E9: BCF 06.5 |
.................... while(!input(CLK)); |
00EA: BSF 06.6 |
00EB: BCF 03.5 |
00EC: BTFSC 06.6 |
00ED: GOTO 0F0 |
00EE: BSF 03.5 |
00EF: GOTO 0EA |
.................... |
.................... // stop bit |
.................... output_float(DATA); |
00F0: BSF 03.5 |
00F1: BSF 06.5 |
.................... while(input(DATA)); // mys musi sama jeste jednou zatahat za hodiny a data |
00F2: BSF 06.5 |
00F3: BCF 03.5 |
00F4: BTFSS 06.5 |
00F5: GOTO 0F8 |
00F6: BSF 03.5 |
00F7: GOTO 0F2 |
.................... while(input(CLK)); |
00F8: BSF 03.5 |
00F9: BSF 06.6 |
00FA: BCF 03.5 |
00FB: BTFSC 06.6 |
00FC: GOTO 0F8 |
.................... |
.................... // ceka se az nastane klidovy stav |
.................... while(!input(CLK) || !input(DATA)); |
00FD: BSF 03.5 |
00FE: BSF 06.6 |
00FF: BCF 03.5 |
0100: BTFSS 06.6 |
0101: GOTO 0FD |
0102: BSF 03.5 |
0103: BSF 06.5 |
0104: BCF 03.5 |
0105: BTFSS 06.5 |
0106: GOTO 0FD |
.................... } |
0107: RETLW 00 |
.................... |
.................... |
.................... int8 read_byte() // dodelat paritu |
.................... { |
.................... unsigned int8 bajt; |
.................... unsigned int8 i; |
.................... int1 parity=0; |
* |
023A: BCF 35.0 |
.................... |
.................... // cekani na startbit |
.................... while(input(CLK) || input(DATA)); // oba signaly musi byt v 0 |
023B: BSF 03.5 |
023C: BSF 06.6 |
023D: BCF 03.5 |
023E: BTFSC 06.6 |
023F: GOTO 23B |
0240: BSF 03.5 |
0241: BSF 06.5 |
0242: BCF 03.5 |
0243: BTFSC 06.5 |
0244: GOTO 23B |
.................... while(!input(CLK)); // ceka se na nabeznou hranu hodin |
0245: BSF 03.5 |
0246: BSF 06.6 |
0247: BCF 03.5 |
0248: BTFSS 06.6 |
0249: GOTO 245 |
.................... |
.................... bajt = 0; |
024A: CLRF 33 |
.................... for(i=0; i<8; i++) |
024B: CLRF 34 |
024C: MOVF 34,W |
024D: SUBLW 07 |
024E: BTFSS 03.0 |
024F: GOTO 27C |
.................... { |
.................... while(input(CLK)); // ceka na nulu hodin |
0250: BSF 03.5 |
0251: BSF 06.6 |
0252: BCF 03.5 |
0253: BTFSC 06.6 |
0254: GOTO 250 |
.................... |
.................... bajt >>= 1; |
0255: BCF 03.0 |
0256: RRF 33,F |
.................... bajt |= input(DATA) << 7; // zapise se stav do promene |
0257: BSF 03.5 |
0258: BSF 06.5 |
0259: MOVLW 00 |
025A: BCF 03.5 |
025B: BTFSC 06.5 |
025C: MOVLW 01 |
025D: MOVWF 77 |
025E: RRF 77,W |
025F: CLRF 77 |
0260: BTFSC 03.0 |
0261: BSF 77.7 |
0262: MOVF 77,W |
0263: IORWF 33,F |
.................... parity^=input(DATA); |
0264: MOVLW 00 |
0265: BTFSC 35.0 |
0266: MOVLW 01 |
0267: MOVWF 36 |
0268: BSF 03.5 |
0269: BSF 06.5 |
026A: MOVLW 00 |
026B: BCF 03.5 |
026C: BTFSC 06.5 |
026D: MOVLW 01 |
026E: XORWF 36,W |
026F: MOVWF 78 |
0270: BTFSC 78.0 |
0271: GOTO 274 |
0272: BCF 35.0 |
0273: GOTO 275 |
0274: BSF 35.0 |
.................... |
.................... while(!input(CLK)); // ceka na jednicku hodin |
0275: BSF 03.5 |
0276: BSF 06.6 |
0277: BCF 03.5 |
0278: BTFSS 06.6 |
0279: GOTO 275 |
.................... }; |
027A: INCF 34,F |
027B: GOTO 24C |
.................... while(input(CLK)); |
027C: BSF 03.5 |
027D: BSF 06.6 |
027E: BCF 03.5 |
027F: BTFSC 06.6 |
0280: GOTO 27C |
.................... parity^=input(DATA); |
0281: MOVLW 00 |
0282: BTFSC 35.0 |
0283: MOVLW 01 |
0284: MOVWF 36 |
0285: BSF 03.5 |
0286: BSF 06.5 |
0287: MOVLW 00 |
0288: BCF 03.5 |
0289: BTFSC 06.5 |
028A: MOVLW 01 |
028B: XORWF 36,W |
028C: MOVWF 78 |
028D: BTFSC 78.0 |
028E: GOTO 291 |
028F: BCF 35.0 |
0290: GOTO 292 |
0291: BSF 35.0 |
.................... // if (parity) |
.................... while(!input(CLK)); // ceka na jednicku hodin |
0292: BSF 03.5 |
0293: BSF 06.6 |
0294: BCF 03.5 |
0295: BTFSS 06.6 |
0296: GOTO 292 |
.................... while(input(CLK)); |
0297: BSF 03.5 |
0298: BSF 06.6 |
0299: BCF 03.5 |
029A: BTFSC 06.6 |
029B: GOTO 297 |
.................... while(!input(CLK)); // ceka na jednicku hodin |
029C: BSF 03.5 |
029D: BSF 06.6 |
029E: BCF 03.5 |
029F: BTFSS 06.6 |
02A0: GOTO 29C |
.................... return (bajt); |
02A1: MOVF 33,W |
02A2: MOVWF 78 |
.................... } |
02A3: RETLW 00 |
.................... |
.................... |
.................... void read_standard_byte(signed int8 *x,*y,unsigned int8 *tl1,*tl2,*tl3) |
.................... { |
.................... unsigned int8 st,nd,rd; |
.................... |
.................... st = read_byte(); |
02A4: CALL 23A |
02A5: MOVF 78,W |
02A6: MOVWF 30 |
.................... nd = read_byte(); |
02A7: CALL 23A |
02A8: MOVF 78,W |
02A9: MOVWF 31 |
.................... rd = read_byte(); |
02AA: CALL 23A |
02AB: MOVF 78,W |
02AC: MOVWF 32 |
.................... |
.................... if ((st & 0b1000) == 0b1000) *x=-nd; else *x=nd; |
02AD: MOVF 30,W |
02AE: ANDLW 08 |
02AF: SUBLW 08 |
02B0: BTFSS 03.2 |
02B1: GOTO 2B8 |
02B2: MOVF 2B,W |
02B3: MOVWF 04 |
02B4: MOVF 31,W |
02B5: SUBLW 00 |
02B6: MOVWF 00 |
02B7: GOTO 2BC |
02B8: MOVF 2B,W |
02B9: MOVWF 04 |
02BA: MOVF 31,W |
02BB: MOVWF 00 |
.................... if ((st & 0b10000) == 0b10000) *y=-rd; else *y=rd; |
02BC: MOVF 30,W |
02BD: ANDLW 10 |
02BE: SUBLW 10 |
02BF: BTFSS 03.2 |
02C0: GOTO 2C7 |
02C1: MOVF 2C,W |
02C2: MOVWF 04 |
02C3: MOVF 32,W |
02C4: SUBLW 00 |
02C5: MOVWF 00 |
02C6: GOTO 2CB |
02C7: MOVF 2C,W |
02C8: MOVWF 04 |
02C9: MOVF 32,W |
02CA: MOVWF 00 |
.................... |
.................... *tl1=st & 1; |
02CB: MOVF 2D,W |
02CC: MOVWF 04 |
02CD: MOVF 30,W |
02CE: ANDLW 01 |
02CF: MOVWF 00 |
.................... *tl2=(st >> 1) & 1; |
02D0: MOVF 2E,W |
02D1: MOVWF 04 |
02D2: BCF 03.0 |
02D3: RRF 30,W |
02D4: ANDLW 01 |
02D5: MOVWF 00 |
.................... *tl3=(st >> 2) & 1; |
02D6: MOVF 2F,W |
02D7: MOVWF 04 |
02D8: RRF 30,W |
02D9: MOVWF 77 |
02DA: RRF 77,F |
02DB: MOVLW 3F |
02DC: ANDWF 77,F |
02DD: MOVF 77,W |
02DE: ANDLW 01 |
02DF: MOVWF 00 |
.................... } |
02E0: BCF 0A.3 |
02E1: GOTO 3A5 (RETURN) |
.................... void ps2break() |
.................... { |
.................... output_low(CLK); |
.................... } |
.................... void ps2enable() |
.................... { |
.................... output_float(CLK); |
.................... } |
.................... |
.................... |
.................... |
.................... |
.................... void trigger() |
.................... { |
.................... output_high(TRIGGER_PIN); |
.................... delay_us(50); |
.................... output_low(TRIGGER_PIN); |
.................... } |
.................... |
.................... void main() |
.................... { |
02E2: CLRF 04 |
02E3: MOVLW 1F |
02E4: ANDWF 03,F |
02E5: BSF 03.5 |
02E6: BCF 1F.4 |
02E7: BCF 1F.5 |
02E8: MOVF 1B,W |
02E9: ANDLW 80 |
02EA: MOVWF 1B |
02EB: MOVLW 07 |
02EC: MOVWF 1C |
02ED: MOVF 1C,W |
02EE: BCF 03.5 |
02EF: BCF 0D.6 |
02F0: MOVLW 60 |
02F1: BSF 03.5 |
02F2: MOVWF 0F |
.................... signed int16 x=0,y=0; |
02F3: BCF 03.5 |
02F4: CLRF 21 |
02F5: CLRF 22 |
02F6: CLRF 23 |
02F7: CLRF 24 |
.................... signed int8 hodnota,dx,dy; |
.................... unsigned int8 tl1,tl2,tl3; |
.................... |
.................... setup_adc_ports(NO_ANALOGS|VSS_VDD); |
02F8: BSF 03.5 |
02F9: BCF 1F.4 |
02FA: BCF 1F.5 |
02FB: MOVF 1B,W |
02FC: ANDLW 80 |
02FD: MOVWF 1B |
.................... setup_adc(ADC_OFF); |
02FE: BCF 03.5 |
02FF: BCF 1F.0 |
.................... setup_spi(FALSE); |
0300: BCF 14.5 |
0301: BSF 03.5 |
0302: BCF 06.2 |
0303: BSF 06.1 |
0304: BCF 06.4 |
0305: MOVLW 00 |
0306: BCF 03.5 |
0307: MOVWF 14 |
0308: BSF 03.5 |
0309: MOVWF 14 |
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
030A: MOVF 01,W |
030B: ANDLW C7 |
030C: IORLW 08 |
030D: MOVWF 01 |
.................... setup_timer_1(T1_DISABLED); |
030E: BCF 03.5 |
030F: CLRF 10 |
.................... setup_timer_2(T2_DISABLED,0,1); |
0310: MOVLW 00 |
0311: MOVWF 78 |
0312: MOVWF 12 |
0313: MOVLW 00 |
0314: BSF 03.5 |
0315: MOVWF 12 |
.................... setup_comparator(NC_NC_NC_NC); |
0316: MOVLW 07 |
0317: MOVWF 1C |
0318: MOVF 05,W |
0319: MOVLW 03 |
031A: MOVWF 77 |
031B: DECFSZ 77,F |
031C: GOTO 31B |
031D: MOVF 1C,W |
031E: BCF 03.5 |
031F: BCF 0D.6 |
.................... setup_vref(FALSE); |
0320: BSF 03.5 |
0321: CLRF 1D |
.................... |
.................... lcd_init(); |
0322: BCF 03.5 |
0323: GOTO 06F |
.................... Delay_ms(500); |
0324: MOVLW 02 |
0325: MOVWF 2B |
0326: MOVLW FA |
0327: MOVWF 34 |
0328: CALL 033 |
0329: DECFSZ 2B,F |
032A: GOTO 326 |
.................... |
.................... send(SET_REMOTE_MODE); |
032B: MOVLW F0 |
032C: MOVWF 2B |
032D: CALL 0A9 |
.................... |
.................... while (true) |
.................... { |
.................... LCD_gotoxy(1,1); |
032E: MOVLW 01 |
032F: MOVWF 34 |
0330: MOVWF 35 |
0331: CALL 108 |
.................... printf(lcd_putc,"%X X=%ld Y=%ld TL1=%U TL2=%U TL3=%U",hodnota, x,y,tl1,tl2,tl3); |
0332: MOVF 25,W |
0333: MOVWF 2B |
0334: MOVLW 37 |
0335: MOVWF 2C |
0336: GOTO 14C |
0337: MOVLW 20 |
0338: MOVWF 33 |
0339: CALL 119 |
033A: MOVLW 58 |
033B: MOVWF 33 |
033C: CALL 119 |
033D: MOVLW 3D |
033E: MOVWF 33 |
033F: CALL 119 |
0340: MOVLW 10 |
0341: MOVWF 04 |
0342: MOVF 22,W |
0343: MOVWF 2C |
0344: MOVF 21,W |
0345: MOVWF 2B |
0346: CALL 16E |
0347: MOVLW 20 |
0348: MOVWF 33 |
0349: CALL 119 |
034A: MOVLW 59 |
034B: MOVWF 33 |
034C: CALL 119 |
034D: MOVLW 3D |
034E: MOVWF 33 |
034F: CALL 119 |
0350: MOVLW 10 |
0351: MOVWF 04 |
0352: MOVF 24,W |
0353: MOVWF 2C |
0354: MOVF 23,W |
0355: MOVWF 2B |
0356: CALL 16E |
0357: MOVLW 0E |
0358: MOVWF 2B |
0359: MOVF 2B,W |
035A: CALL 00C |
035B: INCF 2B,F |
035C: MOVWF 77 |
035D: MOVWF 33 |
035E: CALL 119 |
035F: MOVLW 13 |
0360: SUBWF 2B,W |
0361: BTFSS 03.2 |
0362: GOTO 359 |
0363: MOVF 28,W |
0364: MOVWF 2F |
0365: MOVLW 18 |
0366: MOVWF 30 |
0367: CALL 1ED |
0368: MOVLW 03 |
0369: MOVWF 2C |
036A: MOVLW 20 |
036B: MOVWF 33 |
036C: CALL 119 |
036D: DECFSZ 2C,F |
036E: GOTO 36A |
036F: MOVLW 15 |
0370: MOVWF 2D |
0371: MOVF 2D,W |
0372: CALL 00C |
0373: INCF 2D,F |
0374: MOVWF 77 |
0375: MOVWF 33 |
0376: CALL 119 |
0377: MOVLW 19 |
0378: SUBWF 2D,W |
0379: BTFSS 03.2 |
037A: GOTO 371 |
037B: MOVF 29,W |
037C: MOVWF 2F |
037D: MOVLW 18 |
037E: MOVWF 30 |
037F: CALL 1ED |
0380: MOVLW 1B |
0381: MOVWF 2E |
0382: MOVF 2E,W |
0383: CALL 00C |
0384: INCF 2E,F |
0385: MOVWF 77 |
0386: MOVWF 33 |
0387: CALL 119 |
0388: MOVLW 20 |
0389: SUBWF 2E,W |
038A: BTFSS 03.2 |
038B: GOTO 382 |
038C: MOVF 2A,W |
038D: MOVWF 2F |
038E: MOVLW 18 |
038F: MOVWF 30 |
0390: CALL 1ED |
.................... delay_ms(20); |
0391: MOVLW 14 |
0392: MOVWF 34 |
0393: CALL 033 |
.................... send(READ_DATA); |
0394: MOVLW EB |
0395: MOVWF 2B |
0396: CALL 0A9 |
.................... hodnota=read_byte(); |
0397: CALL 23A |
0398: MOVF 78,W |
0399: MOVWF 25 |
.................... read_standard_byte(&dx,&dy,&tl1,&tl2,&tl3); |
039A: MOVLW 26 |
039B: MOVWF 2B |
039C: MOVLW 27 |
039D: MOVWF 2C |
039E: MOVLW 28 |
039F: MOVWF 2D |
03A0: MOVLW 29 |
03A1: MOVWF 2E |
03A2: MOVLW 2A |
03A3: MOVWF 2F |
03A4: GOTO 2A4 |
.................... x+=dx; |
03A5: CLRF 7A |
03A6: MOVF 26,W |
03A7: BTFSC 26.7 |
03A8: DECF 7A,F |
03A9: ADDWF 21,F |
03AA: BTFSC 03.0 |
03AB: INCF 22,F |
03AC: MOVF 7A,W |
03AD: ADDWF 22,F |
.................... y+=dy; |
03AE: CLRF 7A |
03AF: MOVF 27,W |
03B0: BTFSC 27.7 |
03B1: DECF 7A,F |
03B2: ADDWF 23,F |
03B3: BTFSC 03.0 |
03B4: INCF 24,F |
03B5: MOVF 7A,W |
03B6: ADDWF 24,F |
.................... } |
03B7: GOTO 32E |
.................... } |
.................... |
03B8: SLEEP |
Configuration Fuses: |
Word 1: 3F78 NOWDT NOPUT MCLR BROWNOUT NOLVP NOCPD NOWRT NODEBUG CCPB0 NOPROTECT INTRC_IO |
Word 2: 3FFF FCMEN IESO |
/programy/C/PIC_C/mereni/PS2mys/PIC16F88/mys.PJT |
---|
0,0 → 1,39 |
[PROJECT] |
Target=mys.HEX |
Development_Mode= |
Processor=0x688F |
ToolSuite=CCS |
[Directories] |
Include=C:\Program Files\PICC\devices\;C:\Program Files\PICC\dr |
Library= |
LinkerScript= |
[Target Data] |
FileList=mys.c; |
BuildTool=C-COMPILER |
OptionString=+FM |
AdditionalOptionString= |
BuildRequired=1 |
[mys.c] |
Type=4 |
Path= |
FileList= |
BuildTool= |
OptionString= |
AdditionalOptionString= |
[mru-list] |
1=mys.c |
[Windows] |
0=0000 mys.c 0 0 796 451 3 0 |
[Opened Files] |
1=D:\KAKLIK\programy\PIC_C\mereni\PS2mys\PIC16F88\mys.c |
2=C:\library\CCS\lcd.c |
3=D:\KAKLIK\programy\PIC_C\mereni\PS2mys\PIC16F88\mys.h |
4=C:\Program Files\PICC\devices\16F88.h |
5=C:\library\kaklik\CCS\ps2.c |
6= |
/programy/C/PIC_C/mereni/PS2mys/PIC16F88/mys.SYM |
---|
0,0 → 1,109 |
015-016 CCP_1 |
015 CCP_1_LOW |
016 CCP_1_HIGH |
021-022 main.x |
023-024 main.y |
025 main.hodnota |
026 main.dx |
027 main.dy |
028 main.tl1 |
029 main.tl2 |
02A main.tl3 |
02B lcd_init.i |
02B send.command |
02B-02C @PRINTF_LD_278.P1 |
02B @PRINTF_X_278.P2 |
02B read_standard_byte.x |
02B main.@SCRATCH |
02C send.n |
02C @PRINTF_X_278.P1 |
02C read_standard_byte.y |
02C lcd_init.@SCRATCH |
02C main.@SCRATCH |
02D send.parity |
02D read_standard_byte.tl1 |
02D main.@SCRATCH |
02D @PRINTF_LD_278.@SCRATCH |
02E read_standard_byte.tl2 |
02E send.@SCRATCH |
02E main.@SCRATCH |
02E @PRINTF_LD_278.@SCRATCH |
02F @PRINTF_U_278.P1 |
02F read_standard_byte.tl3 |
02F @PRINTF_LD_278.@SCRATCH |
030 read_standard_byte.st |
030 @PRINTF_U_278.P1 |
030 @PRINTF_LD_278.@SCRATCH |
031 @DIV88.P1 |
031 read_standard_byte.nd |
031 @PRINTF_LD_278.@SCRATCH |
032 @DIV88.P1 |
032 read_standard_byte.rd |
032 @PRINTF_LD_278.@SCRATCH |
033 lcd_putc.c |
033 read_byte.bajt |
033 read_standard_byte.@SCRATCH |
033 @DIV88.@SCRATCH |
034 read_byte.i |
034 lcd_gotoxy.x |
034 @delay_ms1.P1 |
034 read_standard_byte.@SCRATCH |
035 lcd_gotoxy.y |
035.0 read_byte.parity |
036 lcd_gotoxy.Adr |
036 read_byte.@SCRATCH |
037 lcd_gotoxy.@SCRATCH |
038 lcd_send_byte.Adr |
039 lcd_send_byte.n |
03A lcd_send_nibble.n |
03B lcd_send_nibble.@SCRATCH |
03C lcd_send_nibble.@SCRATCH |
077 @SCRATCH |
078 @SCRATCH |
078 _RETURN_ |
079 @SCRATCH |
07A @SCRATCH |
07B @SCRATCH |
09C.6 C1OUT |
09C.7 C2OUT |
0033 @delay_ms1 |
0004 @const27 |
0048 lcd_send_nibble |
0059 lcd_send_byte |
006F lcd_init |
0108 lcd_gotoxy |
0119 lcd_putc |
00A9 send |
023A read_byte |
02A4 read_standard_byte |
02E2 main |
000C @const10225 |
014C @PRINTF_X_278 |
016E @PRINTF_LD_278 |
01D8 @DIV88 |
01ED @PRINTF_U_278 |
02E2 @cinit |
Project Files: |
D:\KAKLIK\programy\PIC_C\mereni\PS2mys\PIC16F88\mys.c |
D:\KAKLIK\programy\PIC_C\mereni\PS2mys\PIC16F88\mys.h |
C:\Program Files\PICC\devices\16F88.h |
C:\library\CCS\lcd.c |
C:\library\kaklik\CCS\ps2.c |
Compiler Settings: |
Processor: PIC16F88 |
Pointer Size: 8 |
ADC Range: 0-255 |
Opt Level: 9 |
Short,Int,Long: 1,8,16 |
Output Files: |
Errors: D:\KAKLIK\programy\PIC_C\mereni\PS2mys\PIC16F88\mys.err |
INHX8: D:\KAKLIK\programy\PIC_C\mereni\PS2mys\PIC16F88\mys.HEX |
Symbols: D:\KAKLIK\programy\PIC_C\mereni\PS2mys\PIC16F88\mys.SYM |
List: D:\KAKLIK\programy\PIC_C\mereni\PS2mys\PIC16F88\mys.LST |
Debug/COFF: D:\KAKLIK\programy\PIC_C\mereni\PS2mys\PIC16F88\mys.cof |
Call Tree: D:\KAKLIK\programy\PIC_C\mereni\PS2mys\PIC16F88\mys.tre |
Statistics: D:\KAKLIK\programy\PIC_C\mereni\PS2mys\PIC16F88\mys.sta |
/programy/C/PIC_C/mereni/PS2mys/PIC16F88/mys.c |
---|
0,0 → 1,58 |
#include "D:\KAKLIK\programy\PIC_C\mereni\PS2mys\PIC16F88\mys.h" |
#define LCD_RS PIN_A0 // rizeni registru LCD displeje |
#define LCD_E PIN_A1 // enable LCD displeje |
#define LCD_DATA_LSB PIN_B0 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou) |
#include "C:\library\CCS\lcd.c" // modul pro ovladani LCD |
#define TRIGGER_PIN PIN_B4 |
#DEFINE DATA PIN_B5 // drat DATA |
#DEFINE CLK PIN_B6 // hodiny CLK |
#include "C:\library\kaklik\CCS\ps2.c" // modul pro SW ovladani PS2 |
void trigger() |
{ |
output_high(TRIGGER_PIN); |
delay_us(50); |
output_low(TRIGGER_PIN); |
} |
void main() |
{ |
signed int16 x=0,y=0; |
signed int8 hodnota,dx,dy; |
unsigned int8 tl1,tl2,tl3; |
setup_adc_ports(NO_ANALOGS|VSS_VDD); |
setup_adc(ADC_OFF); |
setup_spi(FALSE); |
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
setup_timer_1(T1_DISABLED); |
setup_timer_2(T2_DISABLED,0,1); |
setup_comparator(NC_NC_NC_NC); |
setup_vref(FALSE); |
lcd_init(); |
Delay_ms(200); |
ps2send(RESET); // resetuje mys |
read_byte(); // prijme 0xFA |
read_byte(); // 0xAA self-test passed |
read_byte(); // mouse ID |
Delay_ms(200); |
ps2send(SET_REMOTE_MODE); |
while (true) |
{ |
LCD_gotoxy(1,1); |
printf(lcd_putc,"%X X=%ld Y=%ld TL1=%U TL2=%U TL3=%U",hodnota, x,y,tl1,tl2,tl3); |
delay_ms(20); |
send(READ_DATA); |
hodnota=read_byte(); |
read_standard_byte(&dx,&dy,&tl1,&tl2,&tl3); |
x+=dx; |
y+=dy; |
} |
} |
/programy/C/PIC_C/mereni/PS2mys/PIC16F88/mys.cof |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/mereni/PS2mys/PIC16F88/mys.err |
---|
0,0 → 1,0 |
No Errors |
/programy/C/PIC_C/mereni/PS2mys/PIC16F88/mys.h |
---|
0,0 → 1,5 |
#include <16F88.h> |
#device adc=8 |
#fuses NOWDT,INTRC_IO, NOPUT, MCLR, BROWNOUT, NOLVP, NOCPD, NOWRT, NODEBUG, NOPROTECT, FCMEN, IESO |
#use delay(clock=4000000) |
/programy/C/PIC_C/mereni/PS2mys/PIC16F88/mys.sta |
---|
0,0 → 1,45 |
ROM used: 953 (23%) |
953 (23%) including unused fragments |
1 Average locations per line |
7 Average locations per statement |
RAM used: 19 (11%) at main() level |
33 (19%) worst case |
Lines Stmts % Files |
----- ----- --- ----- |
55 24 17 D:\KAKLIK\programy\PIC_C\mereni\PS2mys\PIC16F88\mys.c |
6 0 0 D:\KAKLIK\programy\PIC_C\mereni\PS2mys\PIC16F88\mys.h |
275 0 0 C:\Program Files\PICC\devices\16F88.h |
312 47 29 C:\library\CCS\lcd.c |
113 67 32 C:\library\kaklik\CCS\ps2.c |
----- ----- |
1522 276 Total |
Page ROM % RAM Functions: |
---- --- --- --- ---------- |
0 21 2 1 @delay_ms1 |
0 8 1 0 @const27 |
0 17 2 3 lcd_send_nibble |
0 22 2 2 lcd_send_byte |
0 58 6 2 lcd_init |
0 17 2 4 lcd_gotoxy |
0 51 5 1 lcd_putc |
0 95 10 4 send |
0 106 11 4 read_byte |
0 62 7 10 read_standard_byte |
0 215 23 14 main |
0 39 4 0 @const10225 |
0 34 4 2 @PRINTF_X_278 |
0 106 11 8 @PRINTF_LD_278 |
0 21 2 3 @DIV88 |
0 77 8 2 @PRINTF_U_278 |
Segment Used Free |
--------- ---- ---- |
00000-00003 4 0 |
00004-007FF 949 1095 |
00800-00FFF 0 2048 |
/programy/C/PIC_C/mereni/PS2mys/PIC16F88/mys.tre |
---|
0,0 → 1,668 |
ÀÄmys |
ÀÄmain 0/215 Ram=14 |
ÃÄ??0?? |
ÃÄlcd_init 0/58 Ram=2 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄ@const27 0/8 Ram=0 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄ@delay_ms1 0/21 Ram=1 |
ÃÄ@delay_ms1 0/21 Ram=1 |
ÃÄsend 0/95 Ram=4 |
ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_nibble 0/17 Ram=3 |
ÃÄ@PRINTF_X_278 0/34 Ram=2 |
³ ÃÄlcd_putc 0/51 Ram=1 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_putc 0/51 Ram=1 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_nibble 0/17 Ram=3 |
ÃÄlcd_putc 0/51 Ram=1 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_nibble 0/17 Ram=3 |
ÃÄlcd_putc 0/51 Ram=1 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_nibble 0/17 Ram=3 |
ÃÄlcd_putc 0/51 Ram=1 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_nibble 0/17 Ram=3 |
ÃÄ@PRINTF_LD_278 0/106 Ram=8 |
³ ÃÄlcd_putc 0/51 Ram=1 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_putc 0/51 Ram=1 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_putc 0/51 Ram=1 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_nibble 0/17 Ram=3 |
ÃÄlcd_putc 0/51 Ram=1 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_nibble 0/17 Ram=3 |
ÃÄlcd_putc 0/51 Ram=1 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_nibble 0/17 Ram=3 |
ÃÄlcd_putc 0/51 Ram=1 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_nibble 0/17 Ram=3 |
ÃÄ@PRINTF_LD_278 0/106 Ram=8 |
³ ÃÄlcd_putc 0/51 Ram=1 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_putc 0/51 Ram=1 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_putc 0/51 Ram=1 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_nibble 0/17 Ram=3 |
ÃÄ@const10225 0/39 Ram=0 |
ÃÄlcd_putc 0/51 Ram=1 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_nibble 0/17 Ram=3 |
ÃÄ@PRINTF_U_278 0/77 Ram=2 |
³ ÃÄ@DIV88 0/21 Ram=3 |
³ ÃÄlcd_putc 0/51 Ram=1 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_putc 0/51 Ram=1 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_putc 0/51 Ram=1 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄ@DIV88 0/21 Ram=3 |
³ ÃÄlcd_putc 0/51 Ram=1 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_putc 0/51 Ram=1 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_nibble 0/17 Ram=3 |
ÃÄlcd_putc 0/51 Ram=1 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_nibble 0/17 Ram=3 |
ÃÄ@const10225 0/39 Ram=0 |
ÃÄlcd_putc 0/51 Ram=1 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_nibble 0/17 Ram=3 |
ÃÄ@PRINTF_U_278 0/77 Ram=2 |
³ ÃÄ@DIV88 0/21 Ram=3 |
³ ÃÄlcd_putc 0/51 Ram=1 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_putc 0/51 Ram=1 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_putc 0/51 Ram=1 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄ@DIV88 0/21 Ram=3 |
³ ÃÄlcd_putc 0/51 Ram=1 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_putc 0/51 Ram=1 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_nibble 0/17 Ram=3 |
ÃÄ@const10225 0/39 Ram=0 |
ÃÄlcd_putc 0/51 Ram=1 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_nibble 0/17 Ram=3 |
ÃÄ@PRINTF_U_278 0/77 Ram=2 |
³ ÃÄ@DIV88 0/21 Ram=3 |
³ ÃÄlcd_putc 0/51 Ram=1 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_putc 0/51 Ram=1 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_putc 0/51 Ram=1 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄ@DIV88 0/21 Ram=3 |
³ ÃÄlcd_putc 0/51 Ram=1 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_putc 0/51 Ram=1 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_nibble 0/17 Ram=3 |
ÃÄ@delay_ms1 0/21 Ram=1 |
ÃÄsend 0/95 Ram=4 |
ÃÄread_byte 0/106 Ram=4 |
ÀÄread_standard_byte 0/62 Ram=10 |
ÃÄread_byte 0/106 Ram=4 |
ÃÄread_byte 0/106 Ram=4 |
ÀÄread_byte 0/106 Ram=4 |
/programy/C/PIC_C/mereni/geiger/bez_GPS/geiger.BAK |
---|
0,0 → 1,19 |
#include <16F88.h> |
#device adc=8 |
#FUSES NOWDT //No Watch Dog Timer |
#FUSES HS //High speed Osc (> 4mhz) |
#FUSES NOPUT //No Power Up Timer |
#FUSES MCLR //Master Clear pin enabled |
#FUSES NOBROWNOUT //No brownout reset |
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O |
#FUSES NOCPD //No EE protection |
#FUSES NOWRT //Program memory not write protected |
#FUSES NODEBUG //No Debug mode for ICD |
#FUSES NOPROTECT //Code not protected from reading |
#FUSES NOFCMEN //Fail-safe clock monitor disabled |
#FUSES NOIESO //Internal External Switch Over mode enabled |
#use delay(clock=20000000) |
#use rs232(baud=9600,parity=N,xmit=PIN_B3,rcv=PIN_B5,bits=8) |
/programy/C/PIC_C/mereni/geiger/bez_GPS/geiger.PJT |
---|
0,0 → 1,40 |
[PROJECT] |
Target=geiger.HEX |
Development_Mode=2 |
Processor=0x688F |
ToolSuite=CCS |
[Directories] |
Include= |
Library= |
LinkerScript= |
[Target Data] |
FileList=D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.c |
BuildTool=C-COMPILER |
OptionString=+FM |
AdditionalOptionString= |
BuildRequired=1 |
[geiger.c] |
Type=4 |
Path= |
FileList= |
BuildTool= |
OptionString= |
AdditionalOptionString= |
[mru-list] |
1=D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.c |
[Windows] |
0=0000 D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.c 0 0 796 451 3 0 |
[Opened Files] |
1=D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.c |
2=D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.h |
3=C:\Program Files\PICC\devices\16F88.h |
4= |
[Units] |
Count=1 |
1=D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.c (main) |
/programy/C/PIC_C/mereni/geiger/bez_GPS/geiger.c |
---|
0,0 → 1,27 |
#include "D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.h" |
void main() |
{ |
unsigned int16 n; |
setup_adc_ports(NO_ANALOGS|VSS_VDD); |
setup_adc(ADC_OFF); |
setup_spi(FALSE); |
setup_timer_0(RTCC_EXT_H_TO_L|RTCC_DIV_1); |
setup_timer_1(T1_DISABLED|T1_DIV_BY_1); |
setup_timer_2(T2_DISABLED,0,1); |
setup_ccp1(CCP_OFF); |
setup_comparator(A0_A2_A1_A2_OUT_ON_A3_A4); |
setup_vref(VREF_LOW|1|VREF_A2); |
setup_oscillator(False); |
n=0; |
set_timer0(0); |
While(true) |
{ |
printf("%Lu0, %u\n\r", n++, get_timer0()); |
set_timer0(0); |
Delay_ms(10000); |
} |
} |
/programy/C/PIC_C/mereni/geiger/bez_GPS/geiger.cof |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/mereni/geiger/bez_GPS/geiger.err |
---|
0,0 → 1,2 |
No Errors |
0 Errors, 0 Warnings. |
/programy/C/PIC_C/mereni/geiger/bez_GPS/geiger.h |
---|
0,0 → 1,19 |
#include <16F88.h> |
#device adc=8 |
#FUSES NOWDT //No Watch Dog Timer |
#FUSES HS //High speed Osc (> 4mhz) |
#FUSES NOPUT //No Power Up Timer |
#FUSES MCLR //Master Clear pin enabled |
#FUSES NOBROWNOUT //No brownout reset |
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O |
#FUSES NOCPD //No EE protection |
#FUSES NOWRT //Program memory not write protected |
#FUSES NODEBUG //No Debug mode for ICD |
#FUSES NOPROTECT //Code not protected from reading |
#FUSES NOFCMEN //Fail-safe clock monitor disabled |
#FUSES NOIESO //Internal External Switch Over mode disabled |
#use delay(clock=20000000) |
#use rs232(baud=9600,parity=N,xmit=PIN_B3,rcv=PIN_B5,bits=8) |
/programy/C/PIC_C/mereni/geiger/bez_GPS/geiger.hex |
---|
0,0 → 1,47 |
:1000000000308A00E12800008316861183128611D1 |
:100010000830F800000000000000F8171E28F81350 |
:10002000AE0C03188615031C861178171E2878134A |
:10003000F80B10280000000000008615A73084008F |
:10004000840B202800000000F81B0F28781B1728BD |
:1000500000340408AD00270EF038A900A907E23EDD |
:10006000AA00323EAC0027080F39AA07AA07AC073E |
:10007000E93EAB00AB07AB07260E0F39AB07AC0769 |
:10008000AB0DAC0DAC09AC0D26080F39AC07A90DB2 |
:100090000730A8000A30AC07AB03031C4B28AB07A2 |
:1000A000AA03031C4F28AA07A903031C5328A90766 |
:1000B000A803031C57282830840007302D052D1372 |
:1000C00084072C30040203192D170008F700031DC4 |
:1000D00071282D1B71282D1A7D28AD19712820300B |
:1000E0007428AD152D123030F707A7010408A600BB |
:1000F0007708AE00042026088400840A2D1F61289A |
:100100008A113C292908F801280203188A2828089E |
:10011000F7009628F7010830AA00A80DF70D290866 |
:1001200077020318F700F80DAA0B8D280034780821 |
:100130002608A8006430A90082207708A600780865 |
:100140003030031DAA28A71CB128A719B128271AE7 |
:100150002030AD28A71127122714F8077808AE0021 |
:1001600004202608A8000A30A90082207708A600EB |
:1001700078083030031DC228A719C628271CC628B6 |
:10018000271A2030F8077808AE0004203030A60780 |
:100190002608AE0004208A114A2924308400000871 |
:1001A0000319DF280630F800F701F70BD528F80B04 |
:1001B000D4287B30F700F70BDB28800BD2288A117C |
:1001C000562984011F3083058316861183128615F4 |
:1001D00083161F129F121B0880399B0007309C005A |
:1001E0001F129F121B0880399B0083121F1094124C |
:1001F00083160611861406120030831294008316AB |
:1002000094000108C739383881008312900100300A |
:10021000F8009200003083169200061483129701B2 |
:100220009701063083169C0005080738E7398500DA |
:100230001030F700F70B1A2900001C0883120D1369 |
:10024000E13083169D0005158F010F088312A2016E |
:10025000A10181012208FA002108A10A0319A20ABA |
:10026000A3007A08A4000108A50010308400240827 |
:10027000A7002308A60029283030AE0004202C3027 |
:10028000AE0004202030AE0004202508A6001B305C |
:10029000A70097280A30AE0004200D30AE000420DD |
:1002A00081012830A300FA30A400CD28A30B5329E4 |
:0402B0002A29630094 |
:04400E002A3FFC3F0A |
:00000001FF |
;PIC16F88 |
/programy/C/PIC_C/mereni/geiger/bez_GPS/geiger.lst |
---|
0,0 → 1,250 |
CCS PCM C Compiler, Version 3.245, 27853 10-VI-06 10:23 |
Filename: D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.lst |
ROM used: 346 words (8%) |
Largest free fragment is 2048 |
RAM used: 10 (6%) at main() level |
19 (11%) worst case |
Stack: 2 locations |
* |
0000: MOVLW 00 |
0001: MOVWF 0A |
0002: GOTO 0E1 |
0003: NOP |
.................... #include "D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.h" |
.................... #include <16F88.h> |
.................... //////// Standard Header file for the PIC16F88 device //////////////// |
.................... #device PIC16F88 |
.................... #list |
.................... |
.................... #device adc=8 |
.................... |
.................... #FUSES NOWDT //No Watch Dog Timer |
.................... #FUSES HS //High speed Osc (> 4mhz) |
.................... #FUSES NOPUT //No Power Up Timer |
.................... #FUSES MCLR //Master Clear pin enabled |
.................... #FUSES NOBROWNOUT //No brownout reset |
.................... #FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O |
.................... #FUSES NOCPD //No EE protection |
.................... #FUSES NOWRT //Program memory not write protected |
.................... #FUSES NODEBUG //No Debug mode for ICD |
.................... #FUSES NOPROTECT //Code not protected from reading |
.................... #FUSES NOFCMEN //Fail-safe clock monitor disabled |
.................... #FUSES NOIESO //Internal External Switch Over mode disabled |
.................... |
.................... #use delay(clock=20000000) |
00CD: MOVLW 24 |
00CE: MOVWF 04 |
00CF: MOVF 00,W |
00D0: BTFSC 03.2 |
00D1: GOTO 0DF |
00D2: MOVLW 06 |
00D3: MOVWF 78 |
00D4: CLRF 77 |
00D5: DECFSZ 77,F |
00D6: GOTO 0D5 |
00D7: DECFSZ 78,F |
00D8: GOTO 0D4 |
00D9: MOVLW 7B |
00DA: MOVWF 77 |
00DB: DECFSZ 77,F |
00DC: GOTO 0DB |
00DD: DECFSZ 00,F |
00DE: GOTO 0D2 |
00DF: BCF 0A.3 |
00E0: GOTO 156 (RETURN) |
.................... #use rs232(baud=9600,parity=N,xmit=PIN_B3,rcv=PIN_B5,bits=8) |
* |
0004: BSF 03.5 |
0005: BCF 06.3 |
0006: BCF 03.5 |
0007: BCF 06.3 |
0008: MOVLW 08 |
0009: MOVWF 78 |
000A: NOP |
000B: NOP |
000C: NOP |
000D: BSF 78.7 |
000E: GOTO 01E |
000F: BCF 78.7 |
0010: RRF 2E,F |
0011: BTFSC 03.0 |
0012: BSF 06.3 |
0013: BTFSS 03.0 |
0014: BCF 06.3 |
0015: BSF 78.6 |
0016: GOTO 01E |
0017: BCF 78.6 |
0018: DECFSZ 78,F |
0019: GOTO 010 |
001A: NOP |
001B: NOP |
001C: NOP |
001D: BSF 06.3 |
001E: MOVLW A7 |
001F: MOVWF 04 |
0020: DECFSZ 04,F |
0021: GOTO 020 |
0022: NOP |
0023: NOP |
0024: BTFSC 78.7 |
0025: GOTO 00F |
0026: BTFSC 78.6 |
0027: GOTO 017 |
0028: RETLW 00 |
.................... |
.................... |
.................... |
.................... |
.................... void main() |
.................... { |
* |
00E1: CLRF 04 |
00E2: MOVLW 1F |
00E3: ANDWF 03,F |
00E4: BSF 03.5 |
00E5: BCF 06.3 |
00E6: BCF 03.5 |
00E7: BSF 06.3 |
00E8: BSF 03.5 |
00E9: BCF 1F.4 |
00EA: BCF 1F.5 |
00EB: MOVF 1B,W |
00EC: ANDLW 80 |
00ED: MOVWF 1B |
00EE: MOVLW 07 |
00EF: MOVWF 1C |
.................... unsigned int16 n; |
.................... |
.................... setup_adc_ports(NO_ANALOGS|VSS_VDD); |
00F0: BCF 1F.4 |
00F1: BCF 1F.5 |
00F2: MOVF 1B,W |
00F3: ANDLW 80 |
00F4: MOVWF 1B |
.................... setup_adc(ADC_OFF); |
00F5: BCF 03.5 |
00F6: BCF 1F.0 |
.................... setup_spi(FALSE); |
00F7: BCF 14.5 |
00F8: BSF 03.5 |
00F9: BCF 06.2 |
00FA: BSF 06.1 |
00FB: BCF 06.4 |
00FC: MOVLW 00 |
00FD: BCF 03.5 |
00FE: MOVWF 14 |
00FF: BSF 03.5 |
0100: MOVWF 14 |
.................... setup_timer_0(RTCC_EXT_H_TO_L|RTCC_DIV_1); |
0101: MOVF 01,W |
0102: ANDLW C7 |
0103: IORLW 38 |
0104: MOVWF 01 |
.................... setup_timer_1(T1_DISABLED|T1_DIV_BY_1); |
0105: BCF 03.5 |
0106: CLRF 10 |
.................... setup_timer_2(T2_DISABLED,0,1); |
0107: MOVLW 00 |
0108: MOVWF 78 |
0109: MOVWF 12 |
010A: MOVLW 00 |
010B: BSF 03.5 |
010C: MOVWF 12 |
.................... setup_ccp1(CCP_OFF); |
010D: BSF 06.0 |
010E: BCF 03.5 |
010F: CLRF 17 |
0110: CLRF 17 |
.................... setup_comparator(A0_A2_A1_A2_OUT_ON_A3_A4); |
0111: MOVLW 06 |
0112: BSF 03.5 |
0113: MOVWF 1C |
0114: MOVF 05,W |
0115: IORLW 07 |
0116: ANDLW E7 |
0117: MOVWF 05 |
0118: MOVLW 10 |
0119: MOVWF 77 |
011A: DECFSZ 77,F |
011B: GOTO 11A |
011C: NOP |
011D: MOVF 1C,W |
011E: BCF 03.5 |
011F: BCF 0D.6 |
.................... setup_vref(VREF_LOW|1|VREF_A2); |
0120: MOVLW E1 |
0121: BSF 03.5 |
0122: MOVWF 1D |
0123: BSF 05.2 |
.................... setup_oscillator(False); |
0124: CLRF 0F |
0125: MOVF 0F,W |
.................... |
.................... n=0; |
0126: BCF 03.5 |
0127: CLRF 22 |
0128: CLRF 21 |
.................... set_timer0(0); |
0129: CLRF 01 |
.................... While(true) |
.................... { |
.................... printf("%Lu0, %u\n\r", n++, get_timer0()); |
012A: MOVF 22,W |
012B: MOVWF 7A |
012C: MOVF 21,W |
012D: INCF 21,F |
012E: BTFSC 03.2 |
012F: INCF 22,F |
0130: MOVWF 23 |
0131: MOVF 7A,W |
0132: MOVWF 24 |
0133: MOVF 01,W |
0134: MOVWF 25 |
0135: MOVLW 10 |
0136: MOVWF 04 |
0137: MOVF 24,W |
0138: MOVWF 27 |
0139: MOVF 23,W |
013A: MOVWF 26 |
013B: GOTO 029 |
013C: MOVLW 30 |
013D: MOVWF 2E |
013E: CALL 004 |
013F: MOVLW 2C |
0140: MOVWF 2E |
0141: CALL 004 |
0142: MOVLW 20 |
0143: MOVWF 2E |
0144: CALL 004 |
0145: MOVF 25,W |
0146: MOVWF 26 |
0147: MOVLW 1B |
0148: MOVWF 27 |
0149: GOTO 097 |
014A: MOVLW 0A |
014B: MOVWF 2E |
014C: CALL 004 |
014D: MOVLW 0D |
014E: MOVWF 2E |
014F: CALL 004 |
.................... set_timer0(0); |
0150: CLRF 01 |
.................... Delay_ms(10000); |
0151: MOVLW 28 |
0152: MOVWF 23 |
0153: MOVLW FA |
0154: MOVWF 24 |
0155: GOTO 0CD |
0156: DECFSZ 23,F |
0157: GOTO 153 |
.................... } |
0158: GOTO 12A |
.................... } |
0159: SLEEP |
Configuration Fuses: |
Word 1: 3F2A HS NOWDT NOPUT MCLR NOBROWNOUT NOLVP NOCPD NOWRT NODEBUG CCPB0 NOPROTECT |
Word 2: 3FFC NOFCMEN NOIESO |
/programy/C/PIC_C/mereni/geiger/bez_GPS/geiger.sta |
---|
0,0 → 1,33 |
ROM used: 346 (8%) |
346 (8%) including unused fragments |
1 Average locations per line |
20 Average locations per statement |
RAM used: 10 (6%) at main() level |
19 (11%) worst case |
Lines Stmts % Files |
----- ----- --- ----- |
28 17 100 D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.c |
20 0 0 D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.h |
279 0 0 C:\Program Files\PICC\devices\16F88.h |
----- ----- |
654 34 Total |
Page ROM % RAM Functions: |
---- --- --- --- ---------- |
0 20 6 1 @delay_ms1 |
0 37 11 1 @PUTCHAR_1_ |
0 121 35 5 main |
0 89 26 8 @PRINTF_LU_9600_51_53 |
0 21 6 3 @DIV88 |
0 54 16 2 @PRINTF_U_9600_51_53 |
Segment Used Free |
--------- ---- ---- |
00000-00003 4 0 |
00004-007FF 342 1702 |
00800-00FFF 0 2048 |
/programy/C/PIC_C/mereni/geiger/bez_GPS/geiger.sym |
---|
0,0 → 1,61 |
015-016 CCP_1 |
015 CCP_1_LOW |
016 CCP_1_HIGH |
021-022 main.n |
023 main.@SCRATCH |
024 @delay_ms1.P1 |
024 main.@SCRATCH |
025 main.@SCRATCH |
026-027 @PRINTF_LU_9600_51_53.P1 |
026 @PRINTF_U_9600_51_53.P2 |
027 @PRINTF_U_9600_51_53.P1 |
028 @DIV88.P1 |
028 @PRINTF_LU_9600_51_53.@SCRATCH |
029 @DIV88.P1 |
029 @PRINTF_LU_9600_51_53.@SCRATCH |
02A @PRINTF_LU_9600_51_53.@SCRATCH |
02A @DIV88.@SCRATCH |
02B @PRINTF_LU_9600_51_53.@SCRATCH |
02C @PRINTF_LU_9600_51_53.@SCRATCH |
02D @PRINTF_LU_9600_51_53.@SCRATCH |
02E @PUTCHAR_1_.P1 |
077 @SCRATCH |
078 @SCRATCH |
078 _RETURN_ |
079 @SCRATCH |
07A @SCRATCH |
07B @SCRATCH |
09C.6 C1OUT |
09C.7 C2OUT |
00CD @delay_ms1 |
0004 @PUTCHAR_1_ |
00E1 main |
0029 @PRINTF_LU_9600_51_53 |
0082 @DIV88 |
0097 @PRINTF_U_9600_51_53 |
00E1 @cinit |
Project Files: |
D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.c |
D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.h |
C:\Program Files\PICC\devices\16F88.h |
Units: |
D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.c (main) |
Compiler Settings: |
Processor: PIC16F88 |
Pointer Size: 8 |
ADC Range: 0-255 |
Opt Level: 9 |
Short,Int,Long: 1,8,16 |
Output Files: |
Errors: D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.err |
INHX8: D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.hex |
Symbols: D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.sym |
List: D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.lst |
Debug/COFF: D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.cof |
Call Tree: D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.tre |
Statistics: D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.sta |
/programy/C/PIC_C/mereni/geiger/bez_GPS/geiger.tre |
---|
0,0 → 1,17 |
ÀÄgeiger |
ÀÄmain 0/121 Ram=5 |
ÃÄ??0?? |
ÃÄ@PRINTF_LU_9600_51_53 0/89 Ram=8 |
³ ÀÄ@PUTCHAR_1_ 0/37 Ram=1 |
ÃÄ@PUTCHAR_1_ 0/37 Ram=1 |
ÃÄ@PUTCHAR_1_ 0/37 Ram=1 |
ÃÄ@PUTCHAR_1_ 0/37 Ram=1 |
ÃÄ@PRINTF_U_9600_51_53 0/54 Ram=2 |
³ ÃÄ@DIV88 0/21 Ram=3 |
³ ÃÄ@PUTCHAR_1_ 0/37 Ram=1 |
³ ÃÄ@DIV88 0/21 Ram=3 |
³ ÃÄ@PUTCHAR_1_ 0/37 Ram=1 |
³ ÀÄ@PUTCHAR_1_ 0/37 Ram=1 |
ÃÄ@PUTCHAR_1_ 0/37 Ram=1 |
ÃÄ@PUTCHAR_1_ 0/37 Ram=1 |
ÀÄ@delay_ms1 0/20 Ram=1 |
/programy/C/PIC_C/mereni/geiger/geiger.BAK |
---|
0,0 → 1,19 |
#include <16F88.h> |
#device adc=8 |
#FUSES NOWDT //No Watch Dog Timer |
#FUSES HS //High speed Osc (> 4mhz) |
#FUSES NOPUT //No Power Up Timer |
#FUSES MCLR //Master Clear pin enabled |
#FUSES NOBROWNOUT //No brownout reset |
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O |
#FUSES NOCPD //No EE protection |
#FUSES NOWRT //Program memory not write protected |
#FUSES NODEBUG //No Debug mode for ICD |
#FUSES NOPROTECT //Code not protected from reading |
#FUSES NOFCMEN //Fail-safe clock monitor disabled |
#FUSES NOIESO //Internal External Switch Over mode enabled |
#use delay(clock=20000000) |
#use rs232(baud=9600,parity=N,xmit=PIN_B3,rcv=PIN_B5,bits=8) |
/programy/C/PIC_C/mereni/geiger/geiger.PJT |
---|
0,0 → 1,40 |
[PROJECT] |
Target=geiger.HEX |
Development_Mode=2 |
Processor=0x688F |
ToolSuite=CCS |
[Directories] |
Include= |
Library= |
LinkerScript= |
[Target Data] |
FileList=D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.c |
BuildTool=C-COMPILER |
OptionString=+FM |
AdditionalOptionString= |
BuildRequired=1 |
[geiger.c] |
Type=4 |
Path= |
FileList= |
BuildTool= |
OptionString= |
AdditionalOptionString= |
[mru-list] |
1=D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.c |
[Windows] |
0=0000 D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.c 0 0 796 451 3 0 |
[Opened Files] |
1=D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.c |
2=D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.h |
3=C:\Program Files\PICC\devices\16F88.h |
4= |
[Units] |
Count=1 |
1=D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.c (main) |
/programy/C/PIC_C/mereni/geiger/geiger.c |
---|
0,0 → 1,27 |
#include "D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.h" |
void main() |
{ |
unsigned int16 n; |
setup_adc_ports(NO_ANALOGS|VSS_VDD); |
setup_adc(ADC_OFF); |
setup_spi(FALSE); |
setup_timer_0(RTCC_EXT_H_TO_L|RTCC_DIV_1); |
setup_timer_1(T1_DISABLED|T1_DIV_BY_1); |
setup_timer_2(T2_DISABLED,0,1); |
setup_ccp1(CCP_OFF); |
setup_comparator(A0_A2_A1_A2_OUT_ON_A3_A4); |
setup_vref(VREF_LOW|1|VREF_A2); |
setup_oscillator(False); |
n=0; |
set_timer0(0); |
While(true) |
{ |
printf("%Lu0, %u\n\r", n++, get_timer0()); |
set_timer0(0); |
Delay_ms(10000); |
} |
} |
/programy/C/PIC_C/mereni/geiger/geiger.cof |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/mereni/geiger/geiger.err |
---|
0,0 → 1,2 |
No Errors |
0 Errors, 0 Warnings. |
/programy/C/PIC_C/mereni/geiger/geiger.h |
---|
0,0 → 1,19 |
#include <16F88.h> |
#device adc=8 |
#FUSES NOWDT //No Watch Dog Timer |
#FUSES HS //High speed Osc (> 4mhz) |
#FUSES NOPUT //No Power Up Timer |
#FUSES MCLR //Master Clear pin enabled |
#FUSES NOBROWNOUT //No brownout reset |
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O |
#FUSES NOCPD //No EE protection |
#FUSES NOWRT //Program memory not write protected |
#FUSES NODEBUG //No Debug mode for ICD |
#FUSES NOPROTECT //Code not protected from reading |
#FUSES NOFCMEN //Fail-safe clock monitor disabled |
#FUSES NOIESO //Internal External Switch Over mode disabled |
#use delay(clock=20000000) |
#use rs232(baud=9600,parity=N,xmit=PIN_B3,rcv=PIN_B5,bits=8) |
/programy/C/PIC_C/mereni/geiger/geiger.hex |
---|
0,0 → 1,47 |
:1000000000308A00E12800008316861183128611D1 |
:100010000830F800000000000000F8171E28F81350 |
:10002000AE0C03188615031C861178171E2878134A |
:10003000F80B10280000000000008615A73084008F |
:10004000840B202800000000F81B0F28781B1728BD |
:1000500000340408AD00270EF038A900A907E23EDD |
:10006000AA00323EAC0027080F39AA07AA07AC073E |
:10007000E93EAB00AB07AB07260E0F39AB07AC0769 |
:10008000AB0DAC0DAC09AC0D26080F39AC07A90DB2 |
:100090000730A8000A30AC07AB03031C4B28AB07A2 |
:1000A000AA03031C4F28AA07A903031C5328A90766 |
:1000B000A803031C57282830840007302D052D1372 |
:1000C00084072C30040203192D170008F700031DC4 |
:1000D00071282D1B71282D1A7D28AD19712820300B |
:1000E0007428AD152D123030F707A7010408A600BB |
:1000F0007708AE00042026088400840A2D1F61289A |
:100100008A113C292908F801280203188A2828089E |
:10011000F7009628F7010830AA00A80DF70D290866 |
:1001200077020318F700F80DAA0B8D280034780821 |
:100130002608A8006430A90082207708A600780865 |
:100140003030031DAA28A71CB128A719B128271AE7 |
:100150002030AD28A71127122714F8077808AE0021 |
:1001600004202608A8000A30A90082207708A600EB |
:1001700078083030031DC228A719C628271CC628B6 |
:10018000271A2030F8077808AE0004203030A60780 |
:100190002608AE0004208A114A2924308400000871 |
:1001A0000319DF280630F800F701F70BD528F80B04 |
:1001B000D4287B30F700F70BDB28800BD2288A117C |
:1001C000562984011F3083058316861183128615F4 |
:1001D00083161F129F121B0880399B0007309C005A |
:1001E0001F129F121B0880399B0083121F1094124C |
:1001F00083160611861406120030831294008316AB |
:1002000094000108C739383881008312900100300A |
:10021000F8009200003083169200061483129701B2 |
:100220009701063083169C0005080738E7398500DA |
:100230001030F700F70B1A2900001C0883120D1369 |
:10024000E13083169D0005158F010F088312A2016E |
:10025000A10181012208FA002108A10A0319A20ABA |
:10026000A3007A08A4000108A50010308400240827 |
:10027000A7002308A60029283030AE0004202C3027 |
:10028000AE0004202030AE0004202508A6001B305C |
:10029000A70097280A30AE0004200D30AE000420DD |
:1002A00081012830A300FA30A400CD28A30B5329E4 |
:0402B0002A29630094 |
:04400E002A3FFC3F0A |
:00000001FF |
;PIC16F88 |
/programy/C/PIC_C/mereni/geiger/geiger.lst |
---|
0,0 → 1,250 |
CCS PCM C Compiler, Version 3.245, 27853 10-VI-06 10:23 |
Filename: D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.lst |
ROM used: 346 words (8%) |
Largest free fragment is 2048 |
RAM used: 10 (6%) at main() level |
19 (11%) worst case |
Stack: 2 locations |
* |
0000: MOVLW 00 |
0001: MOVWF 0A |
0002: GOTO 0E1 |
0003: NOP |
.................... #include "D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.h" |
.................... #include <16F88.h> |
.................... //////// Standard Header file for the PIC16F88 device //////////////// |
.................... #device PIC16F88 |
.................... #list |
.................... |
.................... #device adc=8 |
.................... |
.................... #FUSES NOWDT //No Watch Dog Timer |
.................... #FUSES HS //High speed Osc (> 4mhz) |
.................... #FUSES NOPUT //No Power Up Timer |
.................... #FUSES MCLR //Master Clear pin enabled |
.................... #FUSES NOBROWNOUT //No brownout reset |
.................... #FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O |
.................... #FUSES NOCPD //No EE protection |
.................... #FUSES NOWRT //Program memory not write protected |
.................... #FUSES NODEBUG //No Debug mode for ICD |
.................... #FUSES NOPROTECT //Code not protected from reading |
.................... #FUSES NOFCMEN //Fail-safe clock monitor disabled |
.................... #FUSES NOIESO //Internal External Switch Over mode disabled |
.................... |
.................... #use delay(clock=20000000) |
00CD: MOVLW 24 |
00CE: MOVWF 04 |
00CF: MOVF 00,W |
00D0: BTFSC 03.2 |
00D1: GOTO 0DF |
00D2: MOVLW 06 |
00D3: MOVWF 78 |
00D4: CLRF 77 |
00D5: DECFSZ 77,F |
00D6: GOTO 0D5 |
00D7: DECFSZ 78,F |
00D8: GOTO 0D4 |
00D9: MOVLW 7B |
00DA: MOVWF 77 |
00DB: DECFSZ 77,F |
00DC: GOTO 0DB |
00DD: DECFSZ 00,F |
00DE: GOTO 0D2 |
00DF: BCF 0A.3 |
00E0: GOTO 156 (RETURN) |
.................... #use rs232(baud=9600,parity=N,xmit=PIN_B3,rcv=PIN_B5,bits=8) |
* |
0004: BSF 03.5 |
0005: BCF 06.3 |
0006: BCF 03.5 |
0007: BCF 06.3 |
0008: MOVLW 08 |
0009: MOVWF 78 |
000A: NOP |
000B: NOP |
000C: NOP |
000D: BSF 78.7 |
000E: GOTO 01E |
000F: BCF 78.7 |
0010: RRF 2E,F |
0011: BTFSC 03.0 |
0012: BSF 06.3 |
0013: BTFSS 03.0 |
0014: BCF 06.3 |
0015: BSF 78.6 |
0016: GOTO 01E |
0017: BCF 78.6 |
0018: DECFSZ 78,F |
0019: GOTO 010 |
001A: NOP |
001B: NOP |
001C: NOP |
001D: BSF 06.3 |
001E: MOVLW A7 |
001F: MOVWF 04 |
0020: DECFSZ 04,F |
0021: GOTO 020 |
0022: NOP |
0023: NOP |
0024: BTFSC 78.7 |
0025: GOTO 00F |
0026: BTFSC 78.6 |
0027: GOTO 017 |
0028: RETLW 00 |
.................... |
.................... |
.................... |
.................... |
.................... void main() |
.................... { |
* |
00E1: CLRF 04 |
00E2: MOVLW 1F |
00E3: ANDWF 03,F |
00E4: BSF 03.5 |
00E5: BCF 06.3 |
00E6: BCF 03.5 |
00E7: BSF 06.3 |
00E8: BSF 03.5 |
00E9: BCF 1F.4 |
00EA: BCF 1F.5 |
00EB: MOVF 1B,W |
00EC: ANDLW 80 |
00ED: MOVWF 1B |
00EE: MOVLW 07 |
00EF: MOVWF 1C |
.................... unsigned int16 n; |
.................... |
.................... setup_adc_ports(NO_ANALOGS|VSS_VDD); |
00F0: BCF 1F.4 |
00F1: BCF 1F.5 |
00F2: MOVF 1B,W |
00F3: ANDLW 80 |
00F4: MOVWF 1B |
.................... setup_adc(ADC_OFF); |
00F5: BCF 03.5 |
00F6: BCF 1F.0 |
.................... setup_spi(FALSE); |
00F7: BCF 14.5 |
00F8: BSF 03.5 |
00F9: BCF 06.2 |
00FA: BSF 06.1 |
00FB: BCF 06.4 |
00FC: MOVLW 00 |
00FD: BCF 03.5 |
00FE: MOVWF 14 |
00FF: BSF 03.5 |
0100: MOVWF 14 |
.................... setup_timer_0(RTCC_EXT_H_TO_L|RTCC_DIV_1); |
0101: MOVF 01,W |
0102: ANDLW C7 |
0103: IORLW 38 |
0104: MOVWF 01 |
.................... setup_timer_1(T1_DISABLED|T1_DIV_BY_1); |
0105: BCF 03.5 |
0106: CLRF 10 |
.................... setup_timer_2(T2_DISABLED,0,1); |
0107: MOVLW 00 |
0108: MOVWF 78 |
0109: MOVWF 12 |
010A: MOVLW 00 |
010B: BSF 03.5 |
010C: MOVWF 12 |
.................... setup_ccp1(CCP_OFF); |
010D: BSF 06.0 |
010E: BCF 03.5 |
010F: CLRF 17 |
0110: CLRF 17 |
.................... setup_comparator(A0_A2_A1_A2_OUT_ON_A3_A4); |
0111: MOVLW 06 |
0112: BSF 03.5 |
0113: MOVWF 1C |
0114: MOVF 05,W |
0115: IORLW 07 |
0116: ANDLW E7 |
0117: MOVWF 05 |
0118: MOVLW 10 |
0119: MOVWF 77 |
011A: DECFSZ 77,F |
011B: GOTO 11A |
011C: NOP |
011D: MOVF 1C,W |
011E: BCF 03.5 |
011F: BCF 0D.6 |
.................... setup_vref(VREF_LOW|1|VREF_A2); |
0120: MOVLW E1 |
0121: BSF 03.5 |
0122: MOVWF 1D |
0123: BSF 05.2 |
.................... setup_oscillator(False); |
0124: CLRF 0F |
0125: MOVF 0F,W |
.................... |
.................... n=0; |
0126: BCF 03.5 |
0127: CLRF 22 |
0128: CLRF 21 |
.................... set_timer0(0); |
0129: CLRF 01 |
.................... While(true) |
.................... { |
.................... printf("%Lu0, %u\n\r", n++, get_timer0()); |
012A: MOVF 22,W |
012B: MOVWF 7A |
012C: MOVF 21,W |
012D: INCF 21,F |
012E: BTFSC 03.2 |
012F: INCF 22,F |
0130: MOVWF 23 |
0131: MOVF 7A,W |
0132: MOVWF 24 |
0133: MOVF 01,W |
0134: MOVWF 25 |
0135: MOVLW 10 |
0136: MOVWF 04 |
0137: MOVF 24,W |
0138: MOVWF 27 |
0139: MOVF 23,W |
013A: MOVWF 26 |
013B: GOTO 029 |
013C: MOVLW 30 |
013D: MOVWF 2E |
013E: CALL 004 |
013F: MOVLW 2C |
0140: MOVWF 2E |
0141: CALL 004 |
0142: MOVLW 20 |
0143: MOVWF 2E |
0144: CALL 004 |
0145: MOVF 25,W |
0146: MOVWF 26 |
0147: MOVLW 1B |
0148: MOVWF 27 |
0149: GOTO 097 |
014A: MOVLW 0A |
014B: MOVWF 2E |
014C: CALL 004 |
014D: MOVLW 0D |
014E: MOVWF 2E |
014F: CALL 004 |
.................... set_timer0(0); |
0150: CLRF 01 |
.................... Delay_ms(10000); |
0151: MOVLW 28 |
0152: MOVWF 23 |
0153: MOVLW FA |
0154: MOVWF 24 |
0155: GOTO 0CD |
0156: DECFSZ 23,F |
0157: GOTO 153 |
.................... } |
0158: GOTO 12A |
.................... } |
0159: SLEEP |
Configuration Fuses: |
Word 1: 3F2A HS NOWDT NOPUT MCLR NOBROWNOUT NOLVP NOCPD NOWRT NODEBUG CCPB0 NOPROTECT |
Word 2: 3FFC NOFCMEN NOIESO |
/programy/C/PIC_C/mereni/geiger/geiger.sta |
---|
0,0 → 1,33 |
ROM used: 346 (8%) |
346 (8%) including unused fragments |
1 Average locations per line |
20 Average locations per statement |
RAM used: 10 (6%) at main() level |
19 (11%) worst case |
Lines Stmts % Files |
----- ----- --- ----- |
28 17 100 D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.c |
20 0 0 D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.h |
279 0 0 C:\Program Files\PICC\devices\16F88.h |
----- ----- |
654 34 Total |
Page ROM % RAM Functions: |
---- --- --- --- ---------- |
0 20 6 1 @delay_ms1 |
0 37 11 1 @PUTCHAR_1_ |
0 121 35 5 main |
0 89 26 8 @PRINTF_LU_9600_51_53 |
0 21 6 3 @DIV88 |
0 54 16 2 @PRINTF_U_9600_51_53 |
Segment Used Free |
--------- ---- ---- |
00000-00003 4 0 |
00004-007FF 342 1702 |
00800-00FFF 0 2048 |
/programy/C/PIC_C/mereni/geiger/geiger.sym |
---|
0,0 → 1,61 |
015-016 CCP_1 |
015 CCP_1_LOW |
016 CCP_1_HIGH |
021-022 main.n |
023 main.@SCRATCH |
024 @delay_ms1.P1 |
024 main.@SCRATCH |
025 main.@SCRATCH |
026-027 @PRINTF_LU_9600_51_53.P1 |
026 @PRINTF_U_9600_51_53.P2 |
027 @PRINTF_U_9600_51_53.P1 |
028 @DIV88.P1 |
028 @PRINTF_LU_9600_51_53.@SCRATCH |
029 @DIV88.P1 |
029 @PRINTF_LU_9600_51_53.@SCRATCH |
02A @PRINTF_LU_9600_51_53.@SCRATCH |
02A @DIV88.@SCRATCH |
02B @PRINTF_LU_9600_51_53.@SCRATCH |
02C @PRINTF_LU_9600_51_53.@SCRATCH |
02D @PRINTF_LU_9600_51_53.@SCRATCH |
02E @PUTCHAR_1_.P1 |
077 @SCRATCH |
078 @SCRATCH |
078 _RETURN_ |
079 @SCRATCH |
07A @SCRATCH |
07B @SCRATCH |
09C.6 C1OUT |
09C.7 C2OUT |
00CD @delay_ms1 |
0004 @PUTCHAR_1_ |
00E1 main |
0029 @PRINTF_LU_9600_51_53 |
0082 @DIV88 |
0097 @PRINTF_U_9600_51_53 |
00E1 @cinit |
Project Files: |
D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.c |
D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.h |
C:\Program Files\PICC\devices\16F88.h |
Units: |
D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.c (main) |
Compiler Settings: |
Processor: PIC16F88 |
Pointer Size: 8 |
ADC Range: 0-255 |
Opt Level: 9 |
Short,Int,Long: 1,8,16 |
Output Files: |
Errors: D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.err |
INHX8: D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.hex |
Symbols: D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.sym |
List: D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.lst |
Debug/COFF: D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.cof |
Call Tree: D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.tre |
Statistics: D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.sta |
/programy/C/PIC_C/mereni/geiger/geiger.tre |
---|
0,0 → 1,17 |
ÀÄgeiger |
ÀÄmain 0/121 Ram=5 |
ÃÄ??0?? |
ÃÄ@PRINTF_LU_9600_51_53 0/89 Ram=8 |
³ ÀÄ@PUTCHAR_1_ 0/37 Ram=1 |
ÃÄ@PUTCHAR_1_ 0/37 Ram=1 |
ÃÄ@PUTCHAR_1_ 0/37 Ram=1 |
ÃÄ@PUTCHAR_1_ 0/37 Ram=1 |
ÃÄ@PRINTF_U_9600_51_53 0/54 Ram=2 |
³ ÃÄ@DIV88 0/21 Ram=3 |
³ ÃÄ@PUTCHAR_1_ 0/37 Ram=1 |
³ ÃÄ@DIV88 0/21 Ram=3 |
³ ÃÄ@PUTCHAR_1_ 0/37 Ram=1 |
³ ÀÄ@PUTCHAR_1_ 0/37 Ram=1 |
ÃÄ@PUTCHAR_1_ 0/37 Ram=1 |
ÃÄ@PUTCHAR_1_ 0/37 Ram=1 |
ÀÄ@delay_ms1 0/20 Ram=1 |
/programy/C/PIC_C/mereni/geiger/nmea.c |
---|
0,0 → 1,1434 |
// Change the following to change the clock frequency |
#define CRYSTAL_FREQ 16000000 |
// Change the following to change between 16 or 20 column display |
#define DISPLAY_COLS 20 |
// Speed units are "1" (nautical knots), "2" (metric kph), or "3" (statute mph) |
#define SPEED_UNITS 1 |
/**************************************************************************** |
GPS18.c |
This program receives NMEA-0183 data from a GPS and displays it. |
Meant for large display version still in 16F876. |
Three buttons |
Automicaly resets if main loop stops (not the best solution, still don't know why it's stopping) |
Next: don't display GPS screens unless GPS is active |
detect display needing reset |
preset data eeprom for first-time operation |
don't display init stuff if reseting from main loop |
+5 +5+5 |
| | | |
20 15 2 |
---------- ---------- |
~SerIn -----18-| |-24-----11-|DB4 A Vdd | |
| |-25-----12-|DB5 | |
ADC0 ------2-| |-26-----13-|DB6 | |
ADC1 ------3-| 16F876 |-27-----14-|DB7 Vo| 3-- |
ADC2 ------5-| | | LCD | | |
| |-14------6-|EN | | |
XTAL--9-| |-15------4-|R/S | | |
XTAL-10-| |-28-FET-16-|K | | |
| | | RW Vss | | |
BUTTON 1---21-| | ---------- | |
BUTTON 2---22-| | 1 5 | |
BUTTON 3---23-| | | | | |
| | Gnd Gnd | |
| | | |
| |-11----------R/C----------- |
| | |
| | |
---------- |
8 19 |
| | |
Gnd Gnd |
***************************************************************************/ |
#case |
#include <16F876.h> |
#include <jonsinc.h> |
#device = *=16 ADC=10 /* allow RAM addresses over 255 */ |
#if ( ( CRYSTAL_FREQ < 4000000) || ( CRYSTAL_FREQ > 20000000 ) ) |
#error "CRYSTAL FREQ" not defined to between 8000000 and 20000000 |
#endif |
#if ( ( DISPLAY_COLS != 16 ) && ( DISPLAY_COLS != 20 ) ) |
#error "DISPLAY COLS" not defined to 16 or 20 |
#endif |
// RMC_TIME = 1 per clock megahertz, rounded |
#define RMC_TIME CRYSTAL_FREQ/1000000 |
#define LCD_D0 PIN_B3 |
#define LCD_D1 PIN_B4 |
#define LCD_D2 PIN_B5 |
#define LCD_D3 PIN_B6 |
#define LCD_EN PIN_C3 |
#define LCD_RS PIN_C4 |
#define RX_IN PIN_C7 |
#define BUTTON_1 PIN_B0 |
#define BUTTON_2 PIN_B1 |
#define BUTTON_3 PIN_B2 |
#define LCD_BACKLITE PIN_B7 |
#define LINE_1 0x00 |
#define LINE_2 0x40 |
#if DISPLAY_COLS == 20 |
#define LINE_3 0x14 |
#define LINE_4 0x54 |
#endif |
#if DISPLAY_COLS == 16 |
#define LINE_3 0x10 |
#define LINE_4 0x50 |
#endif |
#define CLEAR_DISP 0x01 |
#define EOF 0x00 |
#define COMMA ',' |
#define CR 13 |
#define SPACE ' ' |
#define PERIOD '.' |
#define DEGREE 0xdf |
#define DOLLAR '$' |
#define NULL 0 |
#define GPRMC_CODE 75 |
#define GPRMB_CODE 74 |
#define RX_BUFFER_SIZE 70 |
#define POSITION_SCREEN 1 |
#define WAYPOINT_SCREEN 2 |
#define BATTERY_SCREEN 3 |
#define HIDDEN_RMC 5 |
#define WARNING_MSG 0 |
#define NODATA_MSG 1 |
#define ACTIVITY_SYMBOL 0xFF |
#define MAX_VOLTS 15 |
#define EEPROM_CONTRAST 0 |
#define EEPROM_INITIAL 1 |
/* Set the following define to "YES" to display XOR'ed GPS sentence code */ |
/* such as GPRMC and the display will read out the value of 74. */ |
#define GET_GPS_CODE NO |
#separate void Display ( void ); |
#separate void LCD_Init ( void ); |
#separate void LCD_SetPosition ( unsigned int cX ); |
#separate void LCD_PutChar ( unsigned int cX ); |
#separate void LCD_PutCmd ( unsigned int cX ); |
#separate void LCD_PulseEnable ( void ); |
#separate void LCD_SetData ( unsigned int cX ); |
#separate void SkipField ( char cCnt ); |
#separate char GetField ( void ); |
#separate void InitRxBuffer ( char cCode ); |
#separate char GetRxChar ( void ); |
#separate void DisplayLatLon ( void ); |
#separate void DisplayWaypoint ( void ); |
#separate void DisplayLatitude ( char cLine ); |
#separate void DisplayLongitude ( char cLine ); |
#separate void DisplayHeading ( char cLine ); |
#separate void DisplaySpeed ( char cLine ); |
#separate void DisplaySteer ( char cLine, char cX ); |
#separate void DisplayWaypointName ( char cLine, char cX ); |
#separate void DisplayDistance ( char cLine, char cX ); |
#separate void DisplayBearing ( char cLine, char cX ); |
#separate void GetUtcAndMagVar ( void ); |
#separate long TrueToMag ( long iH ); |
#separate long FieldFiveToLong ( void ); |
#separate void DisplayAnalog ( void ); |
#separate void DisplayScaledVoltage ( long iV, char cScale ); |
#separate void DisplayArrival ( char cLine ); |
#separate void DisplayMessage ( char cMsgNum ); |
#separate void DisplayTemplateLatLon ( void ); |
#separate void DisplayTemplateWaypoint ( void ); |
#separate void DisplayTemplateAnalog ( void ); |
#separate void Delay5mS ( char cCnt ); |
#fuses HS, NOPROTECT, PUT, NOWDT, BROWNOUT, NOLVP, NOCPD |
#use standard_io ( A ) |
#use standard_io ( B ) |
#use standard_io ( C ) |
#use delay ( clock = CRYSTAL_FREQ ) |
#use rs232 ( baud=4800, xmit=PIN_C6, rcv=PIN_C7, ERRORS ) // XMIT must be assigned to enable hardward USART |
#priority RDA, RTCC, EXT |
static char cC [ 10 ]; // local buffer |
static char cTimeOut; |
static char cRxBuffer [ RX_BUFFER_SIZE ]; // Fifo |
static char cRxByteCnt; // Number of bytes in the recv fifo |
static char *cRxBufferWritePtr; // Pointers for the Rx buffer |
static char *cRxBufferReadPtr; |
static char cRxIsrState, cRxMsgTypeReceived, cRxMsgTypeDesired; |
static char cRxMsgReady, cReceiveFlag; |
static long iVar, iLastRange, iTimeOut; |
static char cVarDir, cScreenChanged, cAdcDone; |
static char cButtonPressed, cSkip, cButtonCount; |
static char cScreen, cSavedScreen, cRmcTimer1, cRmcTimer2; |
static char cToFrom [ 5 ], cIndicator, cIllumination, cRxErrorFlag; |
static char cDone, cContrast; |
/*******************************************************************/ |
#int_ad |
void AdcInterrupt ( void ) |
{ |
/* Gets here when ADC is done conversion, sets flag */ |
cAdcDone = YES; |
} |
#int_timer1 |
void Timer1Interrupt ( void ) |
{ |
/* Periodic RMC data timer, gets here every 204mS */ |
/* This routine forces RMC to run every 10 minutes to update */ |
/* magnetic variation */ |
if ( cRmcTimer1-- == 0 ) |
{ |
cRmcTimer1 = 255; // 52 seconds @ 10.240MHz |
if ( cRmcTimer2-- == 0 ) |
{ |
cRmcTimer2 = RMC_TIME; // triggers every 10 minutes |
cSavedScreen = cScreen; // save current screen type |
cScreen = HIDDEN_RMC; // force RMC to run |
} |
} |
} |
#int_rtcc |
void Timer0Interrupt ( void ) |
{ |
// Gets here every 16.4mS at 8MHz, 8.2mS at 16MHz |
// Handles data timeout and switch debounce. |
// DATA TIMEOUT TIMER |
if ( cTimeOut != 0 ) |
{ |
cTimeOut--; |
} |
// This timer is preset by the normal operating loop, unless the operating |
// loop stops looping, at which point iTimeOut finally decrements to zero |
// and resets CPU. |
if ( iTimeOut != 0 ) |
{ |
iTimeOut--; |
} |
else |
{ |
reset_cpu(); // force reset |
} |
if ( input ( BUTTON_2 ) == LOW ) // if button still pressed |
{ |
cScreen = WAYPOINT_SCREEN; |
cSkip = YES; // skip out of anything in process |
cScreenChanged = YES; // repaint complete screen |
} |
if ( input ( BUTTON_3 ) == LOW ) // if button still pressed |
{ |
cScreen = BATTERY_SCREEN; |
cSkip = YES; // skip out of anything in process |
cScreenChanged = YES; // repaint complete screen |
} |
// SWITCH DEBOUNCE |
if ( input ( BUTTON_1 ) == LOW ) // if button still pressed |
{ |
if ( cButtonCount < 255 ) // hold at 255 |
{ |
cButtonCount++; // otherwise increment |
} |
} |
else // if button is unpressed |
{ |
if ( cButtonCount > 2 ) // filter out glitches |
{ |
//If button press is greater than 3.3 seconds, cold reset |
if ( cButtonCount == 255 ) |
{ |
reset_cpu(); |
} |
if ( ( cButtonCount > 57 ) && ( cButtonCount < 255 ) ) |
{ |
if ( cScreen != HIDDEN_RMC ) // if not in the middle of getting magnetic variation |
{ |
// cIllumination ^= ON; |
output_bit ( LCD_BACKLITE, cIllumination ^= ON ); |
} |
} |
// If button press is less than 0.5 second |
if ( cButtonCount <= 57 ) |
{ |
if ( cScreen != HIDDEN_RMC ) // if not in the middle of getting magnetic variation |
{ |
//if ( cScreen++ >= BATTERY_SCREEN ) // increment to next screen |
{ |
cScreen = POSITION_SCREEN; // wrap |
} |
cSkip = YES; // skip out of anything in process |
cScreenChanged = YES; // repaint complete screen |
} |
} |
} |
cButtonCount = 0; // restart |
} |
} |
#int_rda |
void SerialInterrupt ( void ) |
{ |
/* |
Reads incoming data from the USART and puts in in a rolling buffer |
( but in this application, it should never roll.) |
If the buffer is full, this routine just discards the received byte. |
Not checking the LRC byte at the end of the NMEA-0183 sentence. |
*/ |
char cChar; |
if ( rs232_errors & 0x04 ) // get framing error bit from Rx status reg |
{ |
cRxErrorFlag = ON; |
} |
cChar = getchar(); // get char from UART, clear any errors |
if ( cRxByteCnt == RX_BUFFER_SIZE ) // is recv fifo full ??? |
{ |
goto done; |
} |
switch ( cRxIsrState ) |
{ |
case 0: |
{ |
if ( cChar == DOLLAR ) // if start of NMEA0183 message |
{ |
cRxByteCnt = 0; // reset byte count |
cReceiveFlag = OFF; // default to off |
cRxMsgTypeReceived = NULL; // set hashed value to null |
cRxIsrState++; // next state |
} |
break; |
} |
case 1: // five type characters to obtain |
case 2: |
case 3: |
case 4: |
case 5: |
{ |
cRxMsgTypeReceived ^= cChar; // hash in msg type |
if ( cRxIsrState++ == 5 ) // if time to check message type |
{ |
if ( cRxMsgTypeReceived == cRxMsgTypeDesired ) // if good |
{ |
cReceiveFlag = YES; // enable receiving |
cRxBufferWritePtr = cRxBuffer; // reset to beginning of buffer |
} |
else // don't want this message |
{ |
cRxIsrState = 0; // reset to look for next msg |
} |
} |
break; |
} |
case 6: |
{ |
/* Case 6 skips the comma character following msg type */ |
cRxIsrState++; |
break; |
} |
default: // remainder of characters |
{ |
if ( cReceiveFlag == YES ) // if this message is wanted |
{ |
*cRxBufferWritePtr = cChar; // put char in fifo |
cRxBufferWritePtr++; // increment pointer |
if ( cRxBufferWritePtr == ( cRxBuffer + RX_BUFFER_SIZE ) ) // pointer past end ? |
{ |
cRxBufferWritePtr = cRxBuffer; // set pointer to start of fifo |
} |
cRxByteCnt++; // Increment byte count |
if ( cChar == CR ) |
{ |
cRxMsgReady = YES; // signal that message is ready |
cReceiveFlag = NO; // no more receive |
} |
} |
} |
} |
done:; |
} |
/*******************************************************************/ |
void main ( void ) |
{ |
char cX; |
iTimeOut = 65535; // default to very long to get by init |
/* INITIALIZE */ |
output_float ( RX_IN ); // ensure Rx input is HiZ |
output_float ( BUTTON_1 ); // ensure switch input is HiZ |
output_float ( BUTTON_2 ); // ensure switch input is HiZ |
output_float ( BUTTON_3 ); // ensure switch input is HiZ |
output_low ( LCD_BACKLITE ); // turn off backlighting |
port_b_pullups ( ON ); // enable pullups on switches |
// GET SAVED SETTINGS |
cContrast = read_eeprom ( EEPROM_CONTRAST ); // get stored value |
// PWM is for display contrast |
setup_ccp2 ( CCP_PWM ); // set for PWM mode |
//The cycle time will be (1/clock)*4*t2div*(period+1) |
// 1/8000000 * 4 * 1 * 128 = 51.2uS = 19.5KHz |
setup_timer_2 ( T2_DIV_BY_1, 255, 1 ); // set PWM period |
// duty cycle = value*(1/clock)*t2div |
// 10 * 1/8000000 * 1 = 1.2uS |
set_pwm2_duty ( cContrast ); // set contrast duty cycle |
// SETUP TIMER 0 |
// Need 8-bit Timer0 to roll over every 13mS, approximately. |
// Roll time = 256 * 1 / ( clock_freq / prescaler setting / 4 ) |
#if CRYSTAL_FREQ >= 15000000 |
setup_counters ( RTCC_INTERNAL, RTCC_DIV_256 ); // ~13mS timer wrap |
#elif CRYSTAL_FREQ >= 8000000 |
setup_counters ( RTCC_INTERNAL, RTCC_DIV_128 ); // ~13mS timer wrap |
#elif CRYSTAL_FREQ < 8000000 |
setup_counters ( RTCC_INTERNAL, RTCC_DIV_64 ); // ~13mS timer wrap |
#endif |
// Timer 1 roll time = 65536 * 1 / ( clock_freq / prescaler setting / 4 ) |
setup_timer_1 ( T1_INTERNAL | T1_DIV_BY_8 ); // 16-bit timer |
setup_adc_ports ( RA0_RA1_RA3_ANALOG ); /* these three statements set up the ADC */ |
setup_adc ( ADC_CLOCK_INTERNAL ); |
cIllumination = OFF; |
LCD_Init(); // set up LCD for 4-wire bus, etc. |
/* INIT MESSAGE */ |
#if ( DISPLAY_COLS == 20 ) |
LCD_SetPosition ( LINE_1 + 0 ); |
printf ( LCD_PutChar, " Northern Light " ); // welcome screen |
LCD_SetPosition ( LINE_2 + 2 ); |
printf ( LCD_PutChar, "Monitor/Repeater" ); |
LCD_SetPosition ( LINE_3 + 3 ); |
printf ( LCD_PutChar, "v18 06/21/03" ); |
LCD_SetPosition ( LINE_4 + 5 ); |
printf ( LCD_PutChar, "c Jon Fick" ); |
#elif ( DISPLAY_COLS == 16 ) |
LCD_SetPosition ( LINE_1 + 0); |
printf ( LCD_PutChar, " Northern Light " ); // welcome screen |
LCD_SetPosition ( LINE_2 + 2 ); |
printf ( LCD_PutChar, "GPS Repeater" ); |
LCD_SetPosition ( LINE_3 + 1 ); |
printf ( LCD_PutChar, "v18 06/21/03" ); |
LCD_SetPosition ( LINE_4 + 3 ); |
printf ( LCD_PutChar, "c Jon Fick" ); |
#endif |
delay_ms ( 1000 ); |
/* INSTRUCTION MESSAGE */ |
LCD_PutCmd ( CLEAR_DISP ); |
LCD_SetPosition ( LINE_1 + 0 ); |
printf ( LCD_PutChar, "BUTTONS:" ); |
LCD_SetPosition ( LINE_2 + 0 ); |
printf ( LCD_PutChar, "<-- Lat/Lon" ); |
LCD_SetPosition ( LINE_3 + 0 ); |
printf ( LCD_PutChar, "<-- Waypoint" ); |
LCD_SetPosition ( LINE_4 + 0 ); |
printf ( LCD_PutChar, "<-- Battery" ); |
delay_ms ( 2000 ); |
/* SETUP MODE */ |
if ( input ( BUTTON_1 ) == LOW ) // if button is pressed |
{ |
LCD_PutCmd ( CLEAR_DISP ); |
LCD_SetPosition ( LINE_1 + 0 ); |
printf ( LCD_PutChar, "Set contrast:" ); |
LCD_SetPosition ( LINE_2 + 0 ); |
printf ( LCD_PutChar, "<-- More" ); |
LCD_SetPosition ( LINE_3 + 0 ); |
printf ( LCD_PutChar, "<-- DONE" ); |
LCD_SetPosition ( LINE_4 + 0 ); |
printf ( LCD_PutChar, "<-- Less" ); |
while ( input ( BUTTON_1 ) == LOW ); // wait for switch to be released after entering SETUP mode |
cContrast = 120; // start at full contrast |
cDone = NO; |
while ( cDone == NO ) |
{ |
set_pwm2_duty ( cContrast ); // update contrast |
if ( input ( BUTTON_1 ) == LOW ) |
{ |
if ( cContrast > 0 ) |
{ |
cContrast--; // more |
} |
} |
if ( input ( BUTTON_2 ) == LOW ) |
{ |
cDone = YES; // done |
} |
if ( input ( BUTTON_3 ) == LOW ) |
{ |
if ( cContrast < 255 ) |
{ |
cContrast++; // less |
} |
} |
delay_ms ( 30 ); // autorepeat |
} |
write_eeprom ( EEPROM_CONTRAST, cContrast ); // save CONTRAST to EEPROM |
LCD_PutCmd ( CLEAR_DISP ); |
LCD_SetPosition ( LINE_2 + 0 ); |
printf ( LCD_PutChar, "<- Press initial" ); |
LCD_SetPosition ( LINE_3 + 0 ); |
printf ( LCD_PutChar, " bootup screen" ); |
while ( input ( BUTTON_1 ) == LOW ); // wait until button not pressed |
cX = POSITION_SCREEN; |
while ( TRUE ) |
{ |
LCD_SetPosition ( LINE_4 + 3 ); |
switch ( cX ) |
{ |
case POSITION_SCREEN: |
{ |
printf ( LCD_PutChar, "POSITION " ); |
break; |
} |
case WAYPOINT_SCREEN: |
{ |
printf ( LCD_PutChar, "WAYPOINT " ); |
break; |
} |
case BATTERY_SCREEN: |
{ |
printf ( LCD_PutChar, "BATTERY " ); |
break; |
} |
} |
delay_ms ( 750 ); |
if ( input ( BUTTON_1 ) == LOW ) // if button is pressed |
{ |
write_eeprom ( EEPROM_INITIAL, cX ); // save screen number to EEPROM |
break; |
} |
if ( cX++ == BATTERY_SCREEN ) |
{ |
cX = POSITION_SCREEN; |
} |
} |
LCD_PutCmd ( CLEAR_DISP ); |
} |
/* This IF/ENDIF is a tool for getting the $GP... codes */ |
/* that are used in the switch/case in the main loop. */ |
#if ( GET_GPS_CODE == YES ) |
printf ( LCD_PutChar, "%u", 'G'^'P'^'R'^'M'^'B'); |
while ( TRUE ); |
#endif |
/* INTERRUPTS */ |
ext_int_edge ( H_TO_L ); // set falling edge ext interrupt |
enable_interrupts ( INT_TIMER1 ); // enable Timer1 interrupt |
enable_interrupts ( INT_RDA ); // enable serial interrupt |
enable_interrupts ( INT_RTCC ); // enable Timer0 interrupt |
enable_interrupts ( INT_AD ); // enable ADC interrupt |
enable_interrupts ( GLOBAL ); // enable all interrupts |
/* VARIABLES */ |
iVar = NULL; // default, no variation yet |
cVarDir = SPACE; // default, no variation yet |
cRmcTimer1 = 255; // initialize to 52 seconds |
cRmcTimer2 = RMC_TIME; // trigger forced RMC after 10 minutes |
cScreen = HIDDEN_RMC; // default screen, get magnetic variation first |
cSavedScreen = read_eeprom ( EEPROM_INITIAL ); // restore initial screen |
iLastRange = 65535; // make max by default |
strcpy ( cToFrom, " " ); // blank by default |
cScreenChanged = YES; |
cIndicator = 0; |
cButtonCount = 0; |
cButtonPressed = NO; |
cRxErrorFlag = OFF; |
/* MAIN LOOP */ |
while ( TRUE ) |
{ |
cTimeOut = 188; // 231 * 0.013mS = 3 seconds |
switch ( cScreen ) |
{ |
case HIDDEN_RMC: |
{ |
InitRxBuffer( GPRMC_CODE ); // set code and turn on serial interrupt |
while ( ( cRxMsgReady == NO ) && ( cTimeOut != 0 ) ); |
disable_interrupts ( INT_RDA ); // ignore rest of messages |
if ( cTimeOut != 0 ) // if not timed out |
{ |
GetUtcAndMagVar(); // get and store the magnetic variation |
} |
cScreen = cSavedScreen; // revert to previous screen |
break; |
} |
case POSITION_SCREEN: |
{ |
if ( cScreenChanged == YES ) |
{ |
disable_interrupts ( INT_RDA ); |
cScreenChanged = NO; |
cSkip = NO; |
LCD_PutCmd ( CLEAR_DISP ); |
DisplayTemplateLatLon(); |
enable_interrupts ( INT_RDA ); |
} |
InitRxBuffer( GPRMC_CODE ); // set code and turn on serial interrupt |
while ( ( cRxMsgReady == NO ) && ( cTimeOut != 0 ) && ( cScreenChanged != YES ) ); |
disable_interrupts ( INT_RDA ); // ignore rest of messages |
if ( cScreenChanged == NO ) |
{ |
if ( cTimeOut != 0 ) |
{ |
DisplayLatLon(); |
} |
else |
{ |
DisplayMessage ( NODATA_MSG ); |
} |
} |
cRxErrorFlag = OFF; |
break; |
} |
case WAYPOINT_SCREEN: |
{ |
if ( cScreenChanged == YES ) |
{ |
disable_interrupts ( INT_RDA ); |
cScreenChanged = NO; |
cSkip = NO; |
LCD_PutCmd ( CLEAR_DISP ); |
DisplayTemplateWaypoint(); |
enable_interrupts ( INT_RDA ); |
} |
cSkip = NO; |
InitRxBuffer( GPRMB_CODE ); // set code and turn on serial interrupt |
while ( ( cRxMsgReady == NO ) && ( cTimeOut != 0 ) && ( cScreenChanged != YES ) ); |
disable_interrupts ( INT_RDA ); // ignore rest of messages |
if ( cScreenChanged == NO ) |
{ |
if ( cTimeOut != 0 ) |
{ |
DisplayWaypoint(); |
} |
else |
{ |
DisplayMessage ( NODATA_MSG ); |
} |
} |
break; |
} |
case BATTERY_SCREEN: |
{ |
if ( cScreenChanged == YES ) |
{ |
disable_interrupts ( INT_RDA ); |
cScreenChanged = NO; |
cSkip = NO; |
LCD_PutCmd ( CLEAR_DISP ); |
DisplayTemplateAnalog(); |
} |
DisplayAnalog(); |
break; |
} |
} |
// Preset timeout counter each loop; RTCC interrupt decrements, resets if zero is reached |
iTimeOut = 2000; // ~ 30 seconds |
/* Flashing activity indicator in lower right of screen. */ |
cIndicator ^= 1; |
#if ( DISPLAY_COLS == 20 ) |
LCD_SetPosition ( LINE_4 + 19 ); |
#elif ( DISPLAY_COLS == 16 ) |
LCD_SetPosition ( LINE_4 + 15 ); |
#endif |
if ( cIndicator == 1 ) |
{ |
printf ( LCD_PutChar, "%c", ACTIVITY_SYMBOL ); |
} |
else |
{ |
printf ( LCD_PutChar, " " ); |
} |
} |
} |
#separate void DisplayTemplateLatLon ( void ) |
{ |
LCD_SetPosition ( LINE_1 ); |
printf ( LCD_PutChar, "LAT" ); |
LCD_SetPosition ( LINE_2 ); |
printf ( LCD_PutChar, "LON" ); |
LCD_SetPosition ( LINE_3 ); |
#if ( DISPLAY_COLS == 20 ) |
printf ( LCD_PutChar, "SPEED" ); |
LCD_SetPosition ( LINE_4 ); |
printf ( LCD_PutChar, "HEADING" ); |
#elif ( DISPLAY_COLS == 16 ) |
printf ( LCD_PutChar, "SPD" ); |
LCD_SetPosition ( LINE_4 ); |
printf ( LCD_PutChar, "HDG" ); |
#endif |
} |
#separate void DisplayTemplateWaypoint ( void ) |
{ |
LCD_SetPosition ( LINE_1 ); |
#if ( DISPLAY_COLS == 20 ) |
printf ( LCD_PutChar, "WAYPOINT" ); |
#elif ( DISPLAY_COLS == 16 ) |
printf ( LCD_PutChar, "WAYPT" ); |
#endif |
LCD_SetPosition ( LINE_2 ); |
printf ( LCD_PutChar, "STEER" ); |
LCD_SetPosition ( LINE_3 ); |
printf ( LCD_PutChar, "DIST" ); |
LCD_SetPosition ( LINE_4 ); |
printf ( LCD_PutChar, "BEARING" ); |
} |
#separate void DisplayTemplateAnalog ( void ) |
{ |
#if ( DISPLAY_COLS == 20 ) |
LCD_SetPosition ( LINE_1 + 3 ); |
#elif ( DISPLAY_COLS == 16 ) |
LCD_SetPosition ( LINE_1 + 1 ); |
#endif |
printf ( LCD_PutChar, "BATTERY STATUS" ); |
#if ( DISPLAY_COLS == 20 ) |
LCD_SetPosition ( LINE_2 ); |
printf ( LCD_PutChar, "Primary" ); |
LCD_SetPosition ( LINE_3 ); |
printf ( LCD_PutChar, "Secondary" ); |
LCD_SetPosition ( LINE_4 ); |
printf ( LCD_PutChar, "Refrigerator" ); |
#elif ( DISPLAY_COLS == 16 ) |
LCD_SetPosition ( LINE_2 ); |
printf ( LCD_PutChar, "Main#1 " ); |
LCD_SetPosition ( LINE_3 ); |
printf ( LCD_PutChar, "Main#2 " ); |
LCD_SetPosition ( LINE_4 ); |
printf ( LCD_PutChar, "Refrig " ); |
#endif |
} |
#separate void DisplayLatLon ( void ) |
{ |
SkipField ( 1 ); // skip UTC |
GetField(); // A = OK, V = warning |
if ( ( cC [ 0 ] == 'A' ) && ( !cSkip ) ) |
{ |
GetField(); // LAT |
if ( !cSkip ) |
{ |
DisplayLatitude ( LINE_1 ); |
} |
GetField(); // LON |
if ( !cSkip ) |
{ |
DisplayLongitude ( LINE_2 ); |
} |
GetField(); // SPEED |
if ( !cSkip ) |
{ |
DisplaySpeed ( LINE_3 ); |
} |
GetField(); // HEADING |
if ( !cSkip ) |
{ |
DisplayHeading ( LINE_4 ); |
} |
} |
else |
{ |
DisplayMessage( WARNING_MSG ); |
} |
} |
#separate void DisplayWaypoint ( void ) |
{ |
char cX; |
GetField(); // A = OK, V = warning |
if ( ( cC [ 0 ] == 'A' ) && ( !cSkip ) ) |
{ |
cX = GetField(); // XTE |
if ( !cSkip ) |
{ |
DisplaySteer ( LINE_2, cX ); |
} |
SkipField ( 1 ); // skip origin WP ID |
GetField(); // DEST WP ID |
if ( !cSkip ) |
{ |
DisplayWaypointName ( LINE_1, cX ); |
} |
SkipField ( 4 ); // skip LAT, NS, LON, EW |
cX = GetField(); // RANGE |
if ( !cSkip ) |
{ |
DisplayDistance ( LINE_3, cX ); |
} |
cX = GetField(); // BEARING |
if ( !cSkip ) |
{ |
DisplayBearing ( LINE_4, cX ); |
} |
SkipField ( 1 ); // skip SPEED TO DEST |
GetField(); // ARRIVAL FLAG |
if ( !cSkip ) |
{ |
DisplayArrival ( LINE_1 ); // overwrite RANGE if arrived |
} |
} |
else |
{ |
DisplayMessage( WARNING_MSG ); |
} |
} |
#separate void DisplayAnalog ( void ) |
{ |
long iX; |
char cCnt; |
set_adc_channel ( 0 ); // set channel |
delay_us ( 100 ); // wait aquisition time |
cAdcDone = NO; |
if ( !cSkip ) |
{ |
#if ( DISPLAY_COLS == 20 ) |
LCD_SetPosition ( LINE_2 + 13 ); |
#elif ( DISPLAY_COLS == 16 ) |
LCD_SetPosition ( LINE_2 + 8 ); |
#endif |
DisplayScaledVoltage ( read_adc(), MAX_VOLTS ); |
printf ( LCD_PutChar, " V " ); |
} |
set_adc_channel ( 1 ); |
delay_us ( 100 ); |
cAdcDone = NO; |
if ( !cSkip ) |
{ |
#if ( DISPLAY_COLS == 20 ) |
LCD_SetPosition ( LINE_3 + 13 ); |
#elif ( DISPLAY_COLS == 16 ) |
LCD_SetPosition ( LINE_3 + 8 ); |
#endif |
DisplayScaledVoltage ( read_adc(), MAX_VOLTS ); |
printf ( LCD_PutChar, " V " ); |
} |
set_adc_channel ( 3 ); |
delay_us ( 100 ); |
cAdcDone = NO; |
if ( !cSkip ) |
{ |
#if ( DISPLAY_COLS == 20 ) |
LCD_SetPosition ( LINE_4 + 13 ); |
#elif ( DISPLAY_COLS == 16 ) |
LCD_SetPosition ( LINE_4 + 8 ); |
#endif |
DisplayScaledVoltage ( read_adc(), MAX_VOLTS ); |
printf ( LCD_PutChar, " V " ); |
} |
Delay5mS ( 100 ); // slow loop down a bit |
} |
#separate void GetUtcAndMagVar ( void ) |
{ |
/* |
This is a non-display version of the RMC sentence |
to get the A/V warning, the magnetic variation, and the |
magnetic direction. |
*/ |
GetField(); // get UTC |
GetField(); // A = OK, V = warning |
if ( cC [ 0 ] == 'A' ) |
{ |
SkipField ( 7 ); // skip fields |
GetField(); // MAGNETIC VARIATION |
iVar = FieldFiveToLong(); // save to global variable, used in other sentences |
GetField(); // EW |
cVarDir = cC [ 0 ]; // save direction |
} |
else |
{ |
iVar = NULL; // invalid |
cVarDir = SPACE; |
} |
} |
/******************************************************************/ |
#separate void DisplayScaledVoltage ( long iV, char cScale ) |
{ |
float fX; |
/* |
0 to 5V input at pin 2 results in 0 - 1023. This routine |
scales it to something else. |
*/ |
while ( cAdcDone == NO ); // wait for completion by ADC interrupt |
if ( iV == 1023 ) |
{ |
printf ( LCD_PutChar, "O/L" ); /* print it to the screen */ |
} |
else |
{ |
fX = ( ( float ) iV ) / 1023 * ( float ) cScale; // scale to proper range, 1023 leaves room for out-of-range |
printf ( LCD_PutChar, "%2.1f", fX ); /* print it to the screen */ |
} |
} |
#separate void DisplayArrival ( char cLine ) |
{ |
#if ( DISPLAY_COLS == 20 ) |
LCD_SetPosition ( cLine + 11 ); |
#elif ( DISPLAY_COLS == 16 ) |
LCD_SetPosition ( cLine + 9 ); |
#endif |
if ( cC [ 0 ] == 'A' ) |
{ |
printf ( LCD_PutChar, "Arrived" ); |
} |
else |
{ |
printf ( LCD_PutChar, " " ); |
} |
} |
#separate void DisplayWaypointName ( char cLine, char cX ) |
{ |
/* Displays waypoint name, pads field with blanks */ |
char cChar, cI; |
LCD_SetPosition ( cLine ); |
if ( cX != 0 ) |
{ |
printf ( LCD_PutChar, "\"" ); |
for ( cI = 0; cI < 6; cI++ ) |
{ |
cChar = cC [ cI ]; |
if ( cChar == EOF ) |
{ |
break; |
} |
printf ( LCD_PutChar, "%c", cChar ); |
} |
printf ( LCD_PutChar, "\"" ); |
// Blank remainder of field |
cChar = SPACE; |
for ( ; cI < 6; cI++ ) |
{ |
printf ( LCD_PutChar, "%c", cChar ); |
} |
} |
else |
{ |
printf ( LCD_PutChar, "- none -" ); |
} |
} |
#separate void DisplaySteer ( char cLine, char cX ) |
{ |
/* |
Displays A.BC literals, appends 'L' or 'R'. |
If less than 1.0, displays feet rather than nm. |
Doesn't display distance if on track. |
*/ |
long iX; |
char cCnt; |
if ( cX != 0 ) |
{ |
if ( ( cC [ 0 ] != '0' ) || ( cC [ 2 ] != '0' ) || ( cC [ 3 ] != '0' ) ) // if not 0.00 |
{ |
LCD_SetPosition ( cLine + 14 ); |
#if ( DISPLAY_COLS == 20 ) |
printf ( LCD_PutChar, " " ); // blank possible characters |
LCD_SetPosition ( cLine + 11 ); |
#elif ( DISPLAY_COLS == 16 ) |
printf ( LCD_PutChar, " " ); // blank possible characters |
LCD_SetPosition ( cLine + 8); |
#endif |
if ( cC [ 0 ] == '0' ) // if less than 1.0 nm, display as feet |
{ |
iX = ( 528 * ( long ) ( cC [ 2 ] - 0x30 ) ) + ( 52 * ( long ) ( cC [ 3 ] - 0x30 ) ); |
printf ( LCD_PutChar, "%luft ", iX ); |
} |
else // if 1.0 nm or greater, display as nautical miles |
{ |
printf ( LCD_PutChar, "%c%c%c%cmi ", cC [ 0 ], cC [ 1 ], cC [ 2 ] , cC [ 3 ] ); |
} |
GetField(); // L or R |
LCD_SetPosition ( cLine + 6 ); |
if ( cC [ 0 ] == 'L' ) |
{ |
#if ( DISPLAY_COLS == 20 ) |
printf ( LCD_PutChar, "PORT " ); |
#elif ( DISPLAY_COLS == 16 ) |
printf ( LCD_PutChar, "L" ); |
#endif |
} |
else |
{ |
#if ( DISPLAY_COLS == 20 ) |
printf ( LCD_PutChar, "STBD " ); |
#elif ( DISPLAY_COLS == 16 ) |
printf ( LCD_PutChar, "R" ); |
#endif |
} |
} |
else // if 0.00 |
{ |
#if ( DISPLAY_COLS == 20 ) |
LCD_SetPosition ( cLine + 11 ); |
printf ( LCD_PutChar, "On track " ); |
#elif ( DISPLAY_COLS == 16 ) |
LCD_SetPosition ( cLine + 6 ); |
printf ( LCD_PutChar, " On track" ); |
#endif |
GetField(); // dummy L or R |
} |
} |
else |
{ |
LCD_SetPosition ( cLine + 6 ); |
printf ( LCD_PutChar, " " ); |
} |
} |
#separate void DisplayDistance ( char cLine, char cX ) |
{ |
/* Format: ABC.D nautical miles */ |
char cChar, cI; |
long iThisRange; |
if ( cX != 0 ) // if waypoint data to display |
{ |
#if ( DISPLAY_COLS == 20 ) |
LCD_SetPosition ( cLine + 11 ); |
#elif ( DISPLAY_COLS == 16 ) |
LCD_SetPosition ( cLine + 8 ); |
#endif |
cI = 0; |
for ( cI = 0; cI < 2; cI++ ) // find first non-zero |
{ |
cChar = cC [ cI ]; |
if ( cChar != '0' ) |
{ |
break; |
} |
} |
for ( ; cI < 5; cI++ ) // display from there on |
{ |
printf ( LCD_PutChar, "%c", cC [ cI ] ); |
} |
printf ( LCD_PutChar, "nm " ); // pad with blanks |
/* |
The least significant character from the GPS is 0.1 nm. |
Multiply whole thing by 10 and make it type long. |
Discern if increasing (FROM) or decreasing (TO). |
*/ |
iThisRange = 1000 * ( long ) ( cC [ 0 ] - 0x30 ); |
iThisRange += 100 * ( long ) ( cC [ 1 ] - 0x30 ); |
iThisRange += 10 * ( long ) ( cC [ 2 ] - 0x30 ); |
iThisRange += ( long ) ( cC [ 4 ] - 0x30 ); |
if ( iThisRange < iLastRange ) |
{ |
#if ( DISPLAY_COLS == 20 ) |
strcpy ( cToFrom, "TO " ); |
#elif ( DISPLAY_COLS == 16 ) |
strcpy ( cToFrom, "TO" ); |
#endif |
} |
if ( iThisRange > iLastRange ) |
{ |
#if ( DISPLAY_COLS == 20 ) |
strcpy ( cToFrom, "FROM" ); |
#elif ( DISPLAY_COLS == 16 ) |
strcpy ( cToFrom, "FM" ); |
#endif |
} |
iLastRange = iThisRange; // save this range to compare next time |
LCD_SetPosition ( cLine + 5 ); |
printf ( LCD_PutChar, cToFrom ); |
} |
else |
{ |
LCD_SetPosition ( cLine + 5 ); |
#if ( DISPLAY_COLS == 20 ) |
printf ( LCD_PutChar, " " ); |
#elif ( DISPLAY_COLS == 16 ) |
printf ( LCD_PutChar, " " ); |
#endif |
} |
} |
#separate void DisplayBearing ( char cLine, char cX ) |
{ |
/* |
Compass variation comes from RMC sentence. If RMC has not run yet |
then "T" is displayed after bearing. |
*/ |
long iHdg; |
char cTrueIndicator; |
if ( cX != 0 ) // if waypoint data to display |
{ |
#if ( DISPLAY_COLS == 20 ) |
LCD_SetPosition ( cLine + 11 ); |
#elif ( DISPLAY_COLS == 16 ) |
LCD_SetPosition ( cLine + 8 ); |
#endif |
iHdg = FieldFiveToLong(); |
iHdg = TrueToMag ( iHdg ); // factor variation into heading |
if ( ( iVar == NULL ) || ( cVarDir == SPACE ) ) |
{ |
cTrueIndicator = 'T'; |
} |
else |
{ |
cTrueIndicator = ' '; |
} |
printf ( LCD_PutChar, "%lu%c%c ", iHdg, DEGREE, cTrueIndicator ); // pad with blanks |
} |
else |
{ |
#if ( DISPLAY_COLS == 20 ) |
LCD_SetPosition ( cLine + 11 ); |
printf ( LCD_PutChar, " " ); |
#elif ( DISPLAY_COLS == 16 ) |
LCD_SetPosition ( cLine + 8 ); |
printf ( LCD_PutChar, " " ); |
#endif |
} |
} |
#separate void DisplayLatitude ( char cLine ) |
{ |
/* Displays latitude ABCD.EF as AB CD.EF, appends 'N' or 'S' */ |
#if ( DISPLAY_COLS == 20 ) |
LCD_SetPosition ( cLine + 8 ); |
#elif ( DISPLAY_COLS == 16 ) |
LCD_SetPosition ( cLine + 5 ); |
#endif |
if ( cC [ 0 ] == '0' ) |
{ |
cC [ 0 ] = SPACE; |
} |
printf ( LCD_PutChar, "%c%c%c", cC [ 0 ], cC [ 1 ], DEGREE ); |
printf ( LCD_PutChar, "%c%c%c%c%c%c", cC [ 2 ], cC [ 3 ], cC [ 4 ], cC [ 5 ], cC [ 6 ], cC [ 7 ] ); |
GetField(); // NS |
printf ( LCD_PutChar, " %c", cC [ 0 ] ); |
} |
#separate void DisplayLongitude ( char cLine ) |
{ |
/* Displays longitude ABCDE.FG as ABC DE.FG, appends 'E' or 'W' */ |
#if ( DISPLAY_COLS == 20 ) |
LCD_SetPosition ( cLine + 7 ); |
#elif ( DISPLAY_COLS == 16 ) |
LCD_SetPosition ( cLine + 4 ); |
#endif |
if ( cC [ 0 ] == '0' ) |
{ |
cC [ 0 ] = SPACE; |
} |
if ( cC [ 1 ] == '0' ) |
{ |
cC [ 1 ] = SPACE; |
} |
printf ( LCD_PutChar, "%c%c%c%c", cC [ 0 ], cC [ 1 ], cC [ 2 ], DEGREE ); |
printf ( LCD_PutChar, "%c%c%c%c%c%c", cC [ 3 ], cC [ 4 ], cC [ 5 ], cC [ 6 ], cC [ 7 ], cC [ 8 ] ); |
GetField(); // EW |
printf ( LCD_PutChar, " %c", cC [ 0 ] ); |
} |
#separate void DisplaySpeed ( char cLine ) |
{ |
float fX; |
// Format ABC.D |
#if ( DISPLAY_COLS == 20 ) |
LCD_SetPosition ( cLine + 8 ); |
#elif ( DISPLAY_COLS == 16 ) |
LCD_SetPosition ( cLine + 5 ); |
#endif |
fX = 100 * ( cC [ 0 ] - 0x30 ); |
fX += 10 * ( cC [ 1 ] - 0x30 ); |
fX += 1 * ( cC [ 2 ] - 0x30 ); |
fX += 0.1 * ( cC [ 4 ] - 0x30 ); |
#if SPEED_UNITS == 2 |
fX *= 1.852; // convert knots to km/h |
#endif |
#if SPEED_UNITS == 3 |
fX *= 1.151; // convert knots to mi/h |
#endif |
printf ( LCD_PutChar, "%3.1f ", fX ); // print it to the screen |
#if SPEED_UNITS == 1 |
printf ( LCD_PutChar, "kts " ); // print it to the screen |
#endif |
#if SPEED_UNITS == 2 |
printf ( LCD_PutChar, "kph " ); // print it to the screen |
#endif |
#if SPEED_UNITS == 3 |
printf ( LCD_PutChar, "mph " ); // print it to the screen |
#endif |
} |
#separate void DisplayHeading ( char cLine ) |
{ |
long iHdg; |
#if ( DISPLAY_COLS == 20 ) |
LCD_SetPosition ( cLine + 8 ); |
#elif ( DISPLAY_COLS == 16 ) |
LCD_SetPosition ( cLine + 5 ); |
#endif |
iHdg = FieldFiveToLong(); |
SkipField ( 1 ); // skip fix date |
GetField(); // MAGNETIC VARIATION |
iVar = FieldFiveToLong(); // save to global variable, used in other sentences |
GetField(); // EW |
cVarDir = cC [ 0 ]; // save direction |
iHdg = TrueToMag ( iHdg ); // factor variation into heading |
printf ( LCD_PutChar, "%lu%c ", iHdg, DEGREE ); // pad with blanks |
} |
#separate long FieldFiveToLong ( void ) |
{ |
/* Converts ABC.D to long, rounds decimal up or down */ |
long iX; |
iX = 100 * ( long ) ( cC [ 0 ] - 0x30 ); |
iX += 10 * ( long ) ( cC [ 1 ] - 0x30 ); |
iX += ( long ) ( cC [ 2 ] - 0x30 ); |
if ( ( cC [ 3 ] == PERIOD ) && ( cC [ 4 ] >= '5' ) ) |
{ |
iX++; // round up |
} |
return ( iX ); |
} |
#separate long TrueToMag ( long iH ) |
{ |
/* Magnetic variation information comes from the RMC sentence */ |
if ( cVarDir == 'W' ) |
{ |
iH += iVar; |
} |
else |
{ |
if ( iH >= iVar ) |
{ |
iH -= iVar; // OK as-is |
} |
else |
{ |
iH = iH + 360 - iVar; // correct for below zero |
} |
} |
if ( iH >= 360 ) |
{ |
iH -= 360; |
} |
return ( iH ); |
} |
#separate void DisplayMessage ( char cMsgNum ) |
{ |
LCD_PutCmd ( CLEAR_DISP ); |
LCD_SetPosition ( LINE_2 ); |
switch ( cMsgNum ) |
{ |
case WARNING_MSG: |
{ |
#if ( DISPLAY_COLS == 20 ) |
printf ( LCD_PutChar, " GPS warning " ); |
#elif ( DISPLAY_COLS == 16 ) |
printf ( LCD_PutChar, " GPS warning" ); |
#endif |
break; |
} |
case NODATA_MSG: |
{ |
if ( cRxErrorFlag == OFF ) // is it a framing error problem ? |
{ |
#if ( DISPLAY_COLS == 20 ) |
printf ( LCD_PutChar, " No data from GPS" ); |
#elif ( DISPLAY_COLS == 16 ) |
printf ( LCD_PutChar, "No data from GPS" ); |
#endif |
} |
else |
{ |
#if ( DISPLAY_COLS == 20 ) |
printf ( LCD_PutChar, " Baud error" ); |
#elif ( DISPLAY_COLS == 16 ) |
printf ( LCD_PutChar, " Baud error" ); |
#endif |
cRxErrorFlag = OFF; |
} |
break; |
} |
} |
Delay5mS ( 255 ); // delay 1.25 seconds |
iVar = NULL; |
cVarDir = SPACE; // signal "no magnetic variation" yet |
cScreenChanged = YES; |
} |
#separate void Delay5mS ( char cCnt ) |
{ |
char cX; |
/* This variable-count 5mS delay is interruptable by a button press */ |
for ( cX = 0; cX < cCnt; cX++ ) |
{ |
if ( cScreenChanged == YES ) |
{ |
break; |
} |
delay_ms ( 5 ); |
} |
} |
#separate char GetField ( void ) |
{ |
char cX, cIndex; |
cX = NULL; |
cIndex = 0; |
while ( !cSkip ) |
{ |
cX = GetRxChar(); |
if ( ( cX == COMMA ) || ( cX == CR ) ) |
{ |
break; |
} |
cC [ cIndex++ ] = cX; |
} |
cC [ cIndex ] = EOF; |
return ( cIndex ); // return number of characters in field |
} |
#separate void SkipField ( char cCnt ) |
{ |
char cX; |
for ( cX = 0; cX < cCnt; cX++ ) |
{ |
while ( GetRxChar() != COMMA ); |
} |
} |
/* RS232 FUNCTIONS ================================================== */ |
#separate void InitRxBuffer ( char cCode ) |
{ |
disable_interrupts ( INT_RDA ); |
cRxBufferWritePtr = cRxBuffer; // point to beginning of buffer |
cRxBufferReadPtr = cRxBuffer; |
cRxByteCnt = 0; |
cRxIsrState = 0; |
cRxMsgReady = NO; |
cRxMsgTypeDesired = cCode; |
enable_interrupts ( INT_RDA ); |
} |
#separate char GetRxChar ( void ) |
{ |
// Get the next available byte in the recv fifo. |
// Call this function ONLY if the recv fifo contains data. |
char cValue; |
cValue = 0; |
if ( cRxByteCnt > 0 ) // For safety, check if there is any data |
{ |
cValue = *cRxBufferReadPtr++; // Read byte from fifo |
if ( cRxBufferReadPtr == ( cRxBuffer + RX_BUFFER_SIZE ) ) // Did tail ptr wrap ? |
{ |
cRxBufferReadPtr = cRxBuffer; // If so, reset it to start of buffer |
} |
cRxByteCnt--; // Decrement byte count |
} |
return ( cValue ); |
} |
/* LCD FUNCTIONS ================================= */ |
#separate void LCD_Init ( void ) |
{ |
LCD_SetData ( 0x00 ); |
delay_ms ( 200 ); /* wait enough time after Vdd rise */ |
output_low ( LCD_RS ); |
LCD_SetData ( 0x03 ); /* init with specific nibbles to start 4-bit mode */ |
LCD_PulseEnable(); |
LCD_PulseEnable(); |
LCD_PulseEnable(); |
LCD_SetData ( 0x02 ); /* set 4-bit interface */ |
LCD_PulseEnable(); /* send dual nibbles hereafter, MSN first */ |
LCD_PutCmd ( 0x2C ); /* function set (all lines, 5x7 characters) */ |
LCD_PutCmd ( 0x0C ); /* display ON, cursor off, no blink */ |
LCD_PutCmd ( 0x01 ); /* clear display */ |
LCD_PutCmd ( 0x06 ); /* entry mode set, increment & scroll left */ |
} |
#separate void LCD_SetPosition ( unsigned int cX ) |
{ |
/* this subroutine works specifically for 4-bit Port A */ |
LCD_SetData ( swap ( cX ) | 0x08 ); |
LCD_PulseEnable(); |
LCD_SetData ( swap ( cX ) ); |
LCD_PulseEnable(); |
} |
#separate void LCD_PutChar ( unsigned int cX ) |
{ |
/* this subroutine works specifically for 4-bit Port A */ |
if ( !cSkip ) |
{ |
output_high ( LCD_RS ); |
LCD_SetData ( swap ( cX ) ); /* send high nibble */ |
LCD_PulseEnable(); |
LCD_SetData ( swap ( cX ) ); /* send low nibble */ |
LCD_PulseEnable(); |
output_low ( LCD_RS ); |
} |
} |
#separate void LCD_PutCmd ( unsigned int cX ) |
{ |
/* this subroutine works specifically for 4-bit Port A */ |
LCD_SetData ( swap ( cX ) ); /* send high nibble */ |
LCD_PulseEnable(); |
LCD_SetData ( swap ( cX ) ); /* send low nibble */ |
LCD_PulseEnable(); |
} |
#separate void LCD_PulseEnable ( void ) |
{ |
output_high ( LCD_EN ); |
delay_us ( 3 ); // was 10 |
output_low ( LCD_EN ); |
delay_ms ( 3 ); // was 5 |
} |
#separate void LCD_SetData ( unsigned int cX ) |
{ |
output_bit ( LCD_D0, cX & 0x01 ); |
output_bit ( LCD_D1, cX & 0x02 ); |
output_bit ( LCD_D2, cX & 0x04 ); |
output_bit ( LCD_D3, cX & 0x08 ); |
} |
/programy/C/PIC_C/mereni/mereni_ultraz/RUN.PIF |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/mereni/mereni_ultraz/Run.BAT |
---|
0,0 → 1,6 |
@echo off |
picpgr reset PIC16F84 |
picpgr run |
pause |
picpgr stop |
pause |
/programy/C/PIC_C/mereni/mereni_ultraz/main.BAK |
---|
0,0 → 1,23 |
#include "D:\@Kaklik\programy\PIC_C\mereni_ultraz\main.h" |
#use fast_io(A) |
void main() |
{ |
setup_counters(RTCC_INTERNAL,WDT_18MS); |
set_tris_A(0b11111100); |
output_high(pin_A3); |
mainloop: |
output_high(pin_A0); |
output_low(pin_A1); |
delay_us(9); |
output_high(pin_A1); |
output_low(pin_A0); |
delay_us(9); |
goto mainloop; |
} |
/programy/C/PIC_C/mereni/mereni_ultraz/main.HEX |
---|
0,0 → 1,9 |
:1000000000308A000428000084011F308305083076 |
:100010008C008C1D1328073081018130840000087A |
:10002000C0390F3880006400813084000008C03976 |
:100030000C048000FC306500851505148510023025 |
:100040008C008C0B21280000000085140510023064 |
:0E0050008C008C0B2928000000001D28630086 |
:02400E00F93F78 |
:00000001FF |
;PIC16F84 |
/programy/C/PIC_C/mereni/mereni_ultraz/main.LST |
---|
0,0 → 1,91 |
CCS PCW C Compiler, Version 3.110, 15448 |
Filename: d:\@kaklik\programy\pic_c\mereni_ultraz\main.LST |
ROM used: 47 (5%) |
Largest free fragment is 977 |
RAM used: 2 (3%) at main() level |
2 (3%) worst case |
Stack: 0 locations |
* |
0000: MOVLW 00 |
0001: MOVWF 0A |
0002: GOTO 004 |
0003: NOP |
.................... #include "D:\@Kaklik\programy\PIC_C\mereni_ultraz\main.h" |
.................... #include <16F84.h> |
.................... //////// Standard Header file for the PIC16F84 device //////////////// |
.................... #device PIC16F84 |
.................... #list |
.................... |
.................... #use delay(clock=4000000) |
.................... #fuses XT,NOWDT |
.................... |
.................... |
.................... #use fast_io(A) |
.................... |
.................... void main() |
.................... { |
0004: CLRF 04 |
0005: MOVLW 1F |
0006: ANDWF 03,F |
.................... |
.................... setup_counters(RTCC_INTERNAL,WDT_18MS); |
0007: MOVLW 08 |
0008: MOVWF 0C |
0009: BTFSS 0C.3 |
000A: GOTO 013 |
000B: MOVLW 07 |
000C: CLRF 01 |
000D: MOVLW 81 |
000E: MOVWF 04 |
000F: MOVF 00,W |
0010: ANDLW C0 |
0011: IORLW 0F |
0012: MOVWF 00 |
0013: CLRWDT |
0014: MOVLW 81 |
0015: MOVWF 04 |
0016: MOVF 00,W |
0017: ANDLW C0 |
0018: IORWF 0C,W |
0019: MOVWF 00 |
.................... |
.................... set_tris_A(0b11111100); |
001A: MOVLW FC |
001B: TRIS 5 |
.................... output_high(pin_A3); |
001C: BSF 05.3 |
.................... |
.................... mainloop: |
.................... output_high(pin_A0); |
001D: BSF 05.0 |
.................... output_low(pin_A1); |
001E: BCF 05.1 |
.................... delay_us(9); |
001F: MOVLW 02 |
0020: MOVWF 0C |
0021: DECFSZ 0C,F |
0022: GOTO 021 |
0023: NOP |
0024: NOP |
.................... output_high(pin_A1); |
0025: BSF 05.1 |
.................... output_low(pin_A0); |
0026: BCF 05.0 |
.................... delay_us(9); |
0027: MOVLW 02 |
0028: MOVWF 0C |
0029: DECFSZ 0C,F |
002A: GOTO 029 |
002B: NOP |
002C: NOP |
.................... |
.................... goto mainloop; |
002D: GOTO 01D |
.................... |
.................... } |
.................... |
002E: SLEEP |
.................... |
/programy/C/PIC_C/mereni/mereni_ultraz/main.PJT |
---|
0,0 → 1,32 |
[PROJECT] |
Target=main.HEX |
Development_Mode= |
Processor=0x684A |
ToolSuite=CCS |
[Directories] |
Include=C:\PROGRAM FILES\PICC\devices\;C:\PROGRAM FILES\PICC\dr |
Library= |
LinkerScript= |
[Target Data] |
FileList=main.c; |
BuildTool=C-COMPILER |
OptionString=+FM |
AdditionalOptionString= |
BuildRequired=1 |
[main.c] |
Type=4 |
Path= |
FileList= |
BuildTool= |
OptionString= |
AdditionalOptionString= |
[mru-list] |
1=main.c |
[Windows] |
0=0000 main.c 0 0 796 451 3 0 |
/programy/C/PIC_C/mereni/mereni_ultraz/main.SYM |
---|
0,0 → 1,13 |
00C @SCRATCH |
00D @SCRATCH |
00D _RETURN_ |
delay_ms.P1 |
delay_us.P2 |
0004 main |
001D mainloop |
Project Files: |
d:\@kaklik\programy\pic_c\mereni_ultraz\main.c |
D:\@Kaklik\programy\PIC_C\mereni_ultraz\main.h |
C:\PROGRAM FILES\PICC\devices\16F84.h |
/programy/C/PIC_C/mereni/mereni_ultraz/main.c |
---|
0,0 → 1,23 |
#include "D:\@Kaklik\programy\PIC_C\mereni_ultraz\main.h" |
#use fast_io(A) |
void main() |
{ |
setup_counters(RTCC_INTERNAL,WDT_18MS); |
set_tris_A(0b11110100); |
output_high(pin_A3); |
mainloop: |
output_high(pin_A0); |
output_low(pin_A1); |
delay_us(9); |
output_high(pin_A1); |
output_low(pin_A0); |
delay_us(9); |
goto mainloop; |
} |
/programy/C/PIC_C/mereni/mereni_ultraz/main.cod |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/mereni/mereni_ultraz/main.err |
---|
0,0 → 1,0 |
No Errors |
/programy/C/PIC_C/mereni/mereni_ultraz/main.h |
---|
0,0 → 1,4 |
#include <16F84.h> |
#use delay(clock=4000000) |
#fuses XT,NOWDT |
/programy/C/PIC_C/mereni/mereni_ultraz/main.sta |
---|
0,0 → 1,27 |
ROM used: 47 (5%) |
977 (95%) including unused fragments |
0 Average locations per line |
4 Average locations per statement |
RAM used: 2 (3%) at main() level |
2 (3%) worst case |
Lines Stmts % Files |
----- ----- --- ----- |
24 11 100 d:\@kaklik\programy\pic_c\mereni_ultraz\main.c |
5 0 0 D:\@Kaklik\programy\PIC_C\mereni_ultraz\main.h |
111 0 0 C:\PROGRAM FILES\PICC\devices\16F84.h |
----- ----- |
280 22 Total |
Page ROM % RAM Functions: |
---- --- --- --- ---------- |
0 43 91 0 main |
Segment Used Free |
--------- ---- ---- |
0000-0003 4 0 |
0004-03FF 43 977 |
/programy/C/PIC_C/mereni/mereni_ultraz/main.tre |
---|
0,0 → 1,3 |
ÀÄmain |
ÀÄmain 0/43 Ram=0 |
ÀÄ??0?? |
/programy/C/PIC_C/mereni/mereni_ultraz/prg.bat |
---|
0,0 → 1,6 |
call picpgr stop |
call picpgr erase pic16f84 |
call picpgr program main.hex hex pic16f84 |
call picpgr run |
pause |
call picpgr stop |
/programy/C/PIC_C/mereni/mereni_ultraz/vssver.scc |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/mereni/mys/PIC16F88/mys.BAK |
---|
0,0 → 1,52 |
#include "D:\KAKLIK\programy\PIC_C\mereni\mys\PIC16F88\mys.h" |
#define LCD_RS PIN_B3 // rizeni registru LCD displeje |
#define LCD_E PIN_B0 // enable LCD displeje |
#define LCD_DATA_LSB PIN_A0 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou) |
#include "C:\library\CCS\lcd.c" |
#include "C:\library\kaklik\CCS\mys_chip_SPI.c" // modul umoznujici komunikaci s cidlem v mysi |
void main() |
{ |
unsigned int8 hodnota; |
signed int16 x=0,y=0; |
signed int8 xd,yd; |
setup_adc_ports(NO_ANALOGS|VSS_VDD); |
setup_adc(ADC_OFF); |
setup_spi(SPI_MASTER|SPI_H_TO_L|SPI_XMIT_L_TO_H|SPI_CLK_DIV_64); |
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
setup_timer_1(T1_DISABLED); |
setup_timer_2(T2_DISABLED,0,1); |
setup_comparator(NC_NC_NC_NC); |
setup_vref(FALSE); |
chip_write(OPERATION_MODE); |
chip_write(0x00); // vypne sleep mode |
chip_write(CONFIGURATION); |
chip_write(0b00000110); // nastavi rozliseni na 600cpi |
lcd_init(); |
Delay_ms(200); |
While(true) |
{ |
LCD_gotoxy(1,1); |
printf(lcd_putc,"status: %X", hodnota); |
delay_ms(20); |
LCD_gotoxy(1,2); |
printf(lcd_putc,"X=%ld Y=%ld", x, y); |
delay_ms(20); |
hodnota=chip_read(MOTION_STATUS); |
xd=chip_read(DELTA_X); |
yd=chip_read(DELTA_Y); |
x+=xd; |
y+=yd; |
} |
} |
/programy/C/PIC_C/mereni/mys/PIC16F88/mys.HEX |
---|
0,0 → 1,74 |
:1000000000308A00862900000A108A100A1182072F |
:1000100028340C34013406340A108A100A1182077D |
:100020007334743461347434753473343A34203432 |
:100030002534583400348316061183120615280817 |
:100040009300831614182628831221288312003463 |
:1000500031308400000803193C280130F800F70112 |
:10006000F70B3028F80B2F284A30F700F70B36280B |
:1000700000000000800B2D2800340508F039B8007E |
:1000800037080F393804850006148316061000005F |
:10009000831206108316061083120034B508031D60 |
:1000A0005328861154288615831686118312B60E9E |
:1000B0003608B7003D20B60E3608B7003D200D309B |
:1000C000F700F70B612800341430B1002820F0301D |
:1000D00083168505831286118316861183120610F6 |
:1000E000831606108312A8012808023C031C8028EE |
:1000F0000230B10028200330B7003D20A80A742840 |
:100100000D30F700F70B82280230B7003D200D308C |
:10011000F700F70B8928A8012808023C031C9C283B |
:1001200028080420A900B5012908B6004E20023095 |
:10013000B1002820A80A8C288A11D4290130310264 |
:10014000B3003208023C031DA7284030B307330830 |
:100150008038B400B5013408B6004E2000343008B1 |
:100160000C3A0319BD28063A0319C528073A0319A2 |
:10017000CB28053A0319D028D528B5010130B6009F |
:100180004E200230B1002820E1280130B1000230B9 |
:10019000B2009E20E1280130B100B2009E20E1288B |
:1001A000B5011030B6004E20E12830081F3C031C7A |
:1001B000DB280730B0050130B5003008B6004E200E |
:1001C000E1280034AA1BF4280F30F700290EF705A8 |
:1001D0000A3077020318EF283030F707F1282A0891 |
:1001E000F7077708B000AF200F30A9050A302902C1 |
:1001F0000318FC283030FE28AA132A08A90729086A |
:10020000B000AF208A11EB290408AF00A91F112903 |
:100210002D30B000AF208403A809A909A80A03194A |
:10022000A90A290EF038AB00AB07E23EAC00323E23 |
:10023000AE0029080F39AC07AC07AE07E93EAD00A8 |
:10024000AD07AD07280E0F39AD07AE07AD0DAE0DEA |
:10025000AE09AE0D28080F39AE07AB0D0730AA0066 |
:100260000A30AE07AD03031C3129AD07AC03031CF4 |
:100270003529AC07AB03031C3929AB07AA03031CC0 |
:100280003D292A30840007302F0584072E300402D0 |
:10029000031966290008F700031D54292F1A642941 |
:1002A000AF195629203057290830AF003030F707F2 |
:1002B000A9010408A8007708AA007708B000AF20B9 |
:1002C000280884002A08F700840A46290008F70055 |
:1002D0003030F7077708B000AF20003483160611DE |
:1002E000831206152808930083161418792983129F |
:1002F0007429061583121308930183161418822992 |
:1003000083127D2983121308F800003484011F3002 |
:10031000830583161F129F121B0880399B0007302C |
:100320009C001C0883120D13603083168F0083120B |
:10033000A201A301A401A50183161F129F121B088D |
:1003400080399B0083121F109412831606118614A5 |
:100350000612323083129400003083169400010894 |
:10036000C73908388100831290010030F8009200EC |
:1003700000308316920007309C0005080330F70018 |
:10038000F70BC0291C0883120D1383169D018530BD |
:100390008312A8001B20A8011B208630A8001B2068 |
:1003A0000630A8001B206428C830B1002820013086 |
:1003B000B100B2009E20A80128080C20A80AF7006E |
:1003C000B000AF2008302802031DDC292108A90055 |
:1003D0003730AA00E2281430B10028200130B100E3 |
:1003E0000230B2009E205830B000AF203D30B00047 |
:1003F000AF20103084002308A9002208A80004219F |
:100400002030B000AF205930B000AF203D30B000F8 |
:10041000AF20103084002508A9002408A80004217A |
:100420001430B10028200230A8006E217808A10005 |
:100430000330A8006E217808A6000430A8006E21C1 |
:100440007808A700FA012608A61BFA03A2070318DA |
:10045000A30A7A08A307FA012708A71BFA03A4072F |
:0C0460000318A50A7A08A507D729630035 |
:04400E00793FFF3FB8 |
:00000001FF |
;PIC16F88 |
/programy/C/PIC_C/mereni/mys/PIC16F88/mys.LST |
---|
0,0 → 1,829 |
CCS PCM C Compiler, Version 3.221, 27853 26-XII-05 16:54 |
Filename: D:\KAKLIK\programy\PIC_C\mereni\mys\PIC16F88\mys.LST |
ROM used: 566 words (14%) |
Largest free fragment is 2048 |
RAM used: 13 (7%) at main() level |
30 (17%) worst case |
Stack: 5 locations |
* |
0000: MOVLW 00 |
0001: MOVWF 0A |
0002: GOTO 186 |
0003: NOP |
.................... #include "D:\KAKLIK\programy\PIC_C\mereni\mys\PIC16F88\mys.h" |
.................... #include <16F88.h> |
.................... //////// Standard Header file for the PIC16F88 device //////////////// |
.................... #device PIC16F88 |
.................... #list |
.................... |
.................... #device adc=8 |
.................... #fuses NOWDT,INTRC, NOPUT, MCLR, BROWNOUT, NOLVP, NOCPD, NOWRT, NODEBUG, NOPROTECT, FCMEN, IESO |
.................... #use delay(clock=4000000) |
* |
0028: MOVLW 31 |
0029: MOVWF 04 |
002A: MOVF 00,W |
002B: BTFSC 03.2 |
002C: GOTO 03C |
002D: MOVLW 01 |
002E: MOVWF 78 |
002F: CLRF 77 |
0030: DECFSZ 77,F |
0031: GOTO 030 |
0032: DECFSZ 78,F |
0033: GOTO 02F |
0034: MOVLW 4A |
0035: MOVWF 77 |
0036: DECFSZ 77,F |
0037: GOTO 036 |
0038: NOP |
0039: NOP |
003A: DECFSZ 00,F |
003B: GOTO 02D |
003C: RETLW 00 |
.................... |
.................... |
.................... |
.................... #define LCD_RS PIN_B3 // rizeni registru LCD displeje |
.................... #define LCD_E PIN_B0 // enable LCD displeje |
.................... #define LCD_DATA_LSB PIN_A0 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou) |
.................... #include "C:\library\CCS\lcd.c" |
.................... // LCD modul pro ovladani dvouradkoveho LCD modulu se standardnim Hitachi radicem |
.................... // (c)miho 2002,2005 |
.................... // |
.................... // Historie: |
.................... // |
.................... // 0.00 Uvodni verze se snadnou definici portu LCD displeje |
.................... // 0.01 Oprava portu (zapomenute stare identifikatory) |
.................... // 0.02 Doplnena moznost pripojeni datoveho portu LCD na libovolne porty |
.................... // 0.03 Doplnena procedura lcd_clr pro smazani displeje |
.................... // |
.................... // |
.................... // Funkce: |
.................... // |
.................... // lcd_init() inicializuje LCD displej a porty, nutno volat jako prvni |
.................... // |
.................... // lcd_putc(c) zapis snaku do lcd displeje, zpracovava nasledujici ridici znaky |
.................... // \f = \x0C - nova stranka - smazani displeje |
.................... // \n = \x0A - odradkovani (prechod na druhou radku) |
.................... // \b = \x08 - backspace - posunuti kurzoru o 1 pozici zpet |
.................... // \r = \x0D - goto home to position 1,1 |
.................... // \0 .. \7 - definovatelne znaky v pozicich 0 az 7 v CGRAM |
.................... // \20 .. \27 - alternativne zapsane znaky (oktalove) v pozicich 0 az 7 CGRAM |
.................... // Pozor na to, ze funkce printf konci tisk pokud narazi na \0 (konec retezce) |
.................... // |
.................... // lcd_gotoxy(x,y) presune kurzor na uvedenou adresu |
.................... // nekontroluje parametry |
.................... // |
.................... // lcd_cursor_on zapne kurzor |
.................... // lcd_cursor_off vypne kurzor |
.................... // |
.................... // lcd_clr smaze displej |
.................... // |
.................... // lcd_define_char(Index, Def) Makro, ktere definuje znaky od pozice Index obsahem definicniho |
.................... // retezce Def. Kazdych 8 znaku retezce Def definuje dalsi znak v CGRAM. |
.................... // Kapacita CGRAM je celkem 8 znaku s indexem 0 az 7. |
.................... // Na konci se provede lcd_gotoxy(1,1). |
.................... // Na konci teto knihovny je priklad pouziti definovanych znaku |
.................... // |
.................... // |
.................... // Definice portu: // Datovy port displeje pripojeny na 4 bity za sebou na jeden port |
.................... // |
.................... // #define LCD_RS PIN_B2 // rizeni registru LCD displeje |
.................... // #define LCD_E PIN_B1 // enable LCD displeje |
.................... // #define LCD_DATA_LSB PIN_C2 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou) |
.................... // |
.................... // |
.................... // Alternativni definice: // Datovy port displeje pripojeny na libovolne 4 bitove porty (vede na kod delsi asi o 25 slov) |
.................... // |
.................... // #define LCD_RS PIN_B2 // rizeni registru LCD displeje |
.................... // #define LCD_E PIN_B1 // enable LCD displeje |
.................... // #define LCD_D0 PIN_C2 // D0 - datove bity pripojene na libovolne porty |
.................... // #define LCD_D1 PIN_C3 // D1 |
.................... // #define LCD_D2 PIN_C4 // D2 |
.................... // #define LCD_D3 PIN_C5 // D3 |
.................... |
.................... |
.................... |
.................... |
.................... // Privatni sekce, cist jen v pripade, ze neco nefunguje |
.................... |
.................... |
.................... |
.................... |
.................... #ifdef LCD_DATA_LSB |
.................... // Generovane defince portu pro ucely teto knihovny aby kod generoval spravne IO operace a soucasne |
.................... // bylo mozne jednoduse deklarovat pripojene piny LCD displeje pri pouziti teto knihovny. Problem spociva |
.................... // v tom, ze se musi spravne ridit smery portu a soucasne datovy port zabira jen 4 bity ze zadaneho portu |
.................... // |
.................... #define LCD_SHIFT (LCD_DATA_LSB&7) // pocet bitu posuvu datoveho kanalu v datovem portu |
.................... #define LCD_PORT (LCD_DATA_LSB>>3) // adresa LCD datoveho portu |
.................... #define LCD_TRIS (LCD_PORT+0x80) // adresa prislusneho TRIS registru |
.................... #define LCD_MASK (0xF<<LCD_SHIFT) // maska platnych bitu |
.................... // |
.................... #if LCD_SHIFT>4 // kontrola mezi |
.................... #error LCD data port LSB bit not in range 0..4 |
.................... #endif |
.................... #endif |
.................... |
.................... |
.................... // Definice konstant pro LCD display |
.................... // |
.................... #define LCD_CURSOR_ON_ 0x0E // kurzor jako blikajici radka pod znakem |
.................... #define LCD_CURSOR_OFF_ 0x0C // zadny kurzor |
.................... #define LCD_LINE_2 0x40 // adresa 1. znaku 2. radky |
.................... |
.................... |
.................... // Definice rezimu LCD displeje |
.................... // |
.................... BYTE const LCD_INIT_STRING[4] = |
.................... { |
.................... 0x28, // intrfejs 4 bity, 2 radky, font 5x7 |
.................... LCD_CURSOR_OFF_, // display on, kurzor off, |
.................... 0x01, // clear displeje |
.................... 0x06 // inkrement pozice kurzoru (posun kurzoru doprava) |
.................... }; |
.................... |
.................... |
.................... // Odesle nibble do displeje (posle data a klikne signalem e) |
.................... // |
.................... void lcd_send_nibble( BYTE n ) |
.................... { |
.................... #ifdef LCD_DATA_LSB |
.................... // data jsou za sebou na 4 bitech jednoho portu |
.................... *LCD_PORT = (*LCD_PORT & ~LCD_MASK) | ((n << LCD_SHIFT) & LCD_MASK); // nastav datove bity portu a ostatni zachovej |
003D: MOVF 05,W |
003E: ANDLW F0 |
003F: MOVWF 38 |
0040: MOVF 37,W |
0041: ANDLW 0F |
0042: IORWF 38,W |
0043: MOVWF 05 |
.................... #else |
.................... // data jsou na libovolnych 4 bitech libovolnych portu |
.................... output_bit(LCD_D0,bit_test(n,0)); |
.................... output_bit(LCD_D1,bit_test(n,1)); |
.................... output_bit(LCD_D2,bit_test(n,2)); |
.................... output_bit(LCD_D3,bit_test(n,3)); |
.................... #endif |
.................... output_bit(LCD_E,1); // vzestupna hrana |
0044: BSF 06.0 |
0045: BSF 03.5 |
0046: BCF 06.0 |
.................... delay_us(1); // pockej alespon 450ns od e nebo alespon 195ns od dat |
0047: NOP |
.................... output_bit(LCD_E,0); // sestupna hrana (minimalni perioda e je 1us) |
0048: BCF 03.5 |
0049: BCF 06.0 |
004A: BSF 03.5 |
004B: BCF 06.0 |
.................... } |
004C: BCF 03.5 |
004D: RETLW 00 |
.................... |
.................... |
.................... // Odesle bajt do registru LCD |
.................... // |
.................... // Pokud je Adr=0 .. instrukcni registr |
.................... // Pokud je Adr=1 .. datovy registr |
.................... // |
.................... void lcd_send_byte( BOOLEAN Adr, BYTE n ) |
.................... { |
.................... output_bit(LCD_RS,Adr); // vyber registr |
004E: MOVF 35,F |
004F: BTFSS 03.2 |
0050: GOTO 053 |
0051: BCF 06.3 |
0052: GOTO 054 |
0053: BSF 06.3 |
0054: BSF 03.5 |
0055: BCF 06.3 |
.................... swap(n); |
0056: BCF 03.5 |
0057: SWAPF 36,F |
.................... lcd_send_nibble(n); // posli horni pulku bajtu |
0058: MOVF 36,W |
0059: MOVWF 37 |
005A: CALL 03D |
.................... swap(n); |
005B: SWAPF 36,F |
.................... lcd_send_nibble(n); // posli spodni pulku bajtu |
005C: MOVF 36,W |
005D: MOVWF 37 |
005E: CALL 03D |
.................... delay_us(40); // minimalni doba na provedeni prikazu |
005F: MOVLW 0D |
0060: MOVWF 77 |
0061: DECFSZ 77,F |
0062: GOTO 061 |
.................... } |
0063: RETLW 00 |
.................... |
.................... |
.................... // Provede inicializaci LCD displeje, smaze obsah a nastavi mod displeje |
.................... // |
.................... // Tato procedura se musi volat pred pouzitim ostatnich lcd_ procedur |
.................... // |
.................... void lcd_init() |
.................... { |
.................... |
.................... int i; // pocitadlo cyklu |
.................... |
.................... delay_ms(20); // spozdeni pro provedeni startu displeje po zapnuti napajeni |
0064: MOVLW 14 |
0065: MOVWF 31 |
0066: CALL 028 |
.................... |
.................... #ifdef LCD_DATA_LSB |
.................... // data jsou na 4 bitech za sebou, nastav smer pro vsechny dalsi prenosy |
.................... *LCD_TRIS = *LCD_TRIS & ~LCD_MASK; // nuluj odpovidajici bity tris registru datoveho portu LCD |
0067: MOVLW F0 |
0068: BSF 03.5 |
0069: ANDWF 05,F |
.................... #endif |
.................... |
.................... output_bit(LCD_RS,0); // nastav jako vystup a nastav klidovy stav |
006A: BCF 03.5 |
006B: BCF 06.3 |
006C: BSF 03.5 |
006D: BCF 06.3 |
.................... output_bit(LCD_E, 0); // nastav jako vystup a nastav klidovy stav |
006E: BCF 03.5 |
006F: BCF 06.0 |
0070: BSF 03.5 |
0071: BCF 06.0 |
.................... |
.................... for (i=0; i<3; i++) // nastav lcd do rezimu 8 bitu sbernice |
0072: BCF 03.5 |
0073: CLRF 28 |
0074: MOVF 28,W |
0075: SUBLW 02 |
0076: BTFSS 03.0 |
0077: GOTO 080 |
.................... { |
.................... delay_ms(2); // muze byt rozdelany prenos dat (2x 4 bity) nebo pomaly povel |
0078: MOVLW 02 |
0079: MOVWF 31 |
007A: CALL 028 |
.................... lcd_send_nibble(3); // rezim 8 bitu |
007B: MOVLW 03 |
007C: MOVWF 37 |
007D: CALL 03D |
.................... } |
007E: INCF 28,F |
007F: GOTO 074 |
.................... |
.................... delay_us(40); // cas na zpracovani |
0080: MOVLW 0D |
0081: MOVWF 77 |
0082: DECFSZ 77,F |
0083: GOTO 082 |
.................... lcd_send_nibble(2); // nastav rezim 4 bitu (plati od nasledujiciho prenosu) |
0084: MOVLW 02 |
0085: MOVWF 37 |
0086: CALL 03D |
.................... delay_us(40); // cas na zpracovani |
0087: MOVLW 0D |
0088: MOVWF 77 |
0089: DECFSZ 77,F |
008A: GOTO 089 |
.................... |
.................... for (i=0;i<3;i++) // proved inicializaci (nastaveni modu, smazani apod) |
008B: CLRF 28 |
008C: MOVF 28,W |
008D: SUBLW 02 |
008E: BTFSS 03.0 |
008F: GOTO 09C |
.................... { |
.................... lcd_send_byte(0,LCD_INIT_STRING[i]); |
0090: MOVF 28,W |
0091: CALL 004 |
0092: MOVWF 29 |
0093: CLRF 35 |
0094: MOVF 29,W |
0095: MOVWF 36 |
0096: CALL 04E |
.................... delay_ms(2); |
0097: MOVLW 02 |
0098: MOVWF 31 |
0099: CALL 028 |
.................... } |
009A: INCF 28,F |
009B: GOTO 08C |
.................... } |
009C: BCF 0A.3 |
009D: GOTO 1D4 (RETURN) |
.................... |
.................... |
.................... // Proved presun kurzoru |
.................... // |
.................... // Pozice 1.1 je domu |
.................... // |
.................... void lcd_gotoxy( BYTE x, BYTE y) |
.................... { |
.................... |
.................... BYTE Adr; |
.................... |
.................... Adr=x-1; |
009E: MOVLW 01 |
009F: SUBWF 31,W |
00A0: MOVWF 33 |
.................... if(y==2) |
00A1: MOVF 32,W |
00A2: SUBLW 02 |
00A3: BTFSS 03.2 |
00A4: GOTO 0A7 |
.................... Adr+=LCD_LINE_2; |
00A5: MOVLW 40 |
00A6: ADDWF 33,F |
.................... |
.................... lcd_send_byte(0,0x80|Adr); |
00A7: MOVF 33,W |
00A8: IORLW 80 |
00A9: MOVWF 34 |
00AA: CLRF 35 |
00AB: MOVF 34,W |
00AC: MOVWF 36 |
00AD: CALL 04E |
.................... } |
00AE: RETLW 00 |
.................... |
.................... |
.................... // Zapis znaku na displej, zpracovani ridicich znaku |
.................... // |
.................... void lcd_putc( char c) |
.................... { |
.................... |
.................... switch (c) |
.................... { |
00AF: MOVF 30,W |
00B0: XORLW 0C |
00B1: BTFSC 03.2 |
00B2: GOTO 0BD |
00B3: XORLW 06 |
00B4: BTFSC 03.2 |
00B5: GOTO 0C5 |
00B6: XORLW 07 |
00B7: BTFSC 03.2 |
00B8: GOTO 0CB |
00B9: XORLW 05 |
00BA: BTFSC 03.2 |
00BB: GOTO 0D0 |
00BC: GOTO 0D5 |
.................... case '\f' : lcd_send_byte(0,1); // smaz displej |
00BD: CLRF 35 |
00BE: MOVLW 01 |
00BF: MOVWF 36 |
00C0: CALL 04E |
.................... delay_ms(2); |
00C1: MOVLW 02 |
00C2: MOVWF 31 |
00C3: CALL 028 |
.................... break; |
00C4: GOTO 0E1 |
.................... case '\n' : lcd_gotoxy(1,2); break; // presun se na 1. znak 2. radky |
00C5: MOVLW 01 |
00C6: MOVWF 31 |
00C7: MOVLW 02 |
00C8: MOVWF 32 |
00C9: CALL 09E |
00CA: GOTO 0E1 |
.................... case '\r' : lcd_gotoxy(1,1); break; // presun home |
00CB: MOVLW 01 |
00CC: MOVWF 31 |
00CD: MOVWF 32 |
00CE: CALL 09E |
00CF: GOTO 0E1 |
.................... case '\b' : lcd_send_byte(0,0x10); break; // posun kurzor o 1 zpet |
00D0: CLRF 35 |
00D1: MOVLW 10 |
00D2: MOVWF 36 |
00D3: CALL 04E |
00D4: GOTO 0E1 |
.................... default : if (c<0x20) c&=0x7; // preklopeni definovatelnych znaku na rozsah 0 az 0x1F |
00D5: MOVF 30,W |
00D6: SUBLW 1F |
00D7: BTFSS 03.0 |
00D8: GOTO 0DB |
00D9: MOVLW 07 |
00DA: ANDWF 30,F |
.................... lcd_send_byte(1,c); break; // zapis znak |
00DB: MOVLW 01 |
00DC: MOVWF 35 |
00DD: MOVF 30,W |
00DE: MOVWF 36 |
00DF: CALL 04E |
00E0: GOTO 0E1 |
.................... } |
.................... } |
00E1: RETLW 00 |
.................... |
.................... |
.................... // Zapni kurzor |
.................... // |
.................... void lcd_cursor_on() |
.................... { |
.................... lcd_send_byte(0,LCD_CURSOR_ON_); |
.................... } |
.................... |
.................... |
.................... // Vypni kurzor |
.................... // |
.................... void lcd_cursor_off() |
.................... { |
.................... lcd_send_byte(0,LCD_CURSOR_OFF_); |
.................... } |
.................... |
.................... |
.................... // Smaz displej |
.................... // |
.................... void lcd_clr() |
.................... { |
.................... lcd_putc('\f'); |
.................... } |
.................... |
.................... |
.................... // Definice vlastnich fontu |
.................... // |
.................... // Vlastnich definic muze byt jen 8 do pozic 0 az 7 pameti CGRAM radice lcd displeje |
.................... // Pro snadne definovani jsou pripraveny nasledujici definice a na konci souboru je uveden |
.................... // priklad pouziti definovanych znaku. |
.................... |
.................... |
.................... // Pomocna procedura pro posilani ridicich dat do radice displeje |
.................... // |
.................... void lcd_putc2(int Data) |
.................... { |
.................... lcd_send_byte(1,Data); |
.................... } |
.................... |
.................... |
.................... // Pomocne definice pro programovani obsahu CGRAM |
.................... // |
.................... #define lcd_define_start(Code) lcd_send_byte(0,0x40+(Code<<3)); delay_ms(2) |
.................... #define lcd_define_def(String) printf(lcd_putc2,String); |
.................... #define lcd_define_end() lcd_send_byte(0,3); delay_ms(2) |
.................... |
.................... |
.................... // Vlastni vykonne makro pro definovani fontu do pozice Index CGRAM s definicnim retezcem Def |
.................... // |
.................... #define lcd_define_char(Index, Def) lcd_define_start(Index); lcd_define_def(Def); lcd_define_end(); |
.................... |
.................... |
.................... // Pripravene definice fontu vybranych znaku |
.................... // V tabulce nesmi byt 00 (konec retezce v printf()), misto toho davame 80 |
.................... // |
.................... #define LCD_CHAR_BAT100 "\x0E\x1F\x1F\x1F\x1F\x1F\x1F\x1F" /* symbol plne baterie */ |
.................... #define LCD_CHAR_BAT50 "\x0E\x1F\x11\x11\x13\x17\x1F\x1F" /* symbol polovicni baterie */ |
.................... #define LCD_CHAR_BAT0 "\x0E\x1F\x11\x11\x11\x11\x11\x1F" /* symbol vybite baterie */ |
.................... #define LCD_CHAR_UP "\x80\x04\x0E\x15\x04\x04\x04\x80" /* symbol sipka nahoru */ |
.................... #define LCD_CHAR_DOWN "\x80\x04\x04\x04\x15\x0E\x04\x80" /* symbol Sipka dolu */ |
.................... #define LCD_CHAR_LUA "\x04\x0E\x11\x11\x1F\x11\x11\x80" /* A s carkou */ |
.................... #define LCD_CHAR_LLA "\x01\x02\x0E\x01\x1F\x11\x0F\x80" /* a s carkou */ |
.................... #define LCD_CHAR_HUC "\x0A\x0E\x11\x10\x10\x11\x0E\x80" /* C s hackem */ |
.................... #define LCD_CHAR_HLC "\x0A\x04\x0E\x10\x10\x11\x0E\x80" /* c s hackem */ |
.................... #define LCD_CHAR_HUD "\x0A\x1C\x12\x11\x11\x12\x1C\x80" /* D s hackem */ |
.................... #define LCD_CHAR_HLD "\x05\x03\x0D\x13\x11\x11\x0F\x80" /* d s hackem */ |
.................... #define LCD_CHAR_LUE "\x04\x1F\x10\x10\x1E\x10\x1F\x80" /* E s carkou */ |
.................... #define LCD_CHAR_LLE "\x01\x02\x0E\x11\x1F\x10\x0E\x80" /* e s carkou */ |
.................... #define LCD_CHAR_HUE "\x0A\x1F\x10\x1E\x10\x10\x1F\x80" /* E s hackem */ |
.................... #define LCD_CHAR_HLE "\x0A\x04\x0E\x11\x1F\x10\x0E\x80" /* e s hackem */ |
.................... #define LCD_CHAR_LUI "\x04\x0E\x04\x04\x04\x04\x0E\x80" /* I s carkou */ |
.................... #define LCD_CHAR_LLI "\x02\x04\x80\x0C\x04\x04\x0E\x80" /* i s carkou */ |
.................... #define LCD_CHAR_HUN "\x0A\x15\x11\x19\x15\x13\x11\x80" /* N s hackem */ |
.................... #define LCD_CHAR_HLN "\x0A\x04\x16\x19\x11\x11\x11\x80" /* n s hackem */ |
.................... #define LCD_CHAR_LUO "\x04\x0E\x11\x11\x11\x11\x0E\x80" /* O s carkou */ |
.................... #define LCD_CHAR_LLO "\x02\x04\x0E\x11\x11\x11\x0E\x80" /* o s carkou */ |
.................... #define LCD_CHAR_HUR "\x0A\x1E\x11\x1E\x14\x12\x11\x80" /* R s hackem */ |
.................... #define LCD_CHAR_HLR "\x0A\x04\x16\x19\x10\x10\x10\x80" /* r s hackem */ |
.................... #define LCD_CHAR_HUS "\x0A\x0F\x10\x0E\x01\x01\x1E\x80" /* S s hackem */ |
.................... #define LCD_CHAR_HLS "\x0A\x04\x0E\x10\x0E\x01\x1E\x80" /* s s hackem */ |
.................... #define LCD_CHAR_HUT "\x0A\x1F\x04\x04\x04\x04\x04\x80" /* T s hackem */ |
.................... #define LCD_CHAR_HLT "\x0A\x0C\x1C\x08\x08\x09\x06\x80" /* t s hackem */ |
.................... #define LCD_CHAR_LUU "\x02\x15\x11\x11\x11\x11\x0E\x80" /* U s carkou */ |
.................... #define LCD_CHAR_LLU "\x02\x04\x11\x11\x11\x13\x0D\x80" /* u s carkou */ |
.................... #define LCD_CHAR_CUU "\x06\x17\x11\x11\x11\x11\x0E\x80" /* U s krouzkem */ |
.................... #define LCD_CHAR_CLU "\x06\x06\x11\x11\x11\x11\x0E\x80" /* u s krouzkem */ |
.................... #define LCD_CHAR_LUY "\x02\x15\x11\x0A\x04\x04\x04\x80" /* Y s carkou */ |
.................... #define LCD_CHAR_LLY "\x02\x04\x11\x11\x0F\x01\x0E\x80" /* y s carkou */ |
.................... #define LCD_CHAR_HUZ "\x0A\x1F\x01\x02\x04\x08\x1F\x80" /* Z s hackem */ |
.................... #define LCD_CHAR_HLZ "\x0A\x04\x1F\x02\x04\x08\x1F\x80" /* z s hackem */ |
.................... |
.................... |
.................... // Priklad pouziti definovanych znaku |
.................... // |
.................... // |
.................... //void lcd_sample() |
.................... //{ |
.................... // lcd_define_char(0,LCD_CHAR_BAT50); // Priklad definice znaku baterie do pozice 0 |
.................... // lcd_define_char(2,LCD_CHAR_HLE LCD_CHAR_LUI); // Priklad definice znaku e s hackem a I s carkou od pozice 2 |
.................... // // vsimnete si, ze neni carka mezi retezci s definici (oba retezce definuji |
.................... // // jediny definicni retezec) |
.................... // printf(lcd_putc,"\fZnaky:\20\22\23"); // priklad vypisu znaku z pozice 0, 2 a 3 |
.................... // delay_ms(1000); |
.................... // lcd_define_char(0,LCD_CHAR_BAT0); // Predefinovani tvaru znaku v pozici 0 |
.................... // delay_ms(1000); |
.................... //} |
.................... |
.................... |
.................... #include "C:\library\kaklik\CCS\mys_chip_SPI.c" // modul umoznujici komunikaci s cidlem v mysi |
.................... //////////////////////////////////////////////////////////////////////////////// |
.................... // |
.................... // Modul pro prime ovladani senzoru v opticke mysi. |
.................... // (Pouziva SPI jednotku) |
.................... // |
.................... // |
.................... //////////////////////////////////////////////////////////////////////////////// |
.................... |
.................... #define SPI_DATA PIN_B2 // je treba nadefinovat datovy pin, aby se vedelo, ktery pin se ma vypinat pri cteni dat. |
.................... |
.................... // Address |
.................... #define PRODUCT_ID 0x00 |
.................... #define PRODUCT_ID4 0x01 |
.................... #define MOTION_STATUS 0x02 // |
.................... #define DELTA_X 0x03 // vycteni os |
.................... #define DELTA_Y 0x04 // -//- |
.................... #define OPERATION_MODE 0x85 // zapis do ridiciho registru |
.................... #define CONFIGURATION 0x86 // zmeni nastaveni rozliseni, atd. |
.................... |
.................... void chip_write(command) |
.................... { |
.................... output_high(PIN_B2); |
* |
001B: BSF 03.5 |
001C: BCF 06.2 |
001D: BCF 03.5 |
001E: BSF 06.2 |
.................... spi_write(command); |
001F: MOVF 28,W |
0020: MOVWF 13 |
0021: BSF 03.5 |
0022: BTFSC 14.0 |
0023: GOTO 026 |
0024: BCF 03.5 |
0025: GOTO 021 |
.................... } |
0026: BCF 03.5 |
0027: RETLW 00 |
.................... |
.................... signed int8 chip_read(command) |
.................... { |
.................... output_high(SPI_DATA); |
* |
016E: BSF 03.5 |
016F: BCF 06.2 |
0170: BCF 03.5 |
0171: BSF 06.2 |
.................... spi_write(command); |
0172: MOVF 28,W |
0173: MOVWF 13 |
0174: BSF 03.5 |
0175: BTFSC 14.0 |
0176: GOTO 179 |
0177: BCF 03.5 |
0178: GOTO 174 |
.................... output_float(SPI_DATA); |
0179: BSF 06.2 |
.................... return spi_read(0); |
017A: BCF 03.5 |
017B: MOVF 13,W |
017C: CLRF 13 |
017D: BSF 03.5 |
017E: BTFSC 14.0 |
017F: GOTO 182 |
0180: BCF 03.5 |
0181: GOTO 17D |
0182: BCF 03.5 |
0183: MOVF 13,W |
0184: MOVWF 78 |
.................... } |
0185: RETLW 00 |
.................... |
.................... |
.................... void main() |
.................... { |
0186: CLRF 04 |
0187: MOVLW 1F |
0188: ANDWF 03,F |
0189: BSF 03.5 |
018A: BCF 1F.4 |
018B: BCF 1F.5 |
018C: MOVF 1B,W |
018D: ANDLW 80 |
018E: MOVWF 1B |
018F: MOVLW 07 |
0190: MOVWF 1C |
0191: MOVF 1C,W |
0192: BCF 03.5 |
0193: BCF 0D.6 |
0194: MOVLW 60 |
0195: BSF 03.5 |
0196: MOVWF 0F |
.................... unsigned int8 hodnota; |
.................... signed int16 x=0,y=0; |
0197: BCF 03.5 |
0198: CLRF 22 |
0199: CLRF 23 |
019A: CLRF 24 |
019B: CLRF 25 |
.................... signed int8 xd,yd; |
.................... |
.................... setup_adc_ports(NO_ANALOGS|VSS_VDD); |
019C: BSF 03.5 |
019D: BCF 1F.4 |
019E: BCF 1F.5 |
019F: MOVF 1B,W |
01A0: ANDLW 80 |
01A1: MOVWF 1B |
.................... setup_adc(ADC_OFF); |
01A2: BCF 03.5 |
01A3: BCF 1F.0 |
.................... setup_spi(SPI_MASTER|SPI_H_TO_L|SPI_XMIT_L_TO_H|SPI_CLK_DIV_64); |
01A4: BCF 14.5 |
01A5: BSF 03.5 |
01A6: BCF 06.2 |
01A7: BSF 06.1 |
01A8: BCF 06.4 |
01A9: MOVLW 32 |
01AA: BCF 03.5 |
01AB: MOVWF 14 |
01AC: MOVLW 00 |
01AD: BSF 03.5 |
01AE: MOVWF 14 |
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
01AF: MOVF 01,W |
01B0: ANDLW C7 |
01B1: IORLW 08 |
01B2: MOVWF 01 |
.................... setup_timer_1(T1_DISABLED); |
01B3: BCF 03.5 |
01B4: CLRF 10 |
.................... setup_timer_2(T2_DISABLED,0,1); |
01B5: MOVLW 00 |
01B6: MOVWF 78 |
01B7: MOVWF 12 |
01B8: MOVLW 00 |
01B9: BSF 03.5 |
01BA: MOVWF 12 |
.................... setup_comparator(NC_NC_NC_NC); |
01BB: MOVLW 07 |
01BC: MOVWF 1C |
01BD: MOVF 05,W |
01BE: MOVLW 03 |
01BF: MOVWF 77 |
01C0: DECFSZ 77,F |
01C1: GOTO 1C0 |
01C2: MOVF 1C,W |
01C3: BCF 03.5 |
01C4: BCF 0D.6 |
.................... setup_vref(FALSE); |
01C5: BSF 03.5 |
01C6: CLRF 1D |
.................... |
.................... chip_write(OPERATION_MODE); |
01C7: MOVLW 85 |
01C8: BCF 03.5 |
01C9: MOVWF 28 |
01CA: CALL 01B |
.................... chip_write(0x00); // vypne sleep mode |
01CB: CLRF 28 |
01CC: CALL 01B |
.................... |
.................... chip_write(CONFIGURATION); |
01CD: MOVLW 86 |
01CE: MOVWF 28 |
01CF: CALL 01B |
.................... chip_write(0b00000110); // nastavi rozliseni na 600cpi |
01D0: MOVLW 06 |
01D1: MOVWF 28 |
01D2: CALL 01B |
.................... |
.................... lcd_init(); |
01D3: GOTO 064 |
.................... Delay_ms(200); |
01D4: MOVLW C8 |
01D5: MOVWF 31 |
01D6: CALL 028 |
.................... |
.................... While(true) |
.................... { |
.................... LCD_gotoxy(1,1); |
01D7: MOVLW 01 |
01D8: MOVWF 31 |
01D9: MOVWF 32 |
01DA: CALL 09E |
.................... printf(lcd_putc,"status: %X", hodnota); |
01DB: CLRF 28 |
01DC: MOVF 28,W |
01DD: CALL 00C |
01DE: INCF 28,F |
01DF: MOVWF 77 |
01E0: MOVWF 30 |
01E1: CALL 0AF |
01E2: MOVLW 08 |
01E3: SUBWF 28,W |
01E4: BTFSS 03.2 |
01E5: GOTO 1DC |
01E6: MOVF 21,W |
01E7: MOVWF 29 |
01E8: MOVLW 37 |
01E9: MOVWF 2A |
01EA: GOTO 0E2 |
.................... delay_ms(20); |
01EB: MOVLW 14 |
01EC: MOVWF 31 |
01ED: CALL 028 |
.................... |
.................... LCD_gotoxy(1,2); |
01EE: MOVLW 01 |
01EF: MOVWF 31 |
01F0: MOVLW 02 |
01F1: MOVWF 32 |
01F2: CALL 09E |
.................... printf(lcd_putc,"X=%ld Y=%ld", x, y); |
01F3: MOVLW 58 |
01F4: MOVWF 30 |
01F5: CALL 0AF |
01F6: MOVLW 3D |
01F7: MOVWF 30 |
01F8: CALL 0AF |
01F9: MOVLW 10 |
01FA: MOVWF 04 |
01FB: MOVF 23,W |
01FC: MOVWF 29 |
01FD: MOVF 22,W |
01FE: MOVWF 28 |
01FF: CALL 104 |
0200: MOVLW 20 |
0201: MOVWF 30 |
0202: CALL 0AF |
0203: MOVLW 59 |
0204: MOVWF 30 |
0205: CALL 0AF |
0206: MOVLW 3D |
0207: MOVWF 30 |
0208: CALL 0AF |
0209: MOVLW 10 |
020A: MOVWF 04 |
020B: MOVF 25,W |
020C: MOVWF 29 |
020D: MOVF 24,W |
020E: MOVWF 28 |
020F: CALL 104 |
.................... delay_ms(20); |
0210: MOVLW 14 |
0211: MOVWF 31 |
0212: CALL 028 |
.................... |
.................... hodnota=chip_read(MOTION_STATUS); |
0213: MOVLW 02 |
0214: MOVWF 28 |
0215: CALL 16E |
0216: MOVF 78,W |
0217: MOVWF 21 |
.................... |
.................... xd=chip_read(DELTA_X); |
0218: MOVLW 03 |
0219: MOVWF 28 |
021A: CALL 16E |
021B: MOVF 78,W |
021C: MOVWF 26 |
.................... yd=chip_read(DELTA_Y); |
021D: MOVLW 04 |
021E: MOVWF 28 |
021F: CALL 16E |
0220: MOVF 78,W |
0221: MOVWF 27 |
.................... |
.................... x+=xd; |
0222: CLRF 7A |
0223: MOVF 26,W |
0224: BTFSC 26.7 |
0225: DECF 7A,F |
0226: ADDWF 22,F |
0227: BTFSC 03.0 |
0228: INCF 23,F |
0229: MOVF 7A,W |
022A: ADDWF 23,F |
.................... y+=yd; |
022B: CLRF 7A |
022C: MOVF 27,W |
022D: BTFSC 27.7 |
022E: DECF 7A,F |
022F: ADDWF 24,F |
0230: BTFSC 03.0 |
0231: INCF 25,F |
0232: MOVF 7A,W |
0233: ADDWF 25,F |
.................... } |
0234: GOTO 1D7 |
.................... } |
.................... |
0235: SLEEP |
Configuration Fuses: |
Word 1: 3F79 NOWDT NOPUT MCLR BROWNOUT NOLVP NOCPD NOWRT NODEBUG CCPB0 NOPROTECT INTRC |
Word 2: 3FFF FCMEN IESO |
/programy/C/PIC_C/mereni/mys/PIC16F88/mys.PJT |
---|
0,0 → 1,39 |
[PROJECT] |
Target=mys.HEX |
Development_Mode= |
Processor=0x688F |
ToolSuite=CCS |
[Directories] |
Include=C:\Program Files\PICC\devices\;C:\Program Files\PICC\dr |
Library= |
LinkerScript= |
[Target Data] |
FileList=mys.c; |
BuildTool=C-COMPILER |
OptionString=+FM |
AdditionalOptionString= |
BuildRequired=1 |
[mys.c] |
Type=4 |
Path= |
FileList= |
BuildTool= |
OptionString= |
AdditionalOptionString= |
[mru-list] |
1=mys.c |
[Windows] |
0=0000 mys.c 0 0 796 451 3 0 |
[Opened Files] |
1=D:\KAKLIK\programy\PIC_C\mereni\mys\PIC16F88\mys.c |
2=C:\library\kaklik\CCS\mys_chip_SPI.c |
3=D:\KAKLIK\programy\PIC_C\mereni\mys\PIC16F88\mys.h |
4=C:\Program Files\PICC\devices\16F88.h |
5=C:\library\CCS\lcd.c |
6= |
/programy/C/PIC_C/mereni/mys/PIC16F88/mys.SYM |
---|
0,0 → 1,79 |
015-016 CCP_1 |
015 CCP_1_LOW |
016 CCP_1_HIGH |
021 main.hodnota |
022-023 main.x |
024-025 main.y |
026 main.xd |
027 main.yd |
028 chip_write.command |
028 lcd_init.i |
028 chip_read.command |
028-029 @PRINTF_LD_278.P1 |
028 main.@SCRATCH |
029 @PRINTF_X_278.P1 |
029 lcd_init.@SCRATCH |
02A @PRINTF_X_278.P1 |
02A @PRINTF_LD_278.@SCRATCH |
02B @PRINTF_LD_278.@SCRATCH |
02C @PRINTF_LD_278.@SCRATCH |
02D @PRINTF_LD_278.@SCRATCH |
02E @PRINTF_LD_278.@SCRATCH |
02F @PRINTF_LD_278.@SCRATCH |
030 lcd_putc.c |
031 @delay_ms1.P1 |
031 lcd_gotoxy.x |
032 lcd_gotoxy.y |
033 lcd_gotoxy.Adr |
034 lcd_gotoxy.@SCRATCH |
035 lcd_send_byte.Adr |
036 lcd_send_byte.n |
037 lcd_send_nibble.n |
038 lcd_send_nibble.@SCRATCH |
039 lcd_send_nibble.@SCRATCH |
077 @SCRATCH |
078 @SCRATCH |
078 _RETURN_ |
079 @SCRATCH |
07A @SCRATCH |
07B @SCRATCH |
09C.6 C1OUT |
09C.7 C2OUT |
0028 @delay_ms1 |
0004 @const27 |
003D lcd_send_nibble |
004E lcd_send_byte |
0064 lcd_init |
009E lcd_gotoxy |
00AF lcd_putc |
001B chip_write |
016E chip_read |
0186 main |
000C @const10113 |
00E2 @PRINTF_X_278 |
0104 @PRINTF_LD_278 |
0186 @cinit |
Project Files: |
D:\KAKLIK\programy\PIC_C\mereni\mys\PIC16F88\mys.c |
D:\KAKLIK\programy\PIC_C\mereni\mys\PIC16F88\mys.h |
C:\Program Files\PICC\devices\16F88.h |
C:\library\CCS\lcd.c |
C:\library\kaklik\CCS\mys_chip_SPI.c |
Compiler Settings: |
Processor: PIC16F88 |
Pointer Size: 8 |
ADC Range: 0-255 |
Opt Level: 9 |
Short,Int,Long: 1,8,16 |
Output Files: |
Errors: D:\KAKLIK\programy\PIC_C\mereni\mys\PIC16F88\mys.err |
INHX8: D:\KAKLIK\programy\PIC_C\mereni\mys\PIC16F88\mys.HEX |
Symbols: D:\KAKLIK\programy\PIC_C\mereni\mys\PIC16F88\mys.SYM |
List: D:\KAKLIK\programy\PIC_C\mereni\mys\PIC16F88\mys.LST |
Debug/COFF: D:\KAKLIK\programy\PIC_C\mereni\mys\PIC16F88\mys.cof |
Call Tree: D:\KAKLIK\programy\PIC_C\mereni\mys\PIC16F88\mys.tre |
Statistics: D:\KAKLIK\programy\PIC_C\mereni\mys\PIC16F88\mys.sta |
/programy/C/PIC_C/mereni/mys/PIC16F88/mys.c |
---|
0,0 → 1,52 |
#include "D:\KAKLIK\programy\PIC_C\mereni\mys\PIC16F88\mys.h" |
#define LCD_RS PIN_B3 // rizeni registru LCD displeje |
#define LCD_E PIN_B0 // enable LCD displeje |
#define LCD_DATA_LSB PIN_A0 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou) |
#include "C:\library\CCS\lcd.c" |
#include "C:\library\kaklik\CCS\mys_chip_SPI.c" // modul umoznujici komunikaci s cidlem v mysi |
void main() |
{ |
unsigned int8 hodnota; |
signed int16 x=0,y=0; |
signed int8 xd,yd; |
setup_adc_ports(NO_ANALOGS|VSS_VDD); |
setup_adc(ADC_OFF); |
setup_spi(SPI_MASTER|SPI_H_TO_L|SPI_XMIT_L_TO_H|SPI_CLK_DIV_64); |
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
setup_timer_1(T1_DISABLED); |
setup_timer_2(T2_DISABLED,0,1); |
setup_comparator(NC_NC_NC_NC); |
setup_vref(FALSE); |
chip_write(OPERATION_MODE); |
chip_write(0x00); // vypne sleep mode |
chip_write(CONFIGURATION); |
chip_write(0b00000110); // nastavi rozliseni na 600cpi |
lcd_init(); |
Delay_ms(200); |
While(true) |
{ |
LCD_gotoxy(1,1); |
printf(lcd_putc,"status: %X", hodnota); |
delay_ms(20); |
LCD_gotoxy(1,2); |
printf(lcd_putc,"X=%ld Y=%ld", x, y); |
delay_ms(20); |
hodnota=chip_read(MOTION_STATUS); |
xd=chip_read(DELTA_X); //precte z cidla zmenu polohy |
yd=chip_read(DELTA_Y); |
x+=xd; |
y+=yd; |
} |
} |
/programy/C/PIC_C/mereni/mys/PIC16F88/mys.cof |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/mereni/mys/PIC16F88/mys.err |
---|
0,0 → 1,0 |
No Errors |
/programy/C/PIC_C/mereni/mys/PIC16F88/mys.h |
---|
0,0 → 1,5 |
#include <16F88.h> |
#device adc=8 |
#fuses NOWDT,INTRC, NOPUT, MCLR, BROWNOUT, NOLVP, NOCPD, NOWRT, NODEBUG, NOPROTECT, FCMEN, IESO |
#use delay(clock=4000000) |
/programy/C/PIC_C/mereni/mys/PIC16F88/mys.sta |
---|
0,0 → 1,42 |
ROM used: 566 (14%) |
566 (14%) including unused fragments |
1 Average locations per line |
7 Average locations per statement |
RAM used: 13 (7%) at main() level |
30 (17%) worst case |
Lines Stmts % Files |
----- ----- --- ----- |
53 27 34 D:\KAKLIK\programy\PIC_C\mereni\mys\PIC16F88\mys.c |
6 0 0 D:\KAKLIK\programy\PIC_C\mereni\mys\PIC16F88\mys.h |
275 0 0 C:\Program Files\PICC\devices\16F88.h |
312 47 44 C:\library\CCS\lcd.c |
33 6 4 C:\library\kaklik\CCS\mys_chip_SPI.c |
----- ----- |
1358 160 Total |
Page ROM % RAM Functions: |
---- --- --- --- ---------- |
0 21 4 1 @delay_ms1 |
0 8 1 0 @const27 |
0 17 3 3 lcd_send_nibble |
0 22 4 2 lcd_send_byte |
0 58 10 2 lcd_init |
0 17 3 4 lcd_gotoxy |
0 51 9 1 lcd_putc |
0 13 2 1 chip_write |
0 24 4 1 chip_read |
0 176 31 8 main |
0 15 3 0 @const10113 |
0 34 6 2 @PRINTF_X_278 |
0 106 19 8 @PRINTF_LD_278 |
Segment Used Free |
--------- ---- ---- |
00000-00003 4 0 |
00004-007FF 562 1482 |
00800-00FFF 0 2048 |
/programy/C/PIC_C/mereni/mys/PIC16F88/mys.tre |
---|
0,0 → 1,301 |
ÀÄmys |
ÀÄmain 0/176 Ram=8 |
ÃÄ??0?? |
ÃÄchip_write 0/13 Ram=1 |
ÃÄchip_write 0/13 Ram=1 |
ÃÄchip_write 0/13 Ram=1 |
ÃÄchip_write 0/13 Ram=1 |
ÃÄlcd_init 0/58 Ram=2 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄ@const27 0/8 Ram=0 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄ@delay_ms1 0/21 Ram=1 |
ÃÄ@delay_ms1 0/21 Ram=1 |
ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_nibble 0/17 Ram=3 |
ÃÄ@const10113 0/15 Ram=0 |
ÃÄlcd_putc 0/51 Ram=1 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_nibble 0/17 Ram=3 |
ÃÄ@PRINTF_X_278 0/34 Ram=2 |
³ ÃÄlcd_putc 0/51 Ram=1 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_putc 0/51 Ram=1 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_nibble 0/17 Ram=3 |
ÃÄ@delay_ms1 0/21 Ram=1 |
ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_nibble 0/17 Ram=3 |
ÃÄlcd_putc 0/51 Ram=1 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_nibble 0/17 Ram=3 |
ÃÄlcd_putc 0/51 Ram=1 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_nibble 0/17 Ram=3 |
ÃÄ@PRINTF_LD_278 0/106 Ram=8 |
³ ÃÄlcd_putc 0/51 Ram=1 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_putc 0/51 Ram=1 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_putc 0/51 Ram=1 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_nibble 0/17 Ram=3 |
ÃÄlcd_putc 0/51 Ram=1 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_nibble 0/17 Ram=3 |
ÃÄlcd_putc 0/51 Ram=1 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_nibble 0/17 Ram=3 |
ÃÄlcd_putc 0/51 Ram=1 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_nibble 0/17 Ram=3 |
ÃÄ@PRINTF_LD_278 0/106 Ram=8 |
³ ÃÄlcd_putc 0/51 Ram=1 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_putc 0/51 Ram=1 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_putc 0/51 Ram=1 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/17 Ram=3 |
³ ÀÄlcd_send_nibble 0/17 Ram=3 |
ÃÄ@delay_ms1 0/21 Ram=1 |
ÃÄchip_read 0/24 Ram=1 |
ÃÄchip_read 0/24 Ram=1 |
ÀÄchip_read 0/24 Ram=1 |
/programy/C/PIC_C/mereni/mys/mys.JPG |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/mereni/otmer/16F873/LCD.C |
---|
0,0 → 1,311 |
// LCD modul pro ovladani dvouradkoveho LCD modulu se standardnim Hitachi radicem |
// (c)miho 2002,2005 |
// |
// Historie: |
// |
// 0.00 Uvodni verze se snadnou definici portu LCD displeje |
// 0.01 Oprava portu (zapomenute stare identifikatory) |
// 0.02 Doplnena moznost pripojeni datoveho portu LCD na libovolne porty |
// 0.03 Doplnena procedura lcd_clr pro smazani displeje |
// |
// |
// Funkce: |
// |
// lcd_init() inicializuje LCD displej a porty, nutno volat jako prvni |
// |
// lcd_putc(c) zapis snaku do lcd displeje, zpracovava nasledujici ridici znaky |
// \f = \x0C - nova stranka - smazani displeje |
// \n = \x0A - odradkovani (prechod na druhou radku) |
// \b = \x08 - backspace - posunuti kurzoru o 1 pozici zpet |
// \r = \x0D - goto home to position 1,1 |
// \0 .. \7 - definovatelne znaky v pozicich 0 az 7 v CGRAM |
// \20 .. \27 - alternativne zapsane znaky (oktalove) v pozicich 0 az 7 CGRAM |
// Pozor na to, ze funkce printf konci tisk pokud narazi na \0 (konec retezce) |
// |
// lcd_gotoxy(x,y) presune kurzor na uvedenou adresu |
// nekontroluje parametry |
// |
// lcd_cursor_on zapne kurzor |
// lcd_cursor_off vypne kurzor |
// |
// lcd_clr smaze displej |
// |
// lcd_define_char(Index, Def) Makro, ktere definuje znaky od pozice Index obsahem definicniho |
// retezce Def. Kazdych 8 znaku retezce Def definuje dalsi znak v CGRAM. |
// Kapacita CGRAM je celkem 8 znaku s indexem 0 az 7. |
// Na konci se provede lcd_gotoxy(1,1). |
// Na konci teto knihovny je priklad pouziti definovanych znaku |
// |
// |
// Definice portu: // Datovy port displeje pripojeny na 4 bity za sebou na jeden port |
// |
// #define LCD_RS PIN_B2 // rizeni registru LCD displeje |
// #define LCD_E PIN_B1 // enable LCD displeje |
// #define LCD_DATA_LSB PIN_C2 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou) |
// |
// |
// Alternativni definice: // Datovy port displeje pripojeny na libovolne 4 bitove porty (vede na kod delsi asi o 25 slov) |
// |
// #define LCD_RS PIN_B2 // rizeni registru LCD displeje |
// #define LCD_E PIN_B1 // enable LCD displeje |
// #define LCD_D0 PIN_C2 // D0 - datove bity pripojene na libovolne porty |
// #define LCD_D1 PIN_C3 // D1 |
// #define LCD_D2 PIN_C4 // D2 |
// #define LCD_D3 PIN_C5 // D3 |
// Privatni sekce, cist jen v pripade, ze neco nefunguje |
#ifdef LCD_DATA_LSB |
// Generovane defince portu pro ucely teto knihovny aby kod generoval spravne IO operace a soucasne |
// bylo mozne jednoduse deklarovat pripojene piny LCD displeje pri pouziti teto knihovny. Problem spociva |
// v tom, ze se musi spravne ridit smery portu a soucasne datovy port zabira jen 4 bity ze zadaneho portu |
// |
#define LCD_SHIFT (LCD_DATA_LSB&7) // pocet bitu posuvu datoveho kanalu v datovem portu |
#define LCD_PORT (LCD_DATA_LSB>>3) // adresa LCD datoveho portu |
#define LCD_TRIS (LCD_PORT+0x80) // adresa prislusneho TRIS registru |
#define LCD_MASK (0xF<<LCD_SHIFT) // maska platnych bitu |
// |
#if LCD_SHIFT>4 // kontrola mezi |
#error LCD data port LSB bit not in range 0..4 |
#endif |
#endif |
// Definice konstant pro LCD display |
// |
#define LCD_CURSOR_ON_ 0x0E // kurzor jako blikajici radka pod znakem |
#define LCD_CURSOR_OFF_ 0x0C // zadny kurzor |
#define LCD_LINE_2 0x40 // adresa 1. znaku 2. radky |
// Definice rezimu LCD displeje |
// |
BYTE const LCD_INIT_STRING[4] = |
{ |
0x28, // intrfejs 4 bity, 2 radky, font 5x7 |
LCD_CURSOR_OFF_, // display on, kurzor off, |
0x01, // clear displeje |
0x06 // inkrement pozice kurzoru (posun kurzoru doprava) |
}; |
// Odesle nibble do displeje (posle data a klikne signalem e) |
// |
void lcd_send_nibble( BYTE n ) |
{ |
#ifdef LCD_DATA_LSB |
// data jsou za sebou na 4 bitech jednoho portu |
*LCD_PORT = (*LCD_PORT & ~LCD_MASK) | ((n << LCD_SHIFT) & LCD_MASK); // nastav datove bity portu a ostatni zachovej |
#else |
// data jsou na libovolnych 4 bitech libovolnych portu |
output_bit(LCD_D0,bit_test(n,0)); |
output_bit(LCD_D1,bit_test(n,1)); |
output_bit(LCD_D2,bit_test(n,2)); |
output_bit(LCD_D3,bit_test(n,3)); |
#endif |
output_bit(LCD_E,1); // vzestupna hrana |
delay_us(1); // pockej alespon 450ns od e nebo alespon 195ns od dat |
output_bit(LCD_E,0); // sestupna hrana (minimalni perioda e je 1us) |
} |
// Odesle bajt do registru LCD |
// |
// Pokud je Adr=0 .. instrukcni registr |
// Pokud je Adr=1 .. datovy registr |
// |
void lcd_send_byte( BOOLEAN Adr, BYTE n ) |
{ |
output_bit(LCD_RS,Adr); // vyber registr |
swap(n); |
lcd_send_nibble(n); // posli horni pulku bajtu |
swap(n); |
lcd_send_nibble(n); // posli spodni pulku bajtu |
delay_us(40); // minimalni doba na provedeni prikazu |
} |
// Provede inicializaci LCD displeje, smaze obsah a nastavi mod displeje |
// |
// Tato procedura se musi volat pred pouzitim ostatnich lcd_ procedur |
// |
void lcd_init() |
{ |
int i; // pocitadlo cyklu |
delay_ms(20); // spozdeni pro provedeni startu displeje po zapnuti napajeni |
#ifdef LCD_DATA_LSB |
// data jsou na 4 bitech za sebou, nastav smer pro vsechny dalsi prenosy |
*LCD_TRIS = *LCD_TRIS & ~LCD_MASK; // nuluj odpovidajici bity tris registru datoveho portu LCD |
#endif |
output_bit(LCD_RS,0); // nastav jako vystup a nastav klidovy stav |
output_bit(LCD_E, 0); // nastav jako vystup a nastav klidovy stav |
for (i=0; i<3; i++) // nastav lcd do rezimu 8 bitu sbernice |
{ |
delay_ms(2); // muze byt rozdelany prenos dat (2x 4 bity) nebo pomaly povel |
lcd_send_nibble(3); // rezim 8 bitu |
} |
delay_us(40); // cas na zpracovani |
lcd_send_nibble(2); // nastav rezim 4 bitu (plati od nasledujiciho prenosu) |
delay_us(40); // cas na zpracovani |
for (i=0;i<3;i++) // proved inicializaci (nastaveni modu, smazani apod) |
{ |
lcd_send_byte(0,LCD_INIT_STRING[i]); |
delay_ms(2); |
} |
} |
// Proved presun kurzoru |
// |
// Pozice 1.1 je domu |
// |
void lcd_gotoxy( BYTE x, BYTE y) |
{ |
BYTE Adr; |
Adr=x-1; |
if(y==2) |
Adr+=LCD_LINE_2; |
lcd_send_byte(0,0x80|Adr); |
} |
// Zapis znaku na displej, zpracovani ridicich znaku |
// |
void lcd_putc( char c) |
{ |
switch (c) |
{ |
case '\f' : lcd_send_byte(0,1); // smaz displej |
delay_ms(2); |
break; |
case '\n' : lcd_gotoxy(1,2); break; // presun se na 1. znak 2. radky |
case '\r' : lcd_gotoxy(1,1); break; // presun home |
case '\b' : lcd_send_byte(0,0x10); break; // posun kurzor o 1 zpet |
default : if (c<0x20) c&=0x7; // preklopeni definovatelnych znaku na rozsah 0 az 0x1F |
lcd_send_byte(1,c); break; // zapis znak |
} |
} |
// Zapni kurzor |
// |
void lcd_cursor_on() |
{ |
lcd_send_byte(0,LCD_CURSOR_ON_); |
} |
// Vypni kurzor |
// |
void lcd_cursor_off() |
{ |
lcd_send_byte(0,LCD_CURSOR_OFF_); |
} |
// Smaz displej |
// |
void lcd_clr() |
{ |
lcd_putc('\f'); |
} |
// Definice vlastnich fontu |
// |
// Vlastnich definic muze byt jen 8 do pozic 0 az 7 pameti CGRAM radice lcd displeje |
// Pro snadne definovani jsou pripraveny nasledujici definice a na konci souboru je uveden |
// priklad pouziti definovanych znaku. |
// Pomocna procedura pro posilani ridicich dat do radice displeje |
// |
void lcd_putc2(int Data) |
{ |
lcd_send_byte(1,Data); |
} |
// Pomocne definice pro programovani obsahu CGRAM |
// |
#define lcd_define_start(Code) lcd_send_byte(0,0x40+(Code<<3)); delay_ms(2) |
#define lcd_define_def(String) printf(lcd_putc2,String); |
#define lcd_define_end() lcd_send_byte(0,3); delay_ms(2) |
// Vlastni vykonne makro pro definovani fontu do pozice Index CGRAM s definicnim retezcem Def |
// |
#define lcd_define_char(Index, Def) lcd_define_start(Index); lcd_define_def(Def); lcd_define_end(); |
// Pripravene definice fontu vybranych znaku |
// V tabulce nesmi byt 00 (konec retezce v printf()), misto toho davame 80 |
// |
#define LCD_CHAR_BAT100 "\x0E\x1F\x1F\x1F\x1F\x1F\x1F\x1F" /* symbol plne baterie */ |
#define LCD_CHAR_BAT50 "\x0E\x1F\x11\x11\x13\x17\x1F\x1F" /* symbol polovicni baterie */ |
#define LCD_CHAR_BAT0 "\x0E\x1F\x11\x11\x11\x11\x11\x1F" /* symbol vybite baterie */ |
#define LCD_CHAR_UP "\x80\x04\x0E\x15\x04\x04\x04\x80" /* symbol sipka nahoru */ |
#define LCD_CHAR_DOWN "\x80\x04\x04\x04\x15\x0E\x04\x80" /* symbol Sipka dolu */ |
#define LCD_CHAR_LUA "\x04\x0E\x11\x11\x1F\x11\x11\x80" /* A s carkou */ |
#define LCD_CHAR_LLA "\x01\x02\x0E\x01\x1F\x11\x0F\x80" /* a s carkou */ |
#define LCD_CHAR_HUC "\x0A\x0E\x11\x10\x10\x11\x0E\x80" /* C s hackem */ |
#define LCD_CHAR_HLC "\x0A\x04\x0E\x10\x10\x11\x0E\x80" /* c s hackem */ |
#define LCD_CHAR_HUD "\x0A\x1C\x12\x11\x11\x12\x1C\x80" /* D s hackem */ |
#define LCD_CHAR_HLD "\x05\x03\x0D\x13\x11\x11\x0F\x80" /* d s hackem */ |
#define LCD_CHAR_LUE "\x04\x1F\x10\x10\x1E\x10\x1F\x80" /* E s carkou */ |
#define LCD_CHAR_LLE "\x01\x02\x0E\x11\x1F\x10\x0E\x80" /* e s carkou */ |
#define LCD_CHAR_HUE "\x0A\x1F\x10\x1E\x10\x10\x1F\x80" /* E s hackem */ |
#define LCD_CHAR_HLE "\x0A\x04\x0E\x11\x1F\x10\x0E\x80" /* e s hackem */ |
#define LCD_CHAR_LUI "\x04\x0E\x04\x04\x04\x04\x0E\x80" /* I s carkou */ |
#define LCD_CHAR_LLI "\x02\x04\x80\x0C\x04\x04\x0E\x80" /* i s carkou */ |
#define LCD_CHAR_HUN "\x0A\x15\x11\x19\x15\x13\x11\x80" /* N s hackem */ |
#define LCD_CHAR_HLN "\x0A\x04\x16\x19\x11\x11\x11\x80" /* n s hackem */ |
#define LCD_CHAR_LUO "\x04\x0E\x11\x11\x11\x11\x0E\x80" /* O s carkou */ |
#define LCD_CHAR_LLO "\x02\x04\x0E\x11\x11\x11\x0E\x80" /* o s carkou */ |
#define LCD_CHAR_HUR "\x0A\x1E\x11\x1E\x14\x12\x11\x80" /* R s hackem */ |
#define LCD_CHAR_HLR "\x0A\x04\x16\x19\x10\x10\x10\x80" /* r s hackem */ |
#define LCD_CHAR_HUS "\x0A\x0F\x10\x0E\x01\x01\x1E\x80" /* S s hackem */ |
#define LCD_CHAR_HLS "\x0A\x04\x0E\x10\x0E\x01\x1E\x80" /* s s hackem */ |
#define LCD_CHAR_HUT "\x0A\x1F\x04\x04\x04\x04\x04\x80" /* T s hackem */ |
#define LCD_CHAR_HLT "\x0A\x0C\x1C\x08\x08\x09\x06\x80" /* t s hackem */ |
#define LCD_CHAR_LUU "\x02\x15\x11\x11\x11\x11\x0E\x80" /* U s carkou */ |
#define LCD_CHAR_LLU "\x02\x04\x11\x11\x11\x13\x0D\x80" /* u s carkou */ |
#define LCD_CHAR_CUU "\x06\x17\x11\x11\x11\x11\x0E\x80" /* U s krouzkem */ |
#define LCD_CHAR_CLU "\x06\x06\x11\x11\x11\x11\x0E\x80" /* u s krouzkem */ |
#define LCD_CHAR_LUY "\x02\x15\x11\x0A\x04\x04\x04\x80" /* Y s carkou */ |
#define LCD_CHAR_LLY "\x02\x04\x11\x11\x0F\x01\x0E\x80" /* y s carkou */ |
#define LCD_CHAR_HUZ "\x0A\x1F\x01\x02\x04\x08\x1F\x80" /* Z s hackem */ |
#define LCD_CHAR_HLZ "\x0A\x04\x1F\x02\x04\x08\x1F\x80" /* z s hackem */ |
// Priklad pouziti definovanych znaku |
// |
// |
//void lcd_sample() |
//{ |
// lcd_define_char(0,LCD_CHAR_BAT50); // Priklad definice znaku baterie do pozice 0 |
// lcd_define_char(2,LCD_CHAR_HLE LCD_CHAR_LUI); // Priklad definice znaku e s hackem a I s carkou od pozice 2 |
// // vsimnete si, ze neni carka mezi retezci s definici (oba retezce definuji |
// // jediny definicni retezec) |
// printf(lcd_putc,"\fZnaky:\20\22\23"); // priklad vypisu znaku z pozice 0, 2 a 3 |
// delay_ms(1000); |
// lcd_define_char(0,LCD_CHAR_BAT0); // Predefinovani tvaru znaku v pozici 0 |
// delay_ms(1000); |
//} |
/programy/C/PIC_C/mereni/otmer/16F873/otmer.BAK |
---|
0,0 → 1,44 |
#include "D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\otmer.h" |
//Definice portu: // Datovy port displeje pripojeny na 4 bity za sebou na jeden port |
#define LCD_RS PIN_B1 // rizeni registru LCD displeje |
#define LCD_E PIN_B0 // enable LCD displeje |
#define LCD_DATA_LSB PIN_C4 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou) |
#include "LCD.C" |
#define DATA PIN_A1 |
#define CP PIN_A0 |
#define STROBE PIN_A2 |
#include "C:\library\kaklik\ccs\shift_reg.c" |
void main() |
{ |
unsigned int16 otacky; |
setup_adc_ports(NO_ANALOGS); |
setup_adc(ADC_OFF); |
setup_spi(FALSE); |
setup_timer_0(RTCC_EXT_H_TO_L|RTCC_DIV_1); |
setup_timer_1(T1_EXTERNAL|T1_DIV_BY_2); |
setup_timer_2(T2_DISABLED,0,1); |
setup_ccp1(CCP_PWM); |
setup_ccp2(CCP_OFF); |
lcd_init(); |
while (true) |
{ |
set_timer1(0); |
Delay_ms(500); |
otacky=get_timer1(); |
otacky=otacky*40; |
LCD_gotoxy(2,2); |
printf(lcd_putc,"otacky:%lu ot/min ",otacky); |
} |
} |
/programy/C/PIC_C/mereni/otmer/16F873/otmer.HEX |
---|
0,0 → 1,64 |
:1000000000308A00582900000A108A100A1182075D |
:1000100028340C34013406340A108A100A1182077D |
:100020006F347434613463346B3479343A34253446 |
:100030006C34753420346F3474342F346D34693437 |
:100040006E34203420340034323084000008031928 |
:1000500038280130A100A001A00B2C28A10B2B28CF |
:100060004A30A000A00B322800000000800B292895 |
:10007000003407080F39B900380EA000F030A00591 |
:100080002008F03939048700061483160610000092 |
:10009000831206108316061083120034B608031D5F |
:1000A0005328861054288614831686108312B70EA0 |
:1000B0003708B8003920B70E3708B80039200D309E |
:1000C000A000A00B612800341430B20024200F30AF |
:1000D00083168705831286108316861083120610F6 |
:1000E000831606108312A8012808023C031C8028EE |
:1000F0000230B20024200330B8003920A80A742846 |
:100100000D30A000A00B82280230B80039200D303D |
:10011000A000A00B8928A8012808023C031C9C28E9 |
:1001200028080420A900B6012908B7004E20023093 |
:10013000B2002420A80A8C288A119C291030A00023 |
:10014000A301AC01A90CA80C031CAC282A08A30726 |
:100150000318AC0A2B08AC07AC0CA30CA20CA10C26 |
:10016000A00BA2288A11B92901303202B400330849 |
:10017000023C031DBD284030B40734088038B50068 |
:10018000B6013508B7004E20003431080C3A031987 |
:10019000D328063A0319DB28073A0319E128053A60 |
:1001A0000319E628EB28B6010130B7004E200230D3 |
:1001B000B2002420F7280130B2000230B300B4208E |
:1001C000F7280130B200B300B420F728B601103090 |
:1001D000B7004E20F72831081F3C031CF1280730D8 |
:1001E000B1050130B6003108B7004E20F7280034C1 |
:1001F0000408B0002A0EF038AC00AC07E23EAD00B7 |
:10020000323EAF002A080F39AD07AD07AF07E93E10 |
:10021000AE00AE07AE07290E0F39AE07AF07AE0D21 |
:10022000AF0DAF09AF0D29080F39AF07AC0D07307F |
:10023000AB000A30AF07AE03031C1A29AE07AD03AB |
:10024000031C1E29AD07AC03031C2229AC07AB031A |
:10025000031C26292B3084000730300584072F30FB |
:10026000040203194F290008A000031D3D29301A7C |
:100270004D29B0193F29203040290830B0003030D6 |
:10028000A007AA010408A9002008AB002008B100BB |
:10029000C520290884002B08A000840A2F29000803 |
:1002A000A0003030A0072008B100C5208A11D8294D |
:1002B00084011F30830583161F149F141F159F117F |
:1002C000FF308312A50083161F149F141F159F1162 |
:1002D00083121F109412A51225088316870083121B |
:1002E00025162508831687008312A5112508831675 |
:1002F0008700003083129400831694000108C739E8 |
:10030000383881009730831290000030A1009200AD |
:10031000003083169200831225112508831687006A |
:10032000831207110C309700A51425088316870047 |
:1003300083129D019D0164288F018E010230A80067 |
:10034000FA30B2002420A80BA0290F08A3000E0841 |
:10035000A0000F082302031DA5292008A6002308DA |
:10036000A7002708A9002608A800AB012830AA008A |
:100370009E282208A7002108A6002608A00027081A |
:10038000A300C2290230B200B300B420A80128089B |
:100390000C20A80AA000B100C52007302802031DC8 |
:1003A000C729103084002708AA002608A900F828C9 |
:1003B0000A30A90029080C20A90AA000B100C52014 |
:0C03C00013302902031DDA299C29630078 |
:02400E00793FF8 |
:00000001FF |
;PIC16F873 |
/programy/C/PIC_C/mereni/otmer/16F873/otmer.LST |
---|
0,0 → 1,762 |
CCS PCM C Compiler, Version 3.221, 27853 19-VIII-05 18:09 |
Filename: D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\otmer.LST |
ROM used: 486 words (12%) |
Largest free fragment is 2048 |
RAM used: 10 (5%) at main() level |
27 (14%) worst case |
Stack: 5 locations |
* |
0000: MOVLW 00 |
0001: MOVWF 0A |
0002: GOTO 158 |
0003: NOP |
.................... #include "D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\otmer.h" |
.................... #include <16F873.h> |
.................... //////// Standard Header file for the PIC16F873 device //////////////// |
.................... #device PIC16F873 |
.................... #list |
.................... |
.................... #device adc=8 |
.................... #fuses NOWDT,XT, NOPUT, NOPROTECT, BROWNOUT, NOLVP, NOCPD, NOWRT, NODEBUG |
.................... #use delay(clock=4000000) |
* |
0024: MOVLW 32 |
0025: MOVWF 04 |
0026: MOVF 00,W |
0027: BTFSC 03.2 |
0028: GOTO 038 |
0029: MOVLW 01 |
002A: MOVWF 21 |
002B: CLRF 20 |
002C: DECFSZ 20,F |
002D: GOTO 02C |
002E: DECFSZ 21,F |
002F: GOTO 02B |
0030: MOVLW 4A |
0031: MOVWF 20 |
0032: DECFSZ 20,F |
0033: GOTO 032 |
0034: NOP |
0035: NOP |
0036: DECFSZ 00,F |
0037: GOTO 029 |
0038: RETLW 00 |
.................... |
.................... |
.................... |
.................... //Definice portu: // Datovy port displeje pripojeny na 4 bity za sebou na jeden port |
.................... |
.................... #define LCD_RS PIN_B1 // rizeni registru LCD displeje |
.................... #define LCD_E PIN_B0 // enable LCD displeje |
.................... #define LCD_DATA_LSB PIN_C4 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou) |
.................... |
.................... #include "LCD.C" |
.................... // LCD modul pro ovladani dvouradkoveho LCD modulu se standardnim Hitachi radicem |
.................... // (c)miho 2002,2005 |
.................... // |
.................... // Historie: |
.................... // |
.................... // 0.00 Uvodni verze se snadnou definici portu LCD displeje |
.................... // 0.01 Oprava portu (zapomenute stare identifikatory) |
.................... // 0.02 Doplnena moznost pripojeni datoveho portu LCD na libovolne porty |
.................... // 0.03 Doplnena procedura lcd_clr pro smazani displeje |
.................... // |
.................... // |
.................... // Funkce: |
.................... // |
.................... // lcd_init() inicializuje LCD displej a porty, nutno volat jako prvni |
.................... // |
.................... // lcd_putc(c) zapis snaku do lcd displeje, zpracovava nasledujici ridici znaky |
.................... // \f = \x0C - nova stranka - smazani displeje |
.................... // \n = \x0A - odradkovani (prechod na druhou radku) |
.................... // \b = \x08 - backspace - posunuti kurzoru o 1 pozici zpet |
.................... // \r = \x0D - goto home to position 1,1 |
.................... // \0 .. \7 - definovatelne znaky v pozicich 0 az 7 v CGRAM |
.................... // \20 .. \27 - alternativne zapsane znaky (oktalove) v pozicich 0 az 7 CGRAM |
.................... // Pozor na to, ze funkce printf konci tisk pokud narazi na \0 (konec retezce) |
.................... // |
.................... // lcd_gotoxy(x,y) presune kurzor na uvedenou adresu |
.................... // nekontroluje parametry |
.................... // |
.................... // lcd_cursor_on zapne kurzor |
.................... // lcd_cursor_off vypne kurzor |
.................... // |
.................... // lcd_clr smaze displej |
.................... // |
.................... // lcd_define_char(Index, Def) Makro, ktere definuje znaky od pozice Index obsahem definicniho |
.................... // retezce Def. Kazdych 8 znaku retezce Def definuje dalsi znak v CGRAM. |
.................... // Kapacita CGRAM je celkem 8 znaku s indexem 0 az 7. |
.................... // Na konci se provede lcd_gotoxy(1,1). |
.................... // Na konci teto knihovny je priklad pouziti definovanych znaku |
.................... // |
.................... // |
.................... // Definice portu: // Datovy port displeje pripojeny na 4 bity za sebou na jeden port |
.................... // |
.................... // #define LCD_RS PIN_B2 // rizeni registru LCD displeje |
.................... // #define LCD_E PIN_B1 // enable LCD displeje |
.................... // #define LCD_DATA_LSB PIN_C2 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou) |
.................... // |
.................... // |
.................... // Alternativni definice: // Datovy port displeje pripojeny na libovolne 4 bitove porty (vede na kod delsi asi o 25 slov) |
.................... // |
.................... // #define LCD_RS PIN_B2 // rizeni registru LCD displeje |
.................... // #define LCD_E PIN_B1 // enable LCD displeje |
.................... // #define LCD_D0 PIN_C2 // D0 - datove bity pripojene na libovolne porty |
.................... // #define LCD_D1 PIN_C3 // D1 |
.................... // #define LCD_D2 PIN_C4 // D2 |
.................... // #define LCD_D3 PIN_C5 // D3 |
.................... |
.................... |
.................... |
.................... |
.................... // Privatni sekce, cist jen v pripade, ze neco nefunguje |
.................... |
.................... |
.................... |
.................... |
.................... #ifdef LCD_DATA_LSB |
.................... // Generovane defince portu pro ucely teto knihovny aby kod generoval spravne IO operace a soucasne |
.................... // bylo mozne jednoduse deklarovat pripojene piny LCD displeje pri pouziti teto knihovny. Problem spociva |
.................... // v tom, ze se musi spravne ridit smery portu a soucasne datovy port zabira jen 4 bity ze zadaneho portu |
.................... // |
.................... #define LCD_SHIFT (LCD_DATA_LSB&7) // pocet bitu posuvu datoveho kanalu v datovem portu |
.................... #define LCD_PORT (LCD_DATA_LSB>>3) // adresa LCD datoveho portu |
.................... #define LCD_TRIS (LCD_PORT+0x80) // adresa prislusneho TRIS registru |
.................... #define LCD_MASK (0xF<<LCD_SHIFT) // maska platnych bitu |
.................... // |
.................... #if LCD_SHIFT>4 // kontrola mezi |
.................... #error LCD data port LSB bit not in range 0..4 |
.................... #endif |
.................... #endif |
.................... |
.................... |
.................... // Definice konstant pro LCD display |
.................... // |
.................... #define LCD_CURSOR_ON_ 0x0E // kurzor jako blikajici radka pod znakem |
.................... #define LCD_CURSOR_OFF_ 0x0C // zadny kurzor |
.................... #define LCD_LINE_2 0x40 // adresa 1. znaku 2. radky |
.................... |
.................... |
.................... // Definice rezimu LCD displeje |
.................... // |
.................... BYTE const LCD_INIT_STRING[4] = |
.................... { |
.................... 0x28, // intrfejs 4 bity, 2 radky, font 5x7 |
.................... LCD_CURSOR_OFF_, // display on, kurzor off, |
.................... 0x01, // clear displeje |
.................... 0x06 // inkrement pozice kurzoru (posun kurzoru doprava) |
.................... }; |
.................... |
.................... |
.................... // Odesle nibble do displeje (posle data a klikne signalem e) |
.................... // |
.................... void lcd_send_nibble( BYTE n ) |
.................... { |
.................... #ifdef LCD_DATA_LSB |
.................... // data jsou za sebou na 4 bitech jednoho portu |
.................... *LCD_PORT = (*LCD_PORT & ~LCD_MASK) | ((n << LCD_SHIFT) & LCD_MASK); // nastav datove bity portu a ostatni zachovej |
0039: MOVF 07,W |
003A: ANDLW 0F |
003B: MOVWF 39 |
003C: SWAPF 38,W |
003D: MOVWF 20 |
003E: MOVLW F0 |
003F: ANDWF 20,F |
0040: MOVF 20,W |
0041: ANDLW F0 |
0042: IORWF 39,W |
0043: MOVWF 07 |
.................... #else |
.................... // data jsou na libovolnych 4 bitech libovolnych portu |
.................... output_bit(LCD_D0,bit_test(n,0)); |
.................... output_bit(LCD_D1,bit_test(n,1)); |
.................... output_bit(LCD_D2,bit_test(n,2)); |
.................... output_bit(LCD_D3,bit_test(n,3)); |
.................... #endif |
.................... output_bit(LCD_E,1); // vzestupna hrana |
0044: BSF 06.0 |
0045: BSF 03.5 |
0046: BCF 06.0 |
.................... delay_us(1); // pockej alespon 450ns od e nebo alespon 195ns od dat |
0047: NOP |
.................... output_bit(LCD_E,0); // sestupna hrana (minimalni perioda e je 1us) |
0048: BCF 03.5 |
0049: BCF 06.0 |
004A: BSF 03.5 |
004B: BCF 06.0 |
.................... } |
004C: BCF 03.5 |
004D: RETLW 00 |
.................... |
.................... |
.................... // Odesle bajt do registru LCD |
.................... // |
.................... // Pokud je Adr=0 .. instrukcni registr |
.................... // Pokud je Adr=1 .. datovy registr |
.................... // |
.................... void lcd_send_byte( BOOLEAN Adr, BYTE n ) |
.................... { |
.................... output_bit(LCD_RS,Adr); // vyber registr |
004E: MOVF 36,F |
004F: BTFSS 03.2 |
0050: GOTO 053 |
0051: BCF 06.1 |
0052: GOTO 054 |
0053: BSF 06.1 |
0054: BSF 03.5 |
0055: BCF 06.1 |
.................... swap(n); |
0056: BCF 03.5 |
0057: SWAPF 37,F |
.................... lcd_send_nibble(n); // posli horni pulku bajtu |
0058: MOVF 37,W |
0059: MOVWF 38 |
005A: CALL 039 |
.................... swap(n); |
005B: SWAPF 37,F |
.................... lcd_send_nibble(n); // posli spodni pulku bajtu |
005C: MOVF 37,W |
005D: MOVWF 38 |
005E: CALL 039 |
.................... delay_us(40); // minimalni doba na provedeni prikazu |
005F: MOVLW 0D |
0060: MOVWF 20 |
0061: DECFSZ 20,F |
0062: GOTO 061 |
.................... } |
0063: RETLW 00 |
.................... |
.................... |
.................... // Provede inicializaci LCD displeje, smaze obsah a nastavi mod displeje |
.................... // |
.................... // Tato procedura se musi volat pred pouzitim ostatnich lcd_ procedur |
.................... // |
.................... void lcd_init() |
.................... { |
.................... |
.................... int i; // pocitadlo cyklu |
.................... |
.................... delay_ms(20); // spozdeni pro provedeni startu displeje po zapnuti napajeni |
0064: MOVLW 14 |
0065: MOVWF 32 |
0066: CALL 024 |
.................... |
.................... #ifdef LCD_DATA_LSB |
.................... // data jsou na 4 bitech za sebou, nastav smer pro vsechny dalsi prenosy |
.................... *LCD_TRIS = *LCD_TRIS & ~LCD_MASK; // nuluj odpovidajici bity tris registru datoveho portu LCD |
0067: MOVLW 0F |
0068: BSF 03.5 |
0069: ANDWF 07,F |
.................... #endif |
.................... |
.................... output_bit(LCD_RS,0); // nastav jako vystup a nastav klidovy stav |
006A: BCF 03.5 |
006B: BCF 06.1 |
006C: BSF 03.5 |
006D: BCF 06.1 |
.................... output_bit(LCD_E, 0); // nastav jako vystup a nastav klidovy stav |
006E: BCF 03.5 |
006F: BCF 06.0 |
0070: BSF 03.5 |
0071: BCF 06.0 |
.................... |
.................... for (i=0; i<3; i++) // nastav lcd do rezimu 8 bitu sbernice |
0072: BCF 03.5 |
0073: CLRF 28 |
0074: MOVF 28,W |
0075: SUBLW 02 |
0076: BTFSS 03.0 |
0077: GOTO 080 |
.................... { |
.................... delay_ms(2); // muze byt rozdelany prenos dat (2x 4 bity) nebo pomaly povel |
0078: MOVLW 02 |
0079: MOVWF 32 |
007A: CALL 024 |
.................... lcd_send_nibble(3); // rezim 8 bitu |
007B: MOVLW 03 |
007C: MOVWF 38 |
007D: CALL 039 |
.................... } |
007E: INCF 28,F |
007F: GOTO 074 |
.................... |
.................... delay_us(40); // cas na zpracovani |
0080: MOVLW 0D |
0081: MOVWF 20 |
0082: DECFSZ 20,F |
0083: GOTO 082 |
.................... lcd_send_nibble(2); // nastav rezim 4 bitu (plati od nasledujiciho prenosu) |
0084: MOVLW 02 |
0085: MOVWF 38 |
0086: CALL 039 |
.................... delay_us(40); // cas na zpracovani |
0087: MOVLW 0D |
0088: MOVWF 20 |
0089: DECFSZ 20,F |
008A: GOTO 089 |
.................... |
.................... for (i=0;i<3;i++) // proved inicializaci (nastaveni modu, smazani apod) |
008B: CLRF 28 |
008C: MOVF 28,W |
008D: SUBLW 02 |
008E: BTFSS 03.0 |
008F: GOTO 09C |
.................... { |
.................... lcd_send_byte(0,LCD_INIT_STRING[i]); |
0090: MOVF 28,W |
0091: CALL 004 |
0092: MOVWF 29 |
0093: CLRF 36 |
0094: MOVF 29,W |
0095: MOVWF 37 |
0096: CALL 04E |
.................... delay_ms(2); |
0097: MOVLW 02 |
0098: MOVWF 32 |
0099: CALL 024 |
.................... } |
009A: INCF 28,F |
009B: GOTO 08C |
.................... } |
009C: BCF 0A.3 |
009D: GOTO 19C (RETURN) |
.................... |
.................... |
.................... // Proved presun kurzoru |
.................... // |
.................... // Pozice 1.1 je domu |
.................... // |
.................... void lcd_gotoxy( BYTE x, BYTE y) |
.................... { |
.................... |
.................... BYTE Adr; |
.................... |
.................... Adr=x-1; |
* |
00B4: MOVLW 01 |
00B5: SUBWF 32,W |
00B6: MOVWF 34 |
.................... if(y==2) |
00B7: MOVF 33,W |
00B8: SUBLW 02 |
00B9: BTFSS 03.2 |
00BA: GOTO 0BD |
.................... Adr+=LCD_LINE_2; |
00BB: MOVLW 40 |
00BC: ADDWF 34,F |
.................... |
.................... lcd_send_byte(0,0x80|Adr); |
00BD: MOVF 34,W |
00BE: IORLW 80 |
00BF: MOVWF 35 |
00C0: CLRF 36 |
00C1: MOVF 35,W |
00C2: MOVWF 37 |
00C3: CALL 04E |
.................... } |
00C4: RETLW 00 |
.................... |
.................... |
.................... // Zapis znaku na displej, zpracovani ridicich znaku |
.................... // |
.................... void lcd_putc( char c) |
.................... { |
.................... |
.................... switch (c) |
.................... { |
00C5: MOVF 31,W |
00C6: XORLW 0C |
00C7: BTFSC 03.2 |
00C8: GOTO 0D3 |
00C9: XORLW 06 |
00CA: BTFSC 03.2 |
00CB: GOTO 0DB |
00CC: XORLW 07 |
00CD: BTFSC 03.2 |
00CE: GOTO 0E1 |
00CF: XORLW 05 |
00D0: BTFSC 03.2 |
00D1: GOTO 0E6 |
00D2: GOTO 0EB |
.................... case '\f' : lcd_send_byte(0,1); // smaz displej |
00D3: CLRF 36 |
00D4: MOVLW 01 |
00D5: MOVWF 37 |
00D6: CALL 04E |
.................... delay_ms(2); |
00D7: MOVLW 02 |
00D8: MOVWF 32 |
00D9: CALL 024 |
.................... break; |
00DA: GOTO 0F7 |
.................... case '\n' : lcd_gotoxy(1,2); break; // presun se na 1. znak 2. radky |
00DB: MOVLW 01 |
00DC: MOVWF 32 |
00DD: MOVLW 02 |
00DE: MOVWF 33 |
00DF: CALL 0B4 |
00E0: GOTO 0F7 |
.................... case '\r' : lcd_gotoxy(1,1); break; // presun home |
00E1: MOVLW 01 |
00E2: MOVWF 32 |
00E3: MOVWF 33 |
00E4: CALL 0B4 |
00E5: GOTO 0F7 |
.................... case '\b' : lcd_send_byte(0,0x10); break; // posun kurzor o 1 zpet |
00E6: CLRF 36 |
00E7: MOVLW 10 |
00E8: MOVWF 37 |
00E9: CALL 04E |
00EA: GOTO 0F7 |
.................... default : if (c<0x20) c&=0x7; // preklopeni definovatelnych znaku na rozsah 0 az 0x1F |
00EB: MOVF 31,W |
00EC: SUBLW 1F |
00ED: BTFSS 03.0 |
00EE: GOTO 0F1 |
00EF: MOVLW 07 |
00F0: ANDWF 31,F |
.................... lcd_send_byte(1,c); break; // zapis znak |
00F1: MOVLW 01 |
00F2: MOVWF 36 |
00F3: MOVF 31,W |
00F4: MOVWF 37 |
00F5: CALL 04E |
00F6: GOTO 0F7 |
.................... } |
.................... } |
00F7: RETLW 00 |
.................... |
.................... |
.................... // Zapni kurzor |
.................... // |
.................... void lcd_cursor_on() |
.................... { |
.................... lcd_send_byte(0,LCD_CURSOR_ON_); |
.................... } |
.................... |
.................... |
.................... // Vypni kurzor |
.................... // |
.................... void lcd_cursor_off() |
.................... { |
.................... lcd_send_byte(0,LCD_CURSOR_OFF_); |
.................... } |
.................... |
.................... |
.................... // Smaz displej |
.................... // |
.................... void lcd_clr() |
.................... { |
.................... lcd_putc('\f'); |
.................... } |
.................... |
.................... |
.................... // Definice vlastnich fontu |
.................... // |
.................... // Vlastnich definic muze byt jen 8 do pozic 0 az 7 pameti CGRAM radice lcd displeje |
.................... // Pro snadne definovani jsou pripraveny nasledujici definice a na konci souboru je uveden |
.................... // priklad pouziti definovanych znaku. |
.................... |
.................... |
.................... // Pomocna procedura pro posilani ridicich dat do radice displeje |
.................... // |
.................... void lcd_putc2(int Data) |
.................... { |
.................... lcd_send_byte(1,Data); |
.................... } |
.................... |
.................... |
.................... // Pomocne definice pro programovani obsahu CGRAM |
.................... // |
.................... #define lcd_define_start(Code) lcd_send_byte(0,0x40+(Code<<3)); delay_ms(2) |
.................... #define lcd_define_def(String) printf(lcd_putc2,String); |
.................... #define lcd_define_end() lcd_send_byte(0,3); delay_ms(2) |
.................... |
.................... |
.................... // Vlastni vykonne makro pro definovani fontu do pozice Index CGRAM s definicnim retezcem Def |
.................... // |
.................... #define lcd_define_char(Index, Def) lcd_define_start(Index); lcd_define_def(Def); lcd_define_end(); |
.................... |
.................... |
.................... // Pripravene definice fontu vybranych znaku |
.................... // V tabulce nesmi byt 00 (konec retezce v printf()), misto toho davame 80 |
.................... // |
.................... #define LCD_CHAR_BAT100 "\x0E\x1F\x1F\x1F\x1F\x1F\x1F\x1F" /* symbol plne baterie */ |
.................... #define LCD_CHAR_BAT50 "\x0E\x1F\x11\x11\x13\x17\x1F\x1F" /* symbol polovicni baterie */ |
.................... #define LCD_CHAR_BAT0 "\x0E\x1F\x11\x11\x11\x11\x11\x1F" /* symbol vybite baterie */ |
.................... #define LCD_CHAR_UP "\x80\x04\x0E\x15\x04\x04\x04\x80" /* symbol sipka nahoru */ |
.................... #define LCD_CHAR_DOWN "\x80\x04\x04\x04\x15\x0E\x04\x80" /* symbol Sipka dolu */ |
.................... #define LCD_CHAR_LUA "\x04\x0E\x11\x11\x1F\x11\x11\x80" /* A s carkou */ |
.................... #define LCD_CHAR_LLA "\x01\x02\x0E\x01\x1F\x11\x0F\x80" /* a s carkou */ |
.................... #define LCD_CHAR_HUC "\x0A\x0E\x11\x10\x10\x11\x0E\x80" /* C s hackem */ |
.................... #define LCD_CHAR_HLC "\x0A\x04\x0E\x10\x10\x11\x0E\x80" /* c s hackem */ |
.................... #define LCD_CHAR_HUD "\x0A\x1C\x12\x11\x11\x12\x1C\x80" /* D s hackem */ |
.................... #define LCD_CHAR_HLD "\x05\x03\x0D\x13\x11\x11\x0F\x80" /* d s hackem */ |
.................... #define LCD_CHAR_LUE "\x04\x1F\x10\x10\x1E\x10\x1F\x80" /* E s carkou */ |
.................... #define LCD_CHAR_LLE "\x01\x02\x0E\x11\x1F\x10\x0E\x80" /* e s carkou */ |
.................... #define LCD_CHAR_HUE "\x0A\x1F\x10\x1E\x10\x10\x1F\x80" /* E s hackem */ |
.................... #define LCD_CHAR_HLE "\x0A\x04\x0E\x11\x1F\x10\x0E\x80" /* e s hackem */ |
.................... #define LCD_CHAR_LUI "\x04\x0E\x04\x04\x04\x04\x0E\x80" /* I s carkou */ |
.................... #define LCD_CHAR_LLI "\x02\x04\x80\x0C\x04\x04\x0E\x80" /* i s carkou */ |
.................... #define LCD_CHAR_HUN "\x0A\x15\x11\x19\x15\x13\x11\x80" /* N s hackem */ |
.................... #define LCD_CHAR_HLN "\x0A\x04\x16\x19\x11\x11\x11\x80" /* n s hackem */ |
.................... #define LCD_CHAR_LUO "\x04\x0E\x11\x11\x11\x11\x0E\x80" /* O s carkou */ |
.................... #define LCD_CHAR_LLO "\x02\x04\x0E\x11\x11\x11\x0E\x80" /* o s carkou */ |
.................... #define LCD_CHAR_HUR "\x0A\x1E\x11\x1E\x14\x12\x11\x80" /* R s hackem */ |
.................... #define LCD_CHAR_HLR "\x0A\x04\x16\x19\x10\x10\x10\x80" /* r s hackem */ |
.................... #define LCD_CHAR_HUS "\x0A\x0F\x10\x0E\x01\x01\x1E\x80" /* S s hackem */ |
.................... #define LCD_CHAR_HLS "\x0A\x04\x0E\x10\x0E\x01\x1E\x80" /* s s hackem */ |
.................... #define LCD_CHAR_HUT "\x0A\x1F\x04\x04\x04\x04\x04\x80" /* T s hackem */ |
.................... #define LCD_CHAR_HLT "\x0A\x0C\x1C\x08\x08\x09\x06\x80" /* t s hackem */ |
.................... #define LCD_CHAR_LUU "\x02\x15\x11\x11\x11\x11\x0E\x80" /* U s carkou */ |
.................... #define LCD_CHAR_LLU "\x02\x04\x11\x11\x11\x13\x0D\x80" /* u s carkou */ |
.................... #define LCD_CHAR_CUU "\x06\x17\x11\x11\x11\x11\x0E\x80" /* U s krouzkem */ |
.................... #define LCD_CHAR_CLU "\x06\x06\x11\x11\x11\x11\x0E\x80" /* u s krouzkem */ |
.................... #define LCD_CHAR_LUY "\x02\x15\x11\x0A\x04\x04\x04\x80" /* Y s carkou */ |
.................... #define LCD_CHAR_LLY "\x02\x04\x11\x11\x0F\x01\x0E\x80" /* y s carkou */ |
.................... #define LCD_CHAR_HUZ "\x0A\x1F\x01\x02\x04\x08\x1F\x80" /* Z s hackem */ |
.................... #define LCD_CHAR_HLZ "\x0A\x04\x1F\x02\x04\x08\x1F\x80" /* z s hackem */ |
.................... |
.................... |
.................... // Priklad pouziti definovanych znaku |
.................... // |
.................... // |
.................... //void lcd_sample() |
.................... //{ |
.................... // lcd_define_char(0,LCD_CHAR_BAT50); // Priklad definice znaku baterie do pozice 0 |
.................... // lcd_define_char(2,LCD_CHAR_HLE LCD_CHAR_LUI); // Priklad definice znaku e s hackem a I s carkou od pozice 2 |
.................... // // vsimnete si, ze neni carka mezi retezci s definici (oba retezce definuji |
.................... // // jediny definicni retezec) |
.................... // printf(lcd_putc,"\fZnaky:\20\22\23"); // priklad vypisu znaku z pozice 0, 2 a 3 |
.................... // delay_ms(1000); |
.................... // lcd_define_char(0,LCD_CHAR_BAT0); // Predefinovani tvaru znaku v pozici 0 |
.................... // delay_ms(1000); |
.................... //} |
.................... |
.................... |
.................... #define DATA PIN_A1 |
.................... #define CP PIN_A0 |
.................... #define STROBE PIN_A2 |
.................... |
.................... #include "C:\library\kaklik\ccs\shift_reg.c" |
.................... //////////////////////////////////////////////////////////////////////////////// |
.................... // KNIHOVNA PRO OVLADANI POSUVNEHO REGISTRU |
.................... // |
.................... //////////////////////////////////////////////////////////////////////////////// |
.................... // definice: |
.................... //#define DATA PIN_A1 |
.................... //#define CP PIN_A0 |
.................... //#define STROBE PIN_A2 |
.................... |
.................... void putreg(unsigned int8 out) // zapise do registru 8bitovou promenou. |
.................... { |
.................... int8 i; |
.................... output_low(STROBE); |
.................... |
.................... for(i=0;i<=7;i++) |
.................... { |
.................... output_bit(DATA,bit_test(out,7-i)); |
.................... output_low(CP); |
.................... output_high(CP); |
.................... } |
.................... output_high(STROBE); |
.................... } |
.................... |
.................... void reg_shift_left() |
.................... { |
.................... output_low(CP); |
.................... output_high(CP); |
.................... |
.................... } |
.................... |
.................... void reg_shift_right() |
.................... { |
.................... } |
.................... |
.................... |
.................... void main() |
.................... { |
* |
0158: CLRF 04 |
0159: MOVLW 1F |
015A: ANDWF 03,F |
015B: BSF 03.5 |
015C: BSF 1F.0 |
015D: BSF 1F.1 |
015E: BSF 1F.2 |
015F: BCF 1F.3 |
.................... unsigned int16 otacky; |
.................... |
.................... setup_adc_ports(NO_ANALOGS); |
* |
0163: BSF 03.5 |
0164: BSF 1F.0 |
0165: BSF 1F.1 |
0166: BSF 1F.2 |
0167: BCF 1F.3 |
.................... setup_adc(ADC_OFF); |
0168: BCF 03.5 |
0169: BCF 1F.0 |
.................... setup_spi(FALSE); |
* |
0160: MOVLW FF |
0161: BCF 03.5 |
0162: MOVWF 25 |
* |
016A: BCF 14.5 |
016B: BCF 25.5 |
016C: MOVF 25,W |
016D: BSF 03.5 |
016E: MOVWF 07 |
016F: BCF 03.5 |
0170: BSF 25.4 |
0171: MOVF 25,W |
0172: BSF 03.5 |
0173: MOVWF 07 |
0174: BCF 03.5 |
0175: BCF 25.3 |
0176: MOVF 25,W |
0177: BSF 03.5 |
0178: MOVWF 07 |
0179: MOVLW 00 |
017A: BCF 03.5 |
017B: MOVWF 14 |
017C: BSF 03.5 |
017D: MOVWF 14 |
.................... setup_timer_0(RTCC_EXT_H_TO_L|RTCC_DIV_1); |
017E: MOVF 01,W |
017F: ANDLW C7 |
0180: IORLW 38 |
0181: MOVWF 01 |
.................... setup_timer_1(T1_EXTERNAL|T1_DIV_BY_2); |
0182: MOVLW 97 |
0183: BCF 03.5 |
0184: MOVWF 10 |
.................... setup_timer_2(T2_DISABLED,0,1); |
0185: MOVLW 00 |
0186: MOVWF 21 |
0187: MOVWF 12 |
0188: MOVLW 00 |
0189: BSF 03.5 |
018A: MOVWF 12 |
.................... setup_ccp1(CCP_PWM); |
018B: BCF 03.5 |
018C: BCF 25.2 |
018D: MOVF 25,W |
018E: BSF 03.5 |
018F: MOVWF 07 |
0190: BCF 03.5 |
0191: BCF 07.2 |
0192: MOVLW 0C |
0193: MOVWF 17 |
.................... setup_ccp2(CCP_OFF); |
0194: BSF 25.1 |
0195: MOVF 25,W |
0196: BSF 03.5 |
0197: MOVWF 07 |
0198: BCF 03.5 |
0199: CLRF 1D |
019A: CLRF 1D |
.................... |
.................... lcd_init(); |
019B: GOTO 064 |
.................... |
.................... while (true) |
.................... { |
.................... set_timer1(0); |
019C: CLRF 0F |
019D: CLRF 0E |
.................... |
.................... Delay_ms(500); |
019E: MOVLW 02 |
019F: MOVWF 28 |
01A0: MOVLW FA |
01A1: MOVWF 32 |
01A2: CALL 024 |
01A3: DECFSZ 28,F |
01A4: GOTO 1A0 |
.................... otacky=get_timer1(); |
01A5: MOVF 0F,W |
01A6: MOVWF 23 |
01A7: MOVF 0E,W |
01A8: MOVWF 20 |
01A9: MOVF 0F,W |
01AA: SUBWF 23,W |
01AB: BTFSS 03.2 |
01AC: GOTO 1A5 |
01AD: MOVF 20,W |
01AE: MOVWF 26 |
01AF: MOVF 23,W |
01B0: MOVWF 27 |
.................... otacky=otacky*40; |
01B1: MOVF 27,W |
01B2: MOVWF 29 |
01B3: MOVF 26,W |
01B4: MOVWF 28 |
01B5: CLRF 2B |
01B6: MOVLW 28 |
01B7: MOVWF 2A |
01B8: GOTO 09E |
01B9: MOVF 22,W |
01BA: MOVWF 27 |
01BB: MOVF 21,W |
01BC: MOVWF 26 |
.................... |
.................... switch(otacky) |
.................... { |
01BD: MOVF 26,W |
01BE: MOVWF 20 |
01BF: MOVF 27,W |
01C0: MOVWF 23 |
01C1: GOTO 1C2 |
.................... |
.................... } |
.................... |
.................... LCD_gotoxy(2,2); |
01C2: MOVLW 02 |
01C3: MOVWF 32 |
01C4: MOVWF 33 |
01C5: CALL 0B4 |
.................... printf(lcd_putc,"otacky:%lu ot/min ",otacky); |
01C6: CLRF 28 |
01C7: MOVF 28,W |
01C8: CALL 00C |
01C9: INCF 28,F |
01CA: MOVWF 20 |
01CB: MOVWF 31 |
01CC: CALL 0C5 |
01CD: MOVLW 07 |
01CE: SUBWF 28,W |
01CF: BTFSS 03.2 |
01D0: GOTO 1C7 |
01D1: MOVLW 10 |
01D2: MOVWF 04 |
01D3: MOVF 27,W |
01D4: MOVWF 2A |
01D5: MOVF 26,W |
01D6: MOVWF 29 |
01D7: GOTO 0F8 |
01D8: MOVLW 0A |
01D9: MOVWF 29 |
01DA: MOVF 29,W |
01DB: CALL 00C |
01DC: INCF 29,F |
01DD: MOVWF 20 |
01DE: MOVWF 31 |
01DF: CALL 0C5 |
01E0: MOVLW 13 |
01E1: SUBWF 29,W |
01E2: BTFSS 03.2 |
01E3: GOTO 1DA |
.................... } |
01E4: GOTO 19C |
.................... |
.................... } |
.................... |
01E5: SLEEP |
Configuration Fuses: |
Word 1: 3F79 XT NOWDT NOPUT NOPROTECT BROWNOUT NOLVP NOCPD NOWRT NODEBUG |
/programy/C/PIC_C/mereni/otmer/16F873/otmer.PJT |
---|
0,0 → 1,39 |
[PROJECT] |
Target=otmer.HEX |
Development_Mode= |
Processor=0x873F |
ToolSuite=CCS |
[Directories] |
Include=C:\Program Files\PICC\devices\;C:\Program Files\PICC\drivers\;C:\library\CCS; |
Library= |
LinkerScript= |
[Target Data] |
FileList=otmer.c; |
BuildTool=C-COMPILER |
OptionString=+FM |
AdditionalOptionString= |
BuildRequired=1 |
[otmer.c] |
Type=4 |
Path= |
FileList= |
BuildTool= |
OptionString= |
AdditionalOptionString= |
[mru-list] |
1=otmer.c |
[Windows] |
0=0000 otmer.c 0 0 796 451 3 0 |
[Opened Files] |
1=D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\otmer.c |
2=D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\otmer.h |
3=C:\Program Files\PICC\devices\16F873.h |
4=D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\LCD.C |
5=C:\library\kaklik\ccs\shift_reg.c |
6= |
/programy/C/PIC_C/mereni/otmer/16F873/otmer.SYM |
---|
0,0 → 1,75 |
015 CCP_1_LOW |
015-016 CCP_1 |
016 CCP_1_HIGH |
01B CCP_2_LOW |
01B-01C CCP_2 |
01C CCP_2_HIGH |
020 @SCRATCH |
021 @SCRATCH |
021 _RETURN_ |
022 @SCRATCH |
023 @SCRATCH |
024 @SCRATCH |
025 @TRIS_C |
026-027 main.otacky |
028 lcd_init.i |
028-029 @MUL1616.P1 |
028 main.@SCRATCH |
029-02A @PRINTF_LU_263.P1 |
029 lcd_init.@SCRATCH |
029 main.@SCRATCH |
02A-02B @MUL1616.P1 |
02B @PRINTF_LU_263.@SCRATCH |
02C @MUL1616.@SCRATCH |
02C @PRINTF_LU_263.@SCRATCH |
02D @PRINTF_LU_263.@SCRATCH |
02E @PRINTF_LU_263.@SCRATCH |
02F @PRINTF_LU_263.@SCRATCH |
030 @PRINTF_LU_263.@SCRATCH |
031 lcd_putc.c |
032 @delay_ms1.P1 |
032 lcd_gotoxy.x |
033 lcd_gotoxy.y |
034 lcd_gotoxy.Adr |
035 lcd_gotoxy.@SCRATCH |
036 lcd_send_byte.Adr |
037 lcd_send_byte.n |
038 lcd_send_nibble.n |
039 lcd_send_nibble.@SCRATCH |
03A lcd_send_nibble.@SCRATCH |
0024 @delay_ms1 |
0004 @const28 |
0039 lcd_send_nibble |
004E lcd_send_byte |
0064 lcd_init |
00B4 lcd_gotoxy |
00C5 lcd_putc |
0158 main |
009E @MUL1616 |
000C @const10134 |
00F8 @PRINTF_LU_263 |
0158 @cinit |
Project Files: |
D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\otmer.c |
D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\otmer.h |
C:\Program Files\PICC\devices\16F873.h |
D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\LCD.C |
C:\library\kaklik\ccs\shift_reg.c |
Compiler Settings: |
Processor: PIC16F873 |
Pointer Size: 8 |
ADC Range: 0-255 |
Opt Level: 9 |
Short,Int,Long: 1,8,16 |
Output Files: |
Errors: D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\otmer.err |
INHX8: D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\otmer.HEX |
Symbols: D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\otmer.SYM |
List: D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\otmer.LST |
Debug/COFF: D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\otmer.cof |
Call Tree: D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\otmer.tre |
Statistics: D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\otmer.sta |
/programy/C/PIC_C/mereni/otmer/16F873/otmer.c |
---|
0,0 → 1,49 |
#include "D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\otmer.h" |
//Definice portu: // Datovy port displeje pripojeny na 4 bity za sebou na jeden port |
#define LCD_RS PIN_B1 // rizeni registru LCD displeje |
#define LCD_E PIN_B0 // enable LCD displeje |
#define LCD_DATA_LSB PIN_C4 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou) |
#include "LCD.C" |
#define DATA PIN_A1 |
#define CP PIN_A0 |
#define STROBE PIN_A2 |
#include "C:\library\kaklik\ccs\shift_reg.c" |
void main() |
{ |
unsigned int16 otacky; |
setup_adc_ports(NO_ANALOGS); |
setup_adc(ADC_OFF); |
setup_spi(FALSE); |
setup_timer_0(RTCC_EXT_H_TO_L|RTCC_DIV_1); |
setup_timer_1(T1_EXTERNAL|T1_DIV_BY_2); |
setup_timer_2(T2_DISABLED,0,1); |
setup_ccp1(CCP_PWM); |
setup_ccp2(CCP_OFF); |
lcd_init(); |
while (true) |
{ |
set_timer1(0); |
Delay_ms(500); |
otacky=get_timer1(); |
otacky=otacky*40; |
switch(otacky) |
{ |
} |
LCD_gotoxy(2,2); |
printf(lcd_putc,"otacky:%lu ot/min ",otacky); |
} |
} |
/programy/C/PIC_C/mereni/otmer/16F873/otmer.cof |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/mereni/otmer/16F873/otmer.err |
---|
0,0 → 1,0 |
No Errors |
/programy/C/PIC_C/mereni/otmer/16F873/otmer.h |
---|
0,0 → 1,5 |
#include <16F873.h> |
#device adc=8 |
#fuses NOWDT,XT, NOPUT, NOPROTECT, BROWNOUT, NOLVP, NOCPD, NOWRT, NODEBUG |
#use delay(clock=4000000) |
/programy/C/PIC_C/mereni/otmer/16F873/otmer.sta |
---|
0,0 → 1,40 |
ROM used: 486 (12%) |
486 (12%) including unused fragments |
1 Average locations per line |
7 Average locations per statement |
RAM used: 10 (5%) at main() level |
27 (14%) worst case |
Lines Stmts % Files |
----- ----- --- ----- |
50 18 24 D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\otmer.c |
6 0 0 D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\otmer.h |
240 0 0 C:\Program Files\PICC\devices\16F873.h |
312 47 51 D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\LCD.C |
34 9 6 C:\library\kaklik\ccs\shift_reg.c |
----- ----- |
1284 148 Total |
Page ROM % RAM Functions: |
---- --- --- --- ---------- |
0 21 4 1 @delay_ms1 |
0 8 2 0 @const28 |
0 21 4 3 lcd_send_nibble |
0 22 5 2 lcd_send_byte |
0 58 12 2 lcd_init |
0 17 3 4 lcd_gotoxy |
0 51 10 1 lcd_putc |
0 142 29 4 main |
0 22 5 5 @MUL1616 |
0 24 5 0 @const10134 |
0 96 20 8 @PRINTF_LU_263 |
Segment Used Free |
--------- ---- ---- |
00000-00003 4 0 |
00004-007FF 482 1562 |
00800-00FFF 0 2048 |
/programy/C/PIC_C/mereni/otmer/16F873/otmer.tre |
---|
0,0 → 1,98 |
ÀÄotmer |
ÀÄmain 0/142 Ram=4 |
ÃÄ??0?? |
ÃÄlcd_init 0/58 Ram=2 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ÃÄ@const28 0/8 Ram=0 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÀÄ@delay_ms1 0/21 Ram=1 |
ÃÄ@delay_ms1 0/21 Ram=1 |
ÃÄ@MUL1616 0/22 Ram=5 |
ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ÀÄlcd_send_nibble 0/21 Ram=3 |
ÃÄ@const10134 0/24 Ram=0 |
ÃÄlcd_putc 0/51 Ram=1 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ÀÄlcd_send_nibble 0/21 Ram=3 |
ÃÄ@PRINTF_LU_263 0/96 Ram=8 |
³ ÃÄlcd_putc 0/51 Ram=1 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÀÄlcd_putc 0/51 Ram=1 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÃÄ@delay_ms1 0/21 Ram=1 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÃÄlcd_send_byte 0/22 Ram=2 |
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ÀÄlcd_send_nibble 0/21 Ram=3 |
ÃÄ@const10134 0/24 Ram=0 |
ÀÄlcd_putc 0/51 Ram=1 |
ÃÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ÀÄlcd_send_nibble 0/21 Ram=3 |
ÃÄ@delay_ms1 0/21 Ram=1 |
ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ÀÄlcd_send_nibble 0/21 Ram=3 |
ÃÄlcd_gotoxy 0/17 Ram=4 |
³ ÀÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ÀÄlcd_send_nibble 0/21 Ram=3 |
ÃÄlcd_send_byte 0/22 Ram=2 |
³ ÃÄlcd_send_nibble 0/21 Ram=3 |
³ ÀÄlcd_send_nibble 0/21 Ram=3 |
ÀÄlcd_send_byte 0/22 Ram=2 |
ÃÄlcd_send_nibble 0/21 Ram=3 |
ÀÄlcd_send_nibble 0/21 Ram=3 |
/programy/C/PIC_C/mereni/otmer/Kopie - otackomer.c |
---|
0,0 → 1,27 |
#include "D:\KAKLIK\programy\PIC_C\mereni\otmer\otackomer.h" |
#define DATA PIN_A1 |
#define CP PIN_A0 |
void main() |
{ |
int i; |
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
while(true) |
{ |
output_high(DATA); |
output_high(CP); |
Delay_ms(100); |
output_low(CP); |
output_low(DATA); |
for(i=7;i>0;i--) |
{ |
Delay_ms(100); |
output_high(CP); |
Delay_ms(100); |
output_low(CP); |
} |
} |
} |
/programy/C/PIC_C/mereni/otmer/Kopie - otmer.c |
---|
0,0 → 1,38 |
#include "D:\KAKLIK\programy\PIC_C\mereni\otmer\otmer.h" |
#define DATA PIN_A1 |
#define CP PIN_A0 |
#define STROBE PIN_A2 |
#include "shift_reg.c" |
void main() |
{ |
int n=0; |
int i; |
putreg(1); |
while(true) |
{ |
i=1; |
for(n=0;n<=7;n++) |
{ |
putreg(i); |
i=i<<1; |
Delay_ms(50); |
}; |
i=0x80; |
for(n=0;n<=7;n++) |
{ |
putreg(i); |
i=i>>1; |
Delay_ms(50); |
}; |
} |
while(true) |
{ |
putreg(~n); |
Delay_ms(100); |
n++; |
} |
} |
/programy/C/PIC_C/mereni/otmer/otmer.BAK |
---|
0,0 → 1,38 |
#include "D:\KAKLIK\programy\PIC_C\mereni\otmer\otmer.h" |
#define DATA PIN_A1 |
#define CP PIN_A0 |
#define STROBE PIN_A2 |
#include "shift_reg.c" |
void main() |
{ |
int n=0; |
int i; |
putreg(1); |
while(true) |
{ |
i=1; |
for(n=0;n<=7;n++) |
{ |
putreg(~i); |
i=i<<1; |
Delay_ms(50); |
}; |
i=0x80; |
for(n=0;n<=7;n++) |
{ |
putreg(~i); |
i=i>>1; |
Delay_ms(50); |
}; |
} |
while(true) |
{ |
putreg(~n); |
Delay_ms(100); |
n++; |
} |
} |
/programy/C/PIC_C/mereni/otmer/otmer.HEX |
---|
0,0 → 1,19 |
:1000000000308A0044280000831605118312051170 |
:1000100093011308073C031C2A281308073C94008B |
:1000200012088C0014088D0003191A2803108C0C78 |
:100030008D0B16280C181E2885101F288514831672 |
:100040008510051083120510831605108312051400 |
:10005000930A0928831605118312051500341130FF |
:10006000840000080319432801308D008C018C0B9B |
:1000700037288D0B36284A308C008C0B3D28000029 |
:100080000000800B3428003484011F3083058F0169 |
:10009000013092000420013090008F010F08073CCE |
:1000A000031C5C281008920004200310900D3230CD |
:1000B00091002F208F0A4E28803090008F010F086A |
:1000C000073C031C6D281008920004200310900CBC |
:1000D000323091002F208F0A5F284B280F089100A3 |
:1000E0009109110892000420643091002F208F0A9A |
:0400F0006E28630013 |
:02400E00F93F78 |
:00000001FF |
;PIC16F84 |
/programy/C/PIC_C/mereni/otmer/otmer.LST |
---|
0,0 → 1,216 |
CCS PCM C Compiler, Version 3.221, 27853 14-VI-05 22:12 |
Filename: D:\KAKLIK\programy\PIC_C\mereni\otmer\otmer.LST |
ROM used: 122 words (12%) |
Largest free fragment is 902 |
RAM used: 5 (7%) at main() level |
8 (12%) worst case |
Stack: 1 locations |
* |
0000: MOVLW 00 |
0001: MOVWF 0A |
0002: GOTO 044 |
0003: NOP |
.................... #include "D:\KAKLIK\programy\PIC_C\mereni\otmer\otmer.h" |
.................... #include <16F84.h> |
.................... //////// Standard Header file for the PIC16F84 device //////////////// |
.................... #device PIC16F84 |
.................... #list |
.................... |
.................... #fuses NOWDT,XT, NOPUT, NOPROTECT |
.................... #use delay(clock=4000000) |
* |
002F: MOVLW 11 |
0030: MOVWF 04 |
0031: MOVF 00,W |
0032: BTFSC 03.2 |
0033: GOTO 043 |
0034: MOVLW 01 |
0035: MOVWF 0D |
0036: CLRF 0C |
0037: DECFSZ 0C,F |
0038: GOTO 037 |
0039: DECFSZ 0D,F |
003A: GOTO 036 |
003B: MOVLW 4A |
003C: MOVWF 0C |
003D: DECFSZ 0C,F |
003E: GOTO 03D |
003F: NOP |
0040: NOP |
0041: DECFSZ 00,F |
0042: GOTO 034 |
0043: RETLW 00 |
.................... |
.................... |
.................... |
.................... #define DATA PIN_A1 |
.................... #define CP PIN_A0 |
.................... #define STROBE PIN_A2 |
.................... |
.................... #include "shift_reg.c" |
.................... //////////////////////////////////////////////////////////////////////////////// |
.................... // KNIHOVNA PRO OVLADANI POSUVNEHO REGISTRU |
.................... // |
.................... //////////////////////////////////////////////////////////////////////////////// |
.................... // definice |
.................... //#define DATA PIN_A1 |
.................... //#define CP PIN_A0 |
.................... //#define STROBE PIN_A2 |
.................... |
.................... void putreg(unsigned int8 out) // zapise do registru 8bitovou promenou. |
.................... { |
.................... int8 i; |
.................... output_low(STROBE); |
* |
0004: BSF 03.5 |
0005: BCF 05.2 |
0006: BCF 03.5 |
0007: BCF 05.2 |
.................... |
.................... for(i=0;i<=7;i++) |
0008: CLRF 13 |
0009: MOVF 13,W |
000A: SUBLW 07 |
000B: BTFSS 03.0 |
000C: GOTO 02A |
.................... { |
.................... output_bit(DATA,bit_test(out,7-i)); |
000D: MOVF 13,W |
000E: SUBLW 07 |
000F: MOVWF 14 |
0010: MOVF 12,W |
0011: MOVWF 0C |
0012: MOVF 14,W |
0013: MOVWF 0D |
0014: BTFSC 03.2 |
0015: GOTO 01A |
0016: BCF 03.0 |
0017: RRF 0C,F |
0018: DECFSZ 0D,F |
0019: GOTO 016 |
001A: BTFSC 0C.0 |
001B: GOTO 01E |
001C: BCF 05.1 |
001D: GOTO 01F |
001E: BSF 05.1 |
001F: BSF 03.5 |
0020: BCF 05.1 |
.................... output_low(CP); |
0021: BCF 05.0 |
0022: BCF 03.5 |
0023: BCF 05.0 |
.................... output_high(CP); |
0024: BSF 03.5 |
0025: BCF 05.0 |
0026: BCF 03.5 |
0027: BSF 05.0 |
.................... } |
0028: INCF 13,F |
0029: GOTO 009 |
.................... output_high(STROBE); |
002A: BSF 03.5 |
002B: BCF 05.2 |
002C: BCF 03.5 |
002D: BSF 05.2 |
.................... } |
002E: RETLW 00 |
.................... void reg_shift_left() |
.................... { |
.................... } |
.................... void reg_shift_right() |
.................... { |
.................... } |
.................... |
.................... |
.................... void main() |
.................... { |
* |
0044: CLRF 04 |
0045: MOVLW 1F |
0046: ANDWF 03,F |
.................... int n=0; |
0047: CLRF 0F |
.................... int i; |
.................... putreg(1); |
0048: MOVLW 01 |
0049: MOVWF 12 |
004A: CALL 004 |
.................... while(true) |
.................... { |
.................... i=1; |
004B: MOVLW 01 |
004C: MOVWF 10 |
.................... for(n=0;n<=7;n++) |
004D: CLRF 0F |
004E: MOVF 0F,W |
004F: SUBLW 07 |
0050: BTFSS 03.0 |
0051: GOTO 05C |
.................... { |
.................... putreg(i); |
0052: MOVF 10,W |
0053: MOVWF 12 |
0054: CALL 004 |
.................... i=i<<1; |
0055: BCF 03.0 |
0056: RLF 10,F |
.................... Delay_ms(50); |
0057: MOVLW 32 |
0058: MOVWF 11 |
0059: CALL 02F |
.................... }; |
005A: INCF 0F,F |
005B: GOTO 04E |
.................... i=0x80; |
005C: MOVLW 80 |
005D: MOVWF 10 |
.................... for(n=0;n<=7;n++) |
005E: CLRF 0F |
005F: MOVF 0F,W |
0060: SUBLW 07 |
0061: BTFSS 03.0 |
0062: GOTO 06D |
.................... { |
.................... putreg(i); |
0063: MOVF 10,W |
0064: MOVWF 12 |
0065: CALL 004 |
.................... i=i>>1; |
0066: BCF 03.0 |
0067: RRF 10,F |
.................... Delay_ms(50); |
0068: MOVLW 32 |
0069: MOVWF 11 |
006A: CALL 02F |
.................... }; |
006B: INCF 0F,F |
006C: GOTO 05F |
.................... } |
006D: GOTO 04B |
.................... |
.................... while(true) |
.................... { |
.................... putreg(~n); |
006E: MOVF 0F,W |
006F: MOVWF 11 |
0070: COMF 11,F |
0071: MOVF 11,W |
0072: MOVWF 12 |
0073: CALL 004 |
.................... Delay_ms(100); |
0074: MOVLW 64 |
0075: MOVWF 11 |
0076: CALL 02F |
.................... n++; |
0077: INCF 0F,F |
.................... } |
0078: GOTO 06E |
.................... } |
.................... |
0079: SLEEP |
Configuration Fuses: |
Word 1: 3FF9 XT NOWDT NOPUT NOPROTECT |
/programy/C/PIC_C/mereni/otmer/otmer.PJT |
---|
0,0 → 1,38 |
[PROJECT] |
Target=otmer.HEX |
Development_Mode= |
Processor=0x684A |
ToolSuite=CCS |
[Directories] |
Include=C:\Program Files\PICC\devices\;C:\Program Files\PICC\dr |
Library= |
LinkerScript= |
[Target Data] |
FileList=otmer.c; |
BuildTool=C-COMPILER |
OptionString=+FM |
AdditionalOptionString= |
BuildRequired=1 |
[otmer.c] |
Type=4 |
Path= |
FileList= |
BuildTool= |
OptionString= |
AdditionalOptionString= |
[mru-list] |
1=otmer.c |
[Windows] |
0=0000 otmer.c 0 0 796 451 3 0 |
[Opened Files] |
1=D:\KAKLIK\programy\PIC_C\mereni\otmer\otmer.c |
2=D:\KAKLIK\programy\PIC_C\mereni\otmer\otmer.h |
3=C:\Program Files\PICC\devices\16F84.h |
4= |
5= |
/programy/C/PIC_C/mereni/otmer/otmer.SYM |
---|
0,0 → 1,36 |
00C @SCRATCH |
00D @SCRATCH |
00D _RETURN_ |
00F main.n |
010 main.i |
011 @delay_ms1.P1 |
011 main.@SCRATCH |
012 putreg.out |
013 putreg.i |
014 putreg.@SCRATCH |
002F @delay_ms1 |
0004 putreg |
0044 main |
0044 @cinit |
Project Files: |
D:\KAKLIK\programy\PIC_C\mereni\otmer\otmer.c |
D:\KAKLIK\programy\PIC_C\mereni\otmer\otmer.h |
C:\Program Files\PICC\devices\16F84.h |
D:\KAKLIK\programy\PIC_C\mereni\otmer\shift_reg.c |
Compiler Settings: |
Processor: PIC16F84 |
Pointer Size: 8 |
Opt Level: 9 |
Short,Int,Long: 1,8,16 |
Output Files: |
Errors: D:\KAKLIK\programy\PIC_C\mereni\otmer\otmer.err |
INHX8: D:\KAKLIK\programy\PIC_C\mereni\otmer\otmer.HEX |
Symbols: D:\KAKLIK\programy\PIC_C\mereni\otmer\otmer.SYM |
List: D:\KAKLIK\programy\PIC_C\mereni\otmer\otmer.LST |
Debug/COFF: D:\KAKLIK\programy\PIC_C\mereni\otmer\otmer.cof |
Call Tree: D:\KAKLIK\programy\PIC_C\mereni\otmer\otmer.tre |
Statistics: D:\KAKLIK\programy\PIC_C\mereni\otmer\otmer.sta |
/programy/C/PIC_C/mereni/otmer/otmer.c |
---|
0,0 → 1,38 |
#include "D:\KAKLIK\programy\PIC_C\mereni\otmer\otmer.h" |
#define DATA PIN_A1 |
#define CP PIN_A0 |
#define STROBE PIN_A2 |
#include "shift_reg.c" |
void main() |
{ |
int n=0; |
int i; |
putreg(1); |
while(true) |
{ |
i=1; |
for(n=0;n<=7;n++) |
{ |
putreg(i); |
i=i<<1; |
Delay_ms(50); |
}; |
i=0x80; |
for(n=0;n<=7;n++) |
{ |
putreg(i); |
i=i>>1; |
Delay_ms(50); |
}; |
} |
while(true) |
{ |
putreg(~n); |
Delay_ms(100); |
n++; |
} |
} |
/programy/C/PIC_C/mereni/otmer/otmer.cof |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/mereni/otmer/otmer.err |
---|
0,0 → 1,0 |
No Errors |
/programy/C/PIC_C/mereni/otmer/otmer.h |
---|
0,0 → 1,4 |
#include <16F84.h> |
#fuses NOWDT,XT, NOPUT, NOPROTECT |
#use delay(clock=4000000) |
/programy/C/PIC_C/mereni/otmer/otmer.sta |
---|
0,0 → 1,30 |
ROM used: 122 (12%) |
122 (12%) including unused fragments |
1 Average locations per line |
4 Average locations per statement |
RAM used: 5 (7%) at main() level |
8 (12%) worst case |
Lines Stmts % Files |
----- ----- --- ----- |
39 22 76 D:\KAKLIK\programy\PIC_C\mereni\otmer\otmer.c |
5 0 0 D:\KAKLIK\programy\PIC_C\mereni\otmer\otmer.h |
111 0 0 C:\Program Files\PICC\devices\16F84.h |
29 7 14 D:\KAKLIK\programy\PIC_C\mereni\otmer\shift_reg.c |
----- ----- |
368 58 Total |
Page ROM % RAM Functions: |
---- --- --- --- ---------- |
0 21 17 1 @delay_ms1 |
0 43 35 3 putreg |
0 54 44 3 main |
Segment Used Free |
--------- ---- ---- |
00000-00003 4 0 |
00004-003FF 118 902 |
/programy/C/PIC_C/mereni/otmer/otmer.tre |
---|
0,0 → 1,10 |
ÀÄotmer |
ÀÄmain 0/54 Ram=3 |
ÃÄ??0?? |
ÃÄputreg 0/43 Ram=3 |
ÃÄputreg 0/43 Ram=3 |
ÃÄ@delay_ms1 0/21 Ram=1 |
ÃÄputreg 0/43 Ram=3 |
ÃÄ@delay_ms1 0/21 Ram=1 |
ÃÄputreg 0/43 Ram=3 |
ÀÄ@delay_ms1 0/21 Ram=1 |
/programy/C/PIC_C/mereni/otmer/shift_reg.BAK |
---|
0,0 → 1,22 |
//////////////////////////////////////////////////////////////////////////////// |
// KNIHOVNA PRO OVLADANI POSUVNEHO REGISTRU |
// |
//////////////////////////////////////////////////////////////////////////////// |
// definice |
//#define DATA PIN_A1 |
//#define CP PIN_A0 |
//#define STROBE PIN_A2 |
void putreg(unsigned int8 out) // zapise do registru 8bitovou promenou. |
{ |
int8 i; |
output_low(STROBE); |
for(i=0;i<=7;i++) |
{ |
output_bit(DATA,bit_test(out,7-i)); |
output_low(CP); |
output_high(CP); |
} |
output_high(STROBE); |
} |
/programy/C/PIC_C/mereni/otmer/vssver.scc |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/mereni/piezo_cidlo/PRG.BAT |
---|
0,0 → 1,10 |
@echo off |
picpgr reset PIC16F84 |
picpgr erase PIC16F84 |
rem cls |
picpgr program piezo.hex hex PIC16f84 XT_ON PWRTE_ON WDTE_OFF CP_OFF |
picpgr run |
pause |
picpgr stop |
pause |
/programy/C/PIC_C/mereni/piezo_cidlo/PRG.PIF |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/mereni/piezo_cidlo/RUN.PIF |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/mereni/piezo_cidlo/Run.BAT |
---|
0,0 → 1,6 |
@echo off |
picpgr reset PIC16F84 |
picpgr run |
pause |
picpgr stop |
pause |
/programy/C/PIC_C/mereni/piezo_cidlo/piezo.BAK |
---|
0,0 → 1,13 |
#include "D:\@Kaklik\programy\PIC_C\cidlo\piezo.h" |
void main() |
{ |
port_b_pullups(false); |
setup_counters(RTCC_INTERNAL,WDT_18MS); |
while (true) |
{ |
if (input(PIN_B0)) output_high(PIN_A3); else output_low(PIN_A3); |
} |
} |
/programy/C/PIC_C/mereni/piezo_cidlo/piezo.HEX |
---|
0,0 → 1,13 |
:1000000000308A001928000010308400000803190D |
:10001000182801308D008C018C0B0C288D0B0B28BF |
:100020004A308C008C0B122800000000800B09283D |
:10003000402884011F3083058316811708308312FE |
:100040008C008C1D2B280730810181308400000832 |
:10005000C0390F3880006400813084000008C03946 |
:100060000C048000831606148312061C4328831692 |
:1000700085118312851502308F00FA309000042814 |
:100080008F0B3D284728831685118312851132284E |
:0200900063000B |
:02400E00FE3F73 |
:00000001FF |
;PIC16C84 |
/programy/C/PIC_C/mereni/piezo_cidlo/piezo.LST |
---|
0,0 → 1,112 |
CCS PCW C Compiler, Version 3.110, 15448 |
Filename: d:\@kaklik\programy\pic_c\cidlo\piezo.LST |
ROM used: 73 (7%) |
Largest free fragment is 951 |
RAM used: 3 (8%) at main() level |
4 (11%) worst case |
Stack: 1 locations |
* |
0000: MOVLW 00 |
0001: MOVWF 0A |
0002: GOTO 019 |
0003: NOP |
.................... #include "D:\@Kaklik\programy\PIC_C\cidlo\piezo.h" |
.................... #include <16C84.h> |
.................... //////// Standard Header file for the PIC16C84 device //////////////// |
.................... #device PIC16C84 |
.................... #list |
.................... |
.................... #use delay(clock=4000000) |
0004: MOVLW 10 |
0005: MOVWF 04 |
0006: MOVF 00,W |
0007: BTFSC 03.2 |
0008: GOTO 018 |
0009: MOVLW 01 |
000A: MOVWF 0D |
000B: CLRF 0C |
000C: DECFSZ 0C,F |
000D: GOTO 00C |
000E: DECFSZ 0D,F |
000F: GOTO 00B |
0010: MOVLW 4A |
0011: MOVWF 0C |
0012: DECFSZ 0C,F |
0013: GOTO 012 |
0014: NOP |
0015: NOP |
0016: DECFSZ 00,F |
0017: GOTO 009 |
0018: GOTO 040 (RETURN) |
.................... #fuses HS,WDT |
.................... |
.................... |
.................... |
.................... |
.................... void main() |
.................... { |
0019: CLRF 04 |
001A: MOVLW 1F |
001B: ANDWF 03,F |
.................... port_b_pullups(false); |
001C: BSF 03.5 |
001D: BSF 01.7 |
.................... setup_counters(RTCC_INTERNAL,WDT_18MS); |
001E: MOVLW 08 |
001F: BCF 03.5 |
0020: MOVWF 0C |
0021: BTFSS 0C.3 |
0022: GOTO 02B |
0023: MOVLW 07 |
0024: CLRF 01 |
0025: MOVLW 81 |
0026: MOVWF 04 |
0027: MOVF 00,W |
0028: ANDLW C0 |
0029: IORLW 0F |
002A: MOVWF 00 |
002B: CLRWDT |
002C: MOVLW 81 |
002D: MOVWF 04 |
002E: MOVF 00,W |
002F: ANDLW C0 |
0030: IORWF 0C,W |
0031: MOVWF 00 |
.................... |
.................... while (true) |
.................... { |
.................... if (input(PIN_B0)) |
0032: BSF 03.5 |
0033: BSF 06.0 |
0034: BCF 03.5 |
0035: BTFSS 06.0 |
0036: GOTO 043 |
.................... { |
.................... output_high(PIN_A3); |
0037: BSF 03.5 |
0038: BCF 05.3 |
0039: BCF 03.5 |
003A: BSF 05.3 |
.................... delay_ms(500); |
003B: MOVLW 02 |
003C: MOVWF 0F |
003D: MOVLW FA |
003E: MOVWF 10 |
003F: GOTO 004 |
0040: DECFSZ 0F,F |
0041: GOTO 03D |
.................... } |
.................... else output_low(PIN_A3); |
0042: GOTO 047 |
0043: BSF 03.5 |
0044: BCF 05.3 |
0045: BCF 03.5 |
0046: BCF 05.3 |
.................... } |
0047: GOTO 032 |
.................... } |
.................... |
0048: SLEEP |
/programy/C/PIC_C/mereni/piezo_cidlo/piezo.PJT |
---|
0,0 → 1,32 |
[PROJECT] |
Target=piezo.HEX |
Development_Mode= |
Processor=0x6C84 |
ToolSuite=CCS |
[Directories] |
Include=C:\PROGRAM FILES\PICC\devices\;C:\PROGRAM FILES\PICC\dr |
Library= |
LinkerScript= |
[Target Data] |
FileList=piezo.c; |
BuildTool=C-COMPILER |
OptionString=+FM |
AdditionalOptionString= |
BuildRequired=1 |
[piezo.c] |
Type=4 |
Path= |
FileList= |
BuildTool= |
OptionString= |
AdditionalOptionString= |
[mru-list] |
1=piezo.c |
[Windows] |
0=0000 piezo.c 0 0 796 451 3 0 |
/programy/C/PIC_C/mereni/piezo_cidlo/piezo.SYM |
---|
0,0 → 1,14 |
00C @SCRATCH |
00D @SCRATCH |
00D _RETURN_ |
00F main.@SCRATCH |
010 delay_ms.P1 |
delay_us.P1 |
0004 delay_ms |
0019 main |
Project Files: |
d:\@kaklik\programy\pic_c\cidlo\piezo.c |
D:\@Kaklik\programy\PIC_C\cidlo\piezo.h |
C:\PROGRAM FILES\PICC\devices\16C84.h |
/programy/C/PIC_C/mereni/piezo_cidlo/piezo.c |
---|
0,0 → 1,18 |
#include "D:\@Kaklik\programy\PIC_C\cidlo\piezo.h" |
void main() |
{ |
port_b_pullups(false); |
setup_counters(RTCC_INTERNAL,WDT_18MS); |
while (true) |
{ |
if (input(PIN_B0)) |
{ |
output_high(PIN_A3); |
delay_ms(500); |
} |
else output_low(PIN_A3); |
} |
} |
/programy/C/PIC_C/mereni/piezo_cidlo/piezo.cod |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/mereni/piezo_cidlo/piezo.err |
---|
0,0 → 1,0 |
No Errors |
/programy/C/PIC_C/mereni/piezo_cidlo/piezo.h |
---|
0,0 → 1,4 |
#include <16C84.h> |
#use delay(clock=4000000) |
#fuses HS,WDT |
/programy/C/PIC_C/mereni/piezo_cidlo/piezo.sta |
---|
0,0 → 1,28 |
ROM used: 73 (7%) |
951 (93%) including unused fragments |
1 Average locations per line |
8 Average locations per statement |
RAM used: 3 (8%) at main() level |
4 (11%) worst case |
Lines Stmts % Files |
----- ----- --- ----- |
19 9 100 d:\@kaklik\programy\pic_c\cidlo\piezo.c |
5 0 0 D:\@Kaklik\programy\PIC_C\cidlo\piezo.h |
111 0 0 C:\PROGRAM FILES\PICC\devices\16C84.h |
----- ----- |
270 18 Total |
Page ROM % RAM Functions: |
---- --- --- --- ---------- |
0 21 29 1 delay_ms |
0 48 66 1 main |
Segment Used Free |
--------- ---- ---- |
0000-0003 4 0 |
0004-03FF 69 951 |
/programy/C/PIC_C/mereni/piezo_cidlo/piezo.tre |
---|
0,0 → 1,4 |
ÀÄpiezo |
ÀÄmain 0/48 Ram=1 |
ÃÄ??0?? |
ÀÄdelay_ms 0/21 Ram=1 |
/programy/C/PIC_C/mereni/piezo_cidlo/vssver.scc |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/mereni/serva/PIC16F84/main.BAK |
---|
0,0 → 1,80 |
#include "D:\@Kaklik\programy\PIC_C\mereni\serva\main.h" |
#DEFINE servo1 PIN_A4 |
#DEFINE servo2 PIN_A3 |
#DEFINE servo3 PIN_A2 |
#DEFINE servo4 PIN_A0 |
#DEFINE SW PIN_A1 |
void main() |
{ |
int i; |
while(true) |
{ |
While(input(SW)) |
{ |
output_high(servo1); |
Delay_us(1500); |
output_low(servo1); |
output_high(servo2); |
Delay_us(1500); |
output_low(servo2); |
output_high(servo3); |
Delay_us(1500); |
output_low(servo3); |
output_high(servo4); |
Delay_us(1500); |
output_low(servo4); |
Delay_ms(10); |
} |
While(!input(SW)) |
{ |
for(i=0; i<100; ++i) |
{ |
output_high(servo1); |
Delay_us(1000); |
output_low(servo1); |
output_high(servo2); |
Delay_us(1000); |
output_low(servo2); |
output_high(servo3); |
Delay_us(1000); |
output_low(servo3); |
output_high(servo4); |
Delay_us(1000); |
output_low(servo4); |
Delay_ms(10); |
} |
for(i=0; i<100; ++i) |
{ |
output_high(servo1); |
Delay_us(2000); |
output_low(servo1); |
output_high(servo2); |
Delay_us(2000); |
output_low(servo2); |
output_high(servo3); |
Delay_us(2000); |
output_low(servo3); |
output_high(servo4); |
Delay_us(2000); |
output_low(servo4); |
Delay_ms(10); |
} |
} |
} |
} |
/programy/C/PIC_C/mereni/serva/PIC16F84/main.HEX |
---|
0,0 → 1,33 |
:1000000000308A00272800001030840000080319FF |
:10001000182801308D008C018C0B0C288D0B0B28BF |
:100020004A308C008C0B122800000000800B09283D |
:10003000003411308400FC308005800C800C0008F6 |
:100040000319262824280000800B2328003484016B |
:100050001F308305831685148312851C7B28831625 |
:100060000512831205160130900004200230900022 |
:10007000EC3091001920900B38288316051283125A |
:100080000512831685118312851501309000042016 |
:1000900002309000EC3091001920900B4A28831612 |
:1000A0008511831285118316051183120515013000 |
:1000B0009000042002309000EC3091001920900B49 |
:1000C0005C2883160511831205118316051083120F |
:1000D000051401309000042002309000EC309100B3 |
:1000E0001920900B6E2883160510831205100A3014 |
:1000F000900004202A288316851483128518ED2881 |
:100100008F010F08633C031CB62883160512831267 |
:100110000516013090000420831605128312051283 |
:1001200083168511831285150130900004208316F3 |
:10013000851183128511831605118312051501306F |
:1001400090000420831605118312051183160510F3 |
:1001500083120514013090000420831605108312C9 |
:1001600005100A30900004208F0A81288F010F08A3 |
:10017000633C031CEC28831605128312051602301B |
:100180009000042083160512831205128316851130 |
:100190008312851502309000042083168511831286 |
:1001A0008511831605118312051502309000042075 |
:1001B0008316051183120511831605108312051489 |
:1001C00002309000042083160510831205100A30B7 |
:0E01D000900004208F0AB7287B282A2863009D |
:02400E00F93F78 |
:00000001FF |
;PIC16F84 |
/programy/C/PIC_C/mereni/serva/PIC16F84/main.LST |
---|
0,0 → 1,340 |
CCS PCW C Compiler, Version 3.110, 15448 |
Filename: d:\@kaklik\programy\pic_c\mereni\serva\main.LST |
ROM used: 239 (23%) |
Largest free fragment is 785 |
RAM used: 4 (6%) at main() level |
5 (7%) worst case |
Stack: 1 locations |
* |
0000: MOVLW 00 |
0001: MOVWF 0A |
0002: GOTO 027 |
0003: NOP |
.................... #include "D:\@Kaklik\programy\PIC_C\mereni\serva\main.h" |
.................... #include <16F84.h> |
.................... //////// Standard Header file for the PIC16F84 device //////////////// |
.................... #device PIC16F84 |
.................... #list |
.................... |
.................... #use delay(clock=4000000) |
0004: MOVLW 10 |
0005: MOVWF 04 |
0006: MOVF 00,W |
0007: BTFSC 03.2 |
0008: GOTO 018 |
0009: MOVLW 01 |
000A: MOVWF 0D |
000B: CLRF 0C |
000C: DECFSZ 0C,F |
000D: GOTO 00C |
000E: DECFSZ 0D,F |
000F: GOTO 00B |
0010: MOVLW 4A |
0011: MOVWF 0C |
0012: DECFSZ 0C,F |
0013: GOTO 012 |
0014: NOP |
0015: NOP |
0016: DECFSZ 00,F |
0017: GOTO 009 |
0018: RETLW 00 |
0019: MOVLW 11 |
001A: MOVWF 04 |
001B: MOVLW FC |
001C: ANDWF 00,F |
001D: RRF 00,F |
001E: RRF 00,F |
001F: MOVF 00,W |
0020: BTFSC 03.2 |
0021: GOTO 026 |
0022: GOTO 024 |
0023: NOP |
0024: DECFSZ 00,F |
0025: GOTO 023 |
0026: RETLW 00 |
.................... #fuses XT,NOWDT |
.................... |
.................... |
.................... #DEFINE servo1 PIN_A4 |
.................... #DEFINE servo2 PIN_A3 |
.................... #DEFINE servo3 PIN_A2 |
.................... #DEFINE servo4 PIN_A0 |
.................... #DEFINE SW PIN_A1 |
.................... |
.................... void main() |
.................... { |
.................... int i; |
0027: CLRF 04 |
0028: MOVLW 1F |
0029: ANDWF 03,F |
.................... |
.................... while(true) |
.................... { |
.................... While(input(SW)) |
002A: BSF 03.5 |
002B: BSF 05.1 |
002C: BCF 03.5 |
002D: BTFSS 05.1 |
002E: GOTO 07B |
.................... { |
.................... output_high(servo1); |
002F: BSF 03.5 |
0030: BCF 05.4 |
0031: BCF 03.5 |
0032: BSF 05.4 |
.................... Delay_us(1500); |
0033: MOVLW 01 |
0034: MOVWF 10 |
0035: CALL 004 |
0036: MOVLW 02 |
0037: MOVWF 10 |
0038: MOVLW EC |
0039: MOVWF 11 |
003A: CALL 019 |
003B: DECFSZ 10,F |
003C: GOTO 038 |
.................... output_low(servo1); |
003D: BSF 03.5 |
003E: BCF 05.4 |
003F: BCF 03.5 |
0040: BCF 05.4 |
.................... |
.................... output_high(servo2); |
0041: BSF 03.5 |
0042: BCF 05.3 |
0043: BCF 03.5 |
0044: BSF 05.3 |
.................... Delay_us(1500); |
0045: MOVLW 01 |
0046: MOVWF 10 |
0047: CALL 004 |
0048: MOVLW 02 |
0049: MOVWF 10 |
004A: MOVLW EC |
004B: MOVWF 11 |
004C: CALL 019 |
004D: DECFSZ 10,F |
004E: GOTO 04A |
.................... output_low(servo2); |
004F: BSF 03.5 |
0050: BCF 05.3 |
0051: BCF 03.5 |
0052: BCF 05.3 |
.................... |
.................... output_high(servo3); |
0053: BSF 03.5 |
0054: BCF 05.2 |
0055: BCF 03.5 |
0056: BSF 05.2 |
.................... Delay_us(1500); |
0057: MOVLW 01 |
0058: MOVWF 10 |
0059: CALL 004 |
005A: MOVLW 02 |
005B: MOVWF 10 |
005C: MOVLW EC |
005D: MOVWF 11 |
005E: CALL 019 |
005F: DECFSZ 10,F |
0060: GOTO 05C |
.................... output_low(servo3); |
0061: BSF 03.5 |
0062: BCF 05.2 |
0063: BCF 03.5 |
0064: BCF 05.2 |
.................... |
.................... output_high(servo4); |
0065: BSF 03.5 |
0066: BCF 05.0 |
0067: BCF 03.5 |
0068: BSF 05.0 |
.................... Delay_us(1500); |
0069: MOVLW 01 |
006A: MOVWF 10 |
006B: CALL 004 |
006C: MOVLW 02 |
006D: MOVWF 10 |
006E: MOVLW EC |
006F: MOVWF 11 |
0070: CALL 019 |
0071: DECFSZ 10,F |
0072: GOTO 06E |
.................... output_low(servo4); |
0073: BSF 03.5 |
0074: BCF 05.0 |
0075: BCF 03.5 |
0076: BCF 05.0 |
.................... |
.................... Delay_ms(10); |
0077: MOVLW 0A |
0078: MOVWF 10 |
0079: CALL 004 |
.................... } |
007A: GOTO 02A |
.................... |
.................... While(!input(SW)) |
007B: BSF 03.5 |
007C: BSF 05.1 |
007D: BCF 03.5 |
007E: BTFSC 05.1 |
007F: GOTO 0ED |
.................... { |
.................... for(i=0; i<100; ++i) |
0080: CLRF 0F |
0081: MOVF 0F,W |
0082: SUBLW 63 |
0083: BTFSS 03.0 |
0084: GOTO 0B6 |
.................... { |
.................... output_high(servo1); |
0085: BSF 03.5 |
0086: BCF 05.4 |
0087: BCF 03.5 |
0088: BSF 05.4 |
.................... Delay_us(1000); |
0089: MOVLW 01 |
008A: MOVWF 10 |
008B: CALL 004 |
.................... output_low(servo1); |
008C: BSF 03.5 |
008D: BCF 05.4 |
008E: BCF 03.5 |
008F: BCF 05.4 |
.................... |
.................... output_high(servo2); |
0090: BSF 03.5 |
0091: BCF 05.3 |
0092: BCF 03.5 |
0093: BSF 05.3 |
.................... Delay_us(1000); |
0094: MOVLW 01 |
0095: MOVWF 10 |
0096: CALL 004 |
.................... output_low(servo2); |
0097: BSF 03.5 |
0098: BCF 05.3 |
0099: BCF 03.5 |
009A: BCF 05.3 |
.................... |
.................... output_high(servo3); |
009B: BSF 03.5 |
009C: BCF 05.2 |
009D: BCF 03.5 |
009E: BSF 05.2 |
.................... Delay_us(1000); |
009F: MOVLW 01 |
00A0: MOVWF 10 |
00A1: CALL 004 |
.................... output_low(servo3); |
00A2: BSF 03.5 |
00A3: BCF 05.2 |
00A4: BCF 03.5 |
00A5: BCF 05.2 |
.................... |
.................... output_high(servo4); |
00A6: BSF 03.5 |
00A7: BCF 05.0 |
00A8: BCF 03.5 |
00A9: BSF 05.0 |
.................... Delay_us(1000); |
00AA: MOVLW 01 |
00AB: MOVWF 10 |
00AC: CALL 004 |
.................... output_low(servo4); |
00AD: BSF 03.5 |
00AE: BCF 05.0 |
00AF: BCF 03.5 |
00B0: BCF 05.0 |
.................... |
.................... Delay_ms(10); |
00B1: MOVLW 0A |
00B2: MOVWF 10 |
00B3: CALL 004 |
.................... } |
00B4: INCF 0F,F |
00B5: GOTO 081 |
.................... |
.................... for(i=0; i<100; ++i) |
00B6: CLRF 0F |
00B7: MOVF 0F,W |
00B8: SUBLW 63 |
00B9: BTFSS 03.0 |
00BA: GOTO 0EC |
.................... { |
.................... output_high(servo1); |
00BB: BSF 03.5 |
00BC: BCF 05.4 |
00BD: BCF 03.5 |
00BE: BSF 05.4 |
.................... Delay_us(2000); |
00BF: MOVLW 02 |
00C0: MOVWF 10 |
00C1: CALL 004 |
.................... output_low(servo1); |
00C2: BSF 03.5 |
00C3: BCF 05.4 |
00C4: BCF 03.5 |
00C5: BCF 05.4 |
.................... |
.................... output_high(servo2); |
00C6: BSF 03.5 |
00C7: BCF 05.3 |
00C8: BCF 03.5 |
00C9: BSF 05.3 |
.................... Delay_us(2000); |
00CA: MOVLW 02 |
00CB: MOVWF 10 |
00CC: CALL 004 |
.................... output_low(servo2); |
00CD: BSF 03.5 |
00CE: BCF 05.3 |
00CF: BCF 03.5 |
00D0: BCF 05.3 |
.................... |
.................... output_high(servo3); |
00D1: BSF 03.5 |
00D2: BCF 05.2 |
00D3: BCF 03.5 |
00D4: BSF 05.2 |
.................... Delay_us(2000); |
00D5: MOVLW 02 |
00D6: MOVWF 10 |
00D7: CALL 004 |
.................... output_low(servo3); |
00D8: BSF 03.5 |
00D9: BCF 05.2 |
00DA: BCF 03.5 |
00DB: BCF 05.2 |
.................... |
.................... output_high(servo4); |
00DC: BSF 03.5 |
00DD: BCF 05.0 |
00DE: BCF 03.5 |
00DF: BSF 05.0 |
.................... Delay_us(2000); |
00E0: MOVLW 02 |
00E1: MOVWF 10 |
00E2: CALL 004 |
.................... output_low(servo4); |
00E3: BSF 03.5 |
00E4: BCF 05.0 |
00E5: BCF 03.5 |
00E6: BCF 05.0 |
.................... |
.................... Delay_ms(10); |
00E7: MOVLW 0A |
00E8: MOVWF 10 |
00E9: CALL 004 |
.................... } |
00EA: INCF 0F,F |
00EB: GOTO 0B7 |
.................... } |
00EC: GOTO 07B |
.................... } |
00ED: GOTO 02A |
.................... } |
.................... |
00EE: SLEEP |
/programy/C/PIC_C/mereni/serva/PIC16F84/main.PJT |
---|
0,0 → 1,35 |
[PROJECT] |
Target=main.HEX |
Development_Mode= |
Processor=0x684A |
ToolSuite=CCS |
[Directories] |
Include=C:\PROGRAM FILES\PICC\devices\;C:\PROGRAM FILES\PICC\dr |
Library= |
LinkerScript= |
[Target Data] |
FileList=main.c; |
BuildTool=C-COMPILER |
OptionString=+FM |
AdditionalOptionString= |
BuildRequired=1 |
[main.c] |
Type=4 |
Path= |
FileList= |
BuildTool= |
OptionString= |
AdditionalOptionString= |
[mru-list] |
1=main.c |
[Windows] |
0=0000 main.c 0 0 796 451 3 0 |
[Opened Files] |
1=D:\KAKLIK\programy\PIC_C\mereni\serva\PIC16F84\main.c |
2= |
/programy/C/PIC_C/mereni/serva/PIC16F84/main.SYM |
---|
0,0 → 1,16 |
00C @SCRATCH |
00D @SCRATCH |
00D _RETURN_ |
00F main.i |
010 delay_ms.P1 |
010 main.@SCRATCH |
011 delay_us.P1 |
0004 delay_ms |
0019 delay_us |
0027 main |
Project Files: |
d:\@kaklik\programy\pic_c\mereni\serva\main.c |
D:\@Kaklik\programy\PIC_C\mereni\serva\main.h |
C:\PROGRAM FILES\PICC\devices\16F84.h |
/programy/C/PIC_C/mereni/serva/PIC16F84/main.c |
---|
0,0 → 1,81 |
#include "D:\@Kaklik\programy\PIC_C\mereni\serva\main.h" |
#DEFINE servo1 PIN_A4 |
#DEFINE servo2 PIN_A3 |
#DEFINE servo3 PIN_A2 |
#DEFINE servo4 PIN_A0 |
#DEFINE SW PIN_A1 |
void main() |
{ |
int i; |
while(true) |
{ |
While(input(SW)) |
{ |
output_high(servo1); |
Delay_us(1500); |
output_low(servo1); |
output_high(servo2); |
Delay_us(1500); |
output_low(servo2); |
output_high(servo3); |
Delay_us(1500); |
output_low(servo3); |
output_high(servo4); |
Delay_us(1500); |
output_low(servo4); |
Delay_ms(10); |
} |
While(!input(SW)) |
{ |
for(i=0; i<100; ++i) |
{ |
output_high(servo1); |
Delay_us(1000); |
output_low(servo1); |
output_high(servo2); |
Delay_us(1000); |
output_low(servo2); |
output_high(servo3); |
Delay_us(1000); |
output_low(servo3); |
output_high(servo4); |
Delay_us(1000); |
output_low(servo4); |
Delay_ms(10); |
} |
for(i=0; i<100; ++i) |
{ |
output_high(servo1); |
Delay_us(2000); |
output_low(servo1); |
output_high(servo2); |
Delay_us(2000); |
output_low(servo2); |
output_high(servo3); |
Delay_us(2000); |
output_low(servo3); |
output_high(servo4); |
Delay_us(2000); |
output_low(servo4); |
Delay_ms(10); |
} |
} |
} |
} |
/programy/C/PIC_C/mereni/serva/PIC16F84/main.cod |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/mereni/serva/PIC16F84/main.err |
---|
0,0 → 1,0 |
No Errors |
/programy/C/PIC_C/mereni/serva/PIC16F84/main.h |
---|
0,0 → 1,4 |
#include <16F84.h> |
#use delay(clock=4000000) |
#fuses XT,NOWDT |
/programy/C/PIC_C/mereni/serva/PIC16F84/main.sta |
---|
0,0 → 1,29 |
ROM used: 239 (23%) |
785 (77%) including unused fragments |
1 Average locations per line |
5 Average locations per statement |
RAM used: 4 (6%) at main() level |
5 (7%) worst case |
Lines Stmts % Files |
----- ----- --- ----- |
81 49 100 d:\@kaklik\programy\pic_c\mereni\serva\main.c |
5 0 0 D:\@Kaklik\programy\PIC_C\mereni\serva\main.h |
111 0 0 C:\PROGRAM FILES\PICC\devices\16F84.h |
----- ----- |
394 98 Total |
Page ROM % RAM Functions: |
---- --- --- --- ---------- |
0 21 9 1 delay_ms |
0 14 6 1 delay_us |
0 200 84 2 main |
Segment Used Free |
--------- ---- ---- |
0000-0003 4 0 |
0004-03FF 235 785 |
/programy/C/PIC_C/mereni/serva/PIC16F84/main.tre |
---|
0,0 → 1,22 |
ÀÄmain |
ÀÄmain 0/200 Ram=2 |
ÃÄ??0?? |
ÃÄdelay_ms 0/21 Ram=1 |
ÃÄdelay_us 0/14 Ram=1 |
ÃÄdelay_ms 0/21 Ram=1 |
ÃÄdelay_us 0/14 Ram=1 |
ÃÄdelay_ms 0/21 Ram=1 |
ÃÄdelay_us 0/14 Ram=1 |
ÃÄdelay_ms 0/21 Ram=1 |
ÃÄdelay_us 0/14 Ram=1 |
ÃÄdelay_ms 0/21 Ram=1 |
ÃÄdelay_ms 0/21 Ram=1 |
ÃÄdelay_ms 0/21 Ram=1 |
ÃÄdelay_ms 0/21 Ram=1 |
ÃÄdelay_ms 0/21 Ram=1 |
ÃÄdelay_ms 0/21 Ram=1 |
ÃÄdelay_ms 0/21 Ram=1 |
ÃÄdelay_ms 0/21 Ram=1 |
ÃÄdelay_ms 0/21 Ram=1 |
ÃÄdelay_ms 0/21 Ram=1 |
ÀÄdelay_ms 0/21 Ram=1 |
/programy/C/PIC_C/mereni/serva/PIC16F84/prg.bat |
---|
0,0 → 1,8 |
:start |
call picpgr stop |
call picpgr erase pic16f84 |
call picpgr program main.hex hex pic16f84 |
call picpgr run |
pause |
call picpgr stop |
rem goto start |
/programy/C/PIC_C/mereni/serva/PIC16F84/vssver.scc |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/mereni/serva/PIC16F88/tester.BAK |
---|
0,0 → 1,93 |
#include "D:\KAKLIK\programy\PIC_C\mereni\serva\PIC16F88\tester.h" |
#DEFINE servo1 PIN_A4 |
#DEFINE servo2 PIN_A3 |
#DEFINE servo3 PIN_A2 |
#DEFINE servo4 PIN_A0 |
#DEFINE SW PIN_A1 |
void main() |
{ |
int i; |
setup_adc_ports(NO_ANALOGS|VSS_VDD); |
setup_adc(ADC_OFF); |
setup_spi(FALSE); |
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
setup_timer_1(T1_DISABLED); |
setup_timer_2(T2_DISABLED,0,1); |
setup_comparator(NC_NC_NC_NC); |
setup_vref(FALSE); |
while(true) |
{ |
While(input(SW)) |
{ |
output_high(servo1); |
Delay_us(1500); |
output_low(servo1); |
output_high(servo2); |
Delay_us(1500); |
output_low(servo2); |
output_high(servo3); |
Delay_us(1500); |
output_low(servo3); |
output_high(servo4); |
Delay_us(1500); |
output_low(servo4); |
Delay_ms(10); |
} |
While(!input(SW)) |
{ |
for(i=0; i<100; ++i) |
{ |
output_high(servo1); |
Delay_us(1000); |
output_low(servo1); |
output_high(servo2); |
Delay_us(1000); |
output_low(servo2); |
output_high(servo3); |
Delay_us(1000); |
output_low(servo3); |
output_high(servo4); |
Delay_us(1000); |
output_low(servo4); |
Delay_ms(10); |
} |
for(i=0; i<100; ++i) |
{ |
output_high(servo1); |
Delay_us(2000); |
output_low(servo1); |
output_high(servo2); |
Delay_us(2000); |
output_low(servo2); |
output_high(servo3); |
Delay_us(2000); |
output_low(servo3); |
output_high(servo4); |
Delay_us(2000); |
output_low(servo4); |
Delay_ms(10); |
} |
} |
} |
} |
/programy/C/PIC_C/mereni/serva/PIC16F88/tester.HEX |
---|
0,0 → 1,41 |
:1000000000308A002C2800002230840000080319E8 |
:1000100018280130F800F701F70B0C28F80B0B2813 |
:100020004A30F700F70B122800000000800B092867 |
:1000300000341230A302031C2B2823308400FC3030 |
:1000400080050310800C800C000803192B28292838 |
:100050000000800B2828003484011F30830583169C |
:100060001F129F121B0880399B0007309C001C0840 |
:1000700083120D13603083168F001F129F121B080E |
:1000800080399B0083121F10941283160611861468 |
:100090000612003083129400831694000108C739B9 |
:1000A00008388100831290010030F800920000307F |
:1000B0008316920007309C0005080330F700F70B09 |
:1000C0005F281C0883120D1383169D0106158312E9 |
:1000D000061DB82883168610831286140130A200EC |
:1000E00004200230A200F730A3001920A20B7328CD |
:1000F0008316861083128610831685118312851548 |
:100100000130A20004200230A200F730A300192021 |
:10011000A20B85288316851183128511831605117C |
:10012000831205150130A20004200230A200F7302E |
:10013000A3001920A20B972883160511831205111D |
:1001400083160510831205140130A200042002302A |
:10015000A200F730A3001920A20BA92883160510CE |
:10016000831205100A30A200042083166628831229 |
:1001700083160615831206192A29A1012108633C5A |
:10018000031CF32883168610831286140130A20004 |
:10019000042083168610831286108316851183121D |
:1001A00085150130A2000420831685118312851164 |
:1001B00083160511831205150130A2000420831651 |
:1001C00005118312051183160510831205140130E1 |
:1001D000A200042083160510831205100A30A20025 |
:1001E0000420A10ABE28A1012108633C031C29297F |
:1001F00083168610831286140230A2000420831610 |
:10020000861083128610831685118312851502309D |
:10021000A20004208316851183128511831605110F |
:10022000831205150230A2000420831605118312E3 |
:10023000051183160510831205140230A200042054 |
:1002400083160510831205100A30A2000420A10AAB |
:0A025000F428B8288316662863001E |
:04400E00F83FFF3F39 |
:00000001FF |
;PIC16F88 |
/programy/C/PIC_C/mereni/serva/PIC16F88/tester.LST |
---|
0,0 → 1,420 |
CCS PCM C Compiler, Version 3.221, 27853 27-XI-05 00:06 |
Filename: D:\KAKLIK\programy\PIC_C\mereni\serva\PIC16F88\tester.LST |
ROM used: 301 words (7%) |
Largest free fragment is 2048 |
RAM used: 7 (4%) at main() level |
8 (5%) worst case |
Stack: 1 locations |
* |
0000: MOVLW 00 |
0001: MOVWF 0A |
0002: GOTO 02C |
0003: NOP |
.................... #include "D:\KAKLIK\programy\PIC_C\mereni\serva\PIC16F88\tester.h" |
.................... #include <16F88.h> |
.................... //////// Standard Header file for the PIC16F88 device //////////////// |
.................... #device PIC16F88 |
.................... #list |
.................... |
.................... #device adc=8 |
.................... #fuses NOWDT,INTRC_IO, NOPUT, MCLR, BROWNOUT, LVP, NOCPD, NOWRT, NODEBUG, NOPROTECT, FCMEN, IESO |
.................... #use delay(clock=4000000) |
0004: MOVLW 22 |
0005: MOVWF 04 |
0006: MOVF 00,W |
0007: BTFSC 03.2 |
0008: GOTO 018 |
0009: MOVLW 01 |
000A: MOVWF 78 |
000B: CLRF 77 |
000C: DECFSZ 77,F |
000D: GOTO 00C |
000E: DECFSZ 78,F |
000F: GOTO 00B |
0010: MOVLW 4A |
0011: MOVWF 77 |
0012: DECFSZ 77,F |
0013: GOTO 012 |
0014: NOP |
0015: NOP |
0016: DECFSZ 00,F |
0017: GOTO 009 |
0018: RETLW 00 |
0019: MOVLW 12 |
001A: SUBWF 23,F |
001B: BTFSS 03.0 |
001C: GOTO 02B |
001D: MOVLW 23 |
001E: MOVWF 04 |
001F: MOVLW FC |
0020: ANDWF 00,F |
0021: BCF 03.0 |
0022: RRF 00,F |
0023: RRF 00,F |
0024: MOVF 00,W |
0025: BTFSC 03.2 |
0026: GOTO 02B |
0027: GOTO 029 |
0028: NOP |
0029: DECFSZ 00,F |
002A: GOTO 028 |
002B: RETLW 00 |
.................... |
.................... |
.................... |
.................... #DEFINE servo1 PIN_B1 |
.................... #DEFINE servo2 PIN_A3 |
.................... #DEFINE servo3 PIN_A2 |
.................... #DEFINE servo4 PIN_A0 |
.................... #DEFINE SW PIN_B2 |
.................... |
.................... void main() |
.................... { |
002C: CLRF 04 |
002D: MOVLW 1F |
002E: ANDWF 03,F |
002F: BSF 03.5 |
0030: BCF 1F.4 |
0031: BCF 1F.5 |
0032: MOVF 1B,W |
0033: ANDLW 80 |
0034: MOVWF 1B |
0035: MOVLW 07 |
0036: MOVWF 1C |
0037: MOVF 1C,W |
0038: BCF 03.5 |
0039: BCF 0D.6 |
003A: MOVLW 60 |
003B: BSF 03.5 |
003C: MOVWF 0F |
.................... int i; |
.................... |
.................... setup_adc_ports(NO_ANALOGS|VSS_VDD); |
003D: BCF 1F.4 |
003E: BCF 1F.5 |
003F: MOVF 1B,W |
0040: ANDLW 80 |
0041: MOVWF 1B |
.................... setup_adc(ADC_OFF); |
0042: BCF 03.5 |
0043: BCF 1F.0 |
.................... setup_spi(FALSE); |
0044: BCF 14.5 |
0045: BSF 03.5 |
0046: BCF 06.2 |
0047: BSF 06.1 |
0048: BCF 06.4 |
0049: MOVLW 00 |
004A: BCF 03.5 |
004B: MOVWF 14 |
004C: BSF 03.5 |
004D: MOVWF 14 |
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
004E: MOVF 01,W |
004F: ANDLW C7 |
0050: IORLW 08 |
0051: MOVWF 01 |
.................... setup_timer_1(T1_DISABLED); |
0052: BCF 03.5 |
0053: CLRF 10 |
.................... setup_timer_2(T2_DISABLED,0,1); |
0054: MOVLW 00 |
0055: MOVWF 78 |
0056: MOVWF 12 |
0057: MOVLW 00 |
0058: BSF 03.5 |
0059: MOVWF 12 |
.................... setup_comparator(NC_NC_NC_NC); |
005A: MOVLW 07 |
005B: MOVWF 1C |
005C: MOVF 05,W |
005D: MOVLW 03 |
005E: MOVWF 77 |
005F: DECFSZ 77,F |
0060: GOTO 05F |
0061: MOVF 1C,W |
0062: BCF 03.5 |
0063: BCF 0D.6 |
.................... setup_vref(FALSE); |
0064: BSF 03.5 |
0065: CLRF 1D |
.................... |
.................... |
.................... |
.................... while(true) |
.................... { |
.................... While(input(SW)) |
.................... { |
0066: BSF 06.2 |
0067: BCF 03.5 |
0068: BTFSS 06.2 |
0069: GOTO 0B8 |
.................... output_high(servo1); |
006A: BSF 03.5 |
006B: BCF 06.1 |
006C: BCF 03.5 |
006D: BSF 06.1 |
.................... Delay_us(1500); |
006E: MOVLW 01 |
006F: MOVWF 22 |
0070: CALL 004 |
0071: MOVLW 02 |
0072: MOVWF 22 |
0073: MOVLW F7 |
0074: MOVWF 23 |
0075: CALL 019 |
0076: DECFSZ 22,F |
0077: GOTO 073 |
.................... output_low(servo1); |
0078: BSF 03.5 |
0079: BCF 06.1 |
007A: BCF 03.5 |
007B: BCF 06.1 |
.................... |
.................... output_high(servo2); |
007C: BSF 03.5 |
007D: BCF 05.3 |
007E: BCF 03.5 |
007F: BSF 05.3 |
.................... Delay_us(1500); |
0080: MOVLW 01 |
0081: MOVWF 22 |
0082: CALL 004 |
0083: MOVLW 02 |
0084: MOVWF 22 |
0085: MOVLW F7 |
0086: MOVWF 23 |
0087: CALL 019 |
0088: DECFSZ 22,F |
0089: GOTO 085 |
.................... output_low(servo2); |
008A: BSF 03.5 |
008B: BCF 05.3 |
008C: BCF 03.5 |
008D: BCF 05.3 |
.................... |
.................... output_high(servo3); |
008E: BSF 03.5 |
008F: BCF 05.2 |
0090: BCF 03.5 |
0091: BSF 05.2 |
.................... Delay_us(1500); |
0092: MOVLW 01 |
0093: MOVWF 22 |
0094: CALL 004 |
0095: MOVLW 02 |
0096: MOVWF 22 |
0097: MOVLW F7 |
0098: MOVWF 23 |
0099: CALL 019 |
009A: DECFSZ 22,F |
009B: GOTO 097 |
.................... output_low(servo3); |
009C: BSF 03.5 |
009D: BCF 05.2 |
009E: BCF 03.5 |
009F: BCF 05.2 |
.................... |
.................... output_high(servo4); |
00A0: BSF 03.5 |
00A1: BCF 05.0 |
00A2: BCF 03.5 |
00A3: BSF 05.0 |
.................... Delay_us(1500); |
00A4: MOVLW 01 |
00A5: MOVWF 22 |
00A6: CALL 004 |
00A7: MOVLW 02 |
00A8: MOVWF 22 |
00A9: MOVLW F7 |
00AA: MOVWF 23 |
00AB: CALL 019 |
00AC: DECFSZ 22,F |
00AD: GOTO 0A9 |
.................... output_low(servo4); |
00AE: BSF 03.5 |
00AF: BCF 05.0 |
00B0: BCF 03.5 |
00B1: BCF 05.0 |
.................... |
.................... Delay_ms(10); |
00B2: MOVLW 0A |
00B3: MOVWF 22 |
00B4: CALL 004 |
.................... } |
00B5: BSF 03.5 |
00B6: GOTO 066 |
00B7: BCF 03.5 |
.................... |
.................... While(!input(SW)) |
.................... { |
00B8: BSF 03.5 |
00B9: BSF 06.2 |
00BA: BCF 03.5 |
00BB: BTFSC 06.2 |
00BC: GOTO 12A |
.................... for(i=0; i<100; ++i) |
00BD: CLRF 21 |
00BE: MOVF 21,W |
00BF: SUBLW 63 |
00C0: BTFSS 03.0 |
00C1: GOTO 0F3 |
.................... { |
.................... output_high(servo1); |
00C2: BSF 03.5 |
00C3: BCF 06.1 |
00C4: BCF 03.5 |
00C5: BSF 06.1 |
.................... Delay_us(1000); |
00C6: MOVLW 01 |
00C7: MOVWF 22 |
00C8: CALL 004 |
.................... output_low(servo1); |
00C9: BSF 03.5 |
00CA: BCF 06.1 |
00CB: BCF 03.5 |
00CC: BCF 06.1 |
.................... |
.................... output_high(servo2); |
00CD: BSF 03.5 |
00CE: BCF 05.3 |
00CF: BCF 03.5 |
00D0: BSF 05.3 |
.................... Delay_us(1000); |
00D1: MOVLW 01 |
00D2: MOVWF 22 |
00D3: CALL 004 |
.................... output_low(servo2); |
00D4: BSF 03.5 |
00D5: BCF 05.3 |
00D6: BCF 03.5 |
00D7: BCF 05.3 |
.................... |
.................... output_high(servo3); |
00D8: BSF 03.5 |
00D9: BCF 05.2 |
00DA: BCF 03.5 |
00DB: BSF 05.2 |
.................... Delay_us(1000); |
00DC: MOVLW 01 |
00DD: MOVWF 22 |
00DE: CALL 004 |
.................... output_low(servo3); |
00DF: BSF 03.5 |
00E0: BCF 05.2 |
00E1: BCF 03.5 |
00E2: BCF 05.2 |
.................... |
.................... output_high(servo4); |
00E3: BSF 03.5 |
00E4: BCF 05.0 |
00E5: BCF 03.5 |
00E6: BSF 05.0 |
.................... Delay_us(1000); |
00E7: MOVLW 01 |
00E8: MOVWF 22 |
00E9: CALL 004 |
.................... output_low(servo4); |
00EA: BSF 03.5 |
00EB: BCF 05.0 |
00EC: BCF 03.5 |
00ED: BCF 05.0 |
.................... |
.................... Delay_ms(10); |
00EE: MOVLW 0A |
00EF: MOVWF 22 |
00F0: CALL 004 |
.................... } |
00F1: INCF 21,F |
00F2: GOTO 0BE |
.................... |
.................... for(i=0; i<100; ++i) |
00F3: CLRF 21 |
00F4: MOVF 21,W |
00F5: SUBLW 63 |
00F6: BTFSS 03.0 |
00F7: GOTO 129 |
.................... { |
.................... output_high(servo1); |
00F8: BSF 03.5 |
00F9: BCF 06.1 |
00FA: BCF 03.5 |
00FB: BSF 06.1 |
.................... Delay_us(2000); |
00FC: MOVLW 02 |
00FD: MOVWF 22 |
00FE: CALL 004 |
.................... output_low(servo1); |
00FF: BSF 03.5 |
0100: BCF 06.1 |
0101: BCF 03.5 |
0102: BCF 06.1 |
.................... |
.................... output_high(servo2); |
0103: BSF 03.5 |
0104: BCF 05.3 |
0105: BCF 03.5 |
0106: BSF 05.3 |
.................... Delay_us(2000); |
0107: MOVLW 02 |
0108: MOVWF 22 |
0109: CALL 004 |
.................... output_low(servo2); |
010A: BSF 03.5 |
010B: BCF 05.3 |
010C: BCF 03.5 |
010D: BCF 05.3 |
.................... |
.................... output_high(servo3); |
010E: BSF 03.5 |
010F: BCF 05.2 |
0110: BCF 03.5 |
0111: BSF 05.2 |
.................... Delay_us(2000); |
0112: MOVLW 02 |
0113: MOVWF 22 |
0114: CALL 004 |
.................... output_low(servo3); |
0115: BSF 03.5 |
0116: BCF 05.2 |
0117: BCF 03.5 |
0118: BCF 05.2 |
.................... |
.................... output_high(servo4); |
0119: BSF 03.5 |
011A: BCF 05.0 |
011B: BCF 03.5 |
011C: BSF 05.0 |
.................... Delay_us(2000); |
011D: MOVLW 02 |
011E: MOVWF 22 |
011F: CALL 004 |
.................... output_low(servo4); |
0120: BSF 03.5 |
0121: BCF 05.0 |
0122: BCF 03.5 |
0123: BCF 05.0 |
.................... |
.................... Delay_ms(10); |
0124: MOVLW 0A |
0125: MOVWF 22 |
0126: CALL 004 |
.................... } |
0127: INCF 21,F |
0128: GOTO 0F4 |
.................... } |
0129: GOTO 0B8 |
.................... } |
012A: BSF 03.5 |
012B: GOTO 066 |
.................... |
.................... } |
.................... |
012C: SLEEP |
Configuration Fuses: |
Word 1: 3FF8 NOWDT NOPUT MCLR BROWNOUT LVP NOCPD NOWRT NODEBUG CCPB0 NOPROTECT INTRC_IO |
Word 2: 3FFF FCMEN IESO |
/programy/C/PIC_C/mereni/serva/PIC16F88/tester.PJT |
---|
0,0 → 1,35 |
[PROJECT] |
Target=tester.HEX |
Development_Mode= |
Processor=0x688F |
ToolSuite=CCS |
[Directories] |
Include=C:\Program Files\PICC\devices\;C:\Program Files\PICC\dr |
Library= |
LinkerScript= |
[Target Data] |
FileList=tester.c; |
BuildTool=C-COMPILER |
OptionString=+FM |
AdditionalOptionString= |
BuildRequired=1 |
[tester.c] |
Type=4 |
Path= |
FileList= |
BuildTool= |
OptionString= |
AdditionalOptionString= |
[mru-list] |
1=tester.c |
[Windows] |
0=0000 tester.c 0 0 796 451 3 0 |
[Opened Files] |
1=D:\KAKLIK\programy\PIC_C\mereni\serva\PIC16F88\tester.c |
2= |
/programy/C/PIC_C/mereni/serva/PIC16F88/tester.SYM |
---|
0,0 → 1,41 |
015 CCP_1_LOW |
015-016 CCP_1 |
016 CCP_1_HIGH |
021 main.i |
022 @delay_ms1.P1 |
022 main.@SCRATCH |
023 @delay_us1.P1 |
077 @SCRATCH |
078 @SCRATCH |
078 _RETURN_ |
079 @SCRATCH |
07A @SCRATCH |
07B @SCRATCH |
09C.6 C1OUT |
09C.7 C2OUT |
0004 @delay_ms1 |
0019 @delay_us1 |
002C main |
002C @cinit |
Project Files: |
D:\KAKLIK\programy\PIC_C\mereni\serva\PIC16F88\tester.c |
D:\KAKLIK\programy\PIC_C\mereni\serva\PIC16F88\tester.h |
C:\Program Files\PICC\devices\16F88.h |
Compiler Settings: |
Processor: PIC16F88 |
Pointer Size: 8 |
ADC Range: 0-255 |
Opt Level: 9 |
Short,Int,Long: 1,8,16 |
Output Files: |
Errors: D:\KAKLIK\programy\PIC_C\mereni\serva\PIC16F88\tester.err |
INHX8: D:\KAKLIK\programy\PIC_C\mereni\serva\PIC16F88\tester.HEX |
Symbols: D:\KAKLIK\programy\PIC_C\mereni\serva\PIC16F88\tester.SYM |
List: D:\KAKLIK\programy\PIC_C\mereni\serva\PIC16F88\tester.LST |
Debug/COFF: D:\KAKLIK\programy\PIC_C\mereni\serva\PIC16F88\tester.cof |
Call Tree: D:\KAKLIK\programy\PIC_C\mereni\serva\PIC16F88\tester.tre |
Statistics: D:\KAKLIK\programy\PIC_C\mereni\serva\PIC16F88\tester.sta |
/programy/C/PIC_C/mereni/serva/PIC16F88/tester.c |
---|
0,0 → 1,93 |
#include "D:\KAKLIK\programy\PIC_C\mereni\serva\PIC16F88\tester.h" |
#DEFINE servo1 PIN_B1 |
#DEFINE servo2 PIN_A3 |
#DEFINE servo3 PIN_A2 |
#DEFINE servo4 PIN_A0 |
#DEFINE SW PIN_B2 |
void main() |
{ |
int i; |
setup_adc_ports(NO_ANALOGS|VSS_VDD); |
setup_adc(ADC_OFF); |
setup_spi(FALSE); |
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
setup_timer_1(T1_DISABLED); |
setup_timer_2(T2_DISABLED,0,1); |
setup_comparator(NC_NC_NC_NC); |
setup_vref(FALSE); |
while(true) |
{ |
While(input(SW)) |
{ |
output_high(servo1); |
Delay_us(1500); |
output_low(servo1); |
output_high(servo2); |
Delay_us(1500); |
output_low(servo2); |
output_high(servo3); |
Delay_us(1500); |
output_low(servo3); |
output_high(servo4); |
Delay_us(1500); |
output_low(servo4); |
Delay_ms(10); |
} |
While(!input(SW)) |
{ |
for(i=0; i<100; ++i) |
{ |
output_high(servo1); |
Delay_us(1000); |
output_low(servo1); |
output_high(servo2); |
Delay_us(1000); |
output_low(servo2); |
output_high(servo3); |
Delay_us(1000); |
output_low(servo3); |
output_high(servo4); |
Delay_us(1000); |
output_low(servo4); |
Delay_ms(10); |
} |
for(i=0; i<100; ++i) |
{ |
output_high(servo1); |
Delay_us(2000); |
output_low(servo1); |
output_high(servo2); |
Delay_us(2000); |
output_low(servo2); |
output_high(servo3); |
Delay_us(2000); |
output_low(servo3); |
output_high(servo4); |
Delay_us(2000); |
output_low(servo4); |
Delay_ms(10); |
} |
} |
} |
} |
/programy/C/PIC_C/mereni/serva/PIC16F88/tester.cof |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/mereni/serva/PIC16F88/tester.err |
---|
0,0 → 1,0 |
No Errors |
/programy/C/PIC_C/mereni/serva/PIC16F88/tester.h |
---|
0,0 → 1,5 |
#include <16F88.h> |
#device adc=8 |
#fuses NOWDT,INTRC_IO, NOPUT, MCLR, BROWNOUT, LVP, NOCPD, NOWRT, NODEBUG, NOPROTECT, FCMEN, IESO |
#use delay(clock=4000000) |
/programy/C/PIC_C/mereni/serva/PIC16F88/tester.sta |
---|
0,0 → 1,30 |
ROM used: 301 (7%) |
301 (7%) including unused fragments |
1 Average locations per line |
5 Average locations per statement |
RAM used: 7 (4%) at main() level |
8 (5%) worst case |
Lines Stmts % Files |
----- ----- --- ----- |
94 57 100 D:\KAKLIK\programy\PIC_C\mereni\serva\PIC16F88\tester.c |
6 0 0 D:\KAKLIK\programy\PIC_C\mereni\serva\PIC16F88\tester.h |
275 0 0 C:\Program Files\PICC\devices\16F88.h |
----- ----- |
750 114 Total |
Page ROM % RAM Functions: |
---- --- --- --- ---------- |
0 21 7 1 @delay_ms1 |
0 19 6 1 @delay_us1 |
0 257 85 2 main |
Segment Used Free |
--------- ---- ---- |
00000-00003 4 0 |
00004-007FF 297 1747 |
00800-00FFF 0 2048 |
/programy/C/PIC_C/mereni/serva/PIC16F88/tester.tre |
---|
0,0 → 1,22 |
ÀÄtester |
ÀÄmain 0/257 Ram=2 |
ÃÄ??0?? |
ÃÄ@delay_ms1 0/21 Ram=1 |
ÃÄ@delay_us1 0/19 Ram=1 |
ÃÄ@delay_ms1 0/21 Ram=1 |
ÃÄ@delay_us1 0/19 Ram=1 |
ÃÄ@delay_ms1 0/21 Ram=1 |
ÃÄ@delay_us1 0/19 Ram=1 |
ÃÄ@delay_ms1 0/21 Ram=1 |
ÃÄ@delay_us1 0/19 Ram=1 |
ÃÄ@delay_ms1 0/21 Ram=1 |
ÃÄ@delay_ms1 0/21 Ram=1 |
ÃÄ@delay_ms1 0/21 Ram=1 |
ÃÄ@delay_ms1 0/21 Ram=1 |
ÃÄ@delay_ms1 0/21 Ram=1 |
ÃÄ@delay_ms1 0/21 Ram=1 |
ÃÄ@delay_ms1 0/21 Ram=1 |
ÃÄ@delay_ms1 0/21 Ram=1 |
ÃÄ@delay_ms1 0/21 Ram=1 |
ÃÄ@delay_ms1 0/21 Ram=1 |
ÀÄ@delay_ms1 0/21 Ram=1 |
/programy/C/PIC_C/mereni/tester serv/PRG.BAT |
---|
0,0 → 1,10 |
@echo off |
picpgr reset PIC16F84 |
picpgr erase PIC16F84 |
pause |
rem cls |
picpgr program blikac.hex hex PIC16f84 LP_ON PWRTE_ON WDTE_OFF CP_OFF |
picpgr run |
pause |
picpgr stop |
pause |
/programy/C/PIC_C/mereni/tester serv/Run.BAT |
---|
0,0 → 1,6 |
@echo off |
picpgr reset PIC16F873 |
picpgr run lpt2 |
pause |
picpgr stop lpt2 |
pause |
/programy/C/PIC_C/mereni/tester serv/ble |
---|
--- C/PIC_C/mereni/tester serv/blikac.BAK (nonexistent) |
+++ C/PIC_C/mereni/tester serv/blikac.BAK (revision 410) |
@@ -0,0 +1,40 @@ |
+#include "D:\@Kaklik\programy\PIC_C\prenos\blikac.h" |
+#DEFINE SERVO_X PIN_A2 // piny na ktere jsou pripojena serva |
+#DEFINE SERVO_Y PIN_B0 |
+#DEFINE TL1 PIN_B1 |
+ |
+void main() |
+{ |
+ int i; |
+ while (true) |
+ { |
+ while(input(TL1)) |
+ { |
+ for(i=0;i<=100;i++) |
+ { |
+ output_high(servo_y); |
+ output_high(servo_x); |
+ delay_us(1000); |
+ output_low(servo_y); |
+ output_low(servo_x); |
+ delay_ms(20); |
+ } |
+ |
+ for(i=0;i<=100;i++) |
+ { |
+ output_high(servo_y); |
+ output_high(servo_x); |
+ delay_us(20`00); |
+ output_low(servo_y); |
+ output_low(servo_x); |
+ delay_ms(20); |
+ } |
+ } |
+ output_high(servo_y); |
+ output_high(servo_x); |
+ delay_us(1500); |
+ output_low(servo_y); |
+ output_low(servo_x); |
+ delay_ms(20); |
+ } |
+} |
/programy/C/PIC_C/mereni/tester serv/blikac.HEX |
---|
0,0 → 1,21 |
:1000000000308A00272800001030840000080319FF |
:10001000182801308D008C018C0B0C288D0B0B28BF |
:100020004A308C008C0B122800000000800B09283D |
:10003000003411308400FC308005800C800C0008F6 |
:100040000319262824280000800B23287A288401FD |
:100050001F308305831686148312861C6A288F013D |
:100060000F08643C031C4C288316061083120614E8 |
:1000700083160511831205150130900004208316A4 |
:100080000610831206108316051183120511143011 |
:10009000900004208F0A30288F010F08643C031C55 |
:1000A000692883160610831206148316051183121D |
:1000B00005150230900004208316061083120610E6 |
:1000C00083160511831205111430900004208F0A45 |
:1000D0004D282A288316061083120614831605114C |
:1000E0008312051501309000042002309000EC309E |
:1000F00091001928900B772883160610831206109A |
:1001000083160511831205111430900004202A284B |
:0201100063008A |
:02400E00F93F78 |
:00000001FF |
;PIC16C84 |
/programy/C/PIC_C/mereni/tester serv/blikac.LST |
---|
0,0 → 1,198 |
CCS PCW C Compiler, Version 3.110, 15448 |
Filename: d:\@kaklik\programy\pic_c\prenos\blikac.LST |
ROM used: 137 (13%) |
Largest free fragment is 887 |
RAM used: 4 (11%) at main() level |
5 (14%) worst case |
Stack: 1 locations |
* |
0000: MOVLW 00 |
0001: MOVWF 0A |
0002: GOTO 027 |
0003: NOP |
.................... #include "D:\@Kaklik\programy\PIC_C\prenos\blikac.h" |
.................... #include <16C84.h> |
.................... //////// Standard Header file for the PIC16C84 device //////////////// |
.................... #device PIC16C84 |
.................... #list |
.................... |
.................... #use delay(clock=4000000) |
0004: MOVLW 10 |
0005: MOVWF 04 |
0006: MOVF 00,W |
0007: BTFSC 03.2 |
0008: GOTO 018 |
0009: MOVLW 01 |
000A: MOVWF 0D |
000B: CLRF 0C |
000C: DECFSZ 0C,F |
000D: GOTO 00C |
000E: DECFSZ 0D,F |
000F: GOTO 00B |
0010: MOVLW 4A |
0011: MOVWF 0C |
0012: DECFSZ 0C,F |
0013: GOTO 012 |
0014: NOP |
0015: NOP |
0016: DECFSZ 00,F |
0017: GOTO 009 |
0018: RETLW 00 |
0019: MOVLW 11 |
001A: MOVWF 04 |
001B: MOVLW FC |
001C: ANDWF 00,F |
001D: RRF 00,F |
001E: RRF 00,F |
001F: MOVF 00,W |
0020: BTFSC 03.2 |
0021: GOTO 026 |
0022: GOTO 024 |
0023: NOP |
0024: DECFSZ 00,F |
0025: GOTO 023 |
0026: GOTO 07A (RETURN) |
.................... #fuses XT,PUT,NOWDT |
.................... |
.................... |
.................... #DEFINE SERVO_X PIN_A2 // piny na ktere jsou pripojena serva |
.................... #DEFINE SERVO_Y PIN_B0 |
.................... #DEFINE TL1 PIN_B1 |
.................... |
.................... void main() |
.................... { |
.................... int i; |
0027: CLRF 04 |
0028: MOVLW 1F |
0029: ANDWF 03,F |
.................... while (true) |
.................... { |
.................... while(input(TL1)) |
002A: BSF 03.5 |
002B: BSF 06.1 |
002C: BCF 03.5 |
002D: BTFSS 06.1 |
002E: GOTO 06A |
.................... { |
.................... for(i=0;i<=100;i++) |
002F: CLRF 0F |
0030: MOVF 0F,W |
0031: SUBLW 64 |
0032: BTFSS 03.0 |
0033: GOTO 04C |
.................... { |
.................... output_high(servo_y); |
0034: BSF 03.5 |
0035: BCF 06.0 |
0036: BCF 03.5 |
0037: BSF 06.0 |
.................... output_high(servo_x); |
0038: BSF 03.5 |
0039: BCF 05.2 |
003A: BCF 03.5 |
003B: BSF 05.2 |
.................... delay_us(1000); |
003C: MOVLW 01 |
003D: MOVWF 10 |
003E: CALL 004 |
.................... output_low(servo_y); |
003F: BSF 03.5 |
0040: BCF 06.0 |
0041: BCF 03.5 |
0042: BCF 06.0 |
.................... output_low(servo_x); |
0043: BSF 03.5 |
0044: BCF 05.2 |
0045: BCF 03.5 |
0046: BCF 05.2 |
.................... delay_ms(20); |
0047: MOVLW 14 |
0048: MOVWF 10 |
0049: CALL 004 |
.................... } |
004A: INCF 0F,F |
004B: GOTO 030 |
.................... |
.................... for(i=0;i<=100;i++) |
004C: CLRF 0F |
004D: MOVF 0F,W |
004E: SUBLW 64 |
004F: BTFSS 03.0 |
0050: GOTO 069 |
.................... { |
.................... output_high(servo_y); |
0051: BSF 03.5 |
0052: BCF 06.0 |
0053: BCF 03.5 |
0054: BSF 06.0 |
.................... output_high(servo_x); |
0055: BSF 03.5 |
0056: BCF 05.2 |
0057: BCF 03.5 |
0058: BSF 05.2 |
.................... delay_us(2000); |
0059: MOVLW 02 |
005A: MOVWF 10 |
005B: CALL 004 |
.................... output_low(servo_y); |
005C: BSF 03.5 |
005D: BCF 06.0 |
005E: BCF 03.5 |
005F: BCF 06.0 |
.................... output_low(servo_x); |
0060: BSF 03.5 |
0061: BCF 05.2 |
0062: BCF 03.5 |
0063: BCF 05.2 |
.................... delay_ms(20); |
0064: MOVLW 14 |
0065: MOVWF 10 |
0066: CALL 004 |
.................... } |
0067: INCF 0F,F |
0068: GOTO 04D |
.................... } |
0069: GOTO 02A |
.................... output_high(servo_y); |
006A: BSF 03.5 |
006B: BCF 06.0 |
006C: BCF 03.5 |
006D: BSF 06.0 |
.................... output_high(servo_x); |
006E: BSF 03.5 |
006F: BCF 05.2 |
0070: BCF 03.5 |
0071: BSF 05.2 |
.................... delay_us(1500); |
0072: MOVLW 01 |
0073: MOVWF 10 |
0074: CALL 004 |
0075: MOVLW 02 |
0076: MOVWF 10 |
0077: MOVLW EC |
0078: MOVWF 11 |
0079: GOTO 019 |
007A: DECFSZ 10,F |
007B: GOTO 077 |
.................... output_low(servo_y); |
007C: BSF 03.5 |
007D: BCF 06.0 |
007E: BCF 03.5 |
007F: BCF 06.0 |
.................... output_low(servo_x); |
0080: BSF 03.5 |
0081: BCF 05.2 |
0082: BCF 03.5 |
0083: BCF 05.2 |
.................... delay_ms(20); |
0084: MOVLW 14 |
0085: MOVWF 10 |
0086: CALL 004 |
.................... } |
0087: GOTO 02A |
.................... } |
.................... |
0088: SLEEP |
/programy/C/PIC_C/mereni/tester serv/blikac.PJT |
---|
0,0 → 1,32 |
[PROJECT] |
Target=blikac.HEX |
Development_Mode= |
Processor=0x6C84 |
ToolSuite=CCS |
[Directories] |
Include=C:\PROGRAM FILES\PICC\devices\;C:\PROGRAM FILES\PICC\dr |
Library= |
LinkerScript= |
[Target Data] |
FileList=blikac.c; |
BuildTool=C-COMPILER |
OptionString=+FM |
AdditionalOptionString= |
BuildRequired=1 |
[blikac.c] |
Type=4 |
Path= |
FileList= |
BuildTool= |
OptionString= |
AdditionalOptionString= |
[mru-list] |
1=blikac.c |
[Windows] |
0=0000 blikac.c 0 0 796 451 3 0 |
/programy/C/PIC_C/mereni/tester serv/blikac.SYM |
---|
0,0 → 1,16 |
00C @SCRATCH |
00D @SCRATCH |
00D _RETURN_ |
00F main.i |
010 delay_ms.P1 |
010 main.@SCRATCH |
011 delay_us.P1 |
0004 delay_ms |
0019 delay_us |
0027 main |
Project Files: |
d:\@kaklik\programy\pic_c\prenos\blikac.c |
D:\@Kaklik\programy\PIC_C\prenos\blikac.h |
C:\PROGRAM FILES\PICC\devices\16C84.h |
/programy/C/PIC_C/mereni/tester serv/blikac.c |
---|
0,0 → 1,40 |
#include "D:\@Kaklik\programy\PIC_C\prenos\blikac.h" |
#DEFINE SERVO_X PIN_A2 // piny na ktere jsou pripojena serva |
#DEFINE SERVO_Y PIN_B0 |
#DEFINE TL1 PIN_B1 |
void main() |
{ |
int i; |
while (true) |
{ |
while(input(TL1)) |
{ |
for(i=0;i<=100;i++) |
{ |
output_high(servo_y); |
output_high(servo_x); |
delay_us(1000); |
output_low(servo_y); |
output_low(servo_x); |
delay_ms(20); |
} |
for(i=0;i<=100;i++) |
{ |
output_high(servo_y); |
output_high(servo_x); |
delay_us(2000); |
output_low(servo_y); |
output_low(servo_x); |
delay_ms(20); |
} |
} |
output_high(servo_y); |
output_high(servo_x); |
delay_us(1500); |
output_low(servo_y); |
output_low(servo_x); |
delay_ms(20); |
} |
} |
/programy/C/PIC_C/mereni/tester serv/blikac.cod |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/mereni/tester serv/blikac.err |
---|
0,0 → 1,0 |
No Errors |
/programy/C/PIC_C/mereni/tester serv/blikac.h |
---|
0,0 → 1,4 |
#include <16C84.h> |
#use delay(clock=4000000) |
#fuses XT,PUT,NOWDT |
/programy/C/PIC_C/mereni/tester serv/blikac.sta |
---|
0,0 → 1,29 |
ROM used: 137 (13%) |
887 (87%) including unused fragments |
1 Average locations per line |
5 Average locations per statement |
RAM used: 4 (11%) at main() level |
5 (14%) worst case |
Lines Stmts % Files |
----- ----- --- ----- |
41 26 100 d:\@kaklik\programy\pic_c\prenos\blikac.c |
5 0 0 D:\@Kaklik\programy\PIC_C\prenos\blikac.h |
111 0 0 C:\PROGRAM FILES\PICC\devices\16C84.h |
----- ----- |
314 52 Total |
Page ROM % RAM Functions: |
---- --- --- --- ---------- |
0 21 15 1 delay_ms |
0 14 10 1 delay_us |
0 98 72 2 main |
Segment Used Free |
--------- ---- ---- |
0000-0003 4 0 |
0004-03FF 133 887 |
/programy/C/PIC_C/mereni/tester serv/blikac.tre |
---|
0,0 → 1,10 |
ÀÄblikac |
ÀÄmain 0/98 Ram=2 |
ÃÄ??0?? |
ÃÄdelay_ms 0/21 Ram=1 |
ÃÄdelay_ms 0/21 Ram=1 |
ÃÄdelay_ms 0/21 Ram=1 |
ÃÄdelay_ms 0/21 Ram=1 |
ÃÄdelay_ms 0/21 Ram=1 |
ÃÄdelay_us 0/14 Ram=1 |
ÀÄdelay_ms 0/21 Ram=1 |
/programy/C/PIC_C/mereni/tester serv/vssver.scc |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/mereni/vyskomer_drak/main.BAK |
---|
0,0 → 1,21 |
#include "D:\@Kaklik\programy\PIC_C\mereni\vyskomer_drak\main.h" |
#DEFINE SCLK PIN_A2 |
#DEFINE DOUT |
#DEFINE DIN PIN_A1 |
#include "MS5534A.c" |
void main() |
{ |
output_high(pin_B2); |
while(true) |
{ |
while(!input(pin_B1)) |
{ |
output_high(pin_A3); |
Delay_ms(50); |
} |
output_low(pin_A3); |
Delay_ms(50); |
} |
} |
/programy/C/PIC_C/mereni/vyskomer_drak/main.HEX |
---|
0,0 → 1,10 |
:1000000000308A001928000012308400000803190B |
:10001000182801308D008C018C0B0C288D0B0B28BF |
:100020004A308C008C0B122800000000800B09283D |
:10003000003484011F3083058316061183120615D0 |
:1000400083168614831286182D2883168511831231 |
:1000500085153230920004202028831685118312E2 |
:0C0060008511323092000420202863003B |
:02400E00F93F78 |
:00000001FF |
;PIC16F84 |
/programy/C/PIC_C/mereni/vyskomer_drak/main.LST |
---|
0,0 → 1,204 |
CCS PCW C Compiler, Version 3.110, 15448 |
Filename: d:\@kaklik\programy\pic_c\mereni\vyskomer_drak\main.LST |
ROM used: 54 (5%) |
Largest free fragment is 970 |
RAM used: 5 (7%) at main() level |
6 (9%) worst case |
Stack: 1 locations |
* |
0000: MOVLW 00 |
0001: MOVWF 0A |
0002: GOTO 019 |
0003: NOP |
.................... #include "D:\@Kaklik\programy\PIC_C\mereni\vyskomer_drak\main.h" |
.................... #include <16F84.h> |
.................... //////// Standard Header file for the PIC16F84 device //////////////// |
.................... #device PIC16F84 |
.................... #list |
.................... |
.................... #use delay(clock=4000000) |
0004: MOVLW 12 |
0005: MOVWF 04 |
0006: MOVF 00,W |
0007: BTFSC 03.2 |
0008: GOTO 018 |
0009: MOVLW 01 |
000A: MOVWF 0D |
000B: CLRF 0C |
000C: DECFSZ 0C,F |
000D: GOTO 00C |
000E: DECFSZ 0D,F |
000F: GOTO 00B |
0010: MOVLW 4A |
0011: MOVWF 0C |
0012: DECFSZ 0C,F |
0013: GOTO 012 |
0014: NOP |
0015: NOP |
0016: DECFSZ 00,F |
0017: GOTO 009 |
0018: RETLW 00 |
.................... #fuses XT,NOWDT |
.................... |
.................... |
.................... |
.................... #DEFINE SCLK PIN_A2 |
.................... #DEFINE DOUT PIN_A3 |
.................... #DEFINE DIN PIN_A1 |
.................... #include "MS5534A.c" |
.................... |
.................... #DEFINE CLK 250 |
.................... #DEFINE WORD1 0b111010101000 |
.................... #DEFINE WORD2 0b111010110000 |
.................... #DEFINE WORD3 0b111011001000 |
.................... #DEFINE WORD4 0b111011010000 |
.................... |
.................... void send_bit(bit) |
.................... { |
.................... output_bit(DIN,bit); |
.................... output_high(SCLK); |
.................... Delay_us(CLK); |
.................... output_low(SCLK); |
.................... } |
.................... int1 read_bit() |
.................... { |
.................... output_high(SCLK); |
.................... Delay_us(CLK); |
.................... output_low(SCLK); |
.................... if (input(DOUT)) return true; |
.................... if (!input(DOUT)) return false; |
.................... } |
.................... |
.................... void read_byte(*byte_r) |
.................... { |
.................... int i; |
.................... |
.................... for(i=0;i>=7;i++) |
.................... { |
.................... *byte_r = read_bit(); |
.................... *byte_r << 1; |
.................... } |
.................... } |
.................... |
.................... void send_command(command,width) |
.................... { |
.................... int i; |
.................... for (i=width;i>=0;i--) |
.................... { |
.................... send_bit(bit_test(command,0)); |
.................... command >>1; |
.................... } |
.................... } |
.................... |
.................... void bar_reset() |
.................... { |
.................... int8 i; |
.................... |
.................... for(i=0;i>=20;i++) send_bit(Bit_test(i,0)); |
.................... } |
.................... |
.................... int16 bar_con_pre() |
.................... { |
.................... int16 word; |
.................... |
.................... send_command(0b1111010000,9); |
.................... |
.................... Delay_ms(10); |
.................... |
.................... While(input(DOUT)) Delay_us(100); |
.................... |
.................... read_byte(&word); |
.................... word << 8; |
.................... read_byte(&word); |
.................... |
.................... return word; |
.................... } |
.................... |
.................... int16 bar_con_term() |
.................... { |
.................... int16 word; |
.................... |
.................... send_command(0b1111001000,9); |
.................... |
.................... Delay_ms(10); |
.................... |
.................... While(input(DOUT)) Delay_us(100); |
.................... |
.................... read_byte(&word); |
.................... word << 8; |
.................... read_byte(&word); |
.................... |
.................... return word; |
.................... } |
.................... |
.................... int16 bar_read_cal(command) |
.................... { |
.................... int16 word; |
.................... |
.................... send_command(command,11); |
.................... |
.................... Delay_ms(10); |
.................... |
.................... While(input(DOUT)) Delay_us(100); |
.................... |
.................... read_byte(&word); |
.................... word << 8; |
.................... read_byte(&word); |
.................... |
.................... return word; |
.................... } |
.................... |
.................... |
.................... |
.................... |
.................... |
.................... |
.................... |
.................... void main() |
.................... { |
0019: CLRF 04 |
001A: MOVLW 1F |
001B: ANDWF 03,F |
.................... output_high(pin_B2); |
001C: BSF 03.5 |
001D: BCF 06.2 |
001E: BCF 03.5 |
001F: BSF 06.2 |
.................... while(true) |
.................... { |
.................... while(!input(pin_B1)) |
0020: BSF 03.5 |
0021: BSF 06.1 |
0022: BCF 03.5 |
0023: BTFSC 06.1 |
0024: GOTO 02D |
.................... { |
.................... output_high(pin_A3); |
0025: BSF 03.5 |
0026: BCF 05.3 |
0027: BCF 03.5 |
0028: BSF 05.3 |
.................... Delay_ms(50); |
0029: MOVLW 32 |
002A: MOVWF 12 |
002B: CALL 004 |
.................... } |
002C: GOTO 020 |
.................... output_low(pin_A3); |
002D: BSF 03.5 |
002E: BCF 05.3 |
002F: BCF 03.5 |
0030: BCF 05.3 |
.................... Delay_ms(50); |
0031: MOVLW 32 |
0032: MOVWF 12 |
0033: CALL 004 |
.................... } |
0034: GOTO 020 |
.................... |
.................... } |
.................... |
0035: SLEEP |
/programy/C/PIC_C/mereni/vyskomer_drak/main.PJT |
---|
0,0 → 1,32 |
[PROJECT] |
Target=main.HEX |
Development_Mode= |
Processor=0x684A |
ToolSuite=CCS |
[Directories] |
Include=C:\PROGRAM FILES\PICC\devices\;C:\PROGRAM FILES\PICC\dr |
Library= |
LinkerScript= |
[Target Data] |
FileList=main.c; |
BuildTool=C-COMPILER |
OptionString=+FM |
AdditionalOptionString= |
BuildRequired=1 |
[main.c] |
Type=4 |
Path= |
FileList= |
BuildTool= |
OptionString= |
AdditionalOptionString= |
[mru-list] |
1=main.c |
[Windows] |
0=0000 main.c 0 0 796 451 3 0 |
/programy/C/PIC_C/mereni/vyskomer_drak/main.SYM |
---|
0,0 → 1,28 |
00C @SCRATCH |
00D @SCRATCH |
00D _RETURN_ |
00E @SCRATCH |
00F @SCRATCH |
010 @SCRATCH |
012 delay_ms.P1 |
delay_us.P1 |
send_bit.bit |
read_byte.byte_r |
read_byte.i |
send_command.command |
send_command.width |
send_command.i |
bar_reset.i |
-000 bar_con_pre.word |
-000 bar_con_term.word |
bar_read_cal.command |
-000 bar_read_cal.word |
0004 delay_ms |
0019 main |
Project Files: |
d:\@kaklik\programy\pic_c\mereni\vyskomer_drak\main.c |
D:\@Kaklik\programy\PIC_C\mereni\vyskomer_drak\main.h |
C:\PROGRAM FILES\PICC\devices\16F84.h |
d:\@kaklik\programy\pic_c\mereni\vyskomer_drak\MS5534A.c |
/programy/C/PIC_C/mereni/vyskomer_drak/main.c |
---|
0,0 → 1,21 |
#include "D:\@Kaklik\programy\PIC_C\mereni\vyskomer_drak\main.h" |
#DEFINE SCLK PIN_A2 |
#DEFINE DOUT PIN_A3 |
#DEFINE DIN PIN_A1 |
#include "MS5534A.c" |
void main() |
{ |
output_high(pin_B2); |
while(true) |
{ |
while(!input(pin_B1)) |
{ |
output_high(pin_A3); |
Delay_ms(50); |
} |
output_low(pin_A3); |
Delay_ms(50); |
} |
} |
/programy/C/PIC_C/mereni/vyskomer_drak/main.cod |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/mereni/vyskomer_drak/main.err |
---|
0,0 → 1,0 |
No Errors |
/programy/C/PIC_C/mereni/vyskomer_drak/main.h |
---|
0,0 → 1,4 |
#include <16F84.h> |
#use delay(clock=4000000) |
#fuses XT,NOWDT |
/programy/C/PIC_C/mereni/vyskomer_drak/main.sta |
---|
0,0 → 1,29 |
ROM used: 54 (5%) |
970 (95%) including unused fragments |
0 Average locations per line |
1 Average locations per statement |
RAM used: 5 (7%) at main() level |
6 (9%) worst case |
Lines Stmts % Files |
----- ----- --- ----- |
22 9 17 d:\@kaklik\programy\pic_c\mereni\vyskomer_drak\main.c |
5 0 0 D:\@Kaklik\programy\PIC_C\mereni\vyskomer_drak\main.h |
111 0 0 C:\PROGRAM FILES\PICC\devices\16F84.h |
108 45 71 d:\@kaklik\programy\pic_c\mereni\vyskomer_drak\MS5534A.c |
----- ----- |
492 108 Total |
Page ROM % RAM Functions: |
---- --- --- --- ---------- |
0 21 39 1 delay_ms |
0 29 54 0 main |
Segment Used Free |
--------- ---- ---- |
0000-0003 4 0 |
0004-03FF 50 970 |
/programy/C/PIC_C/mereni/vyskomer_drak/main.tre |
---|
0,0 → 1,5 |
ÀÄmain |
ÀÄmain 0/29 Ram=0 |
ÃÄ??0?? |
ÃÄdelay_ms 0/21 Ram=1 |
ÀÄdelay_ms 0/21 Ram=1 |
/programy/C/PIC_C/mereni/vyskomer_drak/ms5534a.BAK |
---|
0,0 → 1,107 |
#DEFINE CLK 250 |
#DEFINE WORD1 0b111010101000 |
#DEFINE WORD2 0b111010110000 |
#DEFINE WORD3 0b111011001000 |
#DEFINE WORD4 0b111011010000 |
void send_bit(bit) |
{ |
output_bit(DIN,bit); |
output_high(SCLK); |
Delay_us(CLK); |
output_low(SCLK); |
} |
int1 read_bit() |
{ |
output_high(SCLK); |
Delay_us(CLK); |
output_low(SCLK); |
if (input(DOUT)) return true; |
if (!input(DOUT)) return false; |
} |
void read_byte(*byte_r) |
{ |
int i; |
for(i=0;i>=7;i++) |
{ |
*byte_r = read_bit(); |
*byte_r << 1; |
} |
} |
void send_command(command,width) |
{ |
int i; |
for (i=width;i>=0;i--) |
{ |
send_bit(bit_test(command,0)); |
command >>1; |
} |
} |
void bar_reset() |
{ |
int8 i; |
for(i=0;i>=20;i++) send_bit(Bit_test(i,0)); |
} |
int16 bar_con_pre() |
{ |
int16 word; |
send_command(0b1111010000,9); |
Delay_ms(10); |
While(input(DOUT)) Delay_us(100); |
read_byte(&word); |
word << 8; |
read_byte(&word); |
return word; |
} |
int16 bar_con_term() |
{ |
int16 word; |
send_command(0b1111001000,9); |
Delay_ms(10); |
While(input(DOUT)) Delay_us(100); |
read_byte(&word); |
word << 8; |
read_byte(&word); |
return word; |
} |
int16 bar_read_cal(command) |
{ |
int16 word; |
send_command(command,11); |
Delay_ms(10); |
While(input(DOUT)) Delay_us(100); |
read_byte(&word); |
word << 8; |
read_byte(&word); |
return word; |
} |
/programy/C/PIC_C/mereni/vyskomer_drak/ms5534a.c |
---|
0,0 → 1,107 |
#DEFINE CLK 250 |
#DEFINE WORD1 0b111010101000 |
#DEFINE WORD2 0b111010110000 |
#DEFINE WORD3 0b111011001000 |
#DEFINE WORD4 0b111011010000 |
void send_bit(bit) |
{ |
output_bit(DIN,bit); |
output_high(SCLK); |
Delay_us(CLK); |
output_low(SCLK); |
} |
int1 read_bit() |
{ |
output_high(SCLK); |
Delay_us(CLK); |
output_low(SCLK); |
if (input(DOUT)) return true; |
if (!input(DOUT)) return false; |
} |
void read_byte(*byte_r) |
{ |
int i; |
for(i=0;i>=7;i++) |
{ |
*byte_r = read_bit(); |
*byte_r << 1; |
} |
} |
void send_command(command,width) |
{ |
int i; |
for (i=width;i>=0;i--) |
{ |
send_bit(bit_test(command,0)); |
command >>1; |
} |
} |
void bar_reset() |
{ |
int8 i; |
for(i=0;i>=20;i++) send_bit(Bit_test(i,0)); |
} |
int16 bar_con_pre() |
{ |
int16 word; |
send_command(0b1111010000,9); |
Delay_ms(10); |
While(input(DOUT)) Delay_us(100); |
read_byte(&word); |
word << 8; |
read_byte(&word); |
return word; |
} |
int16 bar_con_term() |
{ |
int16 word; |
send_command(0b1111001000,9); |
Delay_ms(10); |
While(input(DOUT)) Delay_us(100); |
read_byte(&word); |
word << 8; |
read_byte(&word); |
return word; |
} |
int16 bar_read_cal(command) |
{ |
int16 word; |
send_command(command,11); |
Delay_ms(10); |
While(input(DOUT)) Delay_us(100); |
read_byte(&word); |
word << 8; |
read_byte(&word); |
return word; |
} |
/programy/C/PIC_C/mereni/vyskomer_drak/prg.bat |
---|
0,0 → 1,8 |
:start |
call picpgr stop |
call picpgr erase pic16f84 |
call picpgr program main.hex hex pic16f84 |
call picpgr run |
pause |
call picpgr stop |
rem goto start |
/programy/C/PIC_C/mereni/vyskomer_drak/run.bat |
---|
0,0 → 1,5 |
call picpgr run |
pause |
call picpgr stop |
pause |
run.bat |
/programy/C/PIC_C/mereni/vyskomer_drak/vssver.scc |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/mereni/zavora/main.BAK |
---|
0,0 → 1,16 |
#include "D:\@Kaklik\programy\PIC_C\mereni\zavora\main.h" |
void main() |
{ |
output_high(PIN_A3); |
Delay_ms(250); |
output_low(PIN_A3); |
Delay_ms(250); |
while(true) |
{ |
if(input(PIN_A4)) output_high(PIN_A3); |
else output_low(PIN_A3); |
} |
} |
/programy/C/PIC_C/mereni/zavora/main.HEX |
---|
0,0 → 1,11 |
:1000000000308A00192800000F308400000803190E |
:10001000182801308D008C018C0B0C288D0B0B28BF |
:100020004A308C008C0B122800000000800B09283D |
:10003000003484011F3083058316851183128515D2 |
:10004000FA308F0004208316851183128511FA304F |
:100050008F000420831605168312051E342883168C |
:100060008511831285113828831685118312851511 |
:040070002A286300D7 |
:02400E00F93F78 |
:00000001FF |
;PIC16F84 |
/programy/C/PIC_C/mereni/zavora/main.LST |
---|
0,0 → 1,95 |
CCS PCW C Compiler, Version 3.110, 15448 |
Filename: d:\@kaklik\programy\pic_c\mereni\zavora\main.LST |
ROM used: 58 (6%) |
Largest free fragment is 966 |
RAM used: 2 (3%) at main() level |
3 (4%) worst case |
Stack: 1 locations |
* |
0000: MOVLW 00 |
0001: MOVWF 0A |
0002: GOTO 019 |
0003: NOP |
.................... #include "D:\@Kaklik\programy\PIC_C\mereni\zavora\main.h" |
.................... #include <16F84.h> |
.................... //////// Standard Header file for the PIC16F84 device //////////////// |
.................... #device PIC16F84 |
.................... #list |
.................... |
.................... #use delay(clock=4000000) |
0004: MOVLW 0F |
0005: MOVWF 04 |
0006: MOVF 00,W |
0007: BTFSC 03.2 |
0008: GOTO 018 |
0009: MOVLW 01 |
000A: MOVWF 0D |
000B: CLRF 0C |
000C: DECFSZ 0C,F |
000D: GOTO 00C |
000E: DECFSZ 0D,F |
000F: GOTO 00B |
0010: MOVLW 4A |
0011: MOVWF 0C |
0012: DECFSZ 0C,F |
0013: GOTO 012 |
0014: NOP |
0015: NOP |
0016: DECFSZ 00,F |
0017: GOTO 009 |
0018: RETLW 00 |
.................... #fuses XT,NOWDT |
.................... |
.................... |
.................... |
.................... |
.................... void main() |
.................... { |
0019: CLRF 04 |
001A: MOVLW 1F |
001B: ANDWF 03,F |
.................... output_high(PIN_A3); |
001C: BSF 03.5 |
001D: BCF 05.3 |
001E: BCF 03.5 |
001F: BSF 05.3 |
.................... Delay_ms(250); |
0020: MOVLW FA |
0021: MOVWF 0F |
0022: CALL 004 |
.................... output_low(PIN_A3); |
0023: BSF 03.5 |
0024: BCF 05.3 |
0025: BCF 03.5 |
0026: BCF 05.3 |
.................... Delay_ms(250); |
0027: MOVLW FA |
0028: MOVWF 0F |
0029: CALL 004 |
.................... |
.................... while(true) |
.................... { |
.................... if(input(PIN_A4)) output_low(PIN_A3); |
002A: BSF 03.5 |
002B: BSF 05.4 |
002C: BCF 03.5 |
002D: BTFSS 05.4 |
002E: GOTO 034 |
002F: BSF 03.5 |
0030: BCF 05.3 |
0031: BCF 03.5 |
0032: BCF 05.3 |
.................... else output_high(PIN_A3); |
0033: GOTO 038 |
0034: BSF 03.5 |
0035: BCF 05.3 |
0036: BCF 03.5 |
0037: BSF 05.3 |
.................... } |
0038: GOTO 02A |
.................... } |
.................... |
0039: SLEEP |
/programy/C/PIC_C/mereni/zavora/main.PJT |
---|
0,0 → 1,32 |
[PROJECT] |
Target=main.HEX |
Development_Mode= |
Processor=0x684A |
ToolSuite=CCS |
[Directories] |
Include=C:\PROGRAM FILES\PICC\devices\;C:\PROGRAM FILES\PICC\dr |
Library= |
LinkerScript= |
[Target Data] |
FileList=main.c; |
BuildTool=C-COMPILER |
OptionString=+FM |
AdditionalOptionString= |
BuildRequired=1 |
[main.c] |
Type=4 |
Path= |
FileList= |
BuildTool= |
OptionString= |
AdditionalOptionString= |
[mru-list] |
1=main.c |
[Windows] |
0=0000 main.c 0 0 796 451 3 0 |
/programy/C/PIC_C/mereni/zavora/main.SYM |
---|
0,0 → 1,13 |
00C @SCRATCH |
00D @SCRATCH |
00D _RETURN_ |
00F delay_ms.P1 |
delay_us.P1 |
0004 delay_ms |
0019 main |
Project Files: |
d:\@kaklik\programy\pic_c\mereni\zavora\main.c |
D:\@Kaklik\programy\PIC_C\mereni\zavora\main.h |
C:\PROGRAM FILES\PICC\devices\16F84.h |
/programy/C/PIC_C/mereni/zavora/main.c |
---|
0,0 → 1,16 |
#include "D:\@Kaklik\programy\PIC_C\mereni\zavora\main.h" |
void main() |
{ |
output_high(PIN_A3); |
Delay_ms(250); |
output_low(PIN_A3); |
Delay_ms(250); |
while(true) |
{ |
if(input(PIN_A4)) output_low(PIN_A3); |
else output_high(PIN_A3); |
} |
} |
/programy/C/PIC_C/mereni/zavora/main.cod |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/mereni/zavora/main.err |
---|
0,0 → 1,0 |
No Errors |
/programy/C/PIC_C/mereni/zavora/main.h |
---|
0,0 → 1,4 |
#include <16F84.h> |
#use delay(clock=4000000) |
#fuses XT,NOWDT |
/programy/C/PIC_C/mereni/zavora/main.sta |
---|
0,0 → 1,28 |
ROM used: 58 (6%) |
966 (94%) including unused fragments |
0 Average locations per line |
6 Average locations per statement |
RAM used: 2 (3%) at main() level |
3 (4%) worst case |
Lines Stmts % Files |
----- ----- --- ----- |
17 9 100 d:\@kaklik\programy\pic_c\mereni\zavora\main.c |
5 0 0 D:\@Kaklik\programy\PIC_C\mereni\zavora\main.h |
111 0 0 C:\PROGRAM FILES\PICC\devices\16F84.h |
----- ----- |
266 18 Total |
Page ROM % RAM Functions: |
---- --- --- --- ---------- |
0 21 36 1 delay_ms |
0 33 57 0 main |
Segment Used Free |
--------- ---- ---- |
0000-0003 4 0 |
0004-03FF 54 966 |
/programy/C/PIC_C/mereni/zavora/main.tre |
---|
0,0 → 1,5 |
ÀÄmain |
ÀÄmain 0/33 Ram=0 |
ÃÄ??0?? |
ÃÄdelay_ms 0/21 Ram=1 |
ÀÄdelay_ms 0/21 Ram=1 |
/programy/C/PIC_C/mereni/zavora/prg.bat |
---|
0,0 → 1,8 |
:start |
call picpgr stop |
call picpgr erase pic16f84 |
call picpgr program main.hex hex pic16f84 |
call picpgr run |
pause |
call picpgr stop |
rem goto start |
/programy/C/PIC_C/mereni/zavora/run.bat |
---|
0,0 → 1,5 |
call picpgr run |
pause |
call picpgr stop |
pause |
run.bat |
/programy/C/PIC_C/mereni/zavora/vssver.scc |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/PICcam/876/camerus.PJT |
---|
0,0 → 1,44 |
[PROJECT] |
Target=camerus.HEX |
Development_Mode= |
Processor=0x876A |
ToolSuite=CCS |
[Directories] |
Include=C:\Program Files\PICC\devices\;C:\Program Files\PICC\Dr |
Library= |
LinkerScript= |
[Target Data] |
FileList=C:\dokumenty\svn\Kaklik\roboti\istrobot\camerus\SW\876\camerus.c |
BuildTool=C-COMPILER |
OptionString=+FM |
AdditionalOptionString= |
BuildRequired=1 |
[camerus.c] |
Type=4 |
Path= |
FileList= |
BuildTool= |
OptionString= |
AdditionalOptionString= |
[mru-list] |
1=camerus.c |
[Windows] |
0=0000 camerus.c 0 0 796 451 3 0 |
[Opened Files] |
1=z:\home\kaklik\projects\programy\PIC_C\PICcam\876\camerus.c |
2= |
3=C:\dokumenty\svn\Kaklik\roboti\istrobot\camerus\SW\876\camerus.h |
4=C:\Program Files\PICC\devices\16F876A.h |
5= |
6= |
[Units] |
Count=1 |
1=C:\dokumenty\svn\Kaklik\roboti\istrobot\camerus\SW\876\camerus.c (main) |
/programy/C/PIC_C/PICcam/876/camerus.c |
---|
0,0 → 1,159 |
#include ".\camerus.h" |
#USE FAST_IO (C) // Brana C je ve FAST_IO modu, aby slo rychle cteni z kamery |
// kroutitka |
#define CERVENA 3 // AN3/RA3 |
#define CERNA 2 // AN2/RA2 |
#define ZELENA 1 // AN1/RA0 |
#define MODRA 0 // AN0/RA1 |
// I/O |
#define LED PIN_C0 // LED signalizujici start programu |
#define HREF PIN_C5 // Signal HREF z kamery (v H po celou dobu radku) |
#define PIX PIN_C6 // Vstup pro body z kamery (za trivstupim hradlem OR (dig. komparator)) |
#define SERVO PIN_B7 // Vystup na servo (1 az 2ms po cca 20ms (synchronizovano snimkovym kmitoctem)) |
#define MOT_L PIN_B5 // Smer otaceni leveho motoru; druhy pol je RC2 |
#define MOT_R PIN_B6 // Smer otaceni praveho motoru; druhy pol je RC1 |
void main() |
{ |
int8 cas; // Cas hrany bila/cerna v radce |
int8 offset; // Promena pro ulozeni ovsetu |
int8 rr; // Promenna na ulozeni Rozumne rychlost |
int8 r1; // Rychlost motoru 1 |
int8 r2; // Rychlost motoru 2 |
int16 ble; // Prodleva do rozjezdu |
setup_adc_ports(ALL_ANALOG); // Zapnuti A/D prevodniku pro cteni kroutitek |
setup_adc(ADC_CLOCK_INTERNAL); |
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); // Casovac pro mereni casu hrany W/B v radce |
setup_timer_1(T1_DISABLED); |
setup_timer_2(T2_DIV_BY_16,255,1); // Casovac PWM motoru |
setup_ccp1(CCP_PWM); // RC1 // PWM pro motory |
setup_ccp2(CCP_PWM); // RC2 |
setup_comparator(NC_NC_NC_NC); |
setup_vref(FALSE); |
set_tris_c(0b11111000); // Nastaveni vstup/vystup pro branu C, protoze se nedela automaticky |
set_pwm1_duty(0); // Zastav motory |
set_pwm2_duty(0); |
output_low(MOT_L); |
output_low(MOT_R); |
output_high(LED); // Budeme blikat LED, aby se poznalo, ze byl RESET |
delay_ms(200); // Musi se pockat, nez se rozjede kamera, nez se do ni zacnou posilat prikazy |
//... Nastaveni kamery ... |
i2c_start(); // Soft RESET kamery |
i2c_write(0xC0); // Pro single slave musi mit vsechny zapisy adresu C0h |
i2c_write(0x12); // Adresa registru COMH |
i2c_write(0x80 | 0x24); // Zapis ridiciho slova |
i2c_stop(); |
i2c_start(); // BW |
i2c_write(0xC0); |
i2c_write(0x28); |
i2c_write(0b01000001); |
i2c_stop(); |
i2c_start(); // Contrast |
i2c_write(0xC0); |
i2c_write(0x05); |
i2c_write(0xA0); |
i2c_stop(); |
/* |
i2c_start(); // Brightness |
i2c_write(0xC0); |
i2c_write(0x06); |
i2c_write(0x80); |
i2c_stop(); |
i2c_start(); // Band Filter |
i2c_write(0xC0); |
i2c_write(0x2D); |
i2c_write(0x04 | 0x03); |
i2c_stop(); |
*/ |
i2c_start(); // VSTRT |
i2c_write(0xC0); |
i2c_write(0x19); |
i2c_write(45); |
i2c_stop(); |
i2c_start(); // VEND |
i2c_write(0xC0); |
i2c_write(0x1A); |
i2c_write(45); |
i2c_stop(); |
output_low(LED); // Blikani LED |
delay_ms(200); |
output_high(LED); // Blikani LED |
delay_ms(200); |
output_low(LED); |
cas=128; // Inicializace promenych, aby neslo servo za roh a aby se to rozjelo jeste dneska |
ble=0; |
// ... Hlavni smycka ... |
while(true) |
{ |
while(!input(HREF)); // Cekej nez se zacnou posilat pixely z radky |
set_timer0(0); // Vynuluj pocitadlo casu |
while(input(HREF)) // Po dobu vysilani radky cekej na hranu W/B |
{ |
if(!input(PIX)) // Pokud se dvakrat za sebou precetla CERNA |
if(!input(PIX)) |
{ |
cas=get_timer0(); // Precti cas z citace casu hrany |
cas=255-cas; // Vlevo je vpravo |
break; |
}; |
}; |
set_adc_channel(MODRA); // Kroutitko na vystredeni predniho kolecka |
Delay_ms(1); |
offset=read_adc(); |
output_high(SERVO); // Odvysilani impuzu 1 az 2ms pro servo |
delay_us(1000); |
delay_us(offset); |
delay_us(offset); |
delay_us(cas); |
delay_us(cas); |
output_low(SERVO); |
ble++; // Casovac pro odlozeni rozjezdu po zapnuti napajeni |
set_adc_channel(ZELENA); // Kroutitka pro vykon motoru (!!! to bude chtit jeste predelat !!!) |
Delay_ms(1); |
offset=read_adc(); |
set_adc_channel(CERNA); |
Delay_ms(1); |
rr=read_adc(); |
r1=cas>>1; // Elektronicky diferencial |
r2=255-offset-(cas>>1); |
if (ble==99) // Rozjezd na Rozumnou rychlost |
{ |
set_pwm1_duty(rr); |
set_pwm2_duty(rr); |
}; |
if ((ble>100)&&(ble<60000)) // Jizda |
{ |
if (r1<=rr) set_pwm1_duty(r1); |
if (r2<=rr) set_pwm2_duty(r2); |
} |
else |
{ |
set_pwm1_duty(0); // Zastaveni |
set_pwm2_duty(0); |
} |
}; |
} |
/programy/C/PIC_C/PICcam/876/camerus.h |
---|
0,0 → 1,16 |
#include <16F876A.h> |
#device adc=8 |
#FUSES NOWDT //No Watch Dog Timer |
#FUSES HS //High speed Osc (> 4mhz) |
#FUSES NOPUT //No Power Up Timer |
#FUSES NOPROTECT //Code not protected from reading |
#FUSES NODEBUG //No Debug mode for ICD |
#FUSES NOBROWNOUT //No brownout reset |
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O |
#FUSES NOCPD //No EE protection |
#FUSES NOWRT //Program memory not write protected |
#use delay(clock=20000000) |
#use i2c(Master,Fast,sda=PIN_C4,scl=PIN_C3,force_hw) |
/programy/C/PIC_C/PICcam/873/camerus.BAK |
---|
0,0 → 1,62 |
#include ".\camerus.h" |
#define CAMERA_ADR 0xC0 |
void main() |
{ |
setup_adc_ports(NO_ANALOGS); |
setup_adc(ADC_OFF); |
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
setup_timer_1(T1_DISABLED); |
setup_timer_2(T2_DISABLED,0,1); |
output_high(PIN_C0); |
output_low(PIN_C6); |
Delay_ms(200); |
output_low(PIN_C0); |
Delay_ms(200); |
output_high(PIN_C0); |
i2c_start(); // Reset |
i2c_write(CAMERA_ADR); |
i2c_write(0x12); |
i2c_write(0x80 | 0x24); |
i2c_stop(); |
// **** Write data => Adr($13) = 0x05 **** |
// This will tri-state the Y and UV busses on the OV6620, which |
// will allow re-programming of the atmega8 to proceed at startup |
// if needed. |
i2c_start(); |
i2c_write(CAMERA_ADR); |
i2c_write(0x13); |
i2c_write(0x05); |
i2c_stop(); |
Delay_ms(250); |
//**** Write data => Adr($3F) = 0x42 **** |
// This will turn on the external clock for the atmega8 to use. |
i2c_start(); |
i2c_write(CAMERA_ADR); |
i2c_write(0x3F); |
i2c_write(0x42); |
i2c_stop(); |
// Wait for a short amount of time for the external clock |
// to stabilize |
Delay_ms(250); |
output_low(PIN_C0); |
// turn on the mega8 by releasing the reset line |
output_high(PIN_C6); |
while(true); |
} |
/programy/C/PIC_C/PICcam/873/camerus.c |
---|
0,0 → 1,62 |
#include ".\camerus.h" |
#define CAMERA_ADR 0xC4 |
void main() |
{ |
setup_adc_ports(NO_ANALOGS); |
setup_adc(ADC_OFF); |
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
setup_timer_1(T1_DISABLED); |
setup_timer_2(T2_DISABLED,0,1); |
output_high(PIN_C0); |
output_low(PIN_C6); |
Delay_ms(200); |
output_low(PIN_C0); |
Delay_ms(200); |
output_high(PIN_C0); |
i2c_start(); // Reset |
i2c_write(CAMERA_ADR); |
i2c_write(0x12); |
i2c_write(0x80 | 0x24); |
i2c_stop(); |
// **** Write data => Adr($13) = 0x05 **** |
// This will tri-state the Y and UV busses on the OV6620, which |
// will allow re-programming of the atmega8 to proceed at startup |
// if needed. |
i2c_start(); |
i2c_write(CAMERA_ADR); |
i2c_write(0x13); |
i2c_write(0x05); |
i2c_stop(); |
Delay_ms(250); |
//**** Write data => Adr($3F) = 0x42 **** |
// This will turn on the external clock for the atmega8 to use. |
i2c_start(); |
i2c_write(CAMERA_ADR); |
i2c_write(0x3F); |
i2c_write(0x42); |
i2c_stop(); |
// Wait for a short amount of time for the external clock |
// to stabilize |
Delay_ms(250); |
output_low(PIN_C0); |
// turn on the mega8 by releasing the reset line |
output_high(PIN_C6); |
while(true); |
} |
/programy/C/PIC_C/PICcam/873/camerus.cof |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/PICcam/873/camerus.hex |
---|
0,0 → 1,28 |
:1000000000308A00292800002630840000080319E7 |
:1000100018280130A100A001A00B0C28A10B0B286F |
:100020004A30A000A00B122800000000800B092815 |
:10003000003494138C11260893000230941B272857 |
:100040008C1D202800308316111B01308312A10063 |
:10005000003484011F308305A51525088316870009 |
:100060008312251625088316870001309300283057 |
:10007000831294008316941314131F149F141F15D6 |
:100080009F11FF308312A50083161F149F141F15A4 |
:100090009F1183121F1083160108C7390838810089 |
:1000A000831290010030A10092000030831692006C |
:1000B0008312251025088316870083120714251341 |
:1000C00025088316870083120713C830A600042072 |
:1000D000251025088316870083120710C830A60054 |
:1000E0000420251025088316870083120714831621 |
:1000F000111411187928C4308312A6001920123067 |
:10010000A6001920A430A600192083161115111974 |
:100110008728111411188A28C4308312A6001920C8 |
:100120001330A60019200530A600192083161115DA |
:1001300011199828FA308312A6000420831611148E |
:100140001118A028C4308312A60019203F30A60041 |
:1001500019204230A6001920831611151119AE2856 |
:10016000FA308312A6000420251025088316870084 |
:10017000831207102513250883168700831207179B |
:04018000C028630030 |
:02400E00393F38 |
:00000001FF |
;PIC16F873 |
/programy/C/PIC_C/PICcam/873/camerus.lst |
---|
0,0 → 1,294 |
CCS PCM C Compiler, Version 3.245, 27853 22-IV-07 16:12 |
Filename: D:\KAKLIK\projekty\programy\PIC_C\PICcam\873\camerus.lst |
ROM used: 194 words (5%) |
Largest free fragment is 2048 |
RAM used: 6 (3%) at main() level |
7 (4%) worst case |
Stack: 1 locations |
* |
0000: MOVLW 00 |
0001: MOVWF 0A |
0002: GOTO 029 |
0003: NOP |
.................... #include ".\camerus.h" |
.................... #include <16F873.h> |
.................... //////// Standard Header file for the PIC16F873 device //////////////// |
.................... #device PIC16F873 |
.................... #list |
.................... |
.................... #device adc=8 |
.................... |
.................... #FUSES NOWDT //No Watch Dog Timer |
.................... #FUSES XT //Crystal osc <= 4mhz |
.................... #FUSES NOPUT //No Power Up Timer |
.................... #FUSES NOPROTECT //Code not protected from reading |
.................... #FUSES NOBROWNOUT //No brownout reset |
.................... #FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O |
.................... #FUSES NOCPD //No EE protection |
.................... #FUSES NOWRT //Program memory not write protected |
.................... #FUSES NODEBUG //No Debug mode for ICD |
.................... |
.................... #use delay(clock=4000000) |
0004: MOVLW 26 |
0005: MOVWF 04 |
0006: MOVF 00,W |
0007: BTFSC 03.2 |
0008: GOTO 018 |
0009: MOVLW 01 |
000A: MOVWF 21 |
000B: CLRF 20 |
000C: DECFSZ 20,F |
000D: GOTO 00C |
000E: DECFSZ 21,F |
000F: GOTO 00B |
0010: MOVLW 4A |
0011: MOVWF 20 |
0012: DECFSZ 20,F |
0013: GOTO 012 |
0014: NOP |
0015: NOP |
0016: DECFSZ 00,F |
0017: GOTO 009 |
0018: RETLW 00 |
.................... #use i2c(Master,Fast,sda=PIN_C4,scl=PIN_C3,force_HW) |
0019: BCF 14.7 |
001A: BCF 0C.3 |
001B: MOVF 26,W |
001C: MOVWF 13 |
001D: MOVLW 02 |
001E: BTFSC 14.7 |
001F: GOTO 027 |
0020: BTFSS 0C.3 |
0021: GOTO 020 |
0022: MOVLW 00 |
0023: BSF 03.5 |
0024: BTFSC 11.6 |
0025: MOVLW 01 |
0026: BCF 03.5 |
0027: MOVWF 21 |
0028: RETLW 00 |
* |
0041: MOVLW FF |
0042: BCF 03.5 |
0043: MOVWF 25 |
.................... |
.................... |
.................... |
.................... #define CAMERA_ADR 0xC4 |
.................... |
.................... |
.................... void main() |
.................... { |
* |
0029: CLRF 04 |
002A: MOVLW 1F |
002B: ANDWF 03,F |
002C: BSF 25.3 |
002D: MOVF 25,W |
002E: BSF 03.5 |
002F: MOVWF 07 |
0030: BCF 03.5 |
0031: BSF 25.4 |
0032: MOVF 25,W |
0033: BSF 03.5 |
0034: MOVWF 07 |
0035: MOVLW 01 |
0036: MOVWF 13 |
0037: MOVLW 28 |
0038: BCF 03.5 |
0039: MOVWF 14 |
003A: BSF 03.5 |
003B: BCF 14.7 |
003C: BCF 14.6 |
003D: BSF 1F.0 |
003E: BSF 1F.1 |
003F: BSF 1F.2 |
0040: BCF 1F.3 |
.................... setup_adc_ports(NO_ANALOGS); |
* |
0044: BSF 03.5 |
0045: BSF 1F.0 |
0046: BSF 1F.1 |
0047: BSF 1F.2 |
0048: BCF 1F.3 |
.................... setup_adc(ADC_OFF); |
0049: BCF 03.5 |
004A: BCF 1F.0 |
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
004B: BSF 03.5 |
004C: MOVF 01,W |
004D: ANDLW C7 |
004E: IORLW 08 |
004F: MOVWF 01 |
.................... setup_timer_1(T1_DISABLED); |
0050: BCF 03.5 |
0051: CLRF 10 |
.................... setup_timer_2(T2_DISABLED,0,1); |
0052: MOVLW 00 |
0053: MOVWF 21 |
0054: MOVWF 12 |
0055: MOVLW 00 |
0056: BSF 03.5 |
0057: MOVWF 12 |
.................... |
.................... output_high(PIN_C0); |
0058: BCF 03.5 |
0059: BCF 25.0 |
005A: MOVF 25,W |
005B: BSF 03.5 |
005C: MOVWF 07 |
005D: BCF 03.5 |
005E: BSF 07.0 |
.................... output_low(PIN_C6); |
005F: BCF 25.6 |
0060: MOVF 25,W |
0061: BSF 03.5 |
0062: MOVWF 07 |
0063: BCF 03.5 |
0064: BCF 07.6 |
.................... |
.................... Delay_ms(200); |
0065: MOVLW C8 |
0066: MOVWF 26 |
0067: CALL 004 |
.................... output_low(PIN_C0); |
0068: BCF 25.0 |
0069: MOVF 25,W |
006A: BSF 03.5 |
006B: MOVWF 07 |
006C: BCF 03.5 |
006D: BCF 07.0 |
.................... Delay_ms(200); |
006E: MOVLW C8 |
006F: MOVWF 26 |
0070: CALL 004 |
.................... output_high(PIN_C0); |
0071: BCF 25.0 |
0072: MOVF 25,W |
0073: BSF 03.5 |
0074: MOVWF 07 |
0075: BCF 03.5 |
0076: BSF 07.0 |
.................... |
.................... i2c_start(); // Reset |
0077: BSF 03.5 |
0078: BSF 11.0 |
0079: BTFSC 11.0 |
007A: GOTO 079 |
.................... i2c_write(CAMERA_ADR); |
007B: MOVLW C4 |
007C: BCF 03.5 |
007D: MOVWF 26 |
007E: CALL 019 |
.................... i2c_write(0x12); |
007F: MOVLW 12 |
0080: MOVWF 26 |
0081: CALL 019 |
.................... i2c_write(0x80 | 0x24); |
0082: MOVLW A4 |
0083: MOVWF 26 |
0084: CALL 019 |
.................... i2c_stop(); |
0085: BSF 03.5 |
0086: BSF 11.2 |
0087: BTFSC 11.2 |
0088: GOTO 087 |
.................... |
.................... // **** Write data => Adr($13) = 0x05 **** |
.................... // This will tri-state the Y and UV busses on the OV6620, which |
.................... // will allow re-programming of the atmega8 to proceed at startup |
.................... // if needed. |
.................... |
.................... i2c_start(); |
0089: BSF 11.0 |
008A: BTFSC 11.0 |
008B: GOTO 08A |
.................... i2c_write(CAMERA_ADR); |
008C: MOVLW C4 |
008D: BCF 03.5 |
008E: MOVWF 26 |
008F: CALL 019 |
.................... i2c_write(0x13); |
0090: MOVLW 13 |
0091: MOVWF 26 |
0092: CALL 019 |
.................... i2c_write(0x05); |
0093: MOVLW 05 |
0094: MOVWF 26 |
0095: CALL 019 |
.................... i2c_stop(); |
0096: BSF 03.5 |
0097: BSF 11.2 |
0098: BTFSC 11.2 |
0099: GOTO 098 |
.................... |
.................... Delay_ms(250); |
009A: MOVLW FA |
009B: BCF 03.5 |
009C: MOVWF 26 |
009D: CALL 004 |
.................... |
.................... //**** Write data => Adr($3F) = 0x42 **** |
.................... // This will turn on the external clock for the atmega8 to use. |
.................... |
.................... i2c_start(); |
009E: BSF 03.5 |
009F: BSF 11.0 |
00A0: BTFSC 11.0 |
00A1: GOTO 0A0 |
.................... i2c_write(CAMERA_ADR); |
00A2: MOVLW C4 |
00A3: BCF 03.5 |
00A4: MOVWF 26 |
00A5: CALL 019 |
.................... i2c_write(0x3F); |
00A6: MOVLW 3F |
00A7: MOVWF 26 |
00A8: CALL 019 |
.................... i2c_write(0x42); |
00A9: MOVLW 42 |
00AA: MOVWF 26 |
00AB: CALL 019 |
.................... i2c_stop(); |
00AC: BSF 03.5 |
00AD: BSF 11.2 |
00AE: BTFSC 11.2 |
00AF: GOTO 0AE |
.................... |
.................... // Wait for a short amount of time for the external clock |
.................... // to stabilize |
.................... |
.................... Delay_ms(250); |
00B0: MOVLW FA |
00B1: BCF 03.5 |
00B2: MOVWF 26 |
00B3: CALL 004 |
.................... |
.................... |
.................... output_low(PIN_C0); |
00B4: BCF 25.0 |
00B5: MOVF 25,W |
00B6: BSF 03.5 |
00B7: MOVWF 07 |
00B8: BCF 03.5 |
00B9: BCF 07.0 |
.................... |
.................... // turn on the mega8 by releasing the reset line |
.................... output_high(PIN_C6); |
00BA: BCF 25.6 |
00BB: MOVF 25,W |
00BC: BSF 03.5 |
00BD: MOVWF 07 |
00BE: BCF 03.5 |
00BF: BSF 07.6 |
.................... |
.................... while(true); |
00C0: GOTO 0C0 |
.................... } |
00C1: SLEEP |
Configuration Fuses: |
Word 1: 3F39 XT NOWDT NOPUT NOPROTECT NOBROWNOUT NOLVP NOCPD NOWRT NODEBUG |
/programy/C/PIC_C/PICcam/873/camerus.sta |
---|
0,0 → 1,30 |
ROM used: 194 (5%) |
194 (5%) including unused fragments |
1 Average locations per line |
6 Average locations per statement |
RAM used: 6 (3%) at main() level |
7 (4%) worst case |
Lines Stmts % Files |
----- ----- --- ----- |
63 32 100 D:\KAKLIK\projekty\programy\PIC_C\PICcam\873\camerus.c |
17 0 0 D:\KAKLIK\projekty\programy\PIC_C\PICcam\873\camerus.h |
244 0 0 C:\Program Files\PICC\devices\16F873.h |
----- ----- |
648 64 Total |
Page ROM % RAM Functions: |
---- --- --- --- ---------- |
0 21 11 1 @delay_ms1 |
0 16 8 1 @I2C_WRITEU_1_59_60_4000000 |
0 153 79 0 main |
Segment Used Free |
--------- ---- ---- |
00000-00003 4 0 |
00004-007FF 190 1854 |
00800-00FFF 0 2048 |
/programy/C/PIC_C/PICcam/873/camerus.PJT |
---|
0,0 → 1,40 |
[PROJECT] |
Target=camerus.HEX |
Development_Mode= |
Processor=0x873F |
ToolSuite=CCS |
[Directories] |
Include=C:\Program Files\PICC\devices\;C:\Program Files\PICC\Dr |
Library= |
LinkerScript= |
[Target Data] |
FileList=D:\KAKLIK\projekty\programy\PIC_C\PICcam\873\camerus.c |
BuildTool=C-COMPILER |
OptionString=+FM |
AdditionalOptionString= |
BuildRequired=1 |
[camerus.c] |
Type=4 |
Path= |
FileList= |
BuildTool= |
OptionString= |
AdditionalOptionString= |
[mru-list] |
1=camerus.c |
[Windows] |
0=0000 camerus.c 0 0 796 451 3 0 |
[Opened Files] |
1=D:\KAKLIK\projekty\programy\PIC_C\PICcam\873\camerus.c |
2= |
3=C:\Program Files\PICC\devices\16F873.h |
4= |
[Units] |
Count=1 |
1=D:\KAKLIK\projekty\programy\PIC_C\PICcam\873\camerus.c (main) |
/programy/C/PIC_C/PICcam/873/camerus.err |
---|
0,0 → 1,2 |
No Errors |
0 Errors, 0 Warnings. |
/programy/C/PIC_C/PICcam/873/camerus.h |
---|
0,0 → 1,16 |
#include <16F873.h> |
#device adc=8 |
#FUSES NOWDT //No Watch Dog Timer |
#FUSES XT //Crystal osc <= 4mhz |
#FUSES NOPUT //No Power Up Timer |
#FUSES NOPROTECT //Code not protected from reading |
#FUSES NOBROWNOUT //No brownout reset |
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O |
#FUSES NOCPD //No EE protection |
#FUSES NOWRT //Program memory not write protected |
#FUSES NODEBUG //No Debug mode for ICD |
#use delay(clock=4000000) |
#use i2c(Master,Fast,sda=PIN_C4,scl=PIN_C3,force_HW) |
/programy/C/PIC_C/PICcam/873/camerus.sym |
---|
0,0 → 1,44 |
015 CCP_1_LOW |
015-016 CCP_1 |
016 CCP_1_HIGH |
01B CCP_2_LOW |
01B-01C CCP_2 |
01C CCP_2_HIGH |
020 @SCRATCH |
021 @SCRATCH |
021 _RETURN_ |
022 @SCRATCH |
023 @SCRATCH |
024 @SCRATCH |
025 @TRIS_C |
026 @I2C_WRITEU_1_59_60_4000000.P1 |
026 @delay_ms1.P2 |
0004 @delay_ms1 |
0019 @I2C_WRITEU_1_59_60_4000000 |
0029 main |
0029 @cinit |
Project Files: |
D:\KAKLIK\projekty\programy\PIC_C\PICcam\873\camerus.c |
D:\KAKLIK\projekty\programy\PIC_C\PICcam\873\camerus.h |
C:\Program Files\PICC\devices\16F873.h |
Units: |
D:\KAKLIK\projekty\programy\PIC_C\PICcam\873\camerus.c (main) |
Compiler Settings: |
Processor: PIC16F873 |
Pointer Size: 8 |
ADC Range: 0-255 |
Opt Level: 9 |
Short,Int,Long: 1,8,16 |
Output Files: |
Errors: D:\KAKLIK\projekty\programy\PIC_C\PICcam\873\camerus.err |
INHX8: D:\KAKLIK\projekty\programy\PIC_C\PICcam\873\camerus.hex |
Symbols: D:\KAKLIK\projekty\programy\PIC_C\PICcam\873\camerus.sym |
List: D:\KAKLIK\projekty\programy\PIC_C\PICcam\873\camerus.lst |
Debug/COFF: D:\KAKLIK\projekty\programy\PIC_C\PICcam\873\camerus.cof |
Call Tree: D:\KAKLIK\projekty\programy\PIC_C\PICcam\873\camerus.tre |
Statistics: D:\KAKLIK\projekty\programy\PIC_C\PICcam\873\camerus.sta |
/programy/C/PIC_C/PICcam/873/camerus.tre |
---|
0,0 → 1,16 |
ÀÄcamerus |
ÀÄmain 0/153 Ram=0 |
ÃÄ??0?? |
ÃÄ@delay_ms1 0/21 Ram=1 |
ÃÄ@delay_ms1 0/21 Ram=1 |
ÃÄ@I2C_WRITEU_1_59_60_4000000 0/16 Ram=1 |
ÃÄ@I2C_WRITEU_1_59_60_4000000 0/16 Ram=1 |
ÃÄ@I2C_WRITEU_1_59_60_4000000 0/16 Ram=1 |
ÃÄ@I2C_WRITEU_1_59_60_4000000 0/16 Ram=1 |
ÃÄ@I2C_WRITEU_1_59_60_4000000 0/16 Ram=1 |
ÃÄ@I2C_WRITEU_1_59_60_4000000 0/16 Ram=1 |
ÃÄ@delay_ms1 0/21 Ram=1 |
ÃÄ@I2C_WRITEU_1_59_60_4000000 0/16 Ram=1 |
ÃÄ@I2C_WRITEU_1_59_60_4000000 0/16 Ram=1 |
ÃÄ@I2C_WRITEU_1_59_60_4000000 0/16 Ram=1 |
ÀÄ@delay_ms1 0/21 Ram=1 |
/programy/C/PIC_C/test/C16F876A/blik/blik.BAK |
---|
0,0 → 1,24 |
#include "D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F876A\blik\blik.h" |
void main() |
{ |
setup_adc_ports(NO_ANALOGS); |
setup_adc(ADC_OFF); |
setup_spi(FALSE); |
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
setup_timer_1(T1_DISABLED); |
setup_timer_2(T2_DISABLED,0,1); |
setup_comparator(NC_NC_NC_NC); |
setup_vref(FALSE); |
While(true) |
{ |
Delay_ms(500); |
Output_high(PIN_B1); |
Delay_ms(500); |
Output_low(PIN_B1); |
} |
} |
/programy/C/PIC_C/test/C16F876A/blik/blik.PJT |
---|
0,0 → 1,38 |
[PROJECT] |
Target=blik.HEX |
Development_Mode= |
Processor=0x876A |
ToolSuite=CCS |
[Directories] |
Include=C:\Program Files\PICC\devices\;C:\Program Files\PICC\dr |
Library= |
LinkerScript= |
[Target Data] |
FileList=D:\KAKLIK\projekty\programy\PIC_C\test\C16F876A\blik\blik.c |
BuildTool=C-COMPILER |
OptionString=+FM |
AdditionalOptionString= |
BuildRequired=1 |
[blik.c] |
Type=4 |
Path= |
FileList= |
BuildTool= |
OptionString= |
AdditionalOptionString= |
[mru-list] |
1=blik.c |
[Windows] |
0=0000 blik.c 0 0 796 451 3 0 |
[Opened Files] |
1=D:\KAKLIK\projekty\programy\PIC_C\test\C16F876A\blik\blik.c |
2= |
[Units] |
Count=1 |
1=D:\KAKLIK\projekty\programy\PIC_C\test\C16F876A\blik\blik.c (main) |
/programy/C/PIC_C/test/C16F876A/blik/blik.c |
---|
0,0 → 1,24 |
#include ".\blik.h" |
void main() |
{ |
setup_adc_ports(NO_ANALOGS); |
setup_adc(ADC_OFF); |
setup_spi(FALSE); |
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
setup_timer_1(T1_DISABLED); |
setup_timer_2(T2_DISABLED,0,1); |
setup_comparator(NC_NC_NC_NC); |
setup_vref(FALSE); |
While(true) |
{ |
Delay_ms(500); |
Output_high(PIN_B1); |
Delay_ms(500); |
Output_low(PIN_B1); |
} |
} |
/programy/C/PIC_C/test/C16F876A/blik/blik.cof |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/test/C16F876A/blik/blik.err |
---|
0,0 → 1,2 |
No Errors |
0 Errors, 0 Warnings. |
/programy/C/PIC_C/test/C16F876A/blik/blik.h |
---|
0,0 → 1,15 |
#include <16F876A.h> |
#device adc=8 |
#FUSES NOWDT //No Watch Dog Timer |
#FUSES HS //High speed Osc (> 4mhz) |
#FUSES NOPUT //No Power Up Timer |
#FUSES NOPROTECT //Code not protected from reading |
#FUSES NODEBUG //No Debug mode for ICD |
#FUSES NOBROWNOUT //No brownout reset |
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O |
#FUSES NOCPD //No EE protection |
#FUSES NOWRT //Program memory not write protected |
#use delay(clock=20000000) |
/programy/C/PIC_C/test/C16F876A/blik/blik.hex |
---|
0,0 → 1,18 |
:1000000000308A00172800002230840000080319FD |
:1000100016280630F800F701F70B0C28F80B0B2810 |
:100020007B30F700F70B1228800B0928003484017D |
:100030001F30830583161F149F141F159F1107304F |
:100040009C00FF308312A00083161F149F141F15FD |
:100050009F1183121F109412A0122008831687008C |
:10006000831220162008831687008312A01120080F |
:1000700083168700003083129400831694000108D1 |
:10008000C73908388100831290010030F8009200CF |
:1000900000308316920007309C0005081030F700EE |
:1000A000F70B502800001C0883120D1383169D01C6 |
:1000B00002308312A100FA30A2000420A10B5B28B9 |
:1000C00083168610831286140230A100FA30A20033 |
:1000D0000420A10B662883168610831286108316CF |
:0400E0005828630039 |
:02400E003A3F37 |
:00000001FF |
;PIC16F876A |
/programy/C/PIC_C/test/C16F876A/blik/blik.lst |
---|
0,0 → 1,175 |
CCS PCM C Compiler, Version 3.245, 27853 23-II-07 18:50 |
Filename: D:\KAKLIK\projekty\programy\PIC_C\test\C16F876A\blik\blik.lst |
ROM used: 114 words (1%) |
Largest free fragment is 2048 |
RAM used: 7 (4%) at main() level |
8 (5%) worst case |
Stack: 1 locations |
* |
0000: MOVLW 00 |
0001: MOVWF 0A |
0002: GOTO 017 |
0003: NOP |
.................... #include ".\blik.h" |
.................... #include <16F876A.h> |
.................... //////// Standard Header file for the PIC16F876A device //////////////// |
.................... #device PIC16F876A |
.................... #list |
.................... |
.................... #device adc=8 |
.................... |
.................... #FUSES NOWDT //No Watch Dog Timer |
.................... #FUSES HS //High speed Osc (> 4mhz) |
.................... #FUSES NOPUT //No Power Up Timer |
.................... #FUSES NOPROTECT //Code not protected from reading |
.................... #FUSES NODEBUG //No Debug mode for ICD |
.................... #FUSES NOBROWNOUT //No brownout reset |
.................... #FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O |
.................... #FUSES NOCPD //No EE protection |
.................... #FUSES NOWRT //Program memory not write protected |
.................... |
.................... #use delay(clock=20000000) |
0004: MOVLW 22 |
0005: MOVWF 04 |
0006: MOVF 00,W |
0007: BTFSC 03.2 |
0008: GOTO 016 |
0009: MOVLW 06 |
000A: MOVWF 78 |
000B: CLRF 77 |
000C: DECFSZ 77,F |
000D: GOTO 00C |
000E: DECFSZ 78,F |
000F: GOTO 00B |
0010: MOVLW 7B |
0011: MOVWF 77 |
0012: DECFSZ 77,F |
0013: GOTO 012 |
0014: DECFSZ 00,F |
0015: GOTO 009 |
0016: RETLW 00 |
.................... |
.................... |
.................... |
.................... |
.................... void main() |
.................... { |
0017: CLRF 04 |
0018: MOVLW 1F |
0019: ANDWF 03,F |
001A: BSF 03.5 |
001B: BSF 1F.0 |
001C: BSF 1F.1 |
001D: BSF 1F.2 |
001E: BCF 1F.3 |
001F: MOVLW 07 |
0020: MOVWF 1C |
.................... |
.................... setup_adc_ports(NO_ANALOGS); |
* |
0024: BSF 03.5 |
0025: BSF 1F.0 |
0026: BSF 1F.1 |
0027: BSF 1F.2 |
0028: BCF 1F.3 |
.................... setup_adc(ADC_OFF); |
0029: BCF 03.5 |
002A: BCF 1F.0 |
.................... setup_spi(FALSE); |
* |
0021: MOVLW FF |
0022: BCF 03.5 |
0023: MOVWF 20 |
* |
002B: BCF 14.5 |
002C: BCF 20.5 |
002D: MOVF 20,W |
002E: BSF 03.5 |
002F: MOVWF 07 |
0030: BCF 03.5 |
0031: BSF 20.4 |
0032: MOVF 20,W |
0033: BSF 03.5 |
0034: MOVWF 07 |
0035: BCF 03.5 |
0036: BCF 20.3 |
0037: MOVF 20,W |
0038: BSF 03.5 |
0039: MOVWF 07 |
003A: MOVLW 00 |
003B: BCF 03.5 |
003C: MOVWF 14 |
003D: BSF 03.5 |
003E: MOVWF 14 |
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
003F: MOVF 01,W |
0040: ANDLW C7 |
0041: IORLW 08 |
0042: MOVWF 01 |
.................... setup_timer_1(T1_DISABLED); |
0043: BCF 03.5 |
0044: CLRF 10 |
.................... setup_timer_2(T2_DISABLED,0,1); |
0045: MOVLW 00 |
0046: MOVWF 78 |
0047: MOVWF 12 |
0048: MOVLW 00 |
0049: BSF 03.5 |
004A: MOVWF 12 |
.................... setup_comparator(NC_NC_NC_NC); |
004B: MOVLW 07 |
004C: MOVWF 1C |
004D: MOVF 05,W |
004E: MOVLW 10 |
004F: MOVWF 77 |
0050: DECFSZ 77,F |
0051: GOTO 050 |
0052: NOP |
0053: MOVF 1C,W |
0054: BCF 03.5 |
0055: BCF 0D.6 |
.................... setup_vref(FALSE); |
0056: BSF 03.5 |
0057: CLRF 1D |
.................... |
.................... While(true) |
.................... { |
.................... Delay_ms(500); |
0058: MOVLW 02 |
0059: BCF 03.5 |
005A: MOVWF 21 |
005B: MOVLW FA |
005C: MOVWF 22 |
005D: CALL 004 |
005E: DECFSZ 21,F |
005F: GOTO 05B |
.................... Output_high(PIN_B1); |
0060: BSF 03.5 |
0061: BCF 06.1 |
0062: BCF 03.5 |
0063: BSF 06.1 |
.................... Delay_ms(500); |
0064: MOVLW 02 |
0065: MOVWF 21 |
0066: MOVLW FA |
0067: MOVWF 22 |
0068: CALL 004 |
0069: DECFSZ 21,F |
006A: GOTO 066 |
.................... Output_low(PIN_B1); |
006B: BSF 03.5 |
006C: BCF 06.1 |
006D: BCF 03.5 |
006E: BCF 06.1 |
.................... } |
006F: BSF 03.5 |
0070: GOTO 058 |
.................... |
.................... } |
0071: SLEEP |
Configuration Fuses: |
Word 1: 3F3A HS NOWDT NOPUT NODEBUG NOPROTECT NOBROWNOUT NOLVP NOCPD NOWRT |
/programy/C/PIC_C/test/C16F876A/blik/blik.sta |
---|
0,0 → 1,31 |
ROM used: 114 (1%) |
114 (1%) including unused fragments |
0 Average locations per line |
8 Average locations per statement |
RAM used: 7 (4%) at main() level |
8 (5%) worst case |
Lines Stmts % Files |
----- ----- --- ----- |
25 14 100 D:\KAKLIK\projekty\programy\PIC_C\test\C16F876A\blik\blik.c |
16 0 0 D:\KAKLIK\projekty\programy\PIC_C\test\C16F876A\blik\blik.h |
270 0 0 C:\Program Files\PICC\devices\16F876A.h |
----- ----- |
622 28 Total |
Page ROM % RAM Functions: |
---- --- --- --- ---------- |
0 19 17 1 @delay_ms1 |
0 91 80 1 main |
Segment Used Free |
--------- ---- ---- |
00000-00003 4 0 |
00004-007FF 110 1934 |
00800-00FFF 0 2048 |
01000-017FF 0 2048 |
01800-01FFF 0 2048 |
/programy/C/PIC_C/test/C16F876A/blik/blik.sym |
---|
0,0 → 1,45 |
015-016 CCP_1 |
015 CCP_1_LOW |
016 CCP_1_HIGH |
01B CCP_2_LOW |
01B-01C CCP_2 |
01C CCP_2_HIGH |
020 @TRIS_C |
021 main.@SCRATCH |
022 @delay_ms1.P1 |
077 @SCRATCH |
078 @SCRATCH |
078 _RETURN_ |
079 @SCRATCH |
07A @SCRATCH |
07B @SCRATCH |
09C.6 C1OUT |
09C.7 C2OUT |
0004 @delay_ms1 |
0017 main |
0017 @cinit |
Project Files: |
D:\KAKLIK\projekty\programy\PIC_C\test\C16F876A\blik\blik.c |
D:\KAKLIK\projekty\programy\PIC_C\test\C16F876A\blik\blik.h |
C:\Program Files\PICC\devices\16F876A.h |
Units: |
D:\KAKLIK\projekty\programy\PIC_C\test\C16F876A\blik\blik.c (main) |
Compiler Settings: |
Processor: PIC16F876A |
Pointer Size: 8 |
ADC Range: 0-255 |
Opt Level: 9 |
Short,Int,Long: 1,8,16 |
Output Files: |
Errors: D:\KAKLIK\projekty\programy\PIC_C\test\C16F876A\blik\blik.err |
INHX8: D:\KAKLIK\projekty\programy\PIC_C\test\C16F876A\blik\blik.hex |
Symbols: D:\KAKLIK\projekty\programy\PIC_C\test\C16F876A\blik\blik.sym |
List: D:\KAKLIK\projekty\programy\PIC_C\test\C16F876A\blik\blik.lst |
Debug/COFF: D:\KAKLIK\projekty\programy\PIC_C\test\C16F876A\blik\blik.cof |
Call Tree: D:\KAKLIK\projekty\programy\PIC_C\test\C16F876A\blik\blik.tre |
Statistics: D:\KAKLIK\projekty\programy\PIC_C\test\C16F876A\blik\blik.sta |
/programy/C/PIC_C/test/C16F876A/blik/blik.tre |
---|
0,0 → 1,5 |
ÀÄblik |
ÀÄmain 0/91 Ram=1 |
ÃÄ??0?? |
ÃÄ@delay_ms1 0/19 Ram=1 |
ÀÄ@delay_ms1 0/19 Ram=1 |
/programy/C/PIC_C/test/PIC16F84A/blik/blik.PJT |
---|
0,0 → 1,38 |
[PROJECT] |
Target=blik.HEX |
Development_Mode= |
Processor=0x6F84 |
ToolSuite=CCS |
[Directories] |
Include=C:\Program Files\PICC\devices\;C:\Program Files\PICC\dr |
Library= |
LinkerScript= |
[Target Data] |
FileList=D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F84A\blik\blik.c |
BuildTool=C-COMPILER |
OptionString=+FM |
AdditionalOptionString= |
BuildRequired=1 |
[blik.c] |
Type=4 |
Path= |
FileList= |
BuildTool= |
OptionString= |
AdditionalOptionString= |
[mru-list] |
1=blik.c |
[Windows] |
0=0000 blik.c 0 0 796 451 3 0 |
[Opened Files] |
1=D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F84A\blik\blik.c |
2= |
[Units] |
Count=1 |
1=D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F84A\blik\blik.c (main) |
/programy/C/PIC_C/test/PIC16F84A/blik/blik.BAK |
---|
0,0 → 1,9 |
#include "blik.h" |
void main() |
{ |
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
} |
/programy/C/PIC_C/test/PIC16F84A/blik/blik.c |
---|
0,0 → 1,17 |
#include "blik.h" |
void main() |
{ |
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
while(true) |
{ |
output_high(PIN_B0); |
Delay_ms(700); |
output_low(PIN_B0); |
Delay_ms(50); |
} |
} |
/programy/C/PIC_C/test/PIC16F84A/blik/blik.cof |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/test/PIC16F84A/blik/blik.err |
---|
0,0 → 1,2 |
No Errors |
0 Errors, 0 Warnings. |
/programy/C/PIC_C/test/PIC16F84A/blik/blik.h |
---|
0,0 → 1,9 |
#include <16F84A.h> |
#FUSES NOWDT //No Watch Dog Timer |
#FUSES XT //Crystal osc <= 4mhz |
#FUSES NOPUT //No Power Up Timer |
#FUSES NOPROTECT //Code not protected from reading |
#use delay(clock=4000000) |
/programy/C/PIC_C/test/PIC16F84A/blik/blik.hex |
---|
0,0 → 1,10 |
:1000000000308A001928000010308400000803190D |
:10001000182801308D008C018C0B0C288D0B0B28BF |
:100020004A308C008C0B122800000000800B09283D |
:10003000003484011F30830583160108C73908384E |
:10004000810006108312061404308F00AF30900038 |
:1000500004208F0B262883160610831206103230D8 |
:0A006000900004208316212863009D |
:02400E00F93F78 |
:00000001FF |
;PIC16F84A |
/programy/C/PIC_C/test/PIC16F84A/blik/blik.lst |
---|
0,0 → 1,98 |
CCS PCM C Compiler, Version 3.245, 27853 05-XI-06 21:34 |
Filename: D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F84A\blik\blik.lst |
ROM used: 53 words (5%) |
Largest free fragment is 971 |
RAM used: 3 (4%) at main() level |
4 (6%) worst case |
Stack: 1 locations |
* |
0000: MOVLW 00 |
0001: MOVWF 0A |
0002: GOTO 019 |
0003: NOP |
.................... #include "blik.h" |
.................... #include <16F84A.h> |
.................... //////// Standard Header file for the PIC16F84A device //////////////// |
.................... #device PIC16F84A |
.................... #list |
.................... |
.................... |
.................... #FUSES NOWDT //No Watch Dog Timer |
.................... #FUSES XT //Crystal osc <= 4mhz |
.................... #FUSES NOPUT //No Power Up Timer |
.................... #FUSES NOPROTECT //Code not protected from reading |
.................... |
.................... #use delay(clock=4000000) |
0004: MOVLW 10 |
0005: MOVWF 04 |
0006: MOVF 00,W |
0007: BTFSC 03.2 |
0008: GOTO 018 |
0009: MOVLW 01 |
000A: MOVWF 0D |
000B: CLRF 0C |
000C: DECFSZ 0C,F |
000D: GOTO 00C |
000E: DECFSZ 0D,F |
000F: GOTO 00B |
0010: MOVLW 4A |
0011: MOVWF 0C |
0012: DECFSZ 0C,F |
0013: GOTO 012 |
0014: NOP |
0015: NOP |
0016: DECFSZ 00,F |
0017: GOTO 009 |
0018: RETLW 00 |
.................... |
.................... |
.................... |
.................... |
.................... void main() |
.................... { |
0019: CLRF 04 |
001A: MOVLW 1F |
001B: ANDWF 03,F |
.................... |
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
001C: BSF 03.5 |
001D: MOVF 01,W |
001E: ANDLW C7 |
001F: IORLW 08 |
0020: MOVWF 01 |
.................... |
.................... while(true) |
.................... { |
.................... output_high(PIN_B0); |
0021: BCF 06.0 |
0022: BCF 03.5 |
0023: BSF 06.0 |
.................... Delay_ms(700); |
0024: MOVLW 04 |
0025: MOVWF 0F |
0026: MOVLW AF |
0027: MOVWF 10 |
0028: CALL 004 |
0029: DECFSZ 0F,F |
002A: GOTO 026 |
.................... output_low(PIN_B0); |
002B: BSF 03.5 |
002C: BCF 06.0 |
002D: BCF 03.5 |
002E: BCF 06.0 |
.................... Delay_ms(50); |
002F: MOVLW 32 |
0030: MOVWF 10 |
0031: CALL 004 |
.................... } |
0032: BSF 03.5 |
0033: GOTO 021 |
.................... |
.................... } |
0034: SLEEP |
Configuration Fuses: |
Word 1: 3FF9 XT NOWDT NOPUT NOPROTECT |
/programy/C/PIC_C/test/PIC16F84A/blik/blik.sta |
---|
0,0 → 1,28 |
ROM used: 53 (5%) |
53 (5%) including unused fragments |
0 Average locations per line |
8 Average locations per statement |
RAM used: 3 (4%) at main() level |
4 (6%) worst case |
Lines Stmts % Files |
----- ----- --- ----- |
18 7 100 D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F84A\blik\blik.c |
10 0 0 D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F84A\blik\blik.h |
113 0 0 C:\Program Files\PICC\devices\16F84A.h |
----- ----- |
282 14 Total |
Page ROM % RAM Functions: |
---- --- --- --- ---------- |
0 21 40 1 @delay_ms1 |
0 28 53 1 main |
Segment Used Free |
--------- ---- ---- |
00000-00003 4 0 |
00004-003FF 49 971 |
/programy/C/PIC_C/test/PIC16F84A/blik/blik.sym |
---|
0,0 → 1,32 |
00C @SCRATCH |
00D @SCRATCH |
00D _RETURN_ |
00F main.@SCRATCH |
010 @delay_ms1.P1 |
0004 @delay_ms1 |
0019 main |
0019 @cinit |
Project Files: |
D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F84A\blik\blik.c |
D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F84A\blik\blik.h |
C:\Program Files\PICC\devices\16F84A.h |
Units: |
D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F84A\blik\blik.c (main) |
Compiler Settings: |
Processor: PIC16F84A |
Pointer Size: 8 |
Opt Level: 9 |
Short,Int,Long: 1,8,16 |
Output Files: |
Errors: D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F84A\blik\blik.err |
INHX8: D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F84A\blik\blik.hex |
Symbols: D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F84A\blik\blik.sym |
List: D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F84A\blik\blik.lst |
Debug/COFF: D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F84A\blik\blik.cof |
Call Tree: D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F84A\blik\blik.tre |
Statistics: D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F84A\blik\blik.sta |
/programy/C/PIC_C/test/PIC16F84A/blik/blik.tre |
---|
0,0 → 1,5 |
ÀÄblik |
ÀÄmain 0/28 Ram=1 |
ÃÄ??0?? |
ÃÄ@delay_ms1 0/21 Ram=1 |
ÀÄ@delay_ms1 0/21 Ram=1 |
/programy/C/PIC_C/test/PIC16F84A/blik/prg.bat |
---|
0,0 → 1,6 |
call picpgr stop LPT2 |
call picpgr erase pic16f84a LPT2 |
call picpgr program blik.hex hex pic16f84a LPT2 |
call picpgr run LPT2 |
pause |
call picpgr stop LPT2 |
/programy/C/PIC_C/test/PIC16F88/blik/blik.PJT |
---|
0,0 → 1,41 |
[PROJECT] |
Target=blik.HEX |
Development_Mode= |
Processor=0x688F |
ToolSuite=CCS |
[Directories] |
Include=C:\Program Files\PICC\devices\;C:\Program Files\PICC\dr |
Library= |
LinkerScript= |
[Target Data] |
FileList=D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F88\blik\blik.c |
BuildTool=C-COMPILER |
OptionString=+FM |
AdditionalOptionString= |
BuildRequired=1 |
[blik.c] |
Type=4 |
Path= |
FileList= |
BuildTool= |
OptionString= |
AdditionalOptionString= |
[mru-list] |
1=blik.c |
[Windows] |
0=0000 blik.c 0 0 796 451 3 0 |
[Opened Files] |
1=D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F88\blik\blik.c |
2=D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F88\blik\blik.h |
3=C:\Program Files\PICC\devices\16F88.h |
4=D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F88\blik\blik.lst |
5= |
[Units] |
Count=1 |
1=D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F88\blik\blik.c (main) |
/programy/C/PIC_C/test/PIC16F88/blik/blik.BAK |
---|
0,0 → 1,25 |
#include "blik.h" |
void main() |
{ |
setup_adc_ports(NO_ANALOGS|VSS_VDD); |
setup_adc(ADC_OFF); |
setup_spi(FALSE); |
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
setup_timer_1(T1_DISABLED); |
setup_timer_2(T2_DISABLED,0,1); |
setup_comparator(NC_NC_NC_NC); |
setup_vref(FALSE); |
setup_oscillator(False); |
while(true) // nekonecny cyklus |
{ |
output_high(PIN_B0); // nastav B0 na 1 |
Delay_ms(700); // pockej 700ms |
output_low(PIN_B0); //nastav B0 na 0 |
Delay_ms(50); // pockej 50ms |
} // opakuj cyklus |
} |
/programy/C/PIC_C/test/PIC16F88/blik/blik.c |
---|
0,0 → 1,25 |
#include "blik.h" |
void main() |
{ |
setup_adc_ports(NO_ANALOGS|VSS_VDD); // parametry |
setup_adc(ADC_OFF); |
setup_spi(FALSE); |
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
setup_timer_1(T1_DISABLED); |
setup_timer_2(T2_DISABLED,0,1); |
setup_comparator(NC_NC_NC_NC); |
setup_vref(FALSE); |
setup_oscillator(False); |
while(true) // nekonecny cyklus |
{ |
output_high(PIN_B0); // nastav B0 na 1 |
Delay_ms(700); // pockej 700ms |
output_low(PIN_B0); //nastav B0 na 0 |
Delay_ms(50); // pockej 50ms |
} // opakuj cyklus |
} |
/programy/C/PIC_C/test/PIC16F88/blik/blik.cof |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/test/PIC16F88/blik/blik.err |
---|
0,0 → 1,2 |
No Errors |
0 Errors, 0 Warnings. |
/programy/C/PIC_C/test/PIC16F88/blik/blik.h |
---|
0,0 → 1,18 |
#include <16F88.h> |
#device adc=8 |
#FUSES NOWDT //No Watch Dog Timer |
#FUSES XT //Crystal osc <= 4mhz |
#FUSES NOPUT //No Power Up Timer |
#FUSES NOMCLR //Master Clear pin used for I/O |
#FUSES NOBROWNOUT //No brownout reset |
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O |
#FUSES NOCPD //No EE protection |
#FUSES NOWRT //Program memory not write protected |
#FUSES NODEBUG //No Debug mode for ICD |
#FUSES NOPROTECT //Code not protected from reading |
#FUSES NOFCMEN //Fail-safe clock monitor disabled |
#FUSES NOIESO //Internal External Switch Over mode disabled |
#use delay(clock=4000000) |
/programy/C/PIC_C/test/PIC16F88/blik/blik.hex |
---|
0,0 → 1,16 |
:1000000000308A00192800002230840000080319FB |
:1000100018280130F800F701F70B0C28F80B0B2813 |
:100020004A30F700F70B122800000000800B092867 |
:10003000003484011F30830583161F129F121B0892 |
:1000400080399B0007309C001F129F121B088039CB |
:100050009B0083121F109412831606118614061239 |
:10006000003083129400831694000108C7390838C1 |
:100070008100831290010030F80092000030831656 |
:10008000920007309C0005080330F700F70B462864 |
:100090001C0883120D1383169D018F010F08061093 |
:1000A000831206140430A100AF30A2000420A10B7B |
:1000B000542883160610831206103230A200042042 |
:0600C00083164F286300C7 |
:04400E00093FFC3F2B |
:00000001FF |
;PIC16F88 |
/programy/C/PIC_C/test/PIC16F88/blik/blik.lst |
---|
0,0 → 1,162 |
CCS PCM C Compiler, Version 3.245, 27853 05-XI-06 22:19 |
Filename: D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F88\blik\blik.lst |
ROM used: 99 words (2%) |
Largest free fragment is 2048 |
RAM used: 6 (3%) at main() level |
7 (4%) worst case |
Stack: 1 locations |
* |
0000: MOVLW 00 |
0001: MOVWF 0A |
0002: GOTO 019 |
0003: NOP |
.................... #include "blik.h" |
.................... #include <16F88.h> |
.................... //////// Standard Header file for the PIC16F88 device //////////////// |
.................... #device PIC16F88 |
.................... #list |
.................... |
.................... #device adc=8 |
.................... |
.................... #FUSES NOWDT //No Watch Dog Timer |
.................... #FUSES XT //Crystal osc <= 4mhz |
.................... #FUSES NOPUT //No Power Up Timer |
.................... #FUSES NOMCLR //Master Clear pin used for I/O |
.................... #FUSES NOBROWNOUT //No brownout reset |
.................... #FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O |
.................... #FUSES NOCPD //No EE protection |
.................... #FUSES NOWRT //Program memory not write protected |
.................... #FUSES NODEBUG //No Debug mode for ICD |
.................... #FUSES NOPROTECT //Code not protected from reading |
.................... #FUSES NOFCMEN //Fail-safe clock monitor disabled |
.................... #FUSES NOIESO //Internal External Switch Over mode disabled |
.................... |
.................... #use delay(clock=4000000) |
0004: MOVLW 22 |
0005: MOVWF 04 |
0006: MOVF 00,W |
0007: BTFSC 03.2 |
0008: GOTO 018 |
0009: MOVLW 01 |
000A: MOVWF 78 |
000B: CLRF 77 |
000C: DECFSZ 77,F |
000D: GOTO 00C |
000E: DECFSZ 78,F |
000F: GOTO 00B |
0010: MOVLW 4A |
0011: MOVWF 77 |
0012: DECFSZ 77,F |
0013: GOTO 012 |
0014: NOP |
0015: NOP |
0016: DECFSZ 00,F |
0017: GOTO 009 |
0018: RETLW 00 |
.................... |
.................... |
.................... |
.................... |
.................... void main() |
.................... { |
0019: CLRF 04 |
001A: MOVLW 1F |
001B: ANDWF 03,F |
001C: BSF 03.5 |
001D: BCF 1F.4 |
001E: BCF 1F.5 |
001F: MOVF 1B,W |
0020: ANDLW 80 |
0021: MOVWF 1B |
0022: MOVLW 07 |
0023: MOVWF 1C |
.................... |
.................... setup_adc_ports(NO_ANALOGS|VSS_VDD); // parametry |
0024: BCF 1F.4 |
0025: BCF 1F.5 |
0026: MOVF 1B,W |
0027: ANDLW 80 |
0028: MOVWF 1B |
.................... setup_adc(ADC_OFF); |
0029: BCF 03.5 |
002A: BCF 1F.0 |
.................... setup_spi(FALSE); |
002B: BCF 14.5 |
002C: BSF 03.5 |
002D: BCF 06.2 |
002E: BSF 06.1 |
002F: BCF 06.4 |
0030: MOVLW 00 |
0031: BCF 03.5 |
0032: MOVWF 14 |
0033: BSF 03.5 |
0034: MOVWF 14 |
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
0035: MOVF 01,W |
0036: ANDLW C7 |
0037: IORLW 08 |
0038: MOVWF 01 |
.................... setup_timer_1(T1_DISABLED); |
0039: BCF 03.5 |
003A: CLRF 10 |
.................... setup_timer_2(T2_DISABLED,0,1); |
003B: MOVLW 00 |
003C: MOVWF 78 |
003D: MOVWF 12 |
003E: MOVLW 00 |
003F: BSF 03.5 |
0040: MOVWF 12 |
.................... setup_comparator(NC_NC_NC_NC); |
0041: MOVLW 07 |
0042: MOVWF 1C |
0043: MOVF 05,W |
0044: MOVLW 03 |
0045: MOVWF 77 |
0046: DECFSZ 77,F |
0047: GOTO 046 |
0048: MOVF 1C,W |
0049: BCF 03.5 |
004A: BCF 0D.6 |
.................... setup_vref(FALSE); |
004B: BSF 03.5 |
004C: CLRF 1D |
.................... setup_oscillator(False); |
004D: CLRF 0F |
004E: MOVF 0F,W |
.................... |
.................... while(true) // nekonecny cyklus |
.................... { |
.................... output_high(PIN_B0); // nastav B0 na 1 |
004F: BCF 06.0 |
0050: BCF 03.5 |
0051: BSF 06.0 |
.................... Delay_ms(700); // pockej 700ms |
0052: MOVLW 04 |
0053: MOVWF 21 |
0054: MOVLW AF |
0055: MOVWF 22 |
0056: CALL 004 |
0057: DECFSZ 21,F |
0058: GOTO 054 |
.................... output_low(PIN_B0); //nastav B0 na 0 |
0059: BSF 03.5 |
005A: BCF 06.0 |
005B: BCF 03.5 |
005C: BCF 06.0 |
.................... Delay_ms(50); // pockej 50ms |
005D: MOVLW 32 |
005E: MOVWF 22 |
005F: CALL 004 |
.................... } // opakuj cyklus |
0060: BSF 03.5 |
0061: GOTO 04F |
.................... |
.................... } |
0062: SLEEP |
Configuration Fuses: |
Word 1: 3F09 XT NOWDT NOPUT NOMCLR NOBROWNOUT NOLVP NOCPD NOWRT NODEBUG CCPB0 NOPROTECT |
Word 2: 3FFC NOFCMEN NOIESO |
/programy/C/PIC_C/test/PIC16F88/blik/blik.sta |
---|
0,0 → 1,29 |
ROM used: 99 (2%) |
99 (2%) including unused fragments |
0 Average locations per line |
7 Average locations per statement |
RAM used: 6 (3%) at main() level |
7 (4%) worst case |
Lines Stmts % Files |
----- ----- --- ----- |
26 15 100 D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F88\blik\blik.c |
19 0 0 D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F88\blik\blik.h |
279 0 0 C:\Program Files\PICC\devices\16F88.h |
----- ----- |
648 30 Total |
Page ROM % RAM Functions: |
---- --- --- --- ---------- |
0 21 21 1 @delay_ms1 |
0 74 75 1 main |
Segment Used Free |
--------- ---- ---- |
00000-00003 4 0 |
00004-007FF 95 1949 |
00800-00FFF 0 2048 |
/programy/C/PIC_C/test/PIC16F88/blik/blik.sym |
---|
0,0 → 1,41 |
015 CCP_1_LOW |
015-016 CCP_1 |
016 CCP_1_HIGH |
021 main.@SCRATCH |
022 @delay_ms1.P1 |
077 @SCRATCH |
078 @SCRATCH |
078 _RETURN_ |
079 @SCRATCH |
07A @SCRATCH |
07B @SCRATCH |
09C.6 C1OUT |
09C.7 C2OUT |
0004 @delay_ms1 |
0019 main |
0019 @cinit |
Project Files: |
D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F88\blik\blik.c |
D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F88\blik\blik.h |
C:\Program Files\PICC\devices\16F88.h |
Units: |
D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F88\blik\blik.c (main) |
Compiler Settings: |
Processor: PIC16F88 |
Pointer Size: 8 |
ADC Range: 0-255 |
Opt Level: 9 |
Short,Int,Long: 1,8,16 |
Output Files: |
Errors: D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F88\blik\blik.err |
INHX8: D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F88\blik\blik.hex |
Symbols: D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F88\blik\blik.sym |
List: D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F88\blik\blik.lst |
Debug/COFF: D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F88\blik\blik.cof |
Call Tree: D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F88\blik\blik.tre |
Statistics: D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F88\blik\blik.sta |
/programy/C/PIC_C/test/PIC16F88/blik/blik.tre |
---|
0,0 → 1,5 |
ÀÄblik |
ÀÄmain 0/74 Ram=1 |
ÃÄ??0?? |
ÃÄ@delay_ms1 0/21 Ram=1 |
ÀÄ@delay_ms1 0/21 Ram=1 |
/programy/C/PIC_C/test/PIC16F88/blik/prg.bat |
---|
0,0 → 1,6 |
call picpgr stop LPT2 |
call picpgr erase pic16f88 LPT2 |
call picpgr program blik.hex hex pic16f88 LPT2 |
call picpgr run LPT2 |
pause |
call picpgr stop LPT2 |
/programy/C/PIC_C/hack/hack.BAK |
---|
0,0 → 1,11 |
#include <16F88.h> |
#device *=16 |
#device ICD=TRUE |
#device adc=8 |
#fuses NOWDT,INTRC , NOPUT, MCLR, NOBROWNOUT, NOLVP, NOCPD, NOWRT, DEBUG, NOPROTECT, NOFCMEN, NOIESO |
//#fuses NOWDT,INTRC_IO, NOPUT, MCLR, NOBROWNOUT, NOLVP, NOCPD, NOWRT, DEBUG, NOPROTECT, NOFCMEN, NOIESO |
#use delay(clock=4000000,RESTART_WDT) |
//#use rs232(baud=2400,xmit=PIN_B3) |
//#use rs232(DEBUGGER) |
#use rs232(baud=9600,parity=N,xmit=PIN_B3,rcv=PIN_B2,bits=8) |
/programy/C/PIC_C/hack/hack.HEX |
---|
0,0 → 1,202 |
:10000000000000308A00422BFF00030E8301A10094 |
:100010007F08A0000A08A8008A01A00E0408A20018 |
:100020007708A3007808A4007908A5007A08A6003C |
:100030007B08A700831383128C308400001C2228C5 |
:100040000C183B288C308400801C28288C183D28F4 |
:10005000220884002308F7002408F8002508F90086 |
:100060002608FA002708FB0028088A00210E8300D2 |
:10007000FF0E7F0E09008A11E0288A11E3280A107A |
:100080008A100A1182074834413443344B342034F7 |
:10009000763431342E343034003400340A108A106F |
:1000A0000A1182070A340D340A340D3425347334AE |
:1000B00000340A108A100A11820725344C34753432 |
:1000C0006534343420342B34203425344C347534A6 |
:1000D000203447344F3400340A108A100A11820742 |
:1000E00025344C3475346534343420342B34203486 |
:1000F00025344C347534203452344534503445342E |
:10010000413454342034253475340A340D340034E9 |
:100110000A108A100A11820725344C34753465346C |
:10012000343420342B34203425344C34753420348A |
:100130004834413443344B3400340A108A100A11D5 |
:10014000820725344C3475346534343420342B34F0 |
:10015000203425344C347534203474346934633499 |
:100160006B34733400340A108A100A118207253464 |
:100170004C347534203478342034313420347034A5 |
:10018000723465347334633461346C3465340034F0 |
:100190000A108A100A1182074534723472346F349F |
:1001A000723400340A108A100A11820725344C3444 |
:1001B000753420347434693463346B3473340034EC |
:1001C0000C108A1128288C108A11282842308400AB |
:1001D000831300080319FD280130F800BF30F70031 |
:1001E0006400F70BF028F80BEE284A30F700F70B05 |
:1001F000F72800006400800BEC2800348316861179 |
:10020000831286110830F800000000000000F81783 |
:100210001829F813CC0C03188615031C86117817BF |
:1002200018297813F80B0A29000000000000861531 |
:100230000130F7008401840B1B29F70B1A290D30BC |
:100240008400840B212900000000F81B0929781B79 |
:10025000112900340408F8000830F7008316061549 |
:100260008312061D352983163029C101F717482945 |
:10027000F7134829031006190314C10C77174829EE |
:100280007713F70B3A29780884004108F8005D29B4 |
:10029000013084000030F71B5530F800F80B4E2970 |
:1002A000840B4A290D30F71B0330F800F80B562950 |
:1002B000F71B3829771B40293A298A11C12BCB011A |
:1002C0000408CA004B10831B4B14440EF038C600C0 |
:1002D000C607E23EC700323EC90044080F39C707CF |
:1002E000C707C907E93EC800C807C807430E0F394A |
:1002F000C807C907C80DC90DC909C90D43080F3979 |
:10030000C907C60D0730C5000A30C907C803031C5A |
:100310008529C807C703031C8929C707C603031C0F |
:100320008D29C607C503031C91294530840083131A |
:1003300007304A058407493004020319C12900081F |
:10034000F700031DA9294A1ABF29CA19AB29203071 |
:10035000AC290830CA003030F707C4010408C300D4 |
:100360004410831B44147708C5007708CC00FE2096 |
:10037000430884008313441883174508F700840A50 |
:100380009B290008F7003030F7077708CC00FE20E3 |
:1003900000344708F80146020318D1294608F7003F |
:1003A000DD29F7010830C800C60DF70D47087702B0 |
:1003B0000318F700F80DC80BD42900344513C512F3 |
:1003C0004408C6006430C700C9217708C400780813 |
:1003D000031D082AC51A082AC519162A451BF6291D |
:1003E0004518F6294519F629C51B162A451C022A67 |
:1003F000C51B162A451B022A4518162A4519022A2A |
:10040000C51B162A2030451E3030CC00FE20162A8F |
:10041000C516C51F122A78088000F8002D30CC00C0 |
:10042000FE20C51330307807CC00FE20451B212A62 |
:100430004408C6000A30C700C9217708C400451720 |
:10044000E729C51F262A2D30CC00FE203030440776 |
:10045000CC00FE208A118F2C1030F700FA01CD015C |
:10046000CA0CC90C031C3A2A4B08FA070318CD0A18 |
:100470004C08CD07CD0CFA0CF90CF80CF70B302A10 |
:100480008A11B62AC701C5010A30C600C401C301DA |
:1004900041084204031D502A0030F800F900412BA6 |
:1004A0004708C70A410784008313421883170008CE |
:1004B000C80048082D3C031D692A0130C5004708C3 |
:1004C000C70A410784008313421883170008C80035 |
:1004D000762A48082B3C031D762A4708C70A41079D |
:1004E00084008313421883170008C80048082F3C73 |
:1004F0000318322B4808393C031C322B4808303C87 |
:10050000031DA22A4708410784008313421883175A |
:100510000008783C0319962A470841078400831392 |
:10052000421883170008583C031DA22A1030C60049 |
:10053000C70A4708C70A4107840083134218831774 |
:100540000008C80046080A3C031DC92A48082F3C79 |
:100550000318C82A4808393C031CC82ACA010A30B3 |
:10056000C9004408CC004308CB002C2A3030480294 |
:100570007807C3007908C4000318C40A4708C70AEB |
:10058000410784008313421883170008C800A62A75 |
:10059000322B4608103C031D322B4808603C0318E0 |
:1005A000D82A48087A3C031CD82A4808DF39D92AB7 |
:1005B0004808C80048082F3C0318E22A4808393C7C |
:1005C0000318EA2A4808403C0318322B4808463CE6 |
:1005D000031C322B48082F3C0318072B4808393CD2 |
:1005E000031C072B430DC900440DCA00C90DCA0DD9 |
:1005F000C90DCA0DC90DCA0DF030C9053030480209 |
:100600004907C3004A08C4000318C40A1C2B430D41 |
:10061000C900440DCA00C90DCA0DC90DCA0DC90DC6 |
:10062000CA0DF030C905413048020A3E4907C300EF |
:100630004A08C4000318C40A4708C70A41078400CF |
:100640008313421883170008C800603C03182F2B3F |
:1006500048087A3C031C2F2B4808DF39302B480808 |
:10066000C800DA2A46080A3C031D3D2B450B3D2BEA |
:10067000C309C409C30A0319C40A4308F80044089B |
:10068000F9000034840183131F30830583161F1281 |
:100690009F121B0880399B0007309C0005086400EE |
:1006A0001C0883120D13603083168F00861183128D |
:1006B0008615A901AA010130AB00AC01AD01AE0164 |
:1006C00083161F129F121B0880399B0083121F1074 |
:1006D00094128316061186140612003083129400B9 |
:1006E000831694000108C7392838810087308312A7 |
:1006F00090000030F800920000308316920007301E |
:100700009C00050864000230F700F70B852B000001 |
:1007100000001C0883120D1383169D0162308F00A8 |
:1007200064308312C200E620C10141084E20C10A94 |
:10073000F700CC00FE2004304102031D952BC201BE |
:1007400042083F2000380319A92BC20ACC00FE2022 |
:10075000A02B8316061283120612831686128312AA |
:100760008612BF010130BE00BD01BC010A30CC00C1 |
:10077000FE200D30CC00FE203E30CC00FE20C0011B |
:100780002A297808B1003108CC00FE204008C00AB0 |
:10079000323E840083133108800031080D3C031978 |
:1007A000D52B4008093C0318C02B32304007840089 |
:1007B000831380010A30CC00FE200D30CC00FE20D7 |
:1007C0003208673A0319F12B153A0319602C1A3ACB |
:1007D0000319E92C013A0319712D193A0319A82DAF |
:1007E000EB2D103084003D08C4003C08C3005F219D |
:1007F0000330C10041085920C10AF700CC00FE2097 |
:1008000008304102031DFA2B103084003F08C40059 |
:100810003E08C3005F212030CC00FE204730CC00D2 |
:10082000FE204F30CC00FE20B001AF0130083D0269 |
:10083000031C3C2C031D202C3C082F0203183C2CCD |
:100840008F018E010F08FA000E08F7000F087A02D8 |
:10085000031D222C7708C1007A08C2004208273CF9 |
:10086000031C382C031D222C41080F3C0318222C9A |
:10087000AF0A0319B00A162C8F018E010F08FA0077 |
:100880000E08F7000F087A02031D3E2C7708C100FE |
:100890007A08C20042083F02031C542C031D3E2C60 |
:1008A0003E084102031C3E2C8316061283120616D4 |
:1008B0000130C200E62083160612831206121A2E99 |
:1008C000C0014008C00AC100103084003D08C400C7 |
:1008D0003C08C3005F210330C20042086C20C20AFA |
:1008E000F700CC00FE2008304202031D6D2C1030B2 |
:1008F00084003F08C4003E08C3005F210B30C300E2 |
:1009000043086C20C30AF700CC00FE2013304302DA |
:10091000031D802C4108C4001830C500DE290A30B0 |
:10092000CC00FE200D30CC00FE20B001AF0130081D |
:100930003D02031CBD2C031DA12C3C082F020318F3 |
:10094000BD2C8F018E010F08FA000E08F7000F086A |
:100950007A02031DA32C7708C1007A08C20042085E |
:10096000273C031CB92C031DA32C41080F3C031882 |
:10097000A32CAF0A0319B00A972C8F018E010F0820 |
:10098000FA000E08F7000F087A02031DBF2C770843 |
:10099000C1007A08C20042083F02031CD52C031D87 |
:1009A000BF2C3E084102031CBF2C83160612831283 |
:1009B00006161430C200E6208316061283120612B1 |
:1009C0000830C100FA30C200E620C10BE22C612CD5 |
:1009D0001A2E103084003D08C4003C08C3005F217B |
:1009E0000330C10041088820C10AF700CC00FE2076 |
:1009F00008304102031DF22C103084003F08C4006F |
:100A00003E08C3005F210B30C20042088820C20AA2 |
:100A1000F700CC00FE2010304202031D052DB0016E |
:100A2000AF0130083D02031C372D031D1B2D3C0870 |
:100A30002F020318372D8F018E010F08FA000E08C0 |
:100A4000F7000F087A02031D1D2D7708C1007A08F0 |
:100A5000C2004208273C031C332D031D1D2D4108F5 |
:100A60000F3C03181D2DAF0A0319B00A112D8F0179 |
:100A70008E010F08FA000E08F7000F087A02031D16 |
:100A8000392D7708C1007A08C20042083F02031CD2 |
:100A90004F2D031D392D3E084102031C392D8316AD |
:100AA00006128312061683160613831206130A30E3 |
:100AB000C200E62083168612831286162830C100F3 |
:100AC000FA30C200E620C10B602D83168612831215 |
:100AD00086128316061283120612831606178312D5 |
:100AE0001A2EC10141083F20003803197B2DC10A8D |
:100AF000CC00FE20722D0A30CC00FE200D30CC0040 |
:100B0000FE20103084003D08C4003C08C3005F2173 |
:100B10000330C10041089D20C10AF700CC00FE202F |
:100B200008304102031D8A2D103084003F08C400A4 |
:100B30003E08C3005F210B30C20042089D20C20A5C |
:100B4000F700CC00FE2011304202031D9D2D1A2E0D |
:100B500033082F3C0318DF2D3308393C031CDF2DED |
:100B6000C2013330C10042227908BD007808BC00C0 |
:100B7000103084003D08C4003C08C3005F210330EE |
:100B8000C1004108B320C10AF700CC00FE200730A5 |
:100B90004102031DC12D0430C2003030CC00FE20C4 |
:100BA000C20BCD2D0730C3004308B320C30AF700A2 |
:100BB000CC00FE2010304302031DD42DEA2DC101CC |
:100BC0004108C820C10AF700CC00FE2005304102D0 |
:100BD000031DE02D1A2E32082F3C03180F2E320869 |
:100BE000393C031C0F2EC2013230C1004222790869 |
:100BF000BF007808BE00103084003F08C4003E08E3 |
:100C0000C3005F210330C1004108D220C10AF700B0 |
:100C1000CC00FE2009304102031D042E1A2EC10112 |
:100C20004108C820C10AF700CC00FE20053041026F |
:100C3000031D102EB62B83160612831206120230E5 |
:100C4000C1009630C200E620C10B212E8316061289 |
:100C5000831206160230C1009630C200E620C10B96 |
:060C60002C2E1B2E322E8B |
:04400E003137FC3F0B |
:00000001FF |
;PIC16F88 |
/programy/C/PIC_C/hack/hack.LST |
---|
0,0 → 1,2662 |
CCS PCM C Compiler, Version 3.221, 27853 12-III-06 16:36 |
Filename: D:\KAKLIK\programy\PIC_C\hack\hack.LST |
ROM used: 1587 words (41%) |
Largest free fragment is 1792 |
RAM used: 41 (11%) at main() level |
51 (14%) worst case |
Stack: 3 worst case (2 in main + 1 for interrupts) |
* |
0000: NOP |
0001: MOVLW 00 |
0002: MOVWF 0A |
0003: GOTO 342 |
0004: MOVWF 7F |
0005: SWAPF 03,W |
0006: CLRF 03 |
0007: MOVWF 21 |
0008: MOVF 7F,W |
0009: MOVWF 20 |
000A: MOVF 0A,W |
000B: MOVWF 28 |
000C: CLRF 0A |
000D: SWAPF 20,F |
000E: MOVF 04,W |
000F: MOVWF 22 |
0010: MOVF 77,W |
0011: MOVWF 23 |
0012: MOVF 78,W |
0013: MOVWF 24 |
0014: MOVF 79,W |
0015: MOVWF 25 |
0016: MOVF 7A,W |
0017: MOVWF 26 |
0018: MOVF 7B,W |
0019: MOVWF 27 |
001A: BCF 03.7 |
001B: BCF 03.5 |
001C: MOVLW 8C |
001D: MOVWF 04 |
001E: BTFSS 00.0 |
001F: GOTO 022 |
0020: BTFSC 0C.0 |
0021: GOTO 03B |
0022: MOVLW 8C |
0023: MOVWF 04 |
0024: BTFSS 00.1 |
0025: GOTO 028 |
0026: BTFSC 0C.1 |
0027: GOTO 03D |
0028: MOVF 22,W |
0029: MOVWF 04 |
002A: MOVF 23,W |
002B: MOVWF 77 |
002C: MOVF 24,W |
002D: MOVWF 78 |
002E: MOVF 25,W |
002F: MOVWF 79 |
0030: MOVF 26,W |
0031: MOVWF 7A |
0032: MOVF 27,W |
0033: MOVWF 7B |
0034: MOVF 28,W |
0035: MOVWF 0A |
0036: SWAPF 21,W |
0037: MOVWF 03 |
0038: SWAPF 7F,F |
0039: SWAPF 7F,W |
003A: RETFIE |
003B: BCF 0A.3 |
003C: GOTO 0E0 |
003D: BCF 0A.3 |
003E: GOTO 0E3 |
.................... #include ".\hack.h" |
.................... #include <16F88.h> |
.................... //////// Standard Header file for the PIC16F88 device //////////////// |
.................... #device PIC16F88 |
.................... #list |
.................... |
.................... #device *=16 |
.................... #device ICD=TRUE |
.................... #device adc=8 |
.................... #fuses NOWDT,INTRC , NOPUT, MCLR, NOBROWNOUT, NOLVP, NOCPD, NOWRT, DEBUG, NOPROTECT, NOFCMEN, NOIESO |
.................... //#fuses NOWDT,INTRC_IO, NOPUT, MCLR, NOBROWNOUT, NOLVP, NOCPD, NOWRT, DEBUG, NOPROTECT, NOFCMEN, NOIESO |
.................... #use delay(clock=4000000,RESTART_WDT) |
* |
00E6: MOVLW 42 |
00E7: MOVWF 04 |
00E8: BCF 03.7 |
00E9: MOVF 00,W |
00EA: BTFSC 03.2 |
00EB: GOTO 0FD |
00EC: MOVLW 01 |
00ED: MOVWF 78 |
00EE: MOVLW BF |
00EF: MOVWF 77 |
00F0: CLRWDT |
00F1: DECFSZ 77,F |
00F2: GOTO 0F0 |
00F3: DECFSZ 78,F |
00F4: GOTO 0EE |
00F5: MOVLW 4A |
00F6: MOVWF 77 |
00F7: DECFSZ 77,F |
00F8: GOTO 0F7 |
00F9: NOP |
00FA: CLRWDT |
00FB: DECFSZ 00,F |
00FC: GOTO 0EC |
00FD: RETLW 00 |
.................... //#use rs232(baud=2400,xmit=PIN_B3) |
.................... //#use rs232(DEBUGGER) |
.................... #use rs232(baud=1200,parity=N,xmit=PIN_B3,rcv=PIN_B2,bits=8) |
00FE: BSF 03.5 |
00FF: BCF 06.3 |
0100: BCF 03.5 |
0101: BCF 06.3 |
0102: MOVLW 08 |
0103: MOVWF 78 |
0104: NOP |
0105: NOP |
0106: NOP |
0107: BSF 78.7 |
0108: GOTO 118 |
0109: BCF 78.7 |
010A: RRF 4C,F |
010B: BTFSC 03.0 |
010C: BSF 06.3 |
010D: BTFSS 03.0 |
010E: BCF 06.3 |
010F: BSF 78.6 |
0110: GOTO 118 |
0111: BCF 78.6 |
0112: DECFSZ 78,F |
0113: GOTO 10A |
0114: NOP |
0115: NOP |
0116: NOP |
0117: BSF 06.3 |
0118: MOVLW 01 |
0119: MOVWF 77 |
011A: CLRF 04 |
011B: DECFSZ 04,F |
011C: GOTO 11B |
011D: DECFSZ 77,F |
011E: GOTO 11A |
011F: MOVLW 0D |
0120: MOVWF 04 |
0121: DECFSZ 04,F |
0122: GOTO 121 |
0123: NOP |
0124: NOP |
0125: BTFSC 78.7 |
0126: GOTO 109 |
0127: BTFSC 78.6 |
0128: GOTO 111 |
0129: RETLW 00 |
012A: MOVF 04,W |
012B: MOVWF 78 |
012C: MOVLW 08 |
012D: MOVWF 77 |
012E: BSF 03.5 |
012F: BSF 06.2 |
0130: BCF 03.5 |
0131: BTFSS 06.2 |
0132: GOTO 135 |
0133: BSF 03.5 |
0134: GOTO 130 |
0135: CLRF 41 |
0136: BSF 77.7 |
0137: GOTO 148 |
0138: BCF 77.7 |
0139: GOTO 148 |
013A: BCF 03.0 |
013B: BTFSC 06.2 |
013C: BSF 03.0 |
013D: RRF 41,F |
013E: BSF 77.6 |
013F: GOTO 148 |
0140: BCF 77.6 |
0141: DECFSZ 77,F |
0142: GOTO 13A |
0143: MOVF 78,W |
0144: MOVWF 04 |
0145: MOVF 41,W |
0146: MOVWF 78 |
0147: GOTO 15D |
0148: MOVLW 01 |
0149: MOVWF 04 |
014A: MOVLW 00 |
014B: BTFSC 77.7 |
014C: MOVLW 55 |
014D: MOVWF 78 |
014E: DECFSZ 78,F |
014F: GOTO 14E |
0150: DECFSZ 04,F |
0151: GOTO 14A |
0152: MOVLW 0D |
0153: BTFSC 77.7 |
0154: MOVLW 03 |
0155: MOVWF 78 |
0156: DECFSZ 78,F |
0157: GOTO 156 |
0158: BTFSC 77.7 |
0159: GOTO 138 |
015A: BTFSC 77.6 |
015B: GOTO 140 |
015C: GOTO 13A |
015D: BCF 0A.3 |
015E: GOTO 3C1 (RETURN) |
.................... |
.................... |
.................... #include <stdlib.h> |
.................... /////////////////////////////////////////////////////////////////////////// |
.................... //// (C) Copyright 1996,2003 Custom Computer Services //// |
.................... //// This source code may only be used by licensed users of the CCS C //// |
.................... //// compiler. This source code may only be distributed to other //// |
.................... //// licensed users of the CCS C compiler. No other use, reproduction //// |
.................... //// or distribution is permitted without written permission. //// |
.................... //// Derivative programs created using this software in object code //// |
.................... //// form are not restricted in any way. //// |
.................... /////////////////////////////////////////////////////////////////////////// |
.................... |
.................... #ifndef _STDLIB |
.................... #define _STDLIB |
.................... |
.................... //--------------------------------------------------------------------------- |
.................... // Definitions and types |
.................... //--------------------------------------------------------------------------- |
.................... |
.................... #ifndef RAND_MAX |
.................... #define RAND_MAX 32767 // The value of which is the maximum value |
.................... // ... returned by the rand function |
.................... #endif |
.................... |
.................... typedef struct { |
.................... signed int quot; |
.................... signed int rem; |
.................... } div_t; |
.................... |
.................... typedef struct { |
.................... signed long quot; |
.................... signed long rem; |
.................... } ldiv_t; |
.................... |
.................... #include <stddef.h> |
.................... /////////////////////////////////////////////////////////////////////////// |
.................... //// (C) Copyright 1996,2003 Custom Computer Services //// |
.................... //// This source code may only be used by licensed users of the CCS C //// |
.................... //// compiler. This source code may only be distributed to other //// |
.................... //// licensed users of the CCS C compiler. No other use, reproduction //// |
.................... //// or distribution is permitted without written permission. //// |
.................... //// Derivative programs created using this software in object code //// |
.................... //// form are not restricted in any way. //// |
.................... /////////////////////////////////////////////////////////////////////////// |
.................... |
.................... #ifndef _STDDEF |
.................... |
.................... #define _STDDEF |
.................... |
.................... #if sizeof(int *)==1 |
.................... #define ptrdiff_t int |
.................... #else |
.................... #define ptrdiff_t long |
.................... #endif |
.................... |
.................... #define size_t int |
.................... #define wchar_t char |
.................... #define NULL 0 |
.................... |
.................... #define offsetof(s,f) (offsetofbit(s,f)/8) |
.................... |
.................... #endif |
.................... |
.................... |
.................... //--------------------------------------------------------------------------- |
.................... // String conversion functions |
.................... //--------------------------------------------------------------------------- |
.................... |
.................... /* Standard template: float atof(char * s) |
.................... * converts the initial portion of the string s to a float. |
.................... * returns the converted value if any, 0 otherwise |
.................... */ |
.................... float atof(char * s); |
.................... |
.................... /* Standard template: signed int atoi(char * s) |
.................... * converts the initial portion of the string s to a signed int |
.................... * returns the converted value if any, 0 otherwise |
.................... */ |
.................... signed int atoi(char *s); |
.................... |
.................... /* Syntax: signed int32 atoi32(char * s) |
.................... converts the initial portion of the string s to a signed int32 |
.................... returns the converted value if any, 0 otherwise*/ |
.................... signed int32 atoi32(char *s); |
.................... |
.................... /* Standard template: signed long atol(char * s) |
.................... * converts the initial portion of the string s to a signed long |
.................... * returns the converted value if any, 0 otherwise |
.................... */ |
.................... signed long atol(char *s); |
.................... |
.................... /* Standard template: float strtol(char * s,char *endptr) |
.................... * converts the initial portion of the string s to a float |
.................... * returns the converted value if any, 0 otherwise |
.................... * the final string is returned in the endptr, if endptr is not null |
.................... */ |
.................... float strtod(char *s,char *endptr); |
.................... |
.................... /* Standard template: long strtoul(char * s,char *endptr,signed int base) |
.................... * converts the initial portion of the string s, represented as an |
.................... * integral value of radix base to a signed long. |
.................... * Returns the converted value if any, 0 otherwise |
.................... * the final string is returned in the endptr, if endptr is not null |
.................... */ |
.................... signed long strtol(char *s,char *endptr,signed int base); |
.................... |
.................... /* Standard template: long strtoul(char * s,char *endptr,signed int base) |
.................... * converts the initial portion of the string s, represented as an |
.................... * integral value of radix base to a unsigned long. |
.................... * returns the converted value if any, 0 otherwise |
.................... * the final string is returned in the endptr, if endptr is not null |
.................... */ |
.................... long strtoul(char *s,char *endptr,signed int base); |
.................... |
.................... //--------------------------------------------------------------------------- |
.................... // Pseudo-random sequence generation functions |
.................... //--------------------------------------------------------------------------- |
.................... |
.................... /* The rand function computes a sequence of pseudo-random integers in |
.................... * the range 0 to RAND_MAX |
.................... * |
.................... * Parameters: |
.................... * (none) |
.................... * |
.................... * Returns: |
.................... * The pseudo-random integer |
.................... */ |
.................... long rand(void); |
.................... |
.................... /* The srand function uses the argument as a seed for a new sequence of |
.................... * pseudo-random numbers to be returned by subsequent calls to rand. |
.................... * |
.................... * Parameters: |
.................... * [in] seed: The seed value to start from. You might need to pass |
.................... * |
.................... * Returns: |
.................... * (none) |
.................... * |
.................... * Remarks |
.................... * The srand function sets the starting point for generating |
.................... * a series of pseudorandom integers. To reinitialize the |
.................... * generator, use 1 as the seed argument. Any other value for |
.................... * seed sets the generator to a random starting point. rand |
.................... * retrieves the pseudorandom numbers that are generated. |
.................... * Calling rand before any call to srand generates the same |
.................... * sequence as calling srand with seed passed as 1. |
.................... * Usually, you need to pass a time here from outer source |
.................... * so that the numbers will be different every time you run. |
.................... */ |
.................... void srand(unsigned int32 seed); |
.................... |
.................... //--------------------------------------------------------------------------- |
.................... // Memory management functions |
.................... //--------------------------------------------------------------------------- |
.................... |
.................... // Comming soon |
.................... |
.................... //--------------------------------------------------------------------------- |
.................... // Communication with the environment |
.................... //--------------------------------------------------------------------------- |
.................... |
.................... /* The function returns 0 always |
.................... */ |
.................... signed int system(char *string); |
.................... |
.................... //--------------------------------------------------------------------------- |
.................... // Searching and sorting utilities |
.................... //--------------------------------------------------------------------------- |
.................... |
.................... /* Performs a binary search of a sorted array.. |
.................... * |
.................... * Parameters: |
.................... * [in] key: Object to search for |
.................... * [in] base: Pointer to base of search data |
.................... * [in] num: Number of elements |
.................... * [in] width: Width of elements |
.................... * [in] compare: Function that compares two elements |
.................... * |
.................... * Returns: |
.................... * bsearch returns a pointer to an occurrence of key in the array pointed |
.................... * to by base. If key is not found, the function returns NULL. If the |
.................... * array is not in order or contains duplicate records with identical keys, |
.................... * the result is unpredictable. |
.................... */ |
.................... //void *bsearch(const void *key, const void *base, size_t num, size_t width, |
.................... // int (*compare)(const void *, const void *)); |
.................... |
.................... /* Performs the shell-metzner sort (not the quick sort algorithm). The contents |
.................... * of the array are sorted into ascending order according to a comparison |
.................... * function pointed to by compar. |
.................... * |
.................... * Parameters: |
.................... * [in] base: Pointer to base of search data |
.................... * [in] num: Number of elements |
.................... * [in] width: Width of elements |
.................... * [in] compare: Function that compares two elements |
.................... * |
.................... * Returns: |
.................... * (none) |
.................... */ |
.................... //void *qsort(const void *base, size_t num, size_t width, |
.................... // int (*compare)(const void *, const void *)); |
.................... |
.................... //--------------------------------------------------------------------------- |
.................... // Integer arithmetic functions |
.................... //--------------------------------------------------------------------------- |
.................... |
.................... #define labs abs |
.................... |
.................... div_t div(signed int numer,signed int denom); |
.................... ldiv_t ldiv(signed long numer,signed long denom); |
.................... |
.................... //--------------------------------------------------------------------------- |
.................... // Multibyte character functions |
.................... //--------------------------------------------------------------------------- |
.................... |
.................... // Not supported |
.................... |
.................... //--------------------------------------------------------------------------- |
.................... // Multibyte string functions |
.................... //--------------------------------------------------------------------------- |
.................... |
.................... // Not supported |
.................... |
.................... |
.................... //--------------------------------------------------------------------------- |
.................... // Internal implementation |
.................... //--------------------------------------------------------------------------- |
.................... |
.................... #include <stddef.h> |
.................... /////////////////////////////////////////////////////////////////////////// |
.................... //// (C) Copyright 1996,2003 Custom Computer Services //// |
.................... //// This source code may only be used by licensed users of the CCS C //// |
.................... //// compiler. This source code may only be distributed to other //// |
.................... //// licensed users of the CCS C compiler. No other use, reproduction //// |
.................... //// or distribution is permitted without written permission. //// |
.................... //// Derivative programs created using this software in object code //// |
.................... //// form are not restricted in any way. //// |
.................... /////////////////////////////////////////////////////////////////////////// |
.................... |
.................... #ifndef _STDDEF |
.................... |
.................... #define _STDDEF |
.................... |
.................... #if sizeof(int *)==1 |
.................... #define ptrdiff_t int |
.................... #else |
.................... #define ptrdiff_t long |
.................... #endif |
.................... |
.................... #define size_t int |
.................... #define wchar_t char |
.................... #define NULL 0 |
.................... |
.................... #define offsetof(s,f) (offsetofbit(s,f)/8) |
.................... |
.................... #endif |
.................... |
.................... #include <string.h> |
.................... //////////////////////////////////////////////////////////////////////////// |
.................... //// (C) Copyright 1996,2003 Custom Computer Services //// |
.................... //// This source code may only be used by licensed users of the CCS C //// |
.................... //// compiler. This source code may only be distributed to other //// |
.................... //// licensed users of the CCS C compiler. No other use, reproduction //// |
.................... //// or distribution is permitted without written permission. //// |
.................... //// Derivative programs created using this software in object code //// |
.................... //// form are not restricted in any way. //// |
.................... //////////////////////////////////////////////////////////////////////////// |
.................... |
.................... #ifndef _STRING |
.................... #define _STRING |
.................... #include <stddef.h> |
.................... /////////////////////////////////////////////////////////////////////////// |
.................... //// (C) Copyright 1996,2003 Custom Computer Services //// |
.................... //// This source code may only be used by licensed users of the CCS C //// |
.................... //// compiler. This source code may only be distributed to other //// |
.................... //// licensed users of the CCS C compiler. No other use, reproduction //// |
.................... //// or distribution is permitted without written permission. //// |
.................... //// Derivative programs created using this software in object code //// |
.................... //// form are not restricted in any way. //// |
.................... /////////////////////////////////////////////////////////////////////////// |
.................... |
.................... #ifndef _STDDEF |
.................... |
.................... #define _STDDEF |
.................... |
.................... #if sizeof(int *)==1 |
.................... #define ptrdiff_t int |
.................... #else |
.................... #define ptrdiff_t long |
.................... #endif |
.................... |
.................... #define size_t int |
.................... #define wchar_t char |
.................... #define NULL 0 |
.................... |
.................... #define offsetof(s,f) (offsetofbit(s,f)/8) |
.................... |
.................... #endif |
.................... |
.................... #include <ctype.h> |
.................... //////////////////////////////////////////////////////////////////////////// |
.................... //// (C) Copyright 1996,2003 Custom Computer Services //// |
.................... //// This source code may only be used by licensed users of the CCS C //// |
.................... //// compiler. This source code may only be distributed to other //// |
.................... //// licensed users of the CCS C compiler. No other use, reproduction //// |
.................... //// or distribution is permitted without written permission. //// |
.................... //// Derivative programs created using this software in object code //// |
.................... //// form are not restricted in any way. //// |
.................... //////////////////////////////////////////////////////////////////////////// |
.................... |
.................... #ifndef _CTYPE |
.................... #define _CTYPE |
.................... |
.................... #define islower(x) isamong(x,"abcdefghijklmnopqrstuvwxyz") |
.................... #define isupper(x) isamong(x,"ABCDEFGHIJKLMNOPQRSTUVWXYZ") |
.................... #define isalnum(x) isamong(x,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz") |
.................... #define isalpha(x) isamong(x,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz") |
.................... #define isdigit(x) isamong(x,"0123456789") |
.................... #define isspace(x) (x==' ') |
.................... #define isxdigit(x) isamong(x,"0123456789ABCDEFabcdef") |
.................... #define iscntrl(x) (x<' ') |
.................... #define isprint(x) (x>=' ') |
.................... #define isgraph(x) (x>' ') |
.................... #define ispunct(x) ((x>' ')&&!isalnum(x)) |
.................... |
.................... #endif |
.................... |
.................... |
.................... |
.................... |
.................... |
.................... ////////////////////////////////////////////// |
.................... //// Uncomment the following define to //// |
.................... //// allow some functions to use a //// |
.................... //// quicker algorithm, but use more ROM //// |
.................... //// //// |
.................... //// #define FASTER_BUT_MORE_ROM //// |
.................... ////////////////////////////////////////////// |
.................... |
.................... |
.................... |
.................... /*Copying functions*/ |
.................... /* standard template: |
.................... void *memmove(void *s1, void *s2, size_t n). |
.................... Copies max of n characters safely (not following ending '\0') |
.................... from s2 in s1; if s2 has less than n characters, appends 0 */ |
.................... |
.................... char *memmove(void *s1,char *s2,size_t n) |
.................... { |
.................... char *sc1; |
.................... char *sc2; |
.................... sc1=s1; |
.................... sc2=s2; |
.................... if(sc2<sc1 && sc1 <sc2 +n) |
.................... for(sc1+=n,sc2+=n;0<n;--n) |
.................... *--sc1=*--sc2; |
.................... else |
.................... for(;0<n;--n) |
.................... *sc1++=*sc2++; |
.................... return s1; |
.................... } |
.................... |
.................... /* compiler ignored the name 'strcpy()'; perhaps, it's reserved? |
.................... Standard template: char *strcpy(char *s1, const char *s2) |
.................... copies the string s2 including the null character to s1*/ |
.................... |
.................... char *strcopy(char *s1, char *s2) |
.................... { |
.................... char *s; |
.................... |
.................... for (s = s1; *s2 != 0; s++, s2++) { |
.................... *s = *s2; |
.................... } |
.................... *s = *s2; |
.................... return(s1); |
.................... } |
.................... |
.................... /* standard template: |
.................... char *strncpy(char *s1, const char *s2, size_t n). |
.................... Copies max of n characters (not following ending '\0') |
.................... from s2 in s1; if s2 has less than n characters, appends 0 */ |
.................... |
.................... char *strncpy(char *s1, char *s2, size_t n) |
.................... { |
.................... char *s; |
.................... |
.................... for (s = s1; n > 0 && *s2 != '\0'; n--) |
.................... *s++ = *s2++; |
.................... for (; n > 0; n--) |
.................... *s++ = '\0'; |
.................... |
.................... return(s1); |
.................... } |
.................... /***********************************************************/ |
.................... |
.................... /*concatenation functions*/ |
.................... /* standard template: char *strcat(char *s1, const char *s2) |
.................... appends s2 to s1*/ |
.................... |
.................... char *strcat(char *s1, char *s2) |
.................... { |
.................... char *s; |
.................... |
.................... for (s = s1; *s != '\0'; ++s); |
.................... while(*s2 != '\0') |
.................... { |
.................... *s = *s2; |
.................... ++s; |
.................... ++s2; |
.................... } |
.................... |
.................... *s = '\0'; |
.................... return(s1); |
.................... } |
.................... /* standard template: char *strncat(char *s1, char *s2,size_t n) |
.................... appends not more than n characters from s2 to s1*/ |
.................... |
.................... char *strncat(char *s1, char *s2, size_t n) |
.................... { |
.................... char *s; |
.................... |
.................... for (s = s1; *s != '\0'; ++s); |
.................... while(*s2 != '\0' && 0<n) |
.................... { |
.................... *s = *s2; |
.................... ++s; |
.................... ++s2; |
.................... --n; |
.................... } |
.................... |
.................... *s = '\0'; |
.................... return(s1); |
.................... } |
.................... |
.................... /***********************************************************/ |
.................... |
.................... |
.................... /*comparison functions*/ |
.................... /* standard template: signed int memcmp(void *s1, void *s2). |
.................... Compares s1 & s2; returns -1 if s1<s2, 0 if s1=s2, 1 if s1>s2 */ |
.................... |
.................... signed int memcmp(void * s1,char *s2,size_t n) |
.................... { |
.................... char *su1, *su2; |
.................... for(su1=s1, su2=s2; 0<n; ++su1, ++su2, --n) |
.................... { |
.................... if(*su1!=*su2) |
.................... return ((*su1<*su2)?1:+1); |
.................... } |
.................... return 0; |
.................... } |
.................... |
.................... /* standard template: int strcmp(const char *s1, const char *s2). |
.................... Compares s1 & s2; returns -1 if s1<s2, 0 if s1=s2, 1 if s1>s2 */ |
.................... |
.................... signed int strcmp(char *s1, char *s2) |
.................... { |
.................... for (; *s1 == *s2; s1++, s2++) |
.................... if (*s1 == '\0') |
.................... return(0); |
.................... return((*s1 < *s2) ?-1: 1); |
.................... } |
.................... /* standard template: int strcoll(const char *s1, const char *s2). |
.................... Compares s1 & s2; returns -1 if s1<s2, 0 if s1=s2, 1 if s1>s2 */ |
.................... |
.................... signed int strcoll(char *s1, char *s2) |
.................... { |
.................... for (; *s1 == *s2; s1++, s2++) |
.................... if (*s1 == '\0') |
.................... return(0); |
.................... return((*s1 < *s2) ?-1: 1); |
.................... } |
.................... |
.................... /* standard template: |
.................... int strncmp(const char *s1, const char *s2, size_t n). |
.................... Compares max of n characters (not following 0) from s1 to s2; |
.................... returns same as strcmp */ |
.................... |
.................... signed int strncmp(char *s1, char *s2, size_t n) |
.................... { |
.................... for (; n > 0; s1++, s2++, n--) |
.................... if (*s1 != *s2) |
.................... return((*s1 <*s2) ?-1: 1); |
.................... else if (*s1 == '\0') |
.................... return(0); |
.................... return(0); |
.................... } |
.................... /* standard template: |
.................... int strxfrm(const char *s1, const char *s2, size_t n). |
.................... transforms maximum of n characters from s2 and places them into s1*/ |
.................... size_t strxfrm(char *s1, char *s2, size_t n) |
.................... { |
.................... char *s; |
.................... int n1; |
.................... n1=n; |
.................... for (s = s1; n > 0 && *s2 != '\0'; n--) |
.................... *s++ = *s2++; |
.................... for (; n > 0; n--) |
.................... *s++ = '\0'; |
.................... |
.................... return(n1); |
.................... } |
.................... |
.................... |
.................... |
.................... |
.................... |
.................... /***********************************************************/ |
.................... /*Search functions*/ |
.................... /* standard template: void *memchr(const char *s, int c). |
.................... Finds first occurrence of c in n characters of s */ |
.................... |
.................... char *memchr(void *s,int c,size_t n) |
.................... { |
.................... char uc; |
.................... char *su; |
.................... uc=c; |
.................... for(su=s;0<n;++su,--n) |
.................... if(*su==uc) |
.................... return su; |
.................... return NULL; |
.................... } |
.................... |
.................... /* standard template: char *strchr(const char *s, int c). |
.................... Finds first occurrence of c in s */ |
.................... |
.................... char *strchr(char *s, int c) |
.................... { |
.................... for (; *s != c; s++) |
.................... if (*s == '\0') |
.................... return(0); |
.................... return(s); |
.................... } |
.................... /* standard template: |
.................... size_t strcspn(const char *s1, const char *s2). |
.................... Computes length of max initial segment of s1 that |
.................... consists entirely of characters NOT from s2*/ |
.................... |
.................... int *strcspn(char *s1, char *s2) |
.................... { |
.................... char *sc1, *sc2; |
.................... |
.................... for (sc1 = s1; *sc1 != 0; sc1++) |
.................... for (sc2 = s2; *sc2 != 0; sc2++) |
.................... if (*sc1 == *sc2) |
.................... return(sc1 - s1); |
.................... return(sc1 - s1); |
.................... } |
.................... /* standard template: |
.................... char *strpbrk(const char *s1, const char *s2). |
.................... Locates first occurence of any character from s2 in s1; |
.................... returns s1 if s2 is empty string */ |
.................... |
.................... char *strpbrk(char *s1, char *s2) |
.................... { |
.................... char *sc1, *sc2; |
.................... |
.................... for (sc1 = s1; *sc1 != 0; sc1++) |
.................... for (sc2 = s2; *sc2 != 0; sc2++) |
.................... if (*sc1 == *sc2) |
.................... return(sc1); |
.................... return(0); |
.................... } |
.................... |
.................... |
.................... /* standard template: char *strrchr(const char *s, int c). |
.................... Finds last occurrence of c in s */ |
.................... |
.................... char *strrchr(char *s, int c) |
.................... { |
.................... char *p; |
.................... |
.................... for (p = 0; ; s++) |
.................... { |
.................... if (*s == c) |
.................... p = s; |
.................... if (*s == '\0') |
.................... return(p); |
.................... } |
.................... } |
.................... /* computes length of max initial segment of s1 consisting |
.................... entirely of characters from s2 */ |
.................... |
.................... int *strspn(char *s1, char *s2) |
.................... { |
.................... char *sc1, *sc2; |
.................... |
.................... for (sc1 = s1; *sc1 != 0; sc1++) |
.................... for (sc2 = s2; ; sc2++) |
.................... if (*sc2 == '\0') |
.................... return(sc1 - s1); |
.................... else if (*sc1 == *sc2) |
.................... break; |
.................... return(sc1 - s1); |
.................... } |
.................... /* standard template: |
.................... char *strstr(const char *s1, const char *s2); |
.................... Locates first occurence of character sequence s2 in s1; |
.................... returns 0 if s2 is empty string |
.................... |
.................... Uncomment #define FASTER_BUT_MORE_ROM at the top of the |
.................... file to use the faster algorithm */ |
.................... char *strstr(char *s1, char *s2) |
.................... { |
.................... char *s, *t; |
.................... |
.................... #ifdef FASTER_BUT_MORE_ROM |
.................... if (*s2 == '\0') |
.................... return(s1); |
.................... #endif |
.................... |
.................... while (*s1) |
.................... { |
.................... for(s = s1, t = s2; *t && *s == *t; ++s, ++t); |
.................... |
.................... if (*t == '\0') |
.................... return s1; |
.................... ++s1; |
.................... #ifdef FASTER_BUT_MORE_ROM |
.................... while(*s1 != '\0' && *s1 != *s2) |
.................... ++s1; |
.................... #endif |
.................... } |
.................... return 0; |
.................... } |
.................... |
.................... /* standard template: char *strtok(char *s1, const char *s2). |
.................... |
.................... Finds next token in s1 delimited by a character from separator |
.................... string s2 (which can be different from call to call). First call |
.................... starts at beginning of s1 searching for first character NOT |
.................... contained in s2; returns 0 if none is found. |
.................... If one is found, it is the start of first token (return value). |
.................... Function then searches from there for a character contained in s2. |
.................... If none is found, current token extends to end of s1, and subsequent |
.................... searches for a token will return 0. If one is found, it is |
.................... overwritten by '\0', which terminates current token. Function saves |
.................... pointer to following character from which next search will start. |
.................... Each subsequent call, with 0 as first argument, starts searching |
.................... from saved pointer */ |
.................... |
.................... char *strtok(char *s1, char *s2) |
.................... { |
.................... char *beg, *end; |
.................... static char *save; |
* |
0359: CLRF 29 |
035A: CLRF 2A |
.................... |
.................... beg = (s1)?s1: save; |
.................... beg += strspn(beg, s2); |
.................... if (*beg == '\0') |
.................... { |
.................... *save = ' '; |
.................... return(0); |
.................... } |
.................... end = strpbrk(beg, s2); |
.................... if (*end != '\0') |
.................... { |
.................... *end = '\0'; |
.................... end++; |
.................... } |
.................... save = end; |
.................... return(beg); |
.................... } |
.................... |
.................... /*****************************************************************/ |
.................... /*Miscellaneous functions*/ |
.................... /* standard template |
.................... maps error number in errnum to an error message string |
.................... Returns: Pointer to string |
.................... */ |
.................... #ifdef _ERRNO |
.................... char * strerror(int errnum) |
.................... { |
.................... char s[15]; |
.................... switch( errnum) |
.................... { |
.................... case 0: |
.................... strcpy(s,"no errors"); |
.................... return s; |
.................... case EDOM : |
.................... strcpy(s,"domain error"); |
.................... return s; |
.................... case ERANGE: |
.................... strcpy(s,"range error"); |
.................... return s; |
.................... } |
.................... } |
.................... #ENDIF |
.................... /* standard template: size_t strlen(const char *s). |
.................... Computes length of s1 (preceding terminating 0) */ |
.................... |
.................... int *strlen(char *s) |
.................... { |
.................... char *sc; |
.................... |
.................... for (sc = s; *sc != 0; sc++); |
.................... return(sc - s); |
.................... } |
.................... |
.................... /* standard template: size_t stricmp(const char *s1, const char *s2). |
.................... Compares s1 to s2 ignoring case (upper vs. lower) */ |
.................... |
.................... signed int stricmp(char *s1, char *s2) |
.................... { |
.................... for(; *s1==*s2||(isalpha(*s1)&&isalpha(*s2)&&(*s1==*s2+32||*s2==*s1+32)); |
.................... s1++, s2++) |
.................... if (*s1 == '\0') |
.................... return(0); |
.................... return((*s1 < *s2) ?-1: 1); |
.................... } |
.................... |
.................... |
.................... /* standard template: char *strlwr(char *s). |
.................... Replaces uppercase letters by lowercase; |
.................... returns pointer to new string s */ |
.................... |
.................... char *strlwr(char *s) |
.................... { |
.................... char *p; |
.................... |
.................... for (p = s; *p != '\0'; p++) |
.................... if (*p >= 'A' && *p <='Z') |
.................... *p += 'a' - 'A'; |
.................... return(s); |
.................... } |
.................... |
.................... |
.................... /************************************************************/ |
.................... |
.................... |
.................... #endif |
.................... |
.................... |
.................... div_t div(signed int numer,signed int denom) |
.................... { |
.................... div_t val; |
.................... val.quot = numer / denom; |
.................... val.rem = numer - (denom * val.quot); |
.................... return (val); |
.................... } |
.................... |
.................... ldiv_t ldiv(signed long numer,signed long denom) |
.................... { |
.................... ldiv_t val; |
.................... val.quot = numer / denom; |
.................... val.rem = numer - (denom * val.quot); |
.................... return (val); |
.................... } |
.................... |
.................... float atof(char * s) |
.................... { |
.................... float pow10 = 1.0; |
.................... float result = 0.0; |
.................... int sign = 0; |
.................... char c; |
.................... int ptr = 0; |
.................... |
.................... c = s[ptr++]; |
.................... |
.................... if ((c>='0' && c<='9') || c=='+' || c=='-' || c=='.') { |
.................... if(c == '-') { |
.................... sign = 1; |
.................... c = s[ptr++]; |
.................... } |
.................... if(c == '+') |
.................... c = s[ptr++]; |
.................... |
.................... while((c >= '0' && c <= '9')) { |
.................... result = 10*result + c - '0'; |
.................... c = s[ptr++]; |
.................... } |
.................... |
.................... if (c == '.') { |
.................... c = s[ptr++]; |
.................... while((c >= '0' && c <= '9')) { |
.................... pow10 = pow10*10; |
.................... result += (c - '0')/pow10; |
.................... c = s[ptr++]; |
.................... } |
.................... } |
.................... |
.................... } |
.................... |
.................... if (sign == 1) |
.................... result = -1*result; |
.................... return(result); |
.................... } |
.................... |
.................... signed int atoi(char *s) |
.................... { |
.................... signed int result; |
.................... int sign, base, index; |
.................... char c; |
.................... |
.................... index = 0; |
.................... sign = 0; |
.................... base = 10; |
.................... result = 0; |
.................... |
.................... if (!s) |
.................... return 0; |
.................... // Omit all preceeding alpha characters |
.................... c = s[index++]; |
.................... |
.................... // increase index if either positive or negative sign is detected |
.................... if (c == '-') |
.................... { |
.................... sign = 1; // Set the sign to negative |
.................... c = s[index++]; |
.................... } |
.................... else if (c == '+') |
.................... { |
.................... c = s[index++]; |
.................... } |
.................... |
.................... if (c >= '0' && c <= '9') |
.................... { |
.................... |
.................... // Check for hexa number |
.................... if (c == '0' && (s[index] == 'x' || s[index] == 'X')) |
.................... { |
.................... base = 16; |
.................... index++; |
.................... c = s[index++]; |
.................... } |
.................... |
.................... // The number is a decimal number |
.................... if (base == 10) |
.................... { |
.................... while (c >= '0' && c <= '9') |
.................... { |
.................... result = 10*result + (c - '0'); |
.................... c = s[index++]; |
.................... } |
.................... } |
.................... else if (base == 16) // The number is a hexa number |
.................... { |
.................... c = toupper(c); |
.................... while ( (c >= '0' && c <= '9') || (c >= 'A' && c<='F')) |
.................... { |
.................... if (c >= '0' && c <= '9') |
.................... result = (result << 4) + (c - '0'); |
.................... else |
.................... result = (result << 4) + (c - 'A' + 10); |
.................... |
.................... c = s[index++]; |
.................... c = toupper(c); |
.................... } |
.................... } |
.................... } |
.................... |
.................... if (sign == 1 && base == 10) |
.................... result = -result; |
.................... |
.................... return(result); |
.................... } |
.................... |
.................... signed long atol(char *s) |
.................... { |
.................... signed long result; |
.................... int sign, base, index; |
.................... char c; |
.................... |
.................... index = 0; |
* |
0242: CLRF 47 |
.................... sign = 0; |
0243: CLRF 45 |
.................... base = 10; |
0244: MOVLW 0A |
0245: MOVWF 46 |
.................... result = 0; |
0246: CLRF 44 |
0247: CLRF 43 |
.................... |
.................... if (!s) |
0248: MOVF 41,W |
0249: IORWF 42,W |
024A: BTFSS 03.2 |
024B: GOTO 250 |
.................... return 0; |
024C: MOVLW 00 |
024D: MOVWF 78 |
024E: MOVWF 79 |
024F: GOTO 341 |
.................... c = s[index++]; |
0250: MOVF 47,W |
0251: INCF 47,F |
0252: ADDWF 41,W |
0253: MOVWF 04 |
0254: BCF 03.7 |
0255: BTFSC 42.0 |
0256: BSF 03.7 |
0257: MOVF 00,W |
0258: MOVWF 48 |
.................... |
.................... // increase index if either positive or negative sign is detected |
.................... if (c == '-') |
0259: MOVF 48,W |
025A: SUBLW 2D |
025B: BTFSS 03.2 |
025C: GOTO 269 |
.................... { |
.................... sign = 1; // Set the sign to negative |
025D: MOVLW 01 |
025E: MOVWF 45 |
.................... c = s[index++]; |
025F: MOVF 47,W |
0260: INCF 47,F |
0261: ADDWF 41,W |
0262: MOVWF 04 |
0263: BCF 03.7 |
0264: BTFSC 42.0 |
0265: BSF 03.7 |
0266: MOVF 00,W |
0267: MOVWF 48 |
.................... } |
.................... else if (c == '+') |
0268: GOTO 276 |
0269: MOVF 48,W |
026A: SUBLW 2B |
026B: BTFSS 03.2 |
026C: GOTO 276 |
.................... { |
.................... c = s[index++]; |
026D: MOVF 47,W |
026E: INCF 47,F |
026F: ADDWF 41,W |
0270: MOVWF 04 |
0271: BCF 03.7 |
0272: BTFSC 42.0 |
0273: BSF 03.7 |
0274: MOVF 00,W |
0275: MOVWF 48 |
.................... } |
.................... |
.................... if (c >= '0' && c <= '9') |
0276: MOVF 48,W |
0277: SUBLW 2F |
0278: BTFSC 03.0 |
0279: GOTO 332 |
027A: MOVF 48,W |
027B: SUBLW 39 |
027C: BTFSS 03.0 |
027D: GOTO 332 |
.................... { |
.................... if (c == '0' && (s[index] == 'x' || s[index] == 'X')) |
027E: MOVF 48,W |
027F: SUBLW 30 |
0280: BTFSS 03.2 |
0281: GOTO 2A2 |
0282: MOVF 47,W |
0283: ADDWF 41,W |
0284: MOVWF 04 |
0285: BCF 03.7 |
0286: BTFSC 42.0 |
0287: BSF 03.7 |
0288: MOVF 00,W |
0289: SUBLW 78 |
028A: BTFSC 03.2 |
028B: GOTO 296 |
028C: MOVF 47,W |
028D: ADDWF 41,W |
028E: MOVWF 04 |
028F: BCF 03.7 |
0290: BTFSC 42.0 |
0291: BSF 03.7 |
0292: MOVF 00,W |
0293: SUBLW 58 |
0294: BTFSS 03.2 |
0295: GOTO 2A2 |
.................... { |
.................... base = 16; |
0296: MOVLW 10 |
0297: MOVWF 46 |
.................... index++; |
0298: INCF 47,F |
.................... c = s[index++]; |
0299: MOVF 47,W |
029A: INCF 47,F |
029B: ADDWF 41,W |
029C: MOVWF 04 |
029D: BCF 03.7 |
029E: BTFSC 42.0 |
029F: BSF 03.7 |
02A0: MOVF 00,W |
02A1: MOVWF 48 |
.................... } |
.................... |
.................... // The number is a decimal number |
.................... if (base == 10) |
02A2: MOVF 46,W |
02A3: SUBLW 0A |
02A4: BTFSS 03.2 |
02A5: GOTO 2C9 |
.................... { |
.................... while (c >= '0' && c <= '9') |
.................... { |
02A6: MOVF 48,W |
02A7: SUBLW 2F |
02A8: BTFSC 03.0 |
02A9: GOTO 2C8 |
02AA: MOVF 48,W |
02AB: SUBLW 39 |
02AC: BTFSS 03.0 |
02AD: GOTO 2C8 |
.................... result = 10*result + (c - '0'); |
02AE: CLRF 4A |
02AF: MOVLW 0A |
02B0: MOVWF 49 |
02B1: MOVF 44,W |
02B2: MOVWF 4C |
02B3: MOVF 43,W |
02B4: MOVWF 4B |
02B5: GOTO 22C |
02B6: MOVLW 30 |
02B7: SUBWF 48,W |
02B8: ADDWF 78,W |
02B9: MOVWF 43 |
02BA: MOVF 79,W |
02BB: MOVWF 44 |
02BC: BTFSC 03.0 |
02BD: INCF 44,F |
.................... c = s[index++]; |
02BE: MOVF 47,W |
02BF: INCF 47,F |
02C0: ADDWF 41,W |
02C1: MOVWF 04 |
02C2: BCF 03.7 |
02C3: BTFSC 42.0 |
02C4: BSF 03.7 |
02C5: MOVF 00,W |
02C6: MOVWF 48 |
.................... } |
02C7: GOTO 2A6 |
.................... } |
.................... else if (base == 16) // The number is a hexa number |
02C8: GOTO 332 |
02C9: MOVF 46,W |
02CA: SUBLW 10 |
02CB: BTFSS 03.2 |
02CC: GOTO 332 |
.................... { |
.................... c = toupper(c); |
02CD: MOVF 48,W |
02CE: SUBLW 60 |
02CF: BTFSC 03.0 |
02D0: GOTO 2D8 |
02D1: MOVF 48,W |
02D2: SUBLW 7A |
02D3: BTFSS 03.0 |
02D4: GOTO 2D8 |
02D5: MOVF 48,W |
02D6: ANDLW DF |
02D7: GOTO 2D9 |
02D8: MOVF 48,W |
02D9: MOVWF 48 |
.................... while ( (c >= '0' && c <= '9') || (c >= 'A' && c <='F')) |
.................... { |
02DA: MOVF 48,W |
02DB: SUBLW 2F |
02DC: BTFSC 03.0 |
02DD: GOTO 2E2 |
02DE: MOVF 48,W |
02DF: SUBLW 39 |
02E0: BTFSC 03.0 |
02E1: GOTO 2EA |
02E2: MOVF 48,W |
02E3: SUBLW 40 |
02E4: BTFSC 03.0 |
02E5: GOTO 332 |
02E6: MOVF 48,W |
02E7: SUBLW 46 |
02E8: BTFSS 03.0 |
02E9: GOTO 332 |
.................... if (c >= '0' && c <= '9') |
02EA: MOVF 48,W |
02EB: SUBLW 2F |
02EC: BTFSC 03.0 |
02ED: GOTO 307 |
02EE: MOVF 48,W |
02EF: SUBLW 39 |
02F0: BTFSS 03.0 |
02F1: GOTO 307 |
.................... result = (result << 4) + (c - '0'); |
02F2: RLF 43,W |
02F3: MOVWF 49 |
02F4: RLF 44,W |
02F5: MOVWF 4A |
02F6: RLF 49,F |
02F7: RLF 4A,F |
02F8: RLF 49,F |
02F9: RLF 4A,F |
02FA: RLF 49,F |
02FB: RLF 4A,F |
02FC: MOVLW F0 |
02FD: ANDWF 49,F |
02FE: MOVLW 30 |
02FF: SUBWF 48,W |
0300: ADDWF 49,W |
0301: MOVWF 43 |
0302: MOVF 4A,W |
0303: MOVWF 44 |
0304: BTFSC 03.0 |
0305: INCF 44,F |
.................... else |
0306: GOTO 31C |
.................... result = (result << 4) + (c - 'A' + 10); |
0307: RLF 43,W |
0308: MOVWF 49 |
0309: RLF 44,W |
030A: MOVWF 4A |
030B: RLF 49,F |
030C: RLF 4A,F |
030D: RLF 49,F |
030E: RLF 4A,F |
030F: RLF 49,F |
0310: RLF 4A,F |
0311: MOVLW F0 |
0312: ANDWF 49,F |
0313: MOVLW 41 |
0314: SUBWF 48,W |
0315: ADDLW 0A |
0316: ADDWF 49,W |
0317: MOVWF 43 |
0318: MOVF 4A,W |
0319: MOVWF 44 |
031A: BTFSC 03.0 |
031B: INCF 44,F |
.................... |
.................... c = s[index++];c = toupper(c); |
031C: MOVF 47,W |
031D: INCF 47,F |
031E: ADDWF 41,W |
031F: MOVWF 04 |
0320: BCF 03.7 |
0321: BTFSC 42.0 |
0322: BSF 03.7 |
0323: MOVF 00,W |
0324: MOVWF 48 |
0325: SUBLW 60 |
0326: BTFSC 03.0 |
0327: GOTO 32F |
0328: MOVF 48,W |
0329: SUBLW 7A |
032A: BTFSS 03.0 |
032B: GOTO 32F |
032C: MOVF 48,W |
032D: ANDLW DF |
032E: GOTO 330 |
032F: MOVF 48,W |
0330: MOVWF 48 |
.................... } |
0331: GOTO 2DA |
.................... } |
.................... } |
.................... |
.................... if (base == 10 && sign == 1) |
0332: MOVF 46,W |
0333: SUBLW 0A |
0334: BTFSS 03.2 |
0335: GOTO 33D |
0336: DECFSZ 45,W |
0337: GOTO 33D |
.................... result = -result; |
0338: COMF 43,F |
0339: COMF 44,F |
033A: INCF 43,F |
033B: BTFSC 03.2 |
033C: INCF 44,F |
.................... |
.................... return(result); |
033D: MOVF 43,W |
033E: MOVWF 78 |
033F: MOVF 44,W |
0340: MOVWF 79 |
.................... } |
0341: RETLW 00 |
.................... |
.................... /* A fast routine to multiply by 10 |
.................... */ |
.................... signed int32 mult_with10(int32 num) |
.................... { |
.................... return ( (num << 1) + (num << 3) ); |
.................... } |
.................... |
.................... signed int32 atoi32(char *s) |
.................... { |
.................... signed int32 result; |
.................... int sign, base, index; |
.................... char c; |
.................... |
.................... index = 0; |
.................... sign = 0; |
.................... base = 10; |
.................... result = 0; |
.................... |
.................... if (!s) |
.................... return 0; |
.................... c = s[index++]; |
.................... |
.................... // increase index if either positive or negative sign is detected |
.................... if (c == '-') |
.................... { |
.................... sign = 1; // Set the sign to negative |
.................... c = s[index++]; |
.................... } |
.................... else if (c == '+') |
.................... { |
.................... c = s[index++]; |
.................... } |
.................... |
.................... if (c >= '0' && c <= '9') |
.................... { |
.................... if (c == '0' && (s[index] == 'x' || s[index] == 'X')) |
.................... { |
.................... base = 16; |
.................... index++; |
.................... c = s[index++]; |
.................... } |
.................... |
.................... // The number is a decimal number |
.................... if (base == 10) |
.................... { |
.................... while (c >= '0' && c <= '9') { |
.................... result = (result << 1) + (result << 3); // result *= 10; |
.................... result += (c - '0'); |
.................... c = s[index++]; |
.................... } |
.................... } |
.................... else if (base == 16) // The number is a hexa number |
.................... { |
.................... c = toupper(c); |
.................... while ((c >= '0' && c <= '9') || (c >= 'A' && c <='F')) |
.................... { |
.................... if (c >= '0' && c <= '9') |
.................... result = (result << 4) + (c - '0'); |
.................... else |
.................... result = (result << 4) + (c - 'A' + 10); |
.................... |
.................... c = s[index++];c = toupper(c); |
.................... } |
.................... } |
.................... } |
.................... |
.................... if (base == 10 && sign == 1) |
.................... result = -result; |
.................... |
.................... return(result); |
.................... } |
.................... |
.................... float strtod(char *s,char *endptr) { |
.................... float pow10 = 1.0; |
.................... float result = 0.0; |
.................... int sign = 0, point = 0; |
.................... char c; |
.................... int ptr = 0; |
.................... |
.................... if (!s) |
.................... return 0; |
.................... c=s[ptr++]; |
.................... |
.................... |
.................... while((c>='0' && c<='9') || c=='+' || c=='-' || c=='.') { |
.................... if(c == '-') { |
.................... sign = 1; |
.................... c = s[ptr++]; |
.................... } |
.................... |
.................... while((c >= '0' && c <= '9') && point == 0) { |
.................... result = 10*result + c - '0'; |
.................... c = s[ptr++]; |
.................... } |
.................... |
.................... if (c == '.') { |
.................... point = 1; |
.................... c = s[ptr++]; |
.................... } |
.................... |
.................... while((c >= '0' && c <= '9') && point == 1) { |
.................... pow10 = pow10*10; |
.................... result += (c - '0')/pow10; |
.................... c = s[ptr++]; |
.................... } |
.................... |
.................... if (c == '+') { |
.................... c = s[ptr++]; |
.................... } |
.................... } |
.................... |
.................... if (sign == 1) |
.................... result = -1*result; |
.................... if(endptr) |
.................... { |
.................... if (ptr) { |
.................... ptr--; |
.................... *((char *)endptr)=s+ptr; |
.................... } |
.................... else |
.................... *((char *)endptr)=s; |
.................... } |
.................... |
.................... return(result); |
.................... } |
.................... |
.................... long strtoul(char *s,char *endptr,signed int base) |
.................... { |
.................... char *sc,*s1,*sd; |
.................... unsigned long x=0; |
.................... char sign; |
.................... char digits[]="0123456789abcdefghijklmnopqstuvwxyz"; |
.................... for(sc=s;isspace(*sc);++sc); |
.................... sign=*sc=='-'||*sc=='+'?sc++:'+'; |
.................... if(sign=='-') |
.................... { |
.................... if (endptr) |
.................... { |
.................... *((char *)endptr)=s; |
.................... } |
.................... return 0; |
.................... } |
.................... |
.................... if (base <0 || base ==1|| base >36) // invalid base |
.................... { |
.................... if (endptr) |
.................... { |
.................... *((char *)endptr)=s; |
.................... } |
.................... return 0; |
.................... } |
.................... else if (base) |
.................... { |
.................... if(base==16 && *sc =='0'&&(sc[1]=='x' || sc[1]=='X')) |
.................... sc+=2; |
.................... if(base==8 && *sc =='0') |
.................... sc+=1; |
.................... if(base==2 && *sc =='0'&&sc[1]=='b') |
.................... sc+=2; |
.................... |
.................... } |
.................... else if(*sc!='0') // base is 0, find base |
.................... base=10; |
.................... else if (sc[1]=='x' || sc[1]=='X') |
.................... base =16,sc+=2; |
.................... else if(sc[1]=='b') |
.................... base=2,sc+=2; |
.................... else |
.................... base=8; |
.................... for (s1=sc;*sc=='0';++sc);// skip leading zeroes |
.................... sd=memchr(digits,tolower(*sc),base); |
.................... for(; sd!=0; ) |
.................... { |
.................... x=x*base+(int16)(sd-digits); |
.................... ++sc; |
.................... sd=memchr(digits,tolower(*sc),base); |
.................... } |
.................... if(s1==sc) |
.................... { |
.................... if (endptr) |
.................... { |
.................... *((char *)endptr)=s; |
.................... } |
.................... return 0; |
.................... } |
.................... if (endptr) |
.................... *((char *)endptr)=sc; |
.................... return x; |
.................... } |
.................... |
.................... |
.................... signed long strtol(char *s,char *endptr,signed int base) |
.................... { |
.................... char *sc,*s1,*sd; |
.................... signed long x=0; |
.................... char sign; |
.................... char digits[]="0123456789abcdefghijklmnopqstuvwxyz"; |
.................... for(sc=s;isspace(*sc);++sc); |
.................... sign=*sc=='-'||*sc=='+'?sc++:'+'; |
.................... if (base <0 || base ==1|| base >36) // invalid base |
.................... { |
.................... if (endptr) |
.................... { |
.................... *((char *)endptr)=s; |
.................... } |
.................... return 0; |
.................... } |
.................... else if (base) |
.................... { |
.................... if(base==16 && *sc =='0'&&(sc[1]=='x' || sc[1]=='X')) |
.................... sc+=2; |
.................... if(base==8 && *sc =='0') |
.................... sc+=1; |
.................... if(base==2 && *sc =='0'&&sc[1]=='b') |
.................... sc+=2; |
.................... |
.................... } |
.................... else if(*sc!='0') // base is 0, find base |
.................... base=10; |
.................... else if (sc[1]=='x' || sc[1]=='X') |
.................... base =16,sc+=2; |
.................... else if(sc[1]=='b') |
.................... base=2,sc+=2; |
.................... else |
.................... base=8; |
.................... for (s1=sc;*sc=='0';++sc);// skip leading zeroes |
.................... |
.................... sd=memchr(digits,tolower(*sc),base); |
.................... for(;sd!=0;) |
.................... { |
.................... x=x*base+(int16)(sd-digits); |
.................... ++sc; |
.................... sd=memchr(digits,tolower(*sc),base); |
.................... } |
.................... if(s1==sc) |
.................... { |
.................... if (endptr) |
.................... { |
.................... *((char *)endptr)=s; |
.................... } |
.................... return 0; |
.................... } |
.................... if(sign=='-') |
.................... x =-x; |
.................... if (endptr) |
.................... *((char *)endptr)=sc; |
.................... return x; |
.................... } |
.................... |
.................... signed int system(char *string) |
.................... { |
.................... return 0; |
.................... } |
.................... |
.................... int mblen(char *s,size_t n) |
.................... { |
.................... return strlen(s); |
.................... } |
.................... |
.................... int mbtowc(wchar_t *pwc,char *s,size_t n) |
.................... { |
.................... *pwc=*s; |
.................... return 1; |
.................... } |
.................... |
.................... int wctomb(char *s,wchar_t wchar) |
.................... { |
.................... *s=wchar; |
.................... return 1; |
.................... } |
.................... |
.................... size_t mbstowcs(wchar_t *pwcs,char *s,size_t n) |
.................... { |
.................... strncpy(pwcs,s,n); |
.................... return strlen(pwcs); |
.................... } |
.................... |
.................... size_t wcstombs(char *s,wchar_t *pwcs,size_t n) |
.................... { |
.................... strncpy(s,pwcs,n); |
.................... return strlen(s); |
.................... } |
.................... |
.................... //--------------------------------------------------------------------------- |
.................... // The random number implementation |
.................... //--------------------------------------------------------------------------- |
.................... |
.................... unsigned int32 _Randseed = 1; |
* |
035B: MOVLW 01 |
035C: MOVWF 2B |
035D: CLRF 2C |
035E: CLRF 2D |
035F: CLRF 2E |
.................... |
.................... long rand(void) |
.................... { |
.................... _Randseed = _Randseed * 1103515245 + 12345; |
.................... return ((unsigned long)(_Randseed >> 16) % RAND_MAX); |
.................... } |
.................... |
.................... void srand(unsigned int32 seed) |
.................... { |
.................... _Randseed = seed; |
.................... } |
.................... |
.................... //--------------------------------------------------------------------------- |
.................... // Searching and sorting utilities implementation |
.................... //--------------------------------------------------------------------------- |
.................... |
.................... typedef signed int (*_Cmpfun)(char * p1,char * p2); |
.................... |
.................... void qsort(char * qdata, int qitems, int qsize, _Cmpfun cmp) { |
.................... int m,j,i,l; |
.................... short done; |
.................... BYTE t[16]; |
.................... |
.................... m = qitems/2; |
.................... while( m > 0 ) { |
.................... for(j=0; j<(qitems-m); ++j) { |
.................... i = j; |
.................... do |
.................... { |
.................... done=TRUE; |
.................... l = i+m; |
.................... if( (*cmp)(qdata+i*qsize, qdata+l*qsize) > 0 ) { |
.................... memcpy(t, qdata+i*qsize, qsize); |
.................... memcpy(qdata+i*qsize, qdata+l*qsize, qsize); |
.................... memcpy(qdata+l*qsize, t, qsize); |
.................... if(m <= i) |
.................... i -= m; |
.................... done = FALSE; |
.................... } |
.................... } while(!done); |
.................... } |
.................... m = m/2; |
.................... } |
.................... } |
.................... |
.................... |
.................... char *bsearch(char *key, char *base, size_t num, size_t width,_Cmpfun cmp) |
.................... { |
.................... char *p, *q; |
.................... size_t n; |
.................... size_t pivot; |
.................... signed int val; |
.................... |
.................... p = base; |
.................... n = num; |
.................... |
.................... while (n > 0) |
.................... { |
.................... pivot = n >> 1; |
.................... q = p + width * pivot; |
.................... |
.................... val = (*cmp)(key, q); |
.................... |
.................... if (val < 0) |
.................... n = pivot; |
.................... else if (val == 0) |
.................... return ((char *)q); |
.................... else { |
.................... p = q + width; |
.................... n -= pivot + 1; |
.................... } |
.................... } |
.................... |
.................... return NULL; // There's no match |
.................... } |
.................... |
.................... |
.................... #endif |
.................... |
.................... |
.................... #define SYNC PIN_B4 // Spousteni oscyloskopu |
.................... #define HACK PIN_B5 // Zkratovani napajeni SmartCard |
.................... #define CLOCK PIN_B6 // Hodiny ze SmartCard |
.................... |
.................... #int_TIMER1 |
.................... TIMER1_isr() |
.................... { |
.................... |
.................... } |
.................... |
* |
00E0: BCF 0C.0 |
00E1: BCF 0A.3 |
00E2: GOTO 028 |
.................... #int_TIMER2 |
.................... TIMER2_isr() |
.................... { |
.................... |
.................... } |
.................... |
00E3: BCF 0C.1 |
00E4: BCF 0A.3 |
00E5: GOTO 028 |
.................... void main() |
.................... { |
* |
0342: CLRF 04 |
0343: BCF 03.7 |
0344: MOVLW 1F |
0345: ANDWF 03,F |
0346: BSF 03.5 |
0347: BCF 1F.4 |
0348: BCF 1F.5 |
0349: MOVF 1B,W |
034A: ANDLW 80 |
034B: MOVWF 1B |
034C: MOVLW 07 |
034D: MOVWF 1C |
034E: MOVF 05,W |
034F: CLRWDT |
0350: MOVF 1C,W |
0351: BCF 03.5 |
0352: BCF 0D.6 |
0353: MOVLW 60 |
0354: BSF 03.5 |
0355: MOVWF 0F |
0356: BCF 06.3 |
0357: BCF 03.5 |
0358: BSF 06.3 |
.................... unsigned int16 i; |
.................... char ch; |
.................... char string[10]; |
.................... const char ver[]={"HACK v1.0\0"}; |
.................... unsigned int16 prescale; |
.................... unsigned int16 ticks; |
.................... int n; |
.................... |
.................... setup_adc_ports(NO_ANALOGS|VSS_VDD); |
* |
0360: BSF 03.5 |
0361: BCF 1F.4 |
0362: BCF 1F.5 |
0363: MOVF 1B,W |
0364: ANDLW 80 |
0365: MOVWF 1B |
.................... setup_adc(ADC_OFF); |
0366: BCF 03.5 |
0367: BCF 1F.0 |
.................... setup_spi(FALSE); |
0368: BCF 14.5 |
0369: BSF 03.5 |
036A: BCF 06.2 |
036B: BSF 06.1 |
036C: BCF 06.4 |
036D: MOVLW 00 |
036E: BCF 03.5 |
036F: MOVWF 14 |
0370: BSF 03.5 |
0371: MOVWF 14 |
.................... setup_timer_0(RTCC_EXT_L_TO_H|RTCC_DIV_1); |
0372: MOVF 01,W |
0373: ANDLW C7 |
0374: IORLW 28 |
0375: MOVWF 01 |
.................... setup_timer_1(T1_EXTERNAL|T1_DIV_BY_1); |
0376: MOVLW 87 |
0377: BCF 03.5 |
0378: MOVWF 10 |
.................... // setup_timer_1(T1_INTERNAL|T1_DIV_BY_8); |
.................... setup_timer_2(T2_DISABLED,0,1); |
0379: MOVLW 00 |
037A: MOVWF 78 |
037B: MOVWF 12 |
037C: MOVLW 00 |
037D: BSF 03.5 |
037E: MOVWF 12 |
.................... setup_comparator(NC_NC_NC_NC); |
037F: MOVLW 07 |
0380: MOVWF 1C |
0381: MOVF 05,W |
0382: CLRWDT |
0383: MOVLW 02 |
0384: MOVWF 77 |
0385: DECFSZ 77,F |
0386: GOTO 385 |
0387: NOP |
0388: NOP |
0389: MOVF 1C,W |
038A: BCF 03.5 |
038B: BCF 0D.6 |
.................... setup_vref(FALSE); |
038C: BSF 03.5 |
038D: CLRF 1D |
.................... // enable_interrupts(INT_TIMER1); |
.................... // enable_interrupts(INT_TIMER2); |
.................... // enable_interrupts(GLOBAL); |
.................... |
.................... setup_oscillator(OSC_4MHZ|OSC_INTRC); // 4 MHz interni RC oscilator |
038E: MOVLW 62 |
038F: MOVWF 0F |
.................... |
.................... delay_ms(100); |
0390: MOVLW 64 |
0391: BCF 03.5 |
0392: MOVWF 42 |
0393: CALL 0E6 |
.................... printf("\n\r\n\r%s", ver); |
0394: CLRF 41 |
0395: MOVF 41,W |
0396: CALL 04E |
0397: INCF 41,F |
0398: MOVWF 77 |
0399: MOVWF 4C |
039A: CALL 0FE |
039B: MOVLW 04 |
039C: SUBWF 41,W |
039D: BTFSS 03.2 |
039E: GOTO 395 |
039F: CLRF 42 |
03A0: MOVF 42,W |
03A1: CALL 03F |
03A2: IORLW 00 |
03A3: BTFSC 03.2 |
03A4: GOTO 3A9 |
03A5: INCF 42,F |
03A6: MOVWF 4C |
03A7: CALL 0FE |
03A8: GOTO 3A0 |
.................... output_low(SYNC); |
03A9: BSF 03.5 |
03AA: BCF 06.4 |
03AB: BCF 03.5 |
03AC: BCF 06.4 |
.................... output_low(HACK); |
03AD: BSF 03.5 |
03AE: BCF 06.5 |
03AF: BCF 03.5 |
03B0: BCF 06.5 |
.................... ticks=1; |
03B1: CLRF 3F |
03B2: MOVLW 01 |
03B3: MOVWF 3E |
.................... prescale=0; |
03B4: CLRF 3D |
03B5: CLRF 3C |
.................... |
.................... while(true) |
.................... { |
.................... printf("\n\r>"); |
03B6: MOVLW 0A |
03B7: MOVWF 4C |
03B8: CALL 0FE |
03B9: MOVLW 0D |
03BA: MOVWF 4C |
03BB: CALL 0FE |
03BC: MOVLW 3E |
03BD: MOVWF 4C |
03BE: CALL 0FE |
.................... n=0; |
03BF: CLRF 40 |
.................... do |
.................... { |
.................... ch=getchar(); |
03C0: GOTO 12A |
03C1: MOVF 78,W |
03C2: MOVWF 31 |
.................... printf("%c",ch); |
03C3: MOVF 31,W |
03C4: MOVWF 4C |
03C5: CALL 0FE |
.................... string[n++]=ch; |
03C6: MOVF 40,W |
03C7: INCF 40,F |
03C8: ADDLW 32 |
03C9: MOVWF 04 |
03CA: BCF 03.7 |
03CB: MOVF 31,W |
03CC: MOVWF 00 |
.................... } while((13 != ch) && (n < 10)); |
03CD: MOVF 31,W |
03CE: SUBLW 0D |
03CF: BTFSC 03.2 |
03D0: GOTO 3D5 |
03D1: MOVF 40,W |
03D2: SUBLW 09 |
03D3: BTFSC 03.0 |
03D4: GOTO 3C0 |
.................... string[n]=0; |
03D5: MOVLW 32 |
03D6: ADDWF 40,W |
03D7: MOVWF 04 |
03D8: BCF 03.7 |
03D9: CLRF 00 |
.................... printf("\n\r"); |
03DA: MOVLW 0A |
03DB: MOVWF 4C |
03DC: CALL 0FE |
03DD: MOVLW 0D |
03DE: MOVWF 4C |
03DF: CALL 0FE |
.................... switch(string[0]) |
.................... { |
03E0: MOVF 32,W |
03E1: XORLW 67 |
03E2: BTFSC 03.2 |
03E3: GOTO 3F1 |
03E4: XORLW 15 |
03E5: BTFSC 03.2 |
03E6: GOTO 460 |
03E7: XORLW 1A |
03E8: BTFSC 03.2 |
03E9: GOTO 4E9 |
03EA: XORLW 01 |
03EB: BTFSC 03.2 |
03EC: GOTO 571 |
03ED: XORLW 19 |
03EE: BTFSC 03.2 |
03EF: GOTO 5A8 |
03F0: GOTO 5EB |
.................... case 'g': // GO |
.................... printf("%Lue4 + %Lu GO", prescale, ticks); |
03F1: MOVLW 10 |
03F2: MOVWF 04 |
03F3: MOVF 3D,W |
03F4: MOVWF 44 |
03F5: MOVF 3C,W |
03F6: MOVWF 43 |
03F7: CALL 15F |
03F8: MOVLW 03 |
03F9: MOVWF 41 |
03FA: MOVF 41,W |
03FB: CALL 059 |
03FC: INCF 41,F |
03FD: MOVWF 77 |
03FE: MOVWF 4C |
03FF: CALL 0FE |
0400: MOVLW 08 |
0401: SUBWF 41,W |
0402: BTFSS 03.2 |
0403: GOTO 3FA |
0404: MOVLW 10 |
0405: MOVWF 04 |
0406: MOVF 3F,W |
0407: MOVWF 44 |
0408: MOVF 3E,W |
0409: MOVWF 43 |
040A: CALL 15F |
040B: MOVLW 20 |
040C: MOVWF 4C |
040D: CALL 0FE |
040E: MOVLW 47 |
040F: MOVWF 4C |
0410: CALL 0FE |
0411: MOVLW 4F |
0412: MOVWF 4C |
0413: CALL 0FE |
.................... for(i=0; i<prescale; i++) { set_timer1(0); while ( get_timer1() < 10000 ) ; }; |
0414: CLRF 30 |
0415: CLRF 2F |
0416: MOVF 30,W |
0417: SUBWF 3D,W |
0418: BTFSS 03.0 |
0419: GOTO 43C |
041A: BTFSS 03.2 |
041B: GOTO 420 |
041C: MOVF 3C,W |
041D: SUBWF 2F,W |
041E: BTFSC 03.0 |
041F: GOTO 43C |
0420: CLRF 0F |
0421: CLRF 0E |
0422: MOVF 0F,W |
0423: MOVWF 7A |
0424: MOVF 0E,W |
0425: MOVWF 77 |
0426: MOVF 0F,W |
0427: SUBWF 7A,W |
0428: BTFSS 03.2 |
0429: GOTO 422 |
042A: MOVF 77,W |
042B: MOVWF 41 |
042C: MOVF 7A,W |
042D: MOVWF 42 |
042E: MOVF 42,W |
042F: SUBLW 27 |
0430: BTFSS 03.0 |
0431: GOTO 438 |
0432: BTFSS 03.2 |
0433: GOTO 422 |
0434: MOVF 41,W |
0435: SUBLW 0F |
0436: BTFSC 03.0 |
0437: GOTO 422 |
0438: INCF 2F,F |
0439: BTFSC 03.2 |
043A: INCF 30,F |
043B: GOTO 416 |
.................... set_timer1(0); while ( get_timer1() < ticks ) ; |
043C: CLRF 0F |
043D: CLRF 0E |
043E: MOVF 0F,W |
043F: MOVWF 7A |
0440: MOVF 0E,W |
0441: MOVWF 77 |
0442: MOVF 0F,W |
0443: SUBWF 7A,W |
0444: BTFSS 03.2 |
0445: GOTO 43E |
0446: MOVF 77,W |
0447: MOVWF 41 |
0448: MOVF 7A,W |
0449: MOVWF 42 |
044A: MOVF 42,W |
044B: SUBWF 3F,W |
044C: BTFSS 03.0 |
044D: GOTO 454 |
044E: BTFSS 03.2 |
044F: GOTO 43E |
0450: MOVF 3E,W |
0451: SUBWF 41,W |
0452: BTFSS 03.0 |
0453: GOTO 43E |
.................... output_high(SYNC); |
0454: BSF 03.5 |
0455: BCF 06.4 |
0456: BCF 03.5 |
0457: BSF 06.4 |
.................... delay_ms(1); |
0458: MOVLW 01 |
0459: MOVWF 42 |
045A: CALL 0E6 |
.................... output_low(SYNC); |
045B: BSF 03.5 |
045C: BCF 06.4 |
045D: BCF 03.5 |
045E: BCF 06.4 |
.................... break; |
045F: GOTO 61A |
.................... |
.................... case 'r': // REPEAT |
.................... n=0; |
0460: CLRF 40 |
.................... while(true) |
.................... { |
.................... printf("%Lue4 + %Lu REPEAT %u\n\r", prescale, ticks, n++); |
0461: MOVF 40,W |
0462: INCF 40,F |
0463: MOVWF 41 |
0464: MOVLW 10 |
0465: MOVWF 04 |
0466: MOVF 3D,W |
0467: MOVWF 44 |
0468: MOVF 3C,W |
0469: MOVWF 43 |
046A: CALL 15F |
046B: MOVLW 03 |
046C: MOVWF 42 |
046D: MOVF 42,W |
046E: CALL 06C |
046F: INCF 42,F |
0470: MOVWF 77 |
0471: MOVWF 4C |
0472: CALL 0FE |
0473: MOVLW 08 |
0474: SUBWF 42,W |
0475: BTFSS 03.2 |
0476: GOTO 46D |
0477: MOVLW 10 |
0478: MOVWF 04 |
0479: MOVF 3F,W |
047A: MOVWF 44 |
047B: MOVF 3E,W |
047C: MOVWF 43 |
047D: CALL 15F |
047E: MOVLW 0B |
047F: MOVWF 43 |
0480: MOVF 43,W |
0481: CALL 06C |
0482: INCF 43,F |
0483: MOVWF 77 |
0484: MOVWF 4C |
0485: CALL 0FE |
0486: MOVLW 13 |
0487: SUBWF 43,W |
0488: BTFSS 03.2 |
0489: GOTO 480 |
048A: MOVF 41,W |
048B: MOVWF 44 |
048C: MOVLW 18 |
048D: MOVWF 45 |
048E: GOTO 1DE |
048F: MOVLW 0A |
0490: MOVWF 4C |
0491: CALL 0FE |
0492: MOVLW 0D |
0493: MOVWF 4C |
0494: CALL 0FE |
.................... for(i=0; i<prescale; i++) { set_timer1(0); while ( get_timer1() < 10000 ) ; }; |
0495: CLRF 30 |
0496: CLRF 2F |
0497: MOVF 30,W |
0498: SUBWF 3D,W |
0499: BTFSS 03.0 |
049A: GOTO 4BD |
049B: BTFSS 03.2 |
049C: GOTO 4A1 |
049D: MOVF 3C,W |
049E: SUBWF 2F,W |
049F: BTFSC 03.0 |
04A0: GOTO 4BD |
04A1: CLRF 0F |
04A2: CLRF 0E |
04A3: MOVF 0F,W |
04A4: MOVWF 7A |
04A5: MOVF 0E,W |
04A6: MOVWF 77 |
04A7: MOVF 0F,W |
04A8: SUBWF 7A,W |
04A9: BTFSS 03.2 |
04AA: GOTO 4A3 |
04AB: MOVF 77,W |
04AC: MOVWF 41 |
04AD: MOVF 7A,W |
04AE: MOVWF 42 |
04AF: MOVF 42,W |
04B0: SUBLW 27 |
04B1: BTFSS 03.0 |
04B2: GOTO 4B9 |
04B3: BTFSS 03.2 |
04B4: GOTO 4A3 |
04B5: MOVF 41,W |
04B6: SUBLW 0F |
04B7: BTFSC 03.0 |
04B8: GOTO 4A3 |
04B9: INCF 2F,F |
04BA: BTFSC 03.2 |
04BB: INCF 30,F |
04BC: GOTO 497 |
.................... set_timer1(0); while ( get_timer1() < ticks ) ; |
04BD: CLRF 0F |
04BE: CLRF 0E |
04BF: MOVF 0F,W |
04C0: MOVWF 7A |
04C1: MOVF 0E,W |
04C2: MOVWF 77 |
04C3: MOVF 0F,W |
04C4: SUBWF 7A,W |
04C5: BTFSS 03.2 |
04C6: GOTO 4BF |
04C7: MOVF 77,W |
04C8: MOVWF 41 |
04C9: MOVF 7A,W |
04CA: MOVWF 42 |
04CB: MOVF 42,W |
04CC: SUBWF 3F,W |
04CD: BTFSS 03.0 |
04CE: GOTO 4D5 |
04CF: BTFSS 03.2 |
04D0: GOTO 4BF |
04D1: MOVF 3E,W |
04D2: SUBWF 41,W |
04D3: BTFSS 03.0 |
04D4: GOTO 4BF |
.................... output_high(SYNC); |
04D5: BSF 03.5 |
04D6: BCF 06.4 |
04D7: BCF 03.5 |
04D8: BSF 06.4 |
.................... delay_ms(20); |
04D9: MOVLW 14 |
04DA: MOVWF 42 |
04DB: CALL 0E6 |
.................... output_low(SYNC); |
04DC: BSF 03.5 |
04DD: BCF 06.4 |
04DE: BCF 03.5 |
04DF: BCF 06.4 |
.................... delay_ms(2000); |
04E0: MOVLW 08 |
04E1: MOVWF 41 |
04E2: MOVLW FA |
04E3: MOVWF 42 |
04E4: CALL 0E6 |
04E5: DECFSZ 41,F |
04E6: GOTO 4E2 |
.................... }; |
04E7: GOTO 461 |
.................... break; |
04E8: GOTO 61A |
.................... |
.................... case 'h': // HACK |
.................... printf("%Lue4 + %Lu HACK", prescale, ticks); |
04E9: MOVLW 10 |
04EA: MOVWF 04 |
04EB: MOVF 3D,W |
04EC: MOVWF 44 |
04ED: MOVF 3C,W |
04EE: MOVWF 43 |
04EF: CALL 15F |
04F0: MOVLW 03 |
04F1: MOVWF 41 |
04F2: MOVF 41,W |
04F3: CALL 088 |
04F4: INCF 41,F |
04F5: MOVWF 77 |
04F6: MOVWF 4C |
04F7: CALL 0FE |
04F8: MOVLW 08 |
04F9: SUBWF 41,W |
04FA: BTFSS 03.2 |
04FB: GOTO 4F2 |
04FC: MOVLW 10 |
04FD: MOVWF 04 |
04FE: MOVF 3F,W |
04FF: MOVWF 44 |
0500: MOVF 3E,W |
0501: MOVWF 43 |
0502: CALL 15F |
0503: MOVLW 0B |
0504: MOVWF 42 |
0505: MOVF 42,W |
0506: CALL 088 |
0507: INCF 42,F |
0508: MOVWF 77 |
0509: MOVWF 4C |
050A: CALL 0FE |
050B: MOVLW 10 |
050C: SUBWF 42,W |
050D: BTFSS 03.2 |
050E: GOTO 505 |
.................... for(i=0; i<prescale; i++) { set_timer1(0); while ( get_timer1() < 10000 ) ; }; |
050F: CLRF 30 |
0510: CLRF 2F |
0511: MOVF 30,W |
0512: SUBWF 3D,W |
0513: BTFSS 03.0 |
0514: GOTO 537 |
0515: BTFSS 03.2 |
0516: GOTO 51B |
0517: MOVF 3C,W |
0518: SUBWF 2F,W |
0519: BTFSC 03.0 |
051A: GOTO 537 |
051B: CLRF 0F |
051C: CLRF 0E |
051D: MOVF 0F,W |
051E: MOVWF 7A |
051F: MOVF 0E,W |
0520: MOVWF 77 |
0521: MOVF 0F,W |
0522: SUBWF 7A,W |
0523: BTFSS 03.2 |
0524: GOTO 51D |
0525: MOVF 77,W |
0526: MOVWF 41 |
0527: MOVF 7A,W |
0528: MOVWF 42 |
0529: MOVF 42,W |
052A: SUBLW 27 |
052B: BTFSS 03.0 |
052C: GOTO 533 |
052D: BTFSS 03.2 |
052E: GOTO 51D |
052F: MOVF 41,W |
0530: SUBLW 0F |
0531: BTFSC 03.0 |
0532: GOTO 51D |
0533: INCF 2F,F |
0534: BTFSC 03.2 |
0535: INCF 30,F |
0536: GOTO 511 |
.................... set_timer1(0); while ( get_timer1() < ticks ) ; |
0537: CLRF 0F |
0538: CLRF 0E |
0539: MOVF 0F,W |
053A: MOVWF 7A |
053B: MOVF 0E,W |
053C: MOVWF 77 |
053D: MOVF 0F,W |
053E: SUBWF 7A,W |
053F: BTFSS 03.2 |
0540: GOTO 539 |
0541: MOVF 77,W |
0542: MOVWF 41 |
0543: MOVF 7A,W |
0544: MOVWF 42 |
0545: MOVF 42,W |
0546: SUBWF 3F,W |
0547: BTFSS 03.0 |
0548: GOTO 54F |
0549: BTFSS 03.2 |
054A: GOTO 539 |
054B: MOVF 3E,W |
054C: SUBWF 41,W |
054D: BTFSS 03.0 |
054E: GOTO 539 |
.................... output_high(SYNC); |
054F: BSF 03.5 |
0550: BCF 06.4 |
0551: BCF 03.5 |
0552: BSF 06.4 |
.................... output_low(CLOCK); |
0553: BSF 03.5 |
0554: BCF 06.6 |
0555: BCF 03.5 |
0556: BCF 06.6 |
.................... delay_ms(10); |
0557: MOVLW 0A |
0558: MOVWF 42 |
0559: CALL 0E6 |
.................... output_high(HACK); |
055A: BSF 03.5 |
055B: BCF 06.5 |
055C: BCF 03.5 |
055D: BSF 06.5 |
.................... delay_ms(10000); |
055E: MOVLW 28 |
055F: MOVWF 41 |
0560: MOVLW FA |
0561: MOVWF 42 |
0562: CALL 0E6 |
0563: DECFSZ 41,F |
0564: GOTO 560 |
.................... output_low(HACK); |
0565: BSF 03.5 |
0566: BCF 06.5 |
0567: BCF 03.5 |
0568: BCF 06.5 |
.................... output_low(SYNC); |
0569: BSF 03.5 |
056A: BCF 06.4 |
056B: BCF 03.5 |
056C: BCF 06.4 |
.................... input(CLOCK); |
056D: BSF 03.5 |
056E: BSF 06.6 |
.................... break; |
056F: BCF 03.5 |
0570: GOTO 61A |
.................... |
.................... case 'i': // Info |
.................... printf("%s\n\r", ver); |
0571: CLRF 41 |
0572: MOVF 41,W |
0573: CALL 03F |
0574: IORLW 00 |
0575: BTFSC 03.2 |
0576: GOTO 57B |
0577: INCF 41,F |
0578: MOVWF 4C |
0579: CALL 0FE |
057A: GOTO 572 |
057B: MOVLW 0A |
057C: MOVWF 4C |
057D: CALL 0FE |
057E: MOVLW 0D |
057F: MOVWF 4C |
0580: CALL 0FE |
.................... printf("%Lue4 + %Lu ticks", prescale, ticks); |
0581: MOVLW 10 |
0582: MOVWF 04 |
0583: MOVF 3D,W |
0584: MOVWF 44 |
0585: MOVF 3C,W |
0586: MOVWF 43 |
0587: CALL 15F |
0588: MOVLW 03 |
0589: MOVWF 41 |
058A: MOVF 41,W |
058B: CALL 09D |
058C: INCF 41,F |
058D: MOVWF 77 |
058E: MOVWF 4C |
058F: CALL 0FE |
0590: MOVLW 08 |
0591: SUBWF 41,W |
0592: BTFSS 03.2 |
0593: GOTO 58A |
0594: MOVLW 10 |
0595: MOVWF 04 |
0596: MOVF 3F,W |
0597: MOVWF 44 |
0598: MOVF 3E,W |
0599: MOVWF 43 |
059A: CALL 15F |
059B: MOVLW 0B |
059C: MOVWF 42 |
059D: MOVF 42,W |
059E: CALL 09D |
059F: INCF 42,F |
05A0: MOVWF 77 |
05A1: MOVWF 4C |
05A2: CALL 0FE |
05A3: MOVLW 11 |
05A4: SUBWF 42,W |
05A5: BTFSS 03.2 |
05A6: GOTO 59D |
.................... break; |
05A7: GOTO 61A |
.................... |
.................... case 'p': |
.................... if (isdigit(string[1])) |
05A8: MOVF 33,W |
05A9: SUBLW 2F |
05AA: BTFSC 03.0 |
05AB: GOTO 5DF |
05AC: MOVF 33,W |
05AD: SUBLW 39 |
05AE: BTFSS 03.0 |
05AF: GOTO 5DF |
.................... { |
.................... prescale=atol(string+1); |
05B0: CLRF 42 |
05B1: MOVLW 33 |
05B2: MOVWF 41 |
05B3: CALL 242 |
05B4: MOVF 79,W |
05B5: MOVWF 3D |
05B6: MOVF 78,W |
05B7: MOVWF 3C |
.................... printf("%Lu x 10000 prescale", prescale); |
05B8: MOVLW 10 |
05B9: MOVWF 04 |
05BA: MOVF 3D,W |
05BB: MOVWF 44 |
05BC: MOVF 3C,W |
05BD: MOVWF 43 |
05BE: CALL 15F |
05BF: MOVLW 03 |
05C0: MOVWF 41 |
05C1: MOVF 41,W |
05C2: CALL 0B3 |
05C3: INCF 41,F |
05C4: MOVWF 77 |
05C5: MOVWF 4C |
05C6: CALL 0FE |
05C7: MOVLW 07 |
05C8: SUBWF 41,W |
05C9: BTFSS 03.2 |
05CA: GOTO 5C1 |
05CB: MOVLW 04 |
05CC: MOVWF 42 |
05CD: MOVLW 30 |
05CE: MOVWF 4C |
05CF: CALL 0FE |
05D0: DECFSZ 42,F |
05D1: GOTO 5CD |
05D2: MOVLW 07 |
05D3: MOVWF 43 |
05D4: MOVF 43,W |
05D5: CALL 0B3 |
05D6: INCF 43,F |
05D7: MOVWF 77 |
05D8: MOVWF 4C |
05D9: CALL 0FE |
05DA: MOVLW 10 |
05DB: SUBWF 43,W |
05DC: BTFSS 03.2 |
05DD: GOTO 5D4 |
.................... } |
.................... else |
05DE: GOTO 5EA |
.................... printf("Error"); |
05DF: CLRF 41 |
05E0: MOVF 41,W |
05E1: CALL 0C8 |
05E2: INCF 41,F |
05E3: MOVWF 77 |
05E4: MOVWF 4C |
05E5: CALL 0FE |
05E6: MOVLW 05 |
05E7: SUBWF 41,W |
05E8: BTFSS 03.2 |
05E9: GOTO 5E0 |
.................... break; |
05EA: GOTO 61A |
.................... |
.................... default: // fine ticks number |
.................... if (isdigit(string[0])) |
05EB: MOVF 32,W |
05EC: SUBLW 2F |
05ED: BTFSC 03.0 |
05EE: GOTO 60F |
05EF: MOVF 32,W |
05F0: SUBLW 39 |
05F1: BTFSS 03.0 |
05F2: GOTO 60F |
.................... { |
.................... ticks=atol(string); |
05F3: CLRF 42 |
05F4: MOVLW 32 |
05F5: MOVWF 41 |
05F6: CALL 242 |
05F7: MOVF 79,W |
05F8: MOVWF 3F |
05F9: MOVF 78,W |
05FA: MOVWF 3E |
.................... printf("%Lu ticks", ticks); |
05FB: MOVLW 10 |
05FC: MOVWF 04 |
05FD: MOVF 3F,W |
05FE: MOVWF 44 |
05FF: MOVF 3E,W |
0600: MOVWF 43 |
0601: CALL 15F |
0602: MOVLW 03 |
0603: MOVWF 41 |
0604: MOVF 41,W |
0605: CALL 0D2 |
0606: INCF 41,F |
0607: MOVWF 77 |
0608: MOVWF 4C |
0609: CALL 0FE |
060A: MOVLW 09 |
060B: SUBWF 41,W |
060C: BTFSS 03.2 |
060D: GOTO 604 |
.................... } |
.................... else |
060E: GOTO 61A |
.................... printf("Error"); |
060F: CLRF 41 |
0610: MOVF 41,W |
0611: CALL 0C8 |
0612: INCF 41,F |
0613: MOVWF 77 |
0614: MOVWF 4C |
0615: CALL 0FE |
0616: MOVLW 05 |
0617: SUBWF 41,W |
0618: BTFSS 03.2 |
0619: GOTO 610 |
.................... }; |
.................... |
.................... }; |
061A: GOTO 3B6 |
.................... |
.................... while(true) |
.................... { |
.................... output_low(PIN_B4); |
061B: BSF 03.5 |
061C: BCF 06.4 |
061D: BCF 03.5 |
061E: BCF 06.4 |
.................... delay_ms(300); |
061F: MOVLW 02 |
0620: MOVWF 41 |
0621: MOVLW 96 |
0622: MOVWF 42 |
0623: CALL 0E6 |
0624: DECFSZ 41,F |
0625: GOTO 621 |
.................... output_high(PIN_B4); |
0626: BSF 03.5 |
0627: BCF 06.4 |
0628: BCF 03.5 |
0629: BSF 06.4 |
.................... delay_ms(300); |
062A: MOVLW 02 |
062B: MOVWF 41 |
062C: MOVLW 96 |
062D: MOVWF 42 |
062E: CALL 0E6 |
062F: DECFSZ 41,F |
0630: GOTO 62C |
.................... } |
0631: GOTO 61B |
.................... } |
.................... |
0632: GOTO 632 |
Configuration Fuses: |
Word 1: 3731 NOWDT PUT MCLR NOBROWNOUT NOLVP NOCPD NOWRT DEBUG CCPB0 NOPROTECT INTRC |
Word 2: 3FFC NOFCMEN NOIESO |
/programy/C/PIC_C/hack/hack.PJT |
---|
0,0 → 1,56 |
[PROJECT] |
Target=hack.HEX |
Development_Mode= |
Processor=0x688F |
ToolSuite=CCS |
[Directories] |
Include=C:\Program Files\PICC\devices\;C:\Program Files\PICC\Drivers; |
Library= |
LinkerScript= |
[Target Data] |
FileList=hack.c; |
BuildTool=C-COMPILER |
OptionString=+FM |
AdditionalOptionString= |
BuildRequired=1 |
[hack.c] |
Type=4 |
Path= |
FileList= |
BuildTool= |
OptionString= |
AdditionalOptionString= |
[mru-list] |
1=hack.c |
[Windows] |
0=0000 hack.c 0 0 796 451 3 0 |
[Opened Files] |
1=D:\KAKLIK\programy\PIC_C\hack\hack.c |
2=C:\Program Files\PICC\devices\16F88.h |
3=D:\KAKLIK\programy\PIC_C\hack\hack.h |
4=C:\Program Files\PICC\Drivers\stdlib.h |
5=C:\Program Files\PICC\Drivers\stddef.h |
6=C:\Program Files\PICC\Drivers\string.h |
7=C:\Program Files\PICC\Drivers\ctype.h |
8= |
[debugperif] |
selected=Analog/Digital Conv |
[debugram] |
autoread=1 |
[debugeedata] |
autoread=1 |
[debugbreak] |
count=0 |
[pcwdebug] |
watchcol0=75 |
[debugwatch] |
count=0 |
[debugexpr] |
expr= |
sideeffects=0 |
/programy/C/PIC_C/hack/hack.SYM |
---|
0,0 → 1,107 |
015-016 CCP_1 |
015 CCP_1_LOW |
016 CCP_1_HIGH |
020 @INTERRUPT_AREA |
021 @INTERRUPT_AREA |
022 @INTERRUPT_AREA |
023 @INTERRUPT_AREA |
024 @INTERRUPT_AREA |
025 @INTERRUPT_AREA |
026 @INTERRUPT_AREA |
027 @INTERRUPT_AREA |
028 @INTERRUPT_AREA |
029-02A strtok.save |
02B-02E _Randseed |
02F-030 main.i |
031 main.ch |
032-03B main.string |
03C-03D main.prescale |
03E-03F main.ticks |
040 main.n |
041-042 atol.s |
041 @GETCH_1_.@SCRATCH |
041 main.@SCRATCH |
042 @delay_ms1.P1 |
042 main.@SCRATCH |
043-044 atol.result |
043-044 @PRINTF_LU_1200_51_50.P1 |
043 main.@SCRATCH |
044 @PRINTF_U_1200_51_50.P1 |
045 @PRINTF_U_1200_51_50.P1 |
045 atol.sign |
045 @PRINTF_LU_1200_51_50.@SCRATCH |
046 atol.base |
046 @DIV88.P1 |
046 @PRINTF_LU_1200_51_50.@SCRATCH |
047 @DIV88.P1 |
047 atol.index |
047 @PRINTF_LU_1200_51_50.@SCRATCH |
048 atol.c |
048 @PRINTF_LU_1200_51_50.@SCRATCH |
048 @DIV88.@SCRATCH |
049-04A @MUL1616.P1 |
049 atol.@SCRATCH |
049 @PRINTF_LU_1200_51_50.@SCRATCH |
04A atol.@SCRATCH |
04A @PRINTF_LU_1200_51_50.@SCRATCH |
04B-04C @MUL1616.P1 |
04B atol.@SCRATCH |
04B @PRINTF_LU_1200_51_50.@SCRATCH |
04C @PUTCHAR_1_.P1 |
04D @MUL1616.@SCRATCH |
077 @SCRATCH |
078 @SCRATCH |
078 _RETURN_ |
079 @SCRATCH |
07A @SCRATCH |
07B @SCRATCH |
09C.6 C1OUT |
09C.7 C2OUT |
00E6 @delay_ms1 |
00FE @PUTCHAR_1_ |
012A @GETCH_1_ |
022C @MUL1616 |
0242 atol |
00E0 TIMER1_isr |
00E3 TIMER2_isr |
003F @const290 |
0342 main |
004E @const11193 |
0059 @const11223 |
015F @PRINTF_LU_1200_51_50 |
006C @const11259 |
01C9 @DIV88 |
01DE @PRINTF_U_1200_51_50 |
0088 @const11300 |
009D @const11330 |
00B3 @const11344 |
00C8 @const11352 |
00D2 @const11365 |
0342 @cinit |
Project Files: |
D:\KAKLIK\programy\PIC_C\hack\hack.c |
D:\KAKLIK\programy\PIC_C\hack\hack.h |
C:\Program Files\PICC\devices\16F88.h |
C:\Program Files\PICC\Drivers\stdlib.h |
C:\Program Files\PICC\Drivers\stddef.h |
C:\Program Files\PICC\Drivers\string.h |
C:\Program Files\PICC\Drivers\ctype.h |
Compiler Settings: |
Processor: PIC16F88 |
Pointer Size: 16 |
ADC Range: 0-255 |
Opt Level: 9 |
Short,Int,Long: 1,8,16 |
ICD Provisions: Yes |
Output Files: |
Errors: D:\KAKLIK\programy\PIC_C\hack\hack.err |
INHX8: D:\KAKLIK\programy\PIC_C\hack\hack.HEX |
Symbols: D:\KAKLIK\programy\PIC_C\hack\hack.SYM |
List: D:\KAKLIK\programy\PIC_C\hack\hack.LST |
Debug/COFF: D:\KAKLIK\programy\PIC_C\hack\hack.cof |
Call Tree: D:\KAKLIK\programy\PIC_C\hack\hack.tre |
Statistics: D:\KAKLIK\programy\PIC_C\hack\hack.sta |
/programy/C/PIC_C/hack/hack.c |
---|
0,0 → 1,137 |
#include ".\hack.h" |
#include <stdlib.h> |
#define SYNC PIN_B4 // Spousteni oscyloskopu |
#define HACK PIN_B5 // Zkratovani napajeni SmartCard |
#define CLOCK PIN_B6 // Hodiny ze SmartCard |
#int_TIMER1 |
TIMER1_isr() |
{ |
} |
#int_TIMER2 |
TIMER2_isr() |
{ |
} |
void main() |
{ |
unsigned int16 i; |
char ch; |
char string[10]; |
const char ver[]={"HACK v1.0\0"}; |
unsigned int16 prescale; |
unsigned int16 ticks; |
int n; |
setup_adc_ports(NO_ANALOGS|VSS_VDD); |
setup_adc(ADC_OFF); |
setup_spi(FALSE); |
setup_timer_0(RTCC_EXT_L_TO_H|RTCC_DIV_1); |
setup_timer_1(T1_EXTERNAL|T1_DIV_BY_1); |
// setup_timer_1(T1_INTERNAL|T1_DIV_BY_8); |
setup_timer_2(T2_DISABLED,0,1); |
setup_comparator(NC_NC_NC_NC); |
setup_vref(FALSE); |
// enable_interrupts(INT_TIMER1); |
// enable_interrupts(INT_TIMER2); |
// enable_interrupts(GLOBAL); |
setup_oscillator(OSC_4MHZ|OSC_INTRC); // 4 MHz interni RC oscilator |
delay_ms(100); |
printf("\n\r\n\r%s", ver); |
output_low(SYNC); |
output_low(HACK); |
ticks=1; |
prescale=0; |
while(true) |
{ |
printf("\n\r>"); |
n=0; |
do |
{ |
ch=getchar(); |
printf("%c",ch); |
string[n++]=ch; |
} while((13 != ch) && (n < 10)); |
string[n]=0; |
printf("\n\r"); |
switch(string[0]) |
{ |
case 'g': // GO |
printf("%Lue4 + %Lu GO", prescale, ticks); |
for(i=0; i<prescale; i++) { set_timer1(0); while ( get_timer1() < 10000 ) ; }; |
set_timer1(0); while ( get_timer1() < ticks ) ; |
output_high(SYNC); |
delay_ms(1); |
output_low(SYNC); |
break; |
case 'r': // REPEAT |
n=0; |
while(true) |
{ |
printf("%Lue4 + %Lu REPEAT %u\n\r", prescale, ticks, n++); |
for(i=0; i<prescale; i++) { set_timer1(0); while ( get_timer1() < 10000 ) ; }; |
set_timer1(0); while ( get_timer1() < ticks ) ; |
output_high(SYNC); |
delay_ms(20); |
output_low(SYNC); |
delay_ms(2000); |
}; |
break; |
case 'h': // HACK |
printf("%Lue4 + %Lu HACK", prescale, ticks); |
for(i=0; i<prescale; i++) { set_timer1(0); while ( get_timer1() < 10000 ) ; }; |
set_timer1(0); while ( get_timer1() < ticks ) ; |
output_high(SYNC); |
output_low(CLOCK); |
delay_ms(10); |
output_high(HACK); |
delay_ms(10000); |
output_low(HACK); |
output_low(SYNC); |
input(CLOCK); |
break; |
case 'i': // Info |
printf("%s\n\r", ver); |
printf("%Lue4 + %Lu ticks", prescale, ticks); |
break; |
case 'p': |
if (isdigit(string[1])) |
{ |
prescale=atol(string+1); |
printf("%Lu x 10000 prescale", prescale); |
} |
else |
printf("Error"); |
break; |
default: // fine ticks number |
if (isdigit(string[0])) |
{ |
ticks=atol(string); |
printf("%Lu ticks", ticks); |
} |
else |
printf("Error"); |
}; |
}; |
while(true) |
{ |
output_low(PIN_B4); |
delay_ms(300); |
output_high(PIN_B4); |
delay_ms(300); |
} |
} |
/programy/C/PIC_C/hack/hack.cof |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/hack/hack.err |
---|
0,0 → 1,0 |
No Errors |
/programy/C/PIC_C/hack/hack.h |
---|
0,0 → 1,11 |
#include <16F88.h> |
#device *=16 |
#device ICD=TRUE |
#device adc=8 |
#fuses NOWDT,INTRC , NOPUT, MCLR, NOBROWNOUT, NOLVP, NOCPD, NOWRT, DEBUG, NOPROTECT, NOFCMEN, NOIESO |
//#fuses NOWDT,INTRC_IO, NOPUT, MCLR, NOBROWNOUT, NOLVP, NOCPD, NOWRT, DEBUG, NOPROTECT, NOFCMEN, NOIESO |
#use delay(clock=4000000,RESTART_WDT) |
//#use rs232(baud=2400,xmit=PIN_B3) |
//#use rs232(DEBUGGER) |
#use rs232(baud=1200,parity=N,xmit=PIN_B3,rcv=PIN_B2,bits=8) |
/programy/C/PIC_C/hack/hack.sta |
---|
0,0 → 1,52 |
ROM used: 1587 (41%) |
1587 (41%) including unused fragments |
1 Average locations per line |
3 Average locations per statement |
RAM used: 41 (11%) at main() level |
51 (14%) worst case |
Lines Stmts % Files |
----- ----- --- ----- |
138 101 18 D:\KAKLIK\programy\PIC_C\hack\hack.c |
12 0 0 D:\KAKLIK\programy\PIC_C\hack\hack.h |
275 0 0 C:\Program Files\PICC\devices\16F88.h |
758 324 50 C:\Program Files\PICC\Drivers\stdlib.h |
28 0 0 C:\Program Files\PICC\Drivers\stddef.h |
417 126 13 C:\Program Files\PICC\Drivers\string.h |
28 0 0 C:\Program Files\PICC\Drivers\ctype.h |
----- ----- |
3312 1102 Total |
Page ROM % RAM Functions: |
---- --- --- --- ---------- |
0 24 2 1 @delay_ms1 |
0 44 3 1 @PUTCHAR_1_ |
0 53 3 1 @GETCH_1_ |
0 22 1 5 @MUL1616 |
0 256 16 11 atol |
0 3 0 0 TIMER1_isr |
0 3 0 0 TIMER2_isr |
0 15 1 0 @const290 |
0 753 47 21 main |
0 11 1 0 @const11193 |
0 19 1 0 @const11223 |
0 106 7 9 @PRINTF_LU_1200_51_50 |
0 28 2 0 @const11259 |
0 21 1 3 @DIV88 |
0 78 5 2 @PRINTF_U_1200_51_50 |
0 21 1 0 @const11300 |
0 22 1 0 @const11330 |
0 21 1 0 @const11344 |
0 10 1 0 @const11352 |
0 14 1 0 @const11365 |
Segment Used Free |
--------- ---- ---- |
00000-00003 4 0 |
00004-0003E 59 0 |
0003F-007FF 1524 461 |
00800-00EFF 0 1792 |
/programy/C/PIC_C/hack/hack.tre |
---|
0,0 → 1,100 |
ÀÄhack |
ÃÄmain 0/753 Ram=21 |
³ ÃÄ??0?? |
³ ÃÄ@delay_ms1 0/24 Ram=1 |
³ ÃÄ@const11193 0/11 Ram=0 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@const290 0/15 Ram=0 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@GETCH_1_ 0/53 Ram=1 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PRINTF_LU_1200_51_50 0/106 Ram=9 |
³ ³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ³ ÀÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@const11223 0/19 Ram=0 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PRINTF_LU_1200_51_50 0/106 Ram=9 |
³ ³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ³ ÀÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@delay_ms1 0/24 Ram=1 |
³ ÃÄ@PRINTF_LU_1200_51_50 0/106 Ram=9 |
³ ³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ³ ÀÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@const11259 0/28 Ram=0 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PRINTF_LU_1200_51_50 0/106 Ram=9 |
³ ³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ³ ÀÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@const11259 0/28 Ram=0 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PRINTF_U_1200_51_50 0/78 Ram=2 |
³ ³ ÃÄ@DIV88 0/21 Ram=3 |
³ ³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ³ ÃÄ@DIV88 0/21 Ram=3 |
³ ³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ³ ÀÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@delay_ms1 0/24 Ram=1 |
³ ÃÄ@delay_ms1 0/24 Ram=1 |
³ ÃÄ@PRINTF_LU_1200_51_50 0/106 Ram=9 |
³ ³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ³ ÀÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@const11300 0/21 Ram=0 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PRINTF_LU_1200_51_50 0/106 Ram=9 |
³ ³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ³ ÀÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@const11300 0/21 Ram=0 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@delay_ms1 0/24 Ram=1 |
³ ÃÄ@delay_ms1 0/24 Ram=1 |
³ ÃÄ@const290 0/15 Ram=0 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PRINTF_LU_1200_51_50 0/106 Ram=9 |
³ ³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ³ ÀÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@const11330 0/22 Ram=0 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PRINTF_LU_1200_51_50 0/106 Ram=9 |
³ ³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ³ ÀÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@const11330 0/22 Ram=0 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄatol 0/256 Ram=11 |
³ ³ ÀÄ@MUL1616 0/22 Ram=5 |
³ ÃÄ@PRINTF_LU_1200_51_50 0/106 Ram=9 |
³ ³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ³ ÀÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@const11344 0/21 Ram=0 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@const11344 0/21 Ram=0 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@const11352 0/10 Ram=0 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄatol 0/256 Ram=11 |
³ ³ ÀÄ@MUL1616 0/22 Ram=5 |
³ ÃÄ@PRINTF_LU_1200_51_50 0/106 Ram=9 |
³ ³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ³ ÀÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@const11365 0/14 Ram=0 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@const11352 0/10 Ram=0 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@delay_ms1 0/24 Ram=1 |
³ ÀÄ@delay_ms1 0/24 Ram=1 |
ÃÄTIMER1_isr 0/3 Ram=0 |
ÀÄTIMER2_isr 0/3 Ram=0 |
/programy/C/PIC_C/motory/DC/regulator_letadlo/main.BAK |
---|
0,0 → 1,14 |
#include "D:\@Kaklik\programy\PIC_C\motory\DC\regulator_letadlo\main.h" |
void main() |
{ |
while (true) |
{ |
output_high(pin_A1); |
Delay_us(50); |
output_low(pin_A1); |
Delay_us(500); |
} |
} |
/programy/C/PIC_C/motory/DC/regulator_letadlo/main.HEX |
---|
0,0 → 1,7 |
:1000000000308A000428000084011F308305831615 |
:1000100085108312851403308C008C0B0D288316F9 |
:1000200085108312851031308C008C0B1528000050 |
:0600300000000728630038 |
:02400E00F93F78 |
:00000001FF |
;PIC16F84 |
/programy/C/PIC_C/motory/DC/regulator_letadlo/main.LST |
---|
0,0 → 1,62 |
CCS PCW C Compiler, Version 3.110, 15448 |
Filename: d:\@kaklik\programy\pic_c\motory\dc\regulator_letadlo\main.LST |
ROM used: 27 (3%) |
Largest free fragment is 997 |
RAM used: 2 (3%) at main() level |
2 (3%) worst case |
Stack: 0 locations |
* |
0000: MOVLW 00 |
0001: MOVWF 0A |
0002: GOTO 004 |
0003: NOP |
.................... #include "D:\@Kaklik\programy\PIC_C\motory\DC\regulator_letadlo\main.h" |
.................... #include <16F84.h> |
.................... //////// Standard Header file for the PIC16F84 device //////////////// |
.................... #device PIC16F84 |
.................... #list |
.................... |
.................... #use delay(clock=4000000) |
.................... #fuses XT,NOWDT |
.................... |
.................... |
.................... |
.................... |
.................... void main() |
.................... { |
0004: CLRF 04 |
0005: MOVLW 1F |
0006: ANDWF 03,F |
.................... while (true) |
.................... { |
.................... |
.................... output_high(pin_A1); |
0007: BSF 03.5 |
0008: BCF 05.1 |
0009: BCF 03.5 |
000A: BSF 05.1 |
.................... Delay_us(10); |
000B: MOVLW 03 |
000C: MOVWF 0C |
000D: DECFSZ 0C,F |
000E: GOTO 00D |
.................... output_low(pin_A1); |
000F: BSF 03.5 |
0010: BCF 05.1 |
0011: BCF 03.5 |
0012: BCF 05.1 |
.................... Delay_us(150); |
0013: MOVLW 31 |
0014: MOVWF 0C |
0015: DECFSZ 0C,F |
0016: GOTO 015 |
0017: NOP |
0018: NOP |
.................... } |
0019: GOTO 007 |
.................... } |
.................... |
001A: SLEEP |
/programy/C/PIC_C/motory/DC/regulator_letadlo/main.PJT |
---|
0,0 → 1,32 |
[PROJECT] |
Target=main.HEX |
Development_Mode= |
Processor=0x684A |
ToolSuite=CCS |
[Directories] |
Include=C:\PROGRAM FILES\PICC\devices\;C:\PROGRAM FILES\PICC\dr |
Library= |
LinkerScript= |
[Target Data] |
FileList=main.c; |
BuildTool=C-COMPILER |
OptionString=+FM |
AdditionalOptionString= |
BuildRequired=1 |
[main.c] |
Type=4 |
Path= |
FileList= |
BuildTool= |
OptionString= |
AdditionalOptionString= |
[mru-list] |
1=main.c |
[Windows] |
0=0000 main.c 0 0 796 451 3 0 |
/programy/C/PIC_C/motory/DC/regulator_letadlo/main.SYM |
---|
0,0 → 1,12 |
00C @SCRATCH |
00D @SCRATCH |
00D _RETURN_ |
delay_ms.P1 |
delay_us.P2 |
0004 main |
Project Files: |
d:\@kaklik\programy\pic_c\motory\dc\regulator_letadlo\main.c |
D:\@Kaklik\programy\PIC_C\motory\DC\regulator_letadlo\main.h |
C:\PROGRAM FILES\PICC\devices\16F84.h |
/programy/C/PIC_C/motory/DC/regulator_letadlo/main.c |
---|
0,0 → 1,14 |
#include "D:\@Kaklik\programy\PIC_C\motory\DC\regulator_letadlo\main.h" |
void main() |
{ |
while (true) |
{ |
output_high(pin_A1); |
Delay_us(10); |
output_low(pin_A1); |
Delay_us(150); |
} |
} |
/programy/C/PIC_C/motory/DC/regulator_letadlo/main.cod |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/motory/DC/regulator_letadlo/main.err |
---|
0,0 → 1,0 |
No Errors |
/programy/C/PIC_C/motory/DC/regulator_letadlo/main.h |
---|
0,0 → 1,4 |
#include <16F84.h> |
#use delay(clock=4000000) |
#fuses XT,NOWDT |
/programy/C/PIC_C/motory/DC/regulator_letadlo/main.sta |
---|
0,0 → 1,27 |
ROM used: 27 (3%) |
997 (97%) including unused fragments |
0 Average locations per line |
4 Average locations per statement |
RAM used: 2 (3%) at main() level |
2 (3%) worst case |
Lines Stmts % Files |
----- ----- --- ----- |
15 6 100 d:\@kaklik\programy\pic_c\motory\dc\regulator_letadlo\main.c |
5 0 0 D:\@Kaklik\programy\PIC_C\motory\DC\regulator_letadlo\main.h |
111 0 0 C:\PROGRAM FILES\PICC\devices\16F84.h |
----- ----- |
262 12 Total |
Page ROM % RAM Functions: |
---- --- --- --- ---------- |
0 23 85 0 main |
Segment Used Free |
--------- ---- ---- |
0000-0003 4 0 |
0004-03FF 23 997 |
/programy/C/PIC_C/motory/DC/regulator_letadlo/main.tre |
---|
0,0 → 1,3 |
ÀÄmain |
ÀÄmain 0/23 Ram=0 |
ÀÄ??0?? |
/programy/C/PIC_C/motory/DC/regulator_letadlo/prg.bat |
---|
0,0 → 1,6 |
call picpgr stop |
call picpgr erase pic16f84 |
call picpgr program main.hex hex pic16f84 |
call picpgr run |
pause |
call picpgr stop |
/programy/C/PIC_C/motory/DC/regulator_letadlo/vssver.scc |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/motory/hodinovy/Run.BAT |
---|
0,0 → 1,8 |
@echo off |
:loop |
picpgr reset PIC16F84 |
picpgr run |
pause |
picpgr stop |
pause |
goto loop |
/programy/C/PIC_C/motory/hodinovy/main.BAK |
---|
0,0 → 1,22 |
#include "D:\@Kaklik\programy\PIC_C\motory\main.h" |
void main() |
{ |
while (true) |
{ |
Delay_ms(15); |
output_high(pin_A0); |
output_low(pin_A1); |
// output_high(pin_A2); |
// Delay_ms(10); |
// output_low(pin_A2); |
Delay_ms(15); |
output_low(pin_A0); |
output_high(pin_A1); |
} |
} |
/programy/C/PIC_C/motory/hodinovy/main.HEX |
---|
0,0 → 1,10 |
:1000000000308A00192800000F308400000803190E |
:10001000182801308D008C018C0B0C288D0B0B28BF |
:100020004A308C008C0B122800000000800B09283D |
:10003000003484011F30830519308F00042083169B |
:10004000051083120514831685108312851019304C |
:100050008F00042083160510831205108316851067 |
:08006000831285141C286300C3 |
:02400E00FD3F74 |
:00000001FF |
;PIC16F84 |
/programy/C/PIC_C/motory/hodinovy/main.LST |
---|
0,0 → 1,95 |
CCS PCW C Compiler, Version 3.110, 15448 |
Filename: d:\@kaklik\programy\pic_c\motory\main.LST |
ROM used: 52 (5%) |
Largest free fragment is 972 |
RAM used: 2 (3%) at main() level |
3 (4%) worst case |
Stack: 1 locations |
* |
0000: MOVLW 00 |
0001: MOVWF 0A |
0002: GOTO 019 |
0003: NOP |
.................... #include "D:\@Kaklik\programy\PIC_C\motory\main.h" |
.................... #include <16F84.h> |
.................... //////// Standard Header file for the PIC16F84 device //////////////// |
.................... #device PIC16F84 |
.................... #list |
.................... |
.................... #use delay(clock=4000000) |
0004: MOVLW 0F |
0005: MOVWF 04 |
0006: MOVF 00,W |
0007: BTFSC 03.2 |
0008: GOTO 018 |
0009: MOVLW 01 |
000A: MOVWF 0D |
000B: CLRF 0C |
000C: DECFSZ 0C,F |
000D: GOTO 00C |
000E: DECFSZ 0D,F |
000F: GOTO 00B |
0010: MOVLW 4A |
0011: MOVWF 0C |
0012: DECFSZ 0C,F |
0013: GOTO 012 |
0014: NOP |
0015: NOP |
0016: DECFSZ 00,F |
0017: GOTO 009 |
0018: RETLW 00 |
.................... #fuses XT,WDT |
.................... |
.................... |
.................... |
.................... |
.................... void main() |
.................... { |
0019: CLRF 04 |
001A: MOVLW 1F |
001B: ANDWF 03,F |
.................... while (true) |
.................... { |
.................... |
.................... Delay_ms(25); |
001C: MOVLW 19 |
001D: MOVWF 0F |
001E: CALL 004 |
.................... |
.................... output_high(pin_A0); |
001F: BSF 03.5 |
0020: BCF 05.0 |
0021: BCF 03.5 |
0022: BSF 05.0 |
.................... output_low(pin_A1); |
0023: BSF 03.5 |
0024: BCF 05.1 |
0025: BCF 03.5 |
0026: BCF 05.1 |
.................... |
.................... // output_high(pin_A2); |
.................... // Delay_ms(10); |
.................... // output_low(pin_A2); |
.................... Delay_ms(25); |
0027: MOVLW 19 |
0028: MOVWF 0F |
0029: CALL 004 |
.................... |
.................... output_low(pin_A0); |
002A: BSF 03.5 |
002B: BCF 05.0 |
002C: BCF 03.5 |
002D: BCF 05.0 |
.................... output_high(pin_A1); |
002E: BSF 03.5 |
002F: BCF 05.1 |
0030: BCF 03.5 |
0031: BSF 05.1 |
.................... } |
0032: GOTO 01C |
.................... } |
.................... |
0033: SLEEP |
/programy/C/PIC_C/motory/hodinovy/main.PJT |
---|
0,0 → 1,32 |
[PROJECT] |
Target=main.HEX |
Development_Mode= |
Processor=0x684A |
ToolSuite=CCS |
[Directories] |
Include=C:\PROGRAM FILES\PICC\devices\;C:\PROGRAM FILES\PICC\dr |
Library= |
LinkerScript= |
[Target Data] |
FileList=main.c; |
BuildTool=C-COMPILER |
OptionString=+FM |
AdditionalOptionString= |
BuildRequired=1 |
[main.c] |
Type=4 |
Path= |
FileList= |
BuildTool= |
OptionString= |
AdditionalOptionString= |
[mru-list] |
1=main.c |
[Windows] |
0=0000 main.c 0 0 796 451 3 0 |
/programy/C/PIC_C/motory/hodinovy/main.SYM |
---|
0,0 → 1,14 |
00C @SCRATCH |
00D @SCRATCH |
00D _RETURN_ |
00F delay_ms.P1 |
delay_us.P1 |
0004 delay_ms |
0019 main |
0040 @cinit |
Project Files: |
d:\@kaklik\programy\pic_c\motory\main.c |
D:\@Kaklik\programy\PIC_C\motory\main.h |
C:\PROGRAM FILES\PICC\devices\16F84.h |
/programy/C/PIC_C/motory/hodinovy/main.c |
---|
0,0 → 1,22 |
#include "D:\@Kaklik\programy\PIC_C\motory\main.h" |
void main() |
{ |
while (true) |
{ |
Delay_ms(25); |
output_high(pin_A0); |
output_low(pin_A1); |
// output_high(pin_A2); |
// Delay_ms(10); |
// output_low(pin_A2); |
Delay_ms(25); |
output_low(pin_A0); |
output_high(pin_A1); |
} |
} |
/programy/C/PIC_C/motory/hodinovy/main.cod |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/motory/hodinovy/main.err |
---|
0,0 → 1,0 |
No Errors |
/programy/C/PIC_C/motory/hodinovy/main.h |
---|
0,0 → 1,4 |
#include <16F84.h> |
#use delay(clock=4000000) |
#fuses XT,WDT |
/programy/C/PIC_C/motory/hodinovy/main.sta |
---|
0,0 → 1,28 |
ROM used: 52 (5%) |
972 (95%) including unused fragments |
0 Average locations per line |
6 Average locations per statement |
RAM used: 2 (3%) at main() level |
3 (4%) worst case |
Lines Stmts % Files |
----- ----- --- ----- |
23 8 100 d:\@kaklik\programy\pic_c\motory\main.c |
5 0 0 D:\@Kaklik\programy\PIC_C\motory\main.h |
111 0 0 C:\PROGRAM FILES\PICC\devices\16F84.h |
----- ----- |
278 16 Total |
Page ROM % RAM Functions: |
---- --- --- --- ---------- |
0 21 40 1 delay_ms |
0 27 52 0 main |
Segment Used Free |
--------- ---- ---- |
0000-0003 4 0 |
0004-03FF 48 972 |
/programy/C/PIC_C/motory/hodinovy/main.tre |
---|
0,0 → 1,5 |
ÀÄmain |
ÀÄmain 0/27 Ram=0 |
ÃÄ??0?? |
ÃÄdelay_ms 0/21 Ram=1 |
ÀÄdelay_ms 0/21 Ram=1 |
/programy/C/PIC_C/motory/hodinovy/prg.bat |
---|
0,0 → 1,6 |
call picpgr stop |
call picpgr erase pic16f84 |
call picpgr program main.hex hex pic16f84 |
call picpgr run |
pause |
call picpgr stop |
/programy/C/PIC_C/motory/hodinovy/vssver.scc |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/motory/krokac/A.BAT |
---|
0,0 → 1,3 |
call picpgr erase pic16f88 |
call picpgr program krokac.hex hex pic16f88 |
call picpgr run |
/programy/C/PIC_C/motory/krokac/KROKAC.C |
---|
0,0 → 1,139 |
#include "C:\MIHO_DAT\KROKAC\krokac.h" |
unsigned int StepState; // Vnitrni promenna kroku |
signed int StepDirection; // Smer +1/0/-1 |
byte const StepTab[8]={ // Tabulka pro krokovy motor |
0b0001, // 0 |
0b0101, // 1 |
0b0100, // 2 |
0b0110, // 3 |
0b0010, // 4 |
0b1010, // 5 |
0b1000 // 6 |
0b1001, // 7 |
}; |
#INT_TIMER2 |
void StepNext() |
{ |
unsigned int i; |
StepState+=StepDirection; // posun se na dalsi krok |
i=StepState&0b111; // vezmi spodni 3 bity stavu |
i=StepTab[i]; // prekoduj pomoci tabulky |
output_bit(MOTORA,i&0b0001); // aktivuj jednotlive vystupy |
output_bit(MOTORB,i&0b0010); |
output_bit(MOTORC,i&0b0100); |
output_bit(MOTORD,i&0b1000); |
} |
void StepSetDirection(signed int Direction) |
{ |
if(Direction> 1) Direction= 1; |
if(Direction<-1) Direction=-1; |
StepDirection=Direction; |
} |
void StepSetTime(unsigned int16 Time) |
{ |
} |
void Delay(unsigned int16 Time) |
{ |
while(Time>255) {Time-=256;delay_us(256);}; |
if(Time!=0) delay_us(Time); |
} |
void main() |
{ |
unsigned int16 T; |
unsigned long int i; |
// Nastav pracovni frekvenci procesoru |
setup_oscillator(OSC_4MHZ); |
// Vypni motorovy vystup |
output_low(MOTORA); |
output_low(MOTORB); |
output_low(MOTORC); |
output_low(MOTORD); |
// Vstupy s pull-up odporem |
port_b_pullups(TRUE); |
// Inicializace A/D prevodniku |
setup_adc_ports(sAN0|VSS_VDD); |
setup_adc(ADC_CLOCK_INTERNAL); |
set_adc_channel(0); |
// Dalsi inicializace |
setup_spi(FALSE); |
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
setup_timer_1(T1_DISABLED); |
setup_comparator(NC_NC_NC_NC); |
setup_vref(FALSE); |
// Inicializace stavovych promennych |
StepState=0; |
// Nastaveni casovace |
setup_timer_2(T2_DIV_BY_16,0xFF,1); |
// Nastveni preruseni od casovace |
enable_interrupts(global); |
enable_interrupts(int_timer2); |
for(;;) |
{ |
T=read_adc(ADC_READ_ONLY); // Prectu hodnotu |
read_adc(ADC_START_ONLY); // Ostartuji dalsi prevod (na pozadi) |
//setup_timer_2(T2_DIV_BY_16,T,1); |
if(T>0) *0x92=T; // Preload register casovace |
// Podle prepinacu se hybu |
if(input(PIN_B5)) |
{ |
if(input(PIN_B4)) StepSetDirection(1); else StepSetDirection(-1); |
} |
else |
{ int1 x; // pomocna promenna aby se volalo spozdeni jen 1x |
if (StepState>230) { |
if (!input(PIN_B4) && (x)) |
{ |
StepSetDirection(0); |
delay_ms(500); |
x=0; |
}; |
StepSetDirection(-1); |
} |
if (StepState<30) { |
StepSetDirection( 1); |
x=1; |
} |
} |
//StepDirection=2; |
//for(i=0;i<800;i++) |
//{ |
// StepNext(); |
// Delay(T); |
//} |
//delay_ms(10); |
//StepDirection=-1; |
//for(i=0;i<800;i++) |
//{ |
// StepNext(); |
// Delay(T); |
//} |
//delay_ms(10); |
} // Cyklus for |
} |
/programy/C/PIC_C/motory/krokac/KROKAC.H |
---|
0,0 → 1,23 |
#include <16F88.h> |
//#device ICD=TRUE |
#device adc=8 |
#FUSES NOWDT //No Watch Dog Timer |
#FUSES RC //Resistor/Capacitor Osc with CLKOUT |
#FUSES NOPUT //No Power Up Timer |
#FUSES MCLR //Master Clear pin enabled |
#FUSES NOBROWNOUT //No brownout reset |
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O |
#FUSES NOCPD //No EE protection |
#FUSES NOWRT //Program memory not write protected |
//#FUSES DEBUG //Debug mode for use with ICD |
#FUSES NOPROTECT //Code not protected from reading |
#FUSES FCMEN //Fail-safe clock monitor enabled |
#FUSES IESO //Internal External Switch Over mode enabled |
#use delay(clock=4000000) |
#define MOTORA PIN_B0 |
#define MOTORB PIN_B1 |
#define MOTORC PIN_B2 |
#define MOTORD PIN_B3 |
/programy/C/PIC_C/motory/krokac/KROKAC.HEX |
---|
0,0 → 1,44 |
:1000000000308A0098280000FF00030E8301A10041 |
:100010007F08A0000A08A8008A01A00E0408A20018 |
:100020007708A3007808A4007908A5007A08A6003C |
:100030007B08A700831383128C308400801C222845 |
:100040008C183528220884002308F7002408F800BB |
:100050002508F9002608FA002708FB0028088A006E |
:10006000210E8300FF0E7F0E09008A1143280A101B |
:100070008A100A118207013405340434063402342C |
:100080000A34083409342A082907A900290807393D |
:10009000B20032083720F800B2003218512806109A |
:1000A00052280614831606108312B2185928861097 |
:1000B0005A28861483168610831232196128061175 |
:1000C00062280615831606118312B2196928861153 |
:1000D0006A2886158316861183128C108A112228AD |
:1000E000B01B78283008013C031878280130B00094 |
:1000F0003008803A7E3C031C7F28FF30B000300877 |
:10010000AA00003431308400000803199628013019 |
:10011000F800F701F70B8A28F80B89284A30F70016 |
:10012000F70B902800000000800B87288A113029E7 |
:1001300084011F30830583161F129F121B0880390C |
:100140009B0007309C001C0883120D13603083163F |
:100150008F000610831206108316861083128610F5 |
:1001600083160611831206118316861183128611D7 |
:10017000831681131F129F121B08803901389B00C0 |
:100180001F1383121F179F1783169F1383121F14A9 |
:100190000030F8001F08C73978049F0094128316B6 |
:1001A0000611861406120030831294008316940000 |
:1001B0000108C7390838810083129001073083167F |
:1001C0009C0005080330F700F70BE4281C08831295 |
:1001D0000D1383169D018312A9010030F800063823 |
:1001E0009200FF3083169200C03083128B04831676 |
:1001F0008C1483121F1DFE288316F9281E08AC01DB |
:10020000AB001F15AB08031D0829AC0803190C2906 |
:100210002B08831692008312831686168312861E7D |
:100220001E29831606168312061E1A290130B000F5 |
:1002300070201D29FF30B00070203E292908E63CBF |
:1002400003183629831606168312061A33292F1C23 |
:100250003329B00170200230B000FA30B10082289A |
:10026000B00B2D292F10FF30B000702029081D3C45 |
:10027000031C3E290130B00070202F148316F9288A |
:02028000630019 |
:04400E003B3FFF3FF6 |
:00000001FF |
;PIC16F88 |
/programy/C/PIC_C/motory/krokac/KROKAC.LST |
---|
0,0 → 1,495 |
CCS PCM C Compiler, Version 3.234, 27853 16-X-05 21:12 |
Filename: C:\MIHO_DAT\KROKAC\krokac.LST |
ROM used: 321 words (8%) |
Largest free fragment is 2048 |
RAM used: 21 (12%) at main() level |
24 (14%) worst case |
Stack: 3 worst case (1 in main + 2 for interrupts) |
* |
0000: MOVLW 00 |
0001: MOVWF 0A |
0002: GOTO 098 |
0003: NOP |
0004: MOVWF 7F |
0005: SWAPF 03,W |
0006: CLRF 03 |
0007: MOVWF 21 |
0008: MOVF 7F,W |
0009: MOVWF 20 |
000A: MOVF 0A,W |
000B: MOVWF 28 |
000C: CLRF 0A |
000D: SWAPF 20,F |
000E: MOVF 04,W |
000F: MOVWF 22 |
0010: MOVF 77,W |
0011: MOVWF 23 |
0012: MOVF 78,W |
0013: MOVWF 24 |
0014: MOVF 79,W |
0015: MOVWF 25 |
0016: MOVF 7A,W |
0017: MOVWF 26 |
0018: MOVF 7B,W |
0019: MOVWF 27 |
001A: BCF 03.7 |
001B: BCF 03.5 |
001C: MOVLW 8C |
001D: MOVWF 04 |
001E: BTFSS 00.1 |
001F: GOTO 022 |
0020: BTFSC 0C.1 |
0021: GOTO 035 |
0022: MOVF 22,W |
0023: MOVWF 04 |
0024: MOVF 23,W |
0025: MOVWF 77 |
0026: MOVF 24,W |
0027: MOVWF 78 |
0028: MOVF 25,W |
0029: MOVWF 79 |
002A: MOVF 26,W |
002B: MOVWF 7A |
002C: MOVF 27,W |
002D: MOVWF 7B |
002E: MOVF 28,W |
002F: MOVWF 0A |
0030: SWAPF 21,W |
0031: MOVWF 03 |
0032: SWAPF 7F,F |
0033: SWAPF 7F,W |
0034: RETFIE |
0035: BCF 0A.3 |
0036: GOTO 043 |
.................... #include "C:\MIHO_DAT\KROKAC\krokac.h" |
.................... #include <16F88.h> |
.................... //////// Standard Header file for the PIC16F88 device //////////////// |
.................... #device PIC16F88 |
.................... #list |
.................... |
.................... //#device ICD=TRUE |
.................... #device adc=8 |
.................... |
.................... #FUSES NOWDT //No Watch Dog Timer |
.................... #FUSES RC //Resistor/Capacitor Osc with CLKOUT |
.................... #FUSES NOPUT //No Power Up Timer |
.................... #FUSES MCLR //Master Clear pin enabled |
.................... #FUSES NOBROWNOUT //No brownout reset |
.................... #FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O |
.................... #FUSES NOCPD //No EE protection |
.................... #FUSES NOWRT //Program memory not write protected |
.................... //#FUSES DEBUG //Debug mode for use with ICD |
.................... #FUSES NOPROTECT //Code not protected from reading |
.................... #FUSES FCMEN //Fail-safe clock monitor enabled |
.................... #FUSES IESO //Internal External Switch Over mode enabled |
.................... |
.................... #use delay(clock=4000000) |
* |
0082: MOVLW 31 |
0083: MOVWF 04 |
0084: MOVF 00,W |
0085: BTFSC 03.2 |
0086: GOTO 096 |
0087: MOVLW 01 |
0088: MOVWF 78 |
0089: CLRF 77 |
008A: DECFSZ 77,F |
008B: GOTO 08A |
008C: DECFSZ 78,F |
008D: GOTO 089 |
008E: MOVLW 4A |
008F: MOVWF 77 |
0090: DECFSZ 77,F |
0091: GOTO 090 |
0092: NOP |
0093: NOP |
0094: DECFSZ 00,F |
0095: GOTO 087 |
0096: BCF 0A.3 |
0097: GOTO 130 (RETURN) |
.................... #define MOTORA PIN_B0 |
.................... #define MOTORB PIN_B1 |
.................... #define MOTORC PIN_B2 |
.................... #define MOTORD PIN_B3 |
.................... |
.................... |
.................... |
.................... |
.................... unsigned int StepState; // Vnitrni promenna kroku |
.................... signed int StepDirection; // Smer +1/0/-1 |
.................... |
.................... byte const StepTab[8]={ // Tabulka pro krokovy motor |
.................... 0b0001, // 0 |
.................... 0b0101, // 1 |
.................... 0b0100, // 2 |
.................... 0b0110, // 3 |
.................... 0b0010, // 4 |
.................... 0b1010, // 5 |
.................... 0b1000 // 6 |
.................... 0b1001, // 7 |
.................... }; |
.................... |
.................... #INT_TIMER2 |
.................... void StepNext() |
.................... { |
.................... unsigned int i; |
.................... |
.................... StepState+=StepDirection; // posun se na dalsi krok |
* |
0043: MOVF 2A,W |
0044: ADDWF 29,W |
0045: MOVWF 29 |
.................... i=StepState&0b111; // vezmi spodni 3 bity stavu |
0046: MOVF 29,W |
0047: ANDLW 07 |
0048: MOVWF 32 |
.................... i=StepTab[i]; // prekoduj pomoci tabulky |
0049: MOVF 32,W |
004A: CALL 037 |
004B: MOVWF 78 |
004C: MOVWF 32 |
.................... output_bit(MOTORA,i&0b0001); // aktivuj jednotlive vystupy |
004D: BTFSC 32.0 |
004E: GOTO 051 |
004F: BCF 06.0 |
0050: GOTO 052 |
0051: BSF 06.0 |
0052: BSF 03.5 |
0053: BCF 06.0 |
.................... output_bit(MOTORB,i&0b0010); |
0054: BCF 03.5 |
0055: BTFSC 32.1 |
0056: GOTO 059 |
0057: BCF 06.1 |
0058: GOTO 05A |
0059: BSF 06.1 |
005A: BSF 03.5 |
005B: BCF 06.1 |
.................... output_bit(MOTORC,i&0b0100); |
005C: BCF 03.5 |
005D: BTFSC 32.2 |
005E: GOTO 061 |
005F: BCF 06.2 |
0060: GOTO 062 |
0061: BSF 06.2 |
0062: BSF 03.5 |
0063: BCF 06.2 |
.................... output_bit(MOTORD,i&0b1000); |
0064: BCF 03.5 |
0065: BTFSC 32.3 |
0066: GOTO 069 |
0067: BCF 06.3 |
0068: GOTO 06A |
0069: BSF 06.3 |
006A: BSF 03.5 |
006B: BCF 06.3 |
.................... } |
.................... |
.................... |
006C: BCF 03.5 |
006D: BCF 0C.1 |
006E: BCF 0A.3 |
006F: GOTO 022 |
.................... void StepSetDirection(signed int Direction) |
.................... { |
.................... if(Direction> 1) Direction= 1; |
0070: BTFSC 30.7 |
0071: GOTO 078 |
0072: MOVF 30,W |
0073: SUBLW 01 |
0074: BTFSC 03.0 |
0075: GOTO 078 |
0076: MOVLW 01 |
0077: MOVWF 30 |
.................... if(Direction<-1) Direction=-1; |
0078: MOVF 30,W |
0079: XORLW 80 |
007A: SUBLW 7E |
007B: BTFSS 03.0 |
007C: GOTO 07F |
007D: MOVLW FF |
007E: MOVWF 30 |
.................... StepDirection=Direction; |
007F: MOVF 30,W |
0080: MOVWF 2A |
.................... } |
0081: RETLW 00 |
.................... |
.................... |
.................... void StepSetTime(unsigned int16 Time) |
.................... { |
.................... |
.................... } |
.................... |
.................... void Delay(unsigned int16 Time) |
.................... { |
.................... while(Time>255) {Time-=256;delay_us(256);}; |
.................... if(Time!=0) delay_us(Time); |
.................... } |
.................... |
.................... |
.................... void main() |
.................... { |
* |
0098: CLRF 04 |
0099: MOVLW 1F |
009A: ANDWF 03,F |
009B: BSF 03.5 |
009C: BCF 1F.4 |
009D: BCF 1F.5 |
009E: MOVF 1B,W |
009F: ANDLW 80 |
00A0: MOVWF 1B |
00A1: MOVLW 07 |
00A2: MOVWF 1C |
00A3: MOVF 1C,W |
00A4: BCF 03.5 |
00A5: BCF 0D.6 |
.................... unsigned int16 T; |
.................... unsigned long int i; |
.................... |
.................... // Nastav pracovni frekvenci procesoru |
.................... setup_oscillator(OSC_4MHZ); |
00A6: MOVLW 60 |
00A7: BSF 03.5 |
00A8: MOVWF 0F |
.................... |
.................... // Vypni motorovy vystup |
.................... output_low(MOTORA); |
00A9: BCF 06.0 |
00AA: BCF 03.5 |
00AB: BCF 06.0 |
.................... output_low(MOTORB); |
00AC: BSF 03.5 |
00AD: BCF 06.1 |
00AE: BCF 03.5 |
00AF: BCF 06.1 |
.................... output_low(MOTORC); |
00B0: BSF 03.5 |
00B1: BCF 06.2 |
00B2: BCF 03.5 |
00B3: BCF 06.2 |
.................... output_low(MOTORD); |
00B4: BSF 03.5 |
00B5: BCF 06.3 |
00B6: BCF 03.5 |
00B7: BCF 06.3 |
.................... |
.................... // Vstupy s pull-up odporem |
.................... port_b_pullups(TRUE); |
00B8: BSF 03.5 |
00B9: BCF 01.7 |
.................... |
.................... // Inicializace A/D prevodniku |
.................... setup_adc_ports(sAN0|VSS_VDD); |
00BA: BCF 1F.4 |
00BB: BCF 1F.5 |
00BC: MOVF 1B,W |
00BD: ANDLW 80 |
00BE: IORLW 01 |
00BF: MOVWF 1B |
.................... setup_adc(ADC_CLOCK_INTERNAL); |
00C0: BCF 1F.6 |
00C1: BCF 03.5 |
00C2: BSF 1F.6 |
00C3: BSF 1F.7 |
00C4: BSF 03.5 |
00C5: BCF 1F.7 |
00C6: BCF 03.5 |
00C7: BSF 1F.0 |
.................... set_adc_channel(0); |
00C8: MOVLW 00 |
00C9: MOVWF 78 |
00CA: MOVF 1F,W |
00CB: ANDLW C7 |
00CC: IORWF 78,W |
00CD: MOVWF 1F |
.................... |
.................... // Dalsi inicializace |
.................... setup_spi(FALSE); |
00CE: BCF 14.5 |
00CF: BSF 03.5 |
00D0: BCF 06.2 |
00D1: BSF 06.1 |
00D2: BCF 06.4 |
00D3: MOVLW 00 |
00D4: BCF 03.5 |
00D5: MOVWF 14 |
00D6: BSF 03.5 |
00D7: MOVWF 14 |
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
00D8: MOVF 01,W |
00D9: ANDLW C7 |
00DA: IORLW 08 |
00DB: MOVWF 01 |
.................... setup_timer_1(T1_DISABLED); |
00DC: BCF 03.5 |
00DD: CLRF 10 |
.................... setup_comparator(NC_NC_NC_NC); |
00DE: MOVLW 07 |
00DF: BSF 03.5 |
00E0: MOVWF 1C |
00E1: MOVF 05,W |
00E2: MOVLW 03 |
00E3: MOVWF 77 |
00E4: DECFSZ 77,F |
00E5: GOTO 0E4 |
00E6: MOVF 1C,W |
00E7: BCF 03.5 |
00E8: BCF 0D.6 |
.................... setup_vref(FALSE); |
00E9: BSF 03.5 |
00EA: CLRF 1D |
.................... |
.................... // Inicializace stavovych promennych |
.................... StepState=0; |
00EB: BCF 03.5 |
00EC: CLRF 29 |
.................... |
.................... // Nastaveni casovace |
.................... setup_timer_2(T2_DIV_BY_16,0xFF,1); |
00ED: MOVLW 00 |
00EE: MOVWF 78 |
00EF: IORLW 06 |
00F0: MOVWF 12 |
00F1: MOVLW FF |
00F2: BSF 03.5 |
00F3: MOVWF 12 |
.................... |
.................... // Nastveni preruseni od casovace |
.................... enable_interrupts(global); |
00F4: MOVLW C0 |
00F5: BCF 03.5 |
00F6: IORWF 0B,F |
.................... enable_interrupts(int_timer2); |
00F7: BSF 03.5 |
00F8: BSF 0C.1 |
.................... |
.................... for(;;) |
.................... { |
.................... |
.................... T=read_adc(ADC_READ_ONLY); // Prectu hodnotu |
00F9: BCF 03.5 |
00FA: BTFSS 1F.2 |
00FB: GOTO 0FE |
00FC: BSF 03.5 |
00FD: GOTO 0F9 |
00FE: MOVF 1E,W |
00FF: CLRF 2C |
0100: MOVWF 2B |
.................... read_adc(ADC_START_ONLY); // Ostartuji dalsi prevod (na pozadi) |
0101: BSF 1F.2 |
.................... |
.................... //setup_timer_2(T2_DIV_BY_16,T,1); |
.................... if(T>0) *0x92=T; // Preload register casovace |
0102: MOVF 2B,F |
0103: BTFSS 03.2 |
0104: GOTO 108 |
0105: MOVF 2C,F |
0106: BTFSC 03.2 |
0107: GOTO 10C |
0108: MOVF 2B,W |
0109: BSF 03.5 |
010A: MOVWF 12 |
010B: BCF 03.5 |
.................... |
.................... // Podle prepinacu se hybu |
.................... if(input(PIN_B5)) |
010C: BSF 03.5 |
010D: BSF 06.5 |
010E: BCF 03.5 |
010F: BTFSS 06.5 |
0110: GOTO 11E |
.................... { |
.................... if(input(PIN_B4)) StepSetDirection(1); else StepSetDirection(-1); |
0111: BSF 03.5 |
0112: BSF 06.4 |
0113: BCF 03.5 |
0114: BTFSS 06.4 |
0115: GOTO 11A |
0116: MOVLW 01 |
0117: MOVWF 30 |
0118: CALL 070 |
0119: GOTO 11D |
011A: MOVLW FF |
011B: MOVWF 30 |
011C: CALL 070 |
.................... } |
.................... else |
011D: GOTO 13E |
.................... { int1 x; // pomocna promenna aby se volalo spozdeni jen 1x |
.................... if (StepState>230) { |
011E: MOVF 29,W |
011F: SUBLW E6 |
0120: BTFSC 03.0 |
0121: GOTO 136 |
.................... if (!input(PIN_B4) && (x)) |
0122: BSF 03.5 |
0123: BSF 06.4 |
0124: BCF 03.5 |
0125: BTFSC 06.4 |
0126: GOTO 133 |
0127: BTFSS 2F.0 |
0128: GOTO 133 |
.................... { |
.................... StepSetDirection(0); |
0129: CLRF 30 |
012A: CALL 070 |
.................... delay_ms(500); |
012B: MOVLW 02 |
012C: MOVWF 30 |
012D: MOVLW FA |
012E: MOVWF 31 |
012F: GOTO 082 |
0130: DECFSZ 30,F |
0131: GOTO 12D |
.................... x=0; |
0132: BCF 2F.0 |
.................... }; |
.................... StepSetDirection(-1); |
0133: MOVLW FF |
0134: MOVWF 30 |
0135: CALL 070 |
.................... } |
.................... if (StepState<30) { |
0136: MOVF 29,W |
0137: SUBLW 1D |
0138: BTFSS 03.0 |
0139: GOTO 13E |
.................... StepSetDirection( 1); |
013A: MOVLW 01 |
013B: MOVWF 30 |
013C: CALL 070 |
.................... x=1; |
013D: BSF 2F.0 |
.................... } |
.................... } |
.................... //StepDirection=2; |
.................... //for(i=0;i<800;i++) |
.................... //{ |
.................... // StepNext(); |
.................... // Delay(T); |
.................... //} |
.................... //delay_ms(10); |
.................... //StepDirection=-1; |
.................... //for(i=0;i<800;i++) |
.................... //{ |
.................... // StepNext(); |
.................... // Delay(T); |
.................... //} |
.................... //delay_ms(10); |
.................... |
.................... } // Cyklus for |
013E: BSF 03.5 |
013F: GOTO 0F9 |
.................... |
.................... } |
.................... |
0140: SLEEP |
Configuration Fuses: |
Word 1: 3F3B NOWDT NOPUT MCLR NOBROWNOUT NOLVP NOCPD NOWRT NODEBUG CCPB0 NOPROTECT RC |
Word 2: 3FFF FCMEN IESO |
/programy/C/PIC_C/motory/krokac/KROKAC.PJT |
---|
0,0 → 1,39 |
[PROJECT] |
Target=krokac.HEX |
Development_Mode= |
Processor=0x688F |
ToolSuite=CCS |
[Directories] |
Include=C:\PROGRAM FILES\PICC_3_234\devices\;C:\PROGRAM FILES\P |
Library= |
LinkerScript= |
[Target Data] |
FileList=krokac.c; |
BuildTool=C-COMPILER |
OptionString=+FM |
AdditionalOptionString= |
BuildRequired=1 |
[krokac.c] |
Type=4 |
Path= |
FileList= |
BuildTool= |
OptionString= |
AdditionalOptionString= |
[mru-list] |
1=krokac.c |
[Windows] |
0=0000 krokac.c 0 0 796 451 3 0 |
[Opened Files] |
1=C:\MIHO_DAT\KROKAC\krokac.c |
2=C:\MIHO_DAT\KROKAC\krokac.h |
3=C:\PROGRAM FILES\PICC_3_234\devices\16F88.h |
4=C:\MIHO_DAT\KROKAC\krokac.lst |
5= |
/programy/C/PIC_C/motory/menice/Run.BAT |
---|
0,0 → 1,8 |
@echo off |
:loop |
picpgr reset PIC16F84 |
picpgr run |
pause |
picpgr stop |
pause |
goto loop |
/programy/C/PIC_C/motory/menice/main.BAK |
---|
0,0 → 1,21 |
#include "D:\@Kaklik\programy\PIC_C\motory\menice\main.h" |
#DEFINE L1 pin_A0 |
#DEFINE L2 pin_A1 |
void main() |
{ |
output_low(L1); |
output_low(L2); |
while(true) |
{ |
output_high(L1); |
output_low(L2); |
Delay_ms(16); |
output_low(L1); |
output_high(L2); |
Delay_ms(16); |
} |
} |
/programy/C/PIC_C/motory/menice/main.HEX |
---|
0,0 → 1,11 |
:1000000000308A00192800000F308400000803190E |
:10001000182801308D008C018C0B0C288D0B0B28BF |
:100020004A308C008C0B122800000000800B09283D |
:10003000003484011F3083058316051083120510D8 |
:100040008316851083128510831685108312851000 |
:10005000831605108312051411308F0004208316B7 |
:100060000510831205108316851083128514113034 |
:080070008F0004202428630026 |
:02400E00FE3F73 |
:00000001FF |
;PIC16F84 |
/programy/C/PIC_C/motory/menice/main.LST |
---|
0,0 → 1,102 |
CCS PCW C Compiler, Version 3.110, 15448 |
Filename: d:\@kaklik\programy\pic_c\motory\menice\main.LST |
ROM used: 60 (6%) |
Largest free fragment is 964 |
RAM used: 2 (3%) at main() level |
3 (4%) worst case |
Stack: 1 locations |
* |
0000: MOVLW 00 |
0001: MOVWF 0A |
0002: GOTO 019 |
0003: NOP |
.................... #include "D:\@Kaklik\programy\PIC_C\motory\menice\main.h" |
.................... #include <16F84.h> |
.................... //////// Standard Header file for the PIC16F84 device //////////////// |
.................... #device PIC16F84 |
.................... #list |
.................... |
.................... #use delay(clock=4000000) |
0004: MOVLW 0F |
0005: MOVWF 04 |
0006: MOVF 00,W |
0007: BTFSC 03.2 |
0008: GOTO 018 |
0009: MOVLW 01 |
000A: MOVWF 0D |
000B: CLRF 0C |
000C: DECFSZ 0C,F |
000D: GOTO 00C |
000E: DECFSZ 0D,F |
000F: GOTO 00B |
0010: MOVLW 4A |
0011: MOVWF 0C |
0012: DECFSZ 0C,F |
0013: GOTO 012 |
0014: NOP |
0015: NOP |
0016: DECFSZ 00,F |
0017: GOTO 009 |
0018: RETLW 00 |
.................... #fuses HS,WDT |
.................... |
.................... |
.................... |
.................... #DEFINE L1 pin_A0 |
.................... #DEFINE L2 pin_A1 |
.................... |
.................... void main() |
.................... { |
0019: CLRF 04 |
001A: MOVLW 1F |
001B: ANDWF 03,F |
.................... output_low(L1); |
001C: BSF 03.5 |
001D: BCF 05.0 |
001E: BCF 03.5 |
001F: BCF 05.0 |
.................... output_low(L2); |
0020: BSF 03.5 |
0021: BCF 05.1 |
0022: BCF 03.5 |
0023: BCF 05.1 |
.................... |
.................... while(true) |
.................... { |
.................... output_low(L2); |
0024: BSF 03.5 |
0025: BCF 05.1 |
0026: BCF 03.5 |
0027: BCF 05.1 |
.................... output_high(L1); |
0028: BSF 03.5 |
0029: BCF 05.0 |
002A: BCF 03.5 |
002B: BSF 05.0 |
.................... Delay_ms(17); |
002C: MOVLW 11 |
002D: MOVWF 0F |
002E: CALL 004 |
.................... output_low(L1); |
002F: BSF 03.5 |
0030: BCF 05.0 |
0031: BCF 03.5 |
0032: BCF 05.0 |
.................... output_high(L2); |
0033: BSF 03.5 |
0034: BCF 05.1 |
0035: BCF 03.5 |
0036: BSF 05.1 |
.................... Delay_ms(17); |
0037: MOVLW 11 |
0038: MOVWF 0F |
0039: CALL 004 |
.................... |
.................... } |
003A: GOTO 024 |
.................... } |
.................... |
003B: SLEEP |
/programy/C/PIC_C/motory/menice/main.PJT |
---|
0,0 → 1,32 |
[PROJECT] |
Target=main.HEX |
Development_Mode= |
Processor=0x684A |
ToolSuite=CCS |
[Directories] |
Include=C:\PROGRAM FILES\PICC\devices\;C:\PROGRAM FILES\PICC\dr; |
Library= |
LinkerScript= |
[Target Data] |
FileList=main.c; |
BuildTool=C-COMPILER |
OptionString=+FM |
AdditionalOptionString= |
BuildRequired=1 |
[main.c] |
Type=4 |
Path= |
FileList= |
BuildTool= |
OptionString= |
AdditionalOptionString= |
[mru-list] |
1=main.c |
[Windows] |
0=0000 main.c 0 0 796 451 3 0 |
/programy/C/PIC_C/motory/menice/main.SYM |
---|
0,0 → 1,13 |
00C @SCRATCH |
00D @SCRATCH |
00D _RETURN_ |
00F delay_ms.P1 |
delay_us.P1 |
0004 delay_ms |
0019 main |
Project Files: |
d:\@kaklik\programy\pic_c\motory\menice\main.c |
D:\@Kaklik\programy\PIC_C\motory\menice\main.h |
C:\PROGRAM FILES\PICC\devices\16F84.h |
/programy/C/PIC_C/motory/menice/main.c |
---|
0,0 → 1,21 |
#include "D:\@Kaklik\programy\PIC_C\motory\menice\main.h" |
#DEFINE L1 pin_A0 |
#DEFINE L2 pin_A1 |
void main() |
{ |
output_low(L1); |
output_low(L2); |
while(true) |
{ |
output_low(L2); |
output_high(L1); |
Delay_ms(17); |
output_low(L1); |
output_high(L2); |
Delay_ms(17); |
} |
} |
/programy/C/PIC_C/motory/menice/main.cod |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/PIC_C/motory/menice/main.err |
---|
0,0 → 1,0 |
No Errors |
/programy/C/PIC_C/motory/menice/main.h |
---|
0,0 → 1,4 |
#include <16F84.h> |
#use delay(clock=4000000) |
#fuses HS,WDT |
/programy/C/PIC_C/motory/menice/main.sta |
---|
0,0 → 1,28 |
ROM used: 60 (6%) |
964 (94%) including unused fragments |
0 Average locations per line |
6 Average locations per statement |
RAM used: 2 (3%) at main() level |
3 (4%) worst case |
Lines Stmts % Files |
----- ----- --- ----- |
22 10 100 d:\@kaklik\programy\pic_c\motory\menice\main.c |
5 0 0 D:\@Kaklik\programy\PIC_C\motory\menice\main.h |
111 0 0 C:\PROGRAM FILES\PICC\devices\16F84.h |
----- ----- |
276 20 Total |
Page ROM % RAM Functions: |
---- --- --- --- ---------- |
0 21 35 1 delay_ms |
0 35 58 0 main |
Segment Used Free |
--------- ---- ---- |
0000-0003 4 0 |
0004-03FF 56 964 |
/programy/C/PIC_C/motory/menice/main.tre |
---|
0,0 → 1,5 |
ÀÄmain |
ÀÄmain 0/35 Ram=0 |
ÃÄ??0?? |
ÃÄdelay_ms 0/21 Ram=1 |
ÀÄdelay_ms 0/21 Ram=1 |
/programy/C/PIC_C/motory/menice/prg.bat |
---|
0,0 → 1,6 |
call picpgr stop |
call picpgr erase pic16f84 |
call picpgr program main.hex hex pic16f84 |
call picpgr run |
pause |
call picpgr stop |
/programy/C/PIC_C/motory/menice/vssver.scc |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr/AVRcam/AVRcam.kdevelop |
---|
0,0 → 1,128 |
<?xml version = '1.0'?> |
<kdevelop> |
<general> |
<author>Jakub Kákona</author> |
<email>kaklik@mlab.cz</email> |
<version>$VERSION$</version> |
<projectmanagement>KDevCustomProject</projectmanagement> |
<primarylanguage>C</primarylanguage> |
<ignoreparts/> |
<projectname>AVRcam</projectname> |
</general> |
<kdevcustomproject> |
<run> |
<mainprogram>AVRcam</mainprogram> |
<directoryradio>executable</directoryradio> |
</run> |
</kdevcustomproject> |
<kdevdebugger> |
<general> |
<dbgshell/> |
</general> |
</kdevdebugger> |
<kdevdoctreeview> |
<ignoretocs> |
<toc>ada</toc> |
<toc>ada_bugs_gcc</toc> |
<toc>bash</toc> |
<toc>bash_bugs</toc> |
<toc>clanlib</toc> |
<toc>fortran_bugs_gcc</toc> |
<toc>gnome1</toc> |
<toc>gnustep</toc> |
<toc>gtk</toc> |
<toc>gtk_bugs</toc> |
<toc>haskell</toc> |
<toc>haskell_bugs_ghc</toc> |
<toc>java_bugs_gcc</toc> |
<toc>java_bugs_sun</toc> |
<toc>kde2book</toc> |
<toc>libstdc++</toc> |
<toc>opengl</toc> |
<toc>pascal_bugs_fp</toc> |
<toc>php</toc> |
<toc>php_bugs</toc> |
<toc>perl</toc> |
<toc>perl_bugs</toc> |
<toc>python</toc> |
<toc>python_bugs</toc> |
<toc>qt-kdev3</toc> |
<toc>ruby</toc> |
<toc>ruby_bugs</toc> |
<toc>sdl</toc> |
<toc>stl</toc> |
<toc>sw</toc> |
<toc>w3c-dom-level2-html</toc> |
<toc>w3c-svg</toc> |
<toc>w3c-uaag10</toc> |
<toc>wxwidgets_bugs</toc> |
</ignoretocs> |
<ignoreqt_xml> |
<toc>Guide to the Qt Translation Tools</toc> |
<toc>Qt Assistant Manual</toc> |
<toc>Qt Designer Manual</toc> |
<toc>Qt Reference Documentation</toc> |
<toc>qmake User Guide</toc> |
</ignoreqt_xml> |
<ignoredoxygen> |
<toc>KDE Libraries (Doxygen)</toc> |
</ignoredoxygen> |
</kdevdoctreeview> |
<kdevfilecreate> |
<filetypes/> |
<useglobaltypes> |
<type ext="c" /> |
<type ext="h" /> |
</useglobaltypes> |
</kdevfilecreate> |
<kdevcppsupport> |
<references/> |
<codecompletion> |
<includeGlobalFunctions>true</includeGlobalFunctions> |
<includeTypes>true</includeTypes> |
<includeEnums>true</includeEnums> |
<includeTypedefs>false</includeTypedefs> |
<automaticCodeCompletion>true</automaticCodeCompletion> |
<automaticArgumentsHint>true</automaticArgumentsHint> |
<automaticHeaderCompletion>true</automaticHeaderCompletion> |
<codeCompletionDelay>250</codeCompletionDelay> |
<argumentsHintDelay>400</argumentsHintDelay> |
<headerCompletionDelay>250</headerCompletionDelay> |
<showOnlyAccessibleItems>false</showOnlyAccessibleItems> |
<completionBoxItemOrder>0</completionBoxItemOrder> |
<howEvaluationContextMenu>true</howEvaluationContextMenu> |
<showCommentWithArgumentHint>true</showCommentWithArgumentHint> |
<statusBarTypeEvaluation>false</statusBarTypeEvaluation> |
<namespaceAliases>std=_GLIBCXX_STD;__gnu_cxx=std</namespaceAliases> |
<processPrimaryTypes>true</processPrimaryTypes> |
<processFunctionArguments>false</processFunctionArguments> |
<preProcessAllHeaders>false</preProcessAllHeaders> |
<parseMissingHeaders>false</parseMissingHeaders> |
<resolveIncludePaths>true</resolveIncludePaths> |
<alwaysParseInBackground>true</alwaysParseInBackground> |
<usePermanentCaching>true</usePermanentCaching> |
<alwaysIncludeNamespaces>false</alwaysIncludeNamespaces> |
<includePaths>.;</includePaths> |
</codecompletion> |
<qt> |
<used>false</used> |
<version>3</version> |
<includestyle>3</includestyle> |
<root>/usr/share/qt3</root> |
<designerintegration>EmbeddedKDevDesigner</designerintegration> |
<qmake>/usr/bin/qmake-qt3</qmake> |
<designer></designer> |
<designerpluginpaths/> |
</qt> |
</kdevcppsupport> |
<kdevfileview> |
<groups> |
<hidenonprojectfiles>false</hidenonprojectfiles> |
<hidenonlocation>false</hidenonlocation> |
</groups> |
<tree> |
<hidepatterns>*.o,*.lo,CVS</hidepatterns> |
<hidenonprojectfiles>false</hidenonprojectfiles> |
</tree> |
</kdevfileview> |
</kdevelop> |
/programy/C/avr/AVRcam/AVRcam.kdevelop.pcs |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr/AVRcam/AVRcam.kdevses |
---|
0,0 → 1,28 |
<?xml version = '1.0' encoding = 'UTF-8'?> |
<!DOCTYPE KDevPrjSession> |
<KDevPrjSession> |
<DocsAndViews NumberOfDocuments="1" > |
<Doc0 NumberOfViews="1" URL="file:///home/kaklik/download/robot/PID/PID.C" > |
<View0 Encoding="UTF-8" line="0" Type="Source" /> |
</Doc0> |
</DocsAndViews> |
<pluginList> |
<kdevdebugger> |
<breakpointList/> |
<showInternalCommands value="0" /> |
</kdevdebugger> |
<kdevastyle> |
<Extensions ext="*.cpp *.h,*.c *.h,*.cxx *.hxx,*.c++ *.h++,*.cc *.hh,*.C *.H,*.diff,*.inl,*.java,*.moc,*.patch,*.tlh,*.xpm" /> |
<AStyle IndentPreprocessors="0" FillCount="4" PadParenthesesOut="1" IndentNamespaces="1" IndentLabels="1" Fill="Tabs" MaxStatement="40" Brackets="Break" MinConditional="-1" IndentBrackets="0" PadParenthesesUn="1" BlockBreak="0" KeepStatements="1" KeepBlocks="1" BlockIfElse="0" IndentSwitches="1" PadOperators="0" FStyle="UserDefined" IndentCases="0" FillEmptyLines="0" BracketsCloseHeaders="0" BlockBreakAll="0" PadParenthesesIn="1" IndentClasses="1" IndentBlocks="0" FillForce="0" /> |
</kdevastyle> |
<kdevbookmarks> |
<bookmarks/> |
</kdevbookmarks> |
<kdevvalgrind> |
<executable path="" params="" /> |
<valgrind path="" params="" /> |
<calltree path="" params="" /> |
<kcachegrind path="" /> |
</kdevvalgrind> |
</pluginList> |
</KDevPrjSession> |
/programy/C/avr/AVRcam/FrameMgr_for_line_following.c |
---|
0,0 → 1,795 |
/* |
Copyright (C) 2004 John Orlando |
AVRcam: a small real-time image processing engine. |
This program is free software; you can redistribute it and/or |
modify it under the terms of the GNU General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
General Public License for more details. |
You should have received a copy of the GNU General Public |
License along with this program; if not, write to the Free Software |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
For more information on the AVRcam, please contact: |
john@jrobot.net |
or go to www.jrobot.net for more details regarding the system. |
*/ |
/********************************************************* |
Module Name: FrameMgr.c |
Module Date: 04/10/2004 |
Module Auth: John Orlando |
Description: This modules is responsible for performing |
both medium and high level processing on image data. |
This is performed at both the line level as well as |
the frame level. It controls the main flow of the |
system, adhering to all the critical timing |
requirements (such as when serial data can be transferred, |
etc). |
Revision History: |
Date Rel Ver. Notes |
4/10/2004 0.1 Module created |
6/30/2004 1.0 Initial release for Circuit Cellar |
contest. |
11/15/2004 1.2 Updated processLine() function so |
it will remove objects less than |
a specified length/width (reduces |
shot noise) |
*********************************************************/ |
/* Includes */ |
#include <stdlib.h> |
#include <string.h> |
#include <avr/io.h> |
#include "Executive.h" |
#include "UIMgr.h" |
#include "FrameMgr.h" |
#include "CamInterface.h" |
#include "UartInterface.h" |
#include "Utility.h" |
#include "I2CInterface.h" |
#include "CamConfig.h" |
#include "CommonDefs.h" |
/* Local Structures and Typedefs */ |
enum |
{ |
ST_FrameMgr_idle, |
ST_FrameMgr_TrackingFrame, |
ST_FrameMgr_DumpingFrame |
}; |
typedef unsigned char FrameMgr_State_t; |
/* Definitions */ |
/* The most objects that can be tracked at any one time is 8. |
This number is determined by the number of bytes that can be |
sent out during a frame (one byte per line, 144 lines per frame) |
with the number of bytes in a tracked object (7) + some wiggle |
room :-) ... I guess this could be increased to around 20 if |
we had enough room and cycles to process objects between lines */ |
#define MAX_TRACKED_OBJECTS 8 |
/* This defines the number of bytes that make up a trackedObject_t |
structure... */ |
#define SIZE_OF_TRACKED_OBJECT 8 |
/* This define is used to turn off the timer overflow interrupt |
that is generated when the PCLK overflows TIMER1 */ |
#define DISABLE_PCLK_TIMER1_OVERFLOW_BITMASK 0xFB |
/* This define is used to determine if a run length is too small |
to be concerned with. This helps to reduce the number of false |
positives. */ |
#define MIN_OBJECT_TRACKING_WIDTH 3 |
/* This define is used to determine if an object has enough |
height to be considered worth tracking...it is used to reduce |
shot noise */ |
#define MIN_OBJECT_TRACKING_HEIGHT 3 |
/* This define is used to indicate how often the filter routine |
that removes objects less than MIN_OBJECT_TRACKING_HEIGHT should |
be executed. It is measured in a number of lines (7 nominally). */ |
#define RUN_OBJECT_FILTER_MASK 0x07 |
/* This enum describes the possible colors that can |
be tracked by the system. This can't be represented as |
simple color names (red, brown, etc) due to the fact that |
the user sets which colors will be associated with which |
bits. Remember...after the AND operation of the indexed |
color map values executes, either a single bit indicating |
the color should be set, or no bits indicating that the |
color isn't represented in the color map (notTracked). */ |
enum |
{ |
notTracked, |
color1, /* bit 1 color */ |
color2, /* bit 2 color */ |
color3, /* bit 3 color */ |
color4, /* bit 4 color */ |
color5, /* bit 5 color */ |
color6, /* bit 6 color */ |
color7, /* bit 7 color */ |
color8 /* bit 8 color */ |
}; |
typedef unsigned char trackedColor_t; |
/* This structure defines the info that needs to be |
maintained for each trackedObject in the trackingTable */ |
typedef struct |
{ |
trackedColor_t color; |
unsigned char lastLineXStart; |
unsigned char lastLineXFinish; |
unsigned char x_upperLeft; |
unsigned char y_upperLeft; |
unsigned char x_lowerRight; |
unsigned char y_lowerRight; |
unsigned char objectValid; /* used to be a fill byte...now it is |
used to determine if the object is valid |
or not...it gets invalidated if it is |
determined that it is too small, or |
that the object is within another object */ |
} trackedObject_t; |
/* These defines are used to index into each individual element in the |
trackedObject_t structure. This seems to be MUCH more efficient than |
accessing the elements in GCC. */ |
#define COLOR_OFFSET 0 |
#define LAST_LINE_X_START_OFFSET 1 |
#define LAST_LINE_X_FINISH_OFFSET 2 |
#define X_UPPER_LEFT_OFFSET 3 |
#define Y_UPPER_LEFT_OFFSET 4 |
#define X_LOWER_RIGHT_OFFSET 5 |
#define Y_LOWER_RIGHT_OFFSET 6 |
#define VALID_OBJECT_OFFSET 7 |
/* Local Variables */ |
/* The trackedObjectTable is used to hold up to eight tracked objects |
while they are being acquired. */ |
static trackedObject_t trackedObjectTable[MAX_TRACKED_OBJECTS]; |
static trackedObject_t *pCurrentTrackedObjectTable = trackedObjectTable; |
static unsigned char lineCount = 0; |
static FrameMgr_State_t currentState = ST_FrameMgr_idle; |
static unsigned char numCurrTrackedObjects = 0; |
static unsigned char numPrevTrackedObjects = 0; |
static unsigned char trackedLineCount = 0; |
/* Local Functions */ |
static void FrameMgr_findConnectedness(void); |
/* Extern Functions */ |
/* These functions are located in assembly files, and thus |
must be externed here so they can be referenced in the source below. */ |
extern void CamIntAsm_waitForNewTrackingFrame(unsigned char *pBuffer, unsigned char *pMemLookup); |
extern void CamIntAsm_waitForNewDumpFrame(unsigned char *pCurrBuffer, unsigned char *pPrevBuffer); |
extern void CamIntAsm_acquireTrackingLine(unsigned char *pBuffer, unsigned char *pMemLookup); |
extern void CamIntAsm_acquireDumpLine(unsigned char *pCurrBuffer, unsigned char *pPrevBuffer); |
/*********************************************************** |
Function Name: FrameMgr_init |
Function Description: This function is responsible |
for initializing the FrameMgr. This includes |
setting up the various buffers and data needed to |
process each frame of image data. |
Inputs: none |
Outputs: none |
***********************************************************/ |
void FrameMgr_init(void) |
{ |
memset(trackedObjectTable,0x00,sizeof(trackedObjectTable)); |
} |
/*********************************************************** |
Function Name: FrameMgr_dispatchEvent |
Function Description: This function is responsible for |
taking an incoming event and performing the needed |
actions with it as pertains to the FrameMgr. |
Inputs: event - the generated event |
Outputs: none |
***********************************************************/ |
void FrameMgr_dispatchEvent(unsigned char event) |
{ |
switch(event) |
{ |
case EV_DUMP_FRAME: |
/* try re-initializing the camera before we start dumping */ |
CamConfig_setCamReg(0x11,0x01); /* reduce the frame rate for dumping*/ |
CamConfig_sendFifoCmds(); |
Utility_delay(1000); /* allow the new frame rate to settle */ |
lineCount = 0; |
currentState = ST_FrameMgr_DumpingFrame; |
//CamIntAsm_waitForNewDumpFrame(currentLineBuffer,previousLineBuffer); |
FrameMgr_acquireLine(); |
break; |
case EV_ENABLE_TRACKING: |
currentState = ST_FrameMgr_TrackingFrame; |
FrameMgr_acquireFrame(); |
break; |
case EV_ACQUIRE_FRAME_COMPLETE: |
FrameMgr_processFrame(); |
break; |
case EV_PROCESS_FRAME_COMPLETE: |
FrameMgr_acquireFrame(); |
break; |
case EV_SERIAL_DATA_RECEIVED: |
if (currentState != ST_FrameMgr_idle) |
{ |
/* we need to go back to processing line data, since |
serial data reception interrupted us....just trash the |
frame and act like the frame has been processed, which |
will kick off the system to wait for the next line */ |
PUBLISH_EVENT(EV_PROCESS_FRAME_COMPLETE); |
} |
break; |
case EV_DISABLE_TRACKING: |
/* tracking needs to be turned off */ |
currentState = ST_FrameMgr_idle; |
break; |
} |
} |
/*********************************************************** |
Function Name: FrameMgr_acquireFrame |
Function Description: This function is responsible for |
beginning of the acquisition of a new frame of data |
from the camera interface. The acquisition of this line |
depends on the current state of the FrameMgr. |
Inputs: none |
Outputs: none |
***********************************************************/ |
void FrameMgr_acquireFrame(void) |
{ |
if (currentState == ST_FrameMgr_TrackingFrame) |
{ |
trackedLineCount = 0; |
numPrevTrackedObjects = numCurrTrackedObjects; |
numCurrTrackedObjects = 0; |
/* clear out the tracking table, and wait for the new frame |
to start */ |
memset(trackedObjectTable,0x00,sizeof(trackedObjectTable)); |
//CamIntAsm_waitForNewTrackingFrame(currentLineBuffer,colorMap); |
WAIT_FOR_VSYNC_HIGH(); |
CamIntAsm_acquireTrackingLine(currentLineBuffer,colorMap); |
} |
} |
/*********************************************************** |
Function Name: FrameMgr_acquireLine |
Function Description: This function is responsible for |
acquiring a line of data from the camera interface. |
The acquisition of this line depends on the current |
state of the FrameMgr. |
Inputs: none |
Outputs: none |
***********************************************************/ |
void FrameMgr_acquireLine(void) |
{ |
unsigned char tmpLineCount; |
/* clearing out the buffers takes too long...we should |
just overwrite the data here without a problem when |
we start acquiring...at no point do we check for |
a 0x00 value in the current or previous lineBuffers, |
so it was a bit excessive :-) */ |
/* check which state we are in and proceed as needed */ |
if (currentState == ST_FrameMgr_DumpingFrame) |
{ |
tmpLineCount = lineCount*2; |
/* clearing out the line data in dump mode is ok, and actually |
is needed, since it is possible for the first dump line in |
a frame to come back with the last line captured of the |
last capture session...*/ |
memset(currentLineBuffer,0x00,LENGTH_OF_LINE_BUFFER); |
memset(previousLineBuffer,0x00,LENGTH_OF_LINE_BUFFER); |
/* wait for another VSYNC so we know which frame to use |
to start looking for a line to receive */ |
WAIT_FOR_VSYNC_HIGH(); |
WAIT_FOR_VSYNC_LOW(); |
/* look at lineCount to determine how many HREFs we should |
wait before we start sampling */ |
while(tmpLineCount != 0) |
{ |
WAIT_FOR_HREF_HIGH(); |
tmpLineCount--; |
WAIT_FOR_HREF_LOW(); |
} |
/* we should now be ready to sample our line...*/ |
CamIntAsm_acquireDumpLine(currentLineBuffer,previousLineBuffer); |
} |
else if (currentState == ST_FrameMgr_TrackingFrame) |
{ |
WAIT_FOR_HREF_LOW(); |
CamIntAsm_acquireTrackingLine(currentLineBuffer,colorMap); |
} |
} |
/*********************************************************** |
Function Name: FrameMgr_processLine |
Function Description: This function is responsible for |
parsing the received image line and performing either |
connected region mapping (if in the Tracking state) or |
sending out the raw sampled data (if in the Dumping |
state). |
Inputs: none |
Outputs: none |
***********************************************************/ |
void FrameMgr_processLine(void) |
{ |
unsigned char i; |
volatile unsigned char dataToSend; |
unsigned char *pTrackedObjectData = (unsigned char *)pCurrentTrackedObjectTable; |
#ifdef DEBUG_TRACKED_LINE |
unsigned char *pSendData; |
unsigned char asciiBuffer[5]; |
unsigned char pixelCount = 0; |
#endif |
if (currentState == ST_FrameMgr_DumpingFrame) |
{ |
/* we want to sit in a tight loop and send the acquired data |
sitting in current and previous line buffers out the serial |
port...it is sent out the serial port immediately instead |
of going into the UIMgr tx fifo because we can't do anything |
until its sent out anyway...may as well just get it out now */ |
/* currentLineBuffer is getting "g" previousLineBuffer is getting "b-r" */ |
UartInt_txByte(0x0B); /* send the header byte */ |
UartInt_txByte(lineCount); /* send the line count */ |
for (i=0; i<NUM_PIXELS_IN_A_DUMP_LINE; i+=2) |
{ |
/* when a dump line is sampled, the upper byte can potentially |
have garbage in it...we don't have time to mask it off as we're |
sampling, so it is done here before we send it out...we also |
combine the samples together so we really are sending up a |
sample for line N as well as line N+1 */ |
dataToSend = currentLineBuffer[i]; |
dataToSend &= 0x0F; |
dataToSend <<= 4; |
dataToSend |= (previousLineBuffer[i] & 0x0F); |
/* dataToSend should be packed now */ |
UartInt_txByte(dataToSend); |
/* flip the colors around since we are doing all G on Y and BR on UV */ |
dataToSend = previousLineBuffer[i+1]; |
dataToSend &= 0x0F; |
dataToSend <<= 4; |
dataToSend |= (currentLineBuffer[i+1] & 0x0F); |
/* dataToSend should be packed now */ |
UartInt_txByte(dataToSend); |
} |
UartInt_txByte(0x0F); /* send line end */ |
/* once all the data is sent, increment out line count by 2 since |
we really get 2 lines worth of pixels on each pass */ |
/* Update...increment only by 1, but only send 72 double-lines */ |
lineCount++; |
/* check to see if we have retrieved all of the needed lines */ |
if (lineCount >= 72) /* half 144, since we send two lines at a time */ |
{ |
/* we're done, so send the dump complete?...nope, just change |
states and we should be fine */ |
lineCount = 0; |
currentState = ST_FrameMgr_idle; |
/* disable the PCLK counting overflow interrupt */ |
TIMSK &= DISABLE_PCLK_TIMER1_OVERFLOW_BITMASK; |
CamConfig_setCamReg(0x11,0x00); /* reset the frame rate to normal*/ |
CamConfig_sendFifoCmds(); |
} |
else |
{ |
/* we have more lines to acquire in this frame, so keep on truckin...*/ |
PUBLISH_FAST_EVENT(FEV_PROCESS_LINE_COMPLETE); |
} |
} |
else if (currentState == ST_FrameMgr_TrackingFrame) |
{ |
#ifdef DEBUG_TRACKED_LINE |
/* send the received line over serial...this should only send |
until a pixelCount == 176 */ |
pSendData = currentLineBuffer; |
itoa(trackedLineCount,asciiBuffer,10); |
UIMgr_txBuffer(asciiBuffer,3); |
UIMgr_txBuffer(" ",1); |
while(pixelCount < ACTUAL_NUM_PIXELS_IN_A_LINE) |
{ |
memset(asciiBuffer,0x00,5); |
itoa(*pSendData++,asciiBuffer,10); /* color is first byte */ |
UIMgr_txBuffer(asciiBuffer,3); /* 3 ascii bytes for data */ |
UIMgr_txBuffer(" ",1); |
pixelCount += *pSendData; /* run-length is second byte */ |
memset(asciiBuffer,0x00,5); |
itoa(*pSendData++,asciiBuffer,10); |
UIMgr_txBuffer(asciiBuffer,3); |
UIMgr_txBuffer(" ",1); |
} |
UIMgr_txBuffer("\n\r",2); |
trackedLineCount++; |
if (trackedLineCount == 144) |
{ |
UIMgr_txBuffer(" FC \n\r",8); |
trackedLineCount = 0; |
PUBLISH_EVENT(EV_PROCESS_FRAME_COMPLETE); |
} |
else |
{ |
PUBLISH_EVENT(EV_PROCESS_LINE_COMPLETE); |
} |
#else |
/* determine if any of the RLE blocks overlap */ |
FrameMgr_findConnectedness(); |
/* we also want to remove any objects that are less than |
a minimum height...we already removed portions of the |
run-length that are less than MIN_PIXEL_WIDTH in the |
findConnectedness() routine...doing it here instead of |
a function to speed things up...this may end up slowing down the |
frame rate slightly, and can be removed if this isn't needed */ |
/* run this routine once every 8 lines */ |
if ( (trackedLineCount & RUN_OBJECT_FILTER_MASK) == RUN_OBJECT_FILTER_MASK) |
{ |
for (i=0; i<MAX_TRACKED_OBJECTS; i++) |
{ |
if ( *(pTrackedObjectData + VALID_OBJECT_OFFSET) == TRUE) |
{ |
/* check to see if the object is already in |
our past...i.e., its last */ |
if ( (*(pTrackedObjectData + Y_LOWER_RIGHT_OFFSET) - |
*(pTrackedObjectData + Y_UPPER_LEFT_OFFSET)) < MIN_OBJECT_TRACKING_HEIGHT) |
{ |
/* the object is less than the minimum height...see if it is adjacent |
to the current line we just processed...if so, leave it here...otherwise, |
it needs to be invalidated since its too small */ |
if ( trackedLineCount - *(pTrackedObjectData + Y_LOWER_RIGHT_OFFSET) > 2) |
{ |
/* invalidate the object */ |
*(pTrackedObjectData + VALID_OBJECT_OFFSET) = FALSE; |
numCurrTrackedObjects--; |
} |
} |
} |
pTrackedObjectData += SIZE_OF_TRACKED_OBJECT; |
} |
} |
trackedLineCount++; |
if (trackedLineCount == ACTUAL_NUM_LINES_IN_A_FRAME) |
{ |
/* an entire frame of tracking data has been acquired, so |
publish an event letting the system know this fact */ |
PUBLISH_EVENT(EV_ACQUIRE_FRAME_COMPLETE); |
/* disable the PCLK counting overflow interrupt */ |
TIMSK &= DISABLE_PCLK_TIMER1_OVERFLOW_BITMASK; |
trackedLineCount = 0; |
} |
else |
{ |
PUBLISH_FAST_EVENT(FEV_PROCESS_LINE_COMPLETE); |
} |
#endif |
} |
else |
{ |
/* ...and here? */ |
} |
} |
/*********************************************************** |
Function Name: FrameMgr_processFrame |
Function Description: This function is responsible for |
parsing the completed frame and performing all actions |
needed at this level. |
Inputs: none |
Outputs: none |
***********************************************************/ |
void FrameMgr_processFrame(void) |
{ |
unsigned char i,k,color; |
#if DEBUG_FRAME_DATA |
unsigned char asciiBuffer[5]; |
unsigned char j; |
#endif |
unsigned char *pTableData = (unsigned char *)pCurrentTrackedObjectTable; |
unsigned char tmpUpperLeftX,tmpUpperLeftY,tmpLowerRightX,tmpLowerRightY; |
#if DEBUG_FRAME_DATA |
/* we want to send all of the currently tracked table out |
the serial port for debugging */ |
for (i=0; i<numCurrTrackedObjects; i++) |
{ |
UIMgr_txBuffer("----------\r\n",12); |
for (j=0; j<SIZE_OF_TRACKED_OBJECT; j++) |
{ |
memset(asciiBuffer,0x00,5); |
itoa(*pTableData++,asciiBuffer,10); |
UIMgr_txBuffer(asciiBuffer,3); /* 3 ascii bytes for data |
+ 1 space */ |
UIMgr_txBuffer("\r\n",2); |
} |
} |
/* finally, send a new line */ |
UIMgr_txBuffer("\r\n",2); |
memset(asciiBuffer,0x00,5); |
itoa(numCurrTrackedObjects,asciiBuffer,10); |
UIMgr_txBuffer(asciiBuffer,3); |
UIMgr_txBuffer(" PFC\r\n",5); |
#else |
/* we only send tracking packets if there are tracked objects */ |
if (numCurrTrackedObjects > 0) |
{ |
UIMgr_writeTxFifo(0x0A); /* header byte for a tracking packet */ |
/* reset the pointer */ |
pTableData = (unsigned char *)pCurrentTrackedObjectTable; |
UIMgr_writeTxFifo(numCurrTrackedObjects); /* num of objects tracked */ |
for (i=0; i<MAX_TRACKED_OBJECTS; i++) |
{ |
/* we only want to process objects that have their objectValid flag |
set to TRUE */ |
if ( *(pTableData + VALID_OBJECT_OFFSET) == TRUE) |
{ |
/* the object is valid...convert the color from bit position to value...remember, |
each bit in the "color" byte corresponds to a color */ |
k=0; |
color = *(pTableData + COLOR_OFFSET); |
if (color == 128) k=0; |
else if (color == 64) k=1; |
else if (color == 32) k=2; |
else if (color == 16) k=3; |
else if (color == 8) k=4; |
else if (color == 4) k=5; |
else if (color == 2) k=6; |
else if (color == 1) k=7; |
tmpUpperLeftX = *(pTableData + X_UPPER_LEFT_OFFSET); /* get the upper left X */ |
tmpUpperLeftY = *(pTableData + Y_UPPER_LEFT_OFFSET); /* get the upper left Y */ |
tmpLowerRightX = *(pTableData + X_LOWER_RIGHT_OFFSET); /* get the lower right X */ |
tmpLowerRightY = *(pTableData + Y_LOWER_RIGHT_OFFSET); /* get the lower right Y */ |
UIMgr_writeTxFifo(k); /* send the color first */ |
UIMgr_writeTxFifo(tmpUpperLeftX); |
UIMgr_writeTxFifo(tmpUpperLeftY); |
UIMgr_writeTxFifo(tmpLowerRightX); |
UIMgr_writeTxFifo(tmpLowerRightY); |
} |
/* move our pointer up to the beginning of the next object */ |
pTableData += SIZE_OF_TRACKED_OBJECT; |
} |
/* all done...send the end of tracking packets char */ |
UIMgr_writeTxFifo(0xFF); |
} |
#endif |
/* the tracked object table will be cleared out right before we start |
to wait for VSYNC to indicate a new frame...so it doesn't need to be |
done now */ |
/* schedule the next action to acquire a new frame */ |
PUBLISH_EVENT(EV_PROCESS_FRAME_COMPLETE); |
} |
/*********************************************************** |
Function Name: FrameMgr_findConnectedness |
Function Description: This function is responsible for |
finding the connectedness between two particular run- |
length encoded lines of pixel data. It updates the |
trackingTable as needed. |
Inputs: none |
Outputs: none |
***********************************************************/ |
static void FrameMgr_findConnectedness(void) |
{ |
trackedColor_t currColor; |
unsigned char *pCurrLineColorInfo = currentLineBuffer; |
unsigned char *pTrackedObjectData; |
register unsigned char currPixelRunStart=0; |
register unsigned char currPixelRunFinish=0; |
register unsigned char lastLineXStart=0; |
register unsigned char lastLineXFinish=0; |
register unsigned char runLength=1; |
unsigned char i; |
bool_t colorConnected; |
do |
{ |
/* grab both the current color and the number of pixels |
in the run...remember, pixels start at 1, not 0! */ |
colorConnected = FALSE; |
currColor = *pCurrLineColorInfo++; |
currPixelRunStart += runLength; |
runLength = *pCurrLineColorInfo++; |
currPixelRunFinish += runLength; |
/* make sure that the run-length is at least as wide as |
the minimum horizontal tracking width, and we care about the color */ |
if ( (currColor != notTracked) && (runLength > MIN_OBJECT_TRACKING_WIDTH) ) |
{ |
/* this run contains a color we care about, so |
either it will begin a new tracked object, or it |
is connected to a currently tracked object... |
compare it with each object in the tracking |
table...we can't just look at the numTrackedObjects because |
it is entirely possible that the first couple of objects could |
be invalid... |
NOTE: Instead of accessing each element in the trackedObjectTable |
through the 'i' index, and then accessing the fields in each structure, |
a pointer to each entry is established each time through the loop, followed |
by accessing the elements through specified offsets. GCC seems to be |
able to optimize this code much better than simply accessing the elements |
of each structure in the array the more normal way...*/ |
pTrackedObjectData = (unsigned char *)pCurrentTrackedObjectTable; |
for (i=0; i<MAX_TRACKED_OBJECTS; i++) |
{ |
if ( (currColor == *(pTrackedObjectData + COLOR_OFFSET)) && |
(*(pTrackedObjectData + VALID_OBJECT_OFFSET) == TRUE) && |
(*(pTrackedObjectData + Y_LOWER_RIGHT_OFFSET) == trackedLineCount - 1) && |
/* add a check to limit the vertical size of object to 18 pixels...this will help segment the |
image for the purpose of tracking a line for the Chibots contest */ |
( (*(pTrackedObjectData + Y_LOWER_RIGHT_OFFSET) - (*(pTrackedObjectData + Y_UPPER_LEFT_OFFSET) ) ) < 18) ) |
{ |
/* found a color match and the object is valid...check to see if there is |
connectedness */ |
lastLineXStart = *(pTrackedObjectData + LAST_LINE_X_START_OFFSET); |
lastLineXFinish = *(pTrackedObjectData + LAST_LINE_X_FINISH_OFFSET); |
/* Check for the 5 following types of line connectedness: |
--------------------- |
| | |
--------------------- |
------------------------- |
| | |
------------------------- */ |
if ( ( (currPixelRunStart >= lastLineXStart) && |
(currPixelRunStart <= lastLineXFinish) ) || |
/* --------------------- |
| | |
--------------------- |
------------------- |
| | |
------------------- |
OR |
------------------------------ |
| | |
------------------------------ |
--------- |
| | |
--------- */ |
( (currPixelRunFinish >= lastLineXStart) && |
(currPixelRunFinish <= lastLineXFinish) ) || |
/* ------------------------------- |
| | |
------------------------------- |
------------------------------- |
| | |
------------------------------- |
OR |
------------- |
| | |
------------- |
------------------------------- |
| | |
------------------------------- */ |
( (currPixelRunStart <= lastLineXStart) && |
(currPixelRunFinish >= lastLineXFinish) ) ) |
{ |
/* THERE IS CONNECTEDNESS...update the lastLineXStart and lastLineXFinish |
data pointed to by pTrackedObjectData */ |
*(pTrackedObjectData + LAST_LINE_X_START_OFFSET) = currPixelRunStart; |
*(pTrackedObjectData + LAST_LINE_X_FINISH_OFFSET) = currPixelRunFinish; |
/* check if the bounding box needs to be updated */ |
if (*(pTrackedObjectData + X_UPPER_LEFT_OFFSET) > currPixelRunStart) |
{ |
/* need to update the bounding box for the upper left point to |
enclose this new left-most point...we never have to update the |
upper left Y point, since each scan line we process moves from |
top to bottom */ |
*(pTrackedObjectData + X_UPPER_LEFT_OFFSET) = currPixelRunStart; |
} |
if ( *(pTrackedObjectData + X_LOWER_RIGHT_OFFSET) < currPixelRunFinish) |
{ |
/* need to update the bounding box for the lower right X point to |
enclose this new right-most point */ |
*(pTrackedObjectData + X_LOWER_RIGHT_OFFSET) = currPixelRunFinish; |
} |
/* the lower right 'y' point always gets updated when connectedness is found */ |
*(pTrackedObjectData + Y_LOWER_RIGHT_OFFSET) = trackedLineCount; |
/* set a flag indicating that that color run is part of another |
object and thus doesn't need to be added as a new entry into the |
tracking table */ |
colorConnected = TRUE; |
break; |
} |
} |
/* go to the next object */ |
pTrackedObjectData += SIZE_OF_TRACKED_OBJECT; |
} |
if (colorConnected == FALSE) |
{ |
/* a new entry needs to be made to the tracking table, since we have |
a run-length with a color, and it isn't connected to anything...but we |
can only do this if there is space left in the trackedObject table */ |
if (numCurrTrackedObjects < MAX_TRACKED_OBJECTS) |
{ |
/* space is available...add the object...but first we need to find an |
invalid object in the object tracking table */ |
pTrackedObjectData = (unsigned char *)pCurrentTrackedObjectTable; |
for (i=0; i<MAX_TRACKED_OBJECTS; i++) |
{ |
if ( *(pTrackedObjectData + VALID_OBJECT_OFFSET) == FALSE) break; |
/* if we haven't broken above, then the object must have been valid... |
go ahead and move the pointer to the next object to check it */ |
pTrackedObjectData += SIZE_OF_TRACKED_OBJECT; |
} |
/* now that we have a pointer to the tracked object to be updated, update all |
the fields */ |
*(pTrackedObjectData + COLOR_OFFSET) = currColor; /* color */ |
*(pTrackedObjectData + LAST_LINE_X_START_OFFSET) = currPixelRunStart; /* lastLineXStart */ |
*(pTrackedObjectData + LAST_LINE_X_FINISH_OFFSET) = currPixelRunFinish; /* lastLineXFinish */ |
*(pTrackedObjectData + X_UPPER_LEFT_OFFSET) = currPixelRunStart; /* x_upperLeft */ |
*(pTrackedObjectData + Y_UPPER_LEFT_OFFSET) = trackedLineCount; /* y_upperLeft */ |
*(pTrackedObjectData + X_LOWER_RIGHT_OFFSET) = currPixelRunFinish; /* x_lowerRight */ |
*(pTrackedObjectData + Y_LOWER_RIGHT_OFFSET) = trackedLineCount; /* y_lowerRight */ |
*(pTrackedObjectData + VALID_OBJECT_OFFSET) = TRUE; /* objectValid flag */ |
numCurrTrackedObjects++; |
} |
} |
/* move the pointer to the beginning of the next tracked object */ |
pTrackedObjectData += SIZE_OF_TRACKED_OBJECT; |
} |
} while(currPixelRunFinish < ACTUAL_NUM_PIXELS_IN_A_LINE); |
} |
/programy/C/avr/AVRcam/AVRcam.elf |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr/AVRcam/AVRcam.kdevelop.filelist |
---|
0,0 → 1,22 |
# KDevelop Custom Project File List |
CamConfig.c |
CamConfig.h |
CamInterface.c |
CamInterface.h |
CommonDefs.h |
DebugInterface.c |
DebugInterface.h |
Events.h |
Executive.c |
Executive.h |
FrameMgr.c |
FrameMgr.h |
I2CInterface.c |
I2CInterface.h |
Main.c |
UartInterface.c |
UartInterface.h |
UIMgr.c |
UIMgr.h |
Utility.c |
Utility.h |
/programy/C/avr/AVRcam/CamConfig.lst |
---|
0,0 → 1,560 |
GAS LISTING /tmp/cctTSiV3.s page 1 |
1 .file "CamConfig.c" |
2 .arch atmega8 |
3 __SREG__ = 0x3f |
4 __SP_H__ = 0x3e |
5 __SP_L__ = 0x3d |
6 __tmp_reg__ = 0 |
7 __zero_reg__ = 1 |
8 .global __do_copy_data |
9 .global __do_clear_bss |
10 .stabs "/home/kaklik/projects/programy/Atmel_C/AVRcam/",100,0,2,.Ltext0 |
11 .stabs "CamConfig.c",100,0,2,.Ltext0 |
12 .text |
13 .Ltext0: |
14 .stabs "gcc2_compiled.",60,0,0,0 |
15 .stabs "int:t(0,1)=r(0,1);-32768;32767;",128,0,0,0 |
16 .stabs "char:t(0,2)=@s8;r(0,2);0;255;",128,0,0,0 |
17 .stabs "long int:t(0,3)=@s32;r(0,3);020000000000;017777777777;",128,0,0,0 |
18 .stabs "unsigned int:t(0,4)=r(0,4);0;0177777;",128,0,0,0 |
19 .stabs "long unsigned int:t(0,5)=@s32;r(0,5);0;037777777777;",128,0,0,0 |
20 .stabs "long long int:t(0,6)=@s64;r(0,6);01000000000000000000000;0777777777777777777777;",128,0,0, |
21 .stabs "long long unsigned int:t(0,7)=@s64;r(0,7);0;01777777777777777777777;",128,0,0,0 |
22 .stabs "short int:t(0,8)=r(0,8);-32768;32767;",128,0,0,0 |
23 .stabs "short unsigned int:t(0,9)=r(0,9);0;0177777;",128,0,0,0 |
24 .stabs "signed char:t(0,10)=@s8;r(0,10);-128;127;",128,0,0,0 |
25 .stabs "unsigned char:t(0,11)=@s8;r(0,11);0;255;",128,0,0,0 |
26 .stabs "float:t(0,12)=r(0,1);4;0;",128,0,0,0 |
27 .stabs "double:t(0,13)=r(0,1);4;0;",128,0,0,0 |
28 .stabs "long double:t(0,14)=r(0,1);4;0;",128,0,0,0 |
29 .stabs "void:t(0,15)=(0,15)",128,0,0,0 |
30 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/io.h",130,0,0,0 |
31 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/sfr_defs.h",130,0,0,0 |
32 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/inttypes.h",130,0,0,0 |
33 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/stdint.h",130,0,0,0 |
34 .stabs "int8_t:t(4,1)=(0,10)",128,0,116,0 |
35 .stabs "uint8_t:t(4,2)=(0,11)",128,0,117,0 |
36 .stabs "int16_t:t(4,3)=(0,1)",128,0,118,0 |
37 .stabs "uint16_t:t(4,4)=(0,4)",128,0,119,0 |
38 .stabs "int32_t:t(4,5)=(0,3)",128,0,120,0 |
39 .stabs "uint32_t:t(4,6)=(0,5)",128,0,121,0 |
40 .stabs "int64_t:t(4,7)=(0,6)",128,0,122,0 |
41 .stabs "uint64_t:t(4,8)=(0,7)",128,0,123,0 |
42 .stabs "intptr_t:t(4,9)=(4,3)",128,0,135,0 |
43 .stabs "uintptr_t:t(4,10)=(4,4)",128,0,140,0 |
44 .stabs "int_least8_t:t(4,11)=(4,1)",128,0,152,0 |
45 .stabs "uint_least8_t:t(4,12)=(4,2)",128,0,157,0 |
46 .stabs "int_least16_t:t(4,13)=(4,3)",128,0,162,0 |
47 .stabs "uint_least16_t:t(4,14)=(4,4)",128,0,167,0 |
48 .stabs "int_least32_t:t(4,15)=(4,5)",128,0,172,0 |
49 .stabs "uint_least32_t:t(4,16)=(4,6)",128,0,177,0 |
50 .stabs "int_least64_t:t(4,17)=(4,7)",128,0,182,0 |
51 .stabs "uint_least64_t:t(4,18)=(4,8)",128,0,187,0 |
52 .stabs "int_fast8_t:t(4,19)=(4,1)",128,0,200,0 |
53 .stabs "uint_fast8_t:t(4,20)=(4,2)",128,0,205,0 |
54 .stabs "int_fast16_t:t(4,21)=(4,3)",128,0,210,0 |
55 .stabs "uint_fast16_t:t(4,22)=(4,4)",128,0,215,0 |
56 .stabs "int_fast32_t:t(4,23)=(4,5)",128,0,220,0 |
57 .stabs "uint_fast32_t:t(4,24)=(4,6)",128,0,225,0 |
GAS LISTING /tmp/cctTSiV3.s page 2 |
58 .stabs "int_fast64_t:t(4,25)=(4,7)",128,0,230,0 |
59 .stabs "uint_fast64_t:t(4,26)=(4,8)",128,0,235,0 |
60 .stabs "intmax_t:t(4,27)=(4,7)",128,0,249,0 |
61 .stabs "uintmax_t:t(4,28)=(4,8)",128,0,254,0 |
62 .stabn 162,0,0,0 |
63 .stabs "int_farptr_t:t(3,1)=(4,5)",128,0,76,0 |
64 .stabs "uint_farptr_t:t(3,2)=(4,6)",128,0,80,0 |
65 .stabn 162,0,0,0 |
66 .stabn 162,0,0,0 |
67 .stabn 162,0,0,0 |
68 .stabs "CamConfig.h",130,0,0,0 |
69 .stabs "I2CInterface.h",130,0,0,0 |
70 .stabs "CommonDefs.h",130,0,0,0 |
71 .stabs "bool_t:t(7,1)=(0,11)",128,0,56,0 |
72 .stabn 162,0,0,0 |
73 .stabs "i2cCmd_t:t(6,1)=(6,2)=s2configReg:(0,11),0,8;data:(0,11),8,8;;",128,0,53,0 |
74 .stabn 162,0,0,0 |
75 .stabn 162,0,0,0 |
76 .stabs "CamConfig_writeTxFifo:F(7,1)",36,0,155,CamConfig_writeTxFifo |
77 .stabs "cmd:P(6,1)",64,0,154,24 |
78 .global CamConfig_writeTxFifo |
79 .type CamConfig_writeTxFifo, @function |
80 CamConfig_writeTxFifo: |
81 .stabd 46,0,0 |
1:CamConfig.c **** /* |
2:CamConfig.c **** Copyright (C) 2004 John Orlando |
3:CamConfig.c **** |
4:CamConfig.c **** AVRcam: a small real-time image processing engine. |
5:CamConfig.c **** |
6:CamConfig.c **** This program is free software; you can redistribute it and/or |
7:CamConfig.c **** modify it under the terms of the GNU General Public |
8:CamConfig.c **** License as published by the Free Software Foundation; either |
9:CamConfig.c **** version 2 of the License, or (at your option) any later version. |
10:CamConfig.c **** |
11:CamConfig.c **** This program is distributed in the hope that it will be useful, |
12:CamConfig.c **** but WITHOUT ANY WARRANTY; without even the implied warranty of |
13:CamConfig.c **** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14:CamConfig.c **** General Public License for more details. |
15:CamConfig.c **** |
16:CamConfig.c **** You should have received a copy of the GNU General Public |
17:CamConfig.c **** License along with this program; if not, write to the Free Software |
18:CamConfig.c **** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19:CamConfig.c **** |
20:CamConfig.c **** For more information on the AVRcam, please contact: |
21:CamConfig.c **** |
22:CamConfig.c **** john@jrobot.net |
23:CamConfig.c **** |
24:CamConfig.c **** or go to www.jrobot.net for more details regarding the system. |
25:CamConfig.c **** */ |
26:CamConfig.c **** /********************************************************** |
27:CamConfig.c **** Module Name: CamConfig.c |
28:CamConfig.c **** Module Date: 04/10/2004 |
29:CamConfig.c **** Module Auth: John Orlando |
30:CamConfig.c **** |
31:CamConfig.c **** Description: This module is responsible for the |
32:CamConfig.c **** high-level configuration activities of the OV6620 |
33:CamConfig.c **** camera module. This module interfaces with the |
GAS LISTING /tmp/cctTSiV3.s page 3 |
34:CamConfig.c **** I2CInterface module to perform this configuration. |
35:CamConfig.c **** |
36:CamConfig.c **** Revision History: |
37:CamConfig.c **** Date Rel Ver. Notes |
38:CamConfig.c **** 4/10/2004 0.1 Module created |
39:CamConfig.c **** 6/30/2004 1.0 Initial release for Circuit Cellar |
40:CamConfig.c **** contest. |
41:CamConfig.c **** 11/15/2004 1.2 Added code to un-tri-state the |
42:CamConfig.c **** OV6620's pixel data busses at |
43:CamConfig.c **** startup after four seconds. |
44:CamConfig.c **** This was added in to |
45:CamConfig.c **** allow the user to re-program the |
46:CamConfig.c **** mega8 at startup if needed. |
47:CamConfig.c **** ***********************************************************/ |
48:CamConfig.c **** |
49:CamConfig.c **** /* Includes */ |
50:CamConfig.c **** #include <avr/io.h> |
51:CamConfig.c **** #include "CamConfig.h" |
52:CamConfig.c **** #include "I2CInterface.h" |
53:CamConfig.c **** #include "CommonDefs.h" |
54:CamConfig.c **** #include "Utility.h" |
55:CamConfig.c **** |
56:CamConfig.c **** /**********************************************************/ |
57:CamConfig.c **** /* Definitions */ |
58:CamConfig.c **** /* The length of an I2C command is made up of a register address |
59:CamConfig.c **** plus the actual value of the register */ |
60:CamConfig.c **** #define SIZE_OF_I2C_CMD 2 |
61:CamConfig.c **** #define MAX_NUM_CONFIG_CMDS 8 |
62:CamConfig.c **** #define CAM_CONFIG_TX_FIFO_SIZE MAX_NUM_CONFIG_CMDS |
63:CamConfig.c **** #define CAM_CONFIG_TX_FIFO_MASK CAM_CONFIG_TX_FIFO_SIZE-1 |
64:CamConfig.c **** |
65:CamConfig.c **** /* Local Variables */ |
66:CamConfig.c **** |
67:CamConfig.c **** /* Local Structures and Typedefs */ |
68:CamConfig.c **** |
69:CamConfig.c **** /* Local Function Prototypes */ |
70:CamConfig.c **** static i2cCmd_t CamConfig_readTxFifo(void); |
71:CamConfig.c **** |
72:CamConfig.c **** /* Extern Variables */ |
73:CamConfig.c **** i2cCmd_t CamConfig_txFifo[CAM_CONFIG_TX_FIFO_SIZE]; |
74:CamConfig.c **** unsigned char CamConfig_txFifoHead=0; |
75:CamConfig.c **** unsigned char CamConfig_txFifoTail=0; |
76:CamConfig.c **** |
77:CamConfig.c **** /*********************************************************** |
78:CamConfig.c **** Function Name: CamConfig_init |
79:CamConfig.c **** Function Description: This function is responsible for |
80:CamConfig.c **** performing the initial configuration of the camera. |
81:CamConfig.c **** Inputs: none |
82:CamConfig.c **** Outputs: none |
83:CamConfig.c **** ***********************************************************/ |
84:CamConfig.c **** void CamConfig_init(void) |
85:CamConfig.c **** { |
86:CamConfig.c **** CamConfig_setCamReg(0x14,0x20); /* reduce frame size */ |
87:CamConfig.c **** CamConfig_setCamReg(0x39,0x40); /* gate PCLK with HREF */ |
88:CamConfig.c **** CamConfig_setCamReg(0x12,0x28); /* set RGB mode, with no AWB */ |
89:CamConfig.c **** CamConfig_setCamReg(0x28,0x05); /* set color sequencer */ |
90:CamConfig.c **** CamConfig_setCamReg(0x13,0x01); /* un-tri-state the Y/UV lines */ |
GAS LISTING /tmp/cctTSiV3.s page 4 |
91:CamConfig.c **** |
92:CamConfig.c **** /* send the first four cmds in the I2C fifo */ |
93:CamConfig.c **** CamConfig_sendFifoCmds(); |
94:CamConfig.c **** } |
95:CamConfig.c **** |
96:CamConfig.c **** |
97:CamConfig.c **** /*********************************************************** |
98:CamConfig.c **** Function Name: CamConfig_setCamReg |
99:CamConfig.c **** Function Description: This function is responsible for |
100:CamConfig.c **** creating an I2C cmd structure and placing it into the |
101:CamConfig.c **** cmd fifo. |
102:CamConfig.c **** Inputs: reg - the register to modify |
103:CamConfig.c **** val - the new value of the register |
104:CamConfig.c **** Outputs: none |
105:CamConfig.c **** ***********************************************************/ |
106:CamConfig.c **** void CamConfig_setCamReg(unsigned char reg, unsigned char val) |
107:CamConfig.c **** { |
108:CamConfig.c **** i2cCmd_t cmd; |
109:CamConfig.c **** |
110:CamConfig.c **** cmd.configReg = reg; |
111:CamConfig.c **** cmd.data = val; |
112:CamConfig.c **** #ifndef SIMULATION |
113:CamConfig.c **** CamConfig_writeTxFifo(cmd); |
114:CamConfig.c **** #endif |
115:CamConfig.c **** } |
116:CamConfig.c **** /*********************************************************** |
117:CamConfig.c **** Function Name: CamConfig_sendFifoCmds |
118:CamConfig.c **** Function Description: This function is responsible for |
119:CamConfig.c **** sending the entire contents of the config fifo. This |
120:CamConfig.c **** function won't return until the configuration process |
121:CamConfig.c **** is complete (or an error is encountered). |
122:CamConfig.c **** Inputs: none |
123:CamConfig.c **** Outputs: none |
124:CamConfig.c **** Note: Since this function is written to use the TWI |
125:CamConfig.c **** interrupt in the I2CInterface module, there will be |
126:CamConfig.c **** some busy-waiting here...no big deal, since we end up |
127:CamConfig.c **** having to trash the frame that we are executing this |
128:CamConfig.c **** slave write in anyway (since we can't meet the strict |
129:CamConfig.c **** timing requirements and write i2c at the same time). |
130:CamConfig.c **** ***********************************************************/ |
131:CamConfig.c **** void CamConfig_sendFifoCmds(void) |
132:CamConfig.c **** { |
133:CamConfig.c **** i2cCmd_t cmd; |
134:CamConfig.c **** |
135:CamConfig.c **** while (CamConfig_txFifoHead != CamConfig_txFifoTail) |
136:CamConfig.c **** { |
137:CamConfig.c **** cmd = CamConfig_readTxFifo(); |
138:CamConfig.c **** I2CInt_writeData(CAM_ADDRESS,&cmd.configReg,SIZE_OF_I2C_CMD); |
139:CamConfig.c **** Utility_delay(100); |
140:CamConfig.c **** /* wait for the I2C transaction to complete */ |
141:CamConfig.c **** while(I2CInt_isI2cBusy() == TRUE); |
142:CamConfig.c **** } |
143:CamConfig.c **** } |
144:CamConfig.c **** |
145:CamConfig.c **** /*********************************************************** |
146:CamConfig.c **** Function Name: CamConfig_writeTxFifo |
147:CamConfig.c **** Function Description: This function is responsible for |
GAS LISTING /tmp/cctTSiV3.s page 5 |
148:CamConfig.c **** adding a new command to the tx fifo. It adjusts all |
149:CamConfig.c **** needed pointers. |
150:CamConfig.c **** Inputs: cmd - the i2cCmd_t to add to the fifo |
151:CamConfig.c **** Outputs: bool_t - indicating if writing to the fifo |
152:CamConfig.c **** causes it to wrap |
153:CamConfig.c **** ***********************************************************/ |
154:CamConfig.c **** bool_t CamConfig_writeTxFifo(i2cCmd_t cmd) |
155:CamConfig.c **** { |
82 .stabn 68,0,155,.LM0-CamConfig_writeTxFifo |
83 .LM0: |
84 /* prologue: frame size=0 */ |
85 /* prologue end (size=0) */ |
156:CamConfig.c **** unsigned char tmpHead; |
157:CamConfig.c **** bool_t retVal = TRUE; |
158:CamConfig.c **** |
159:CamConfig.c **** CamConfig_txFifo[CamConfig_txFifoHead] = cmd; |
86 .stabn 68,0,159,.LM1-CamConfig_writeTxFifo |
87 .LM1: |
88 0000 2091 0000 lds r18,CamConfig_txFifoHead |
89 0004 E22F mov r30,r18 |
90 0006 FF27 clr r31 |
91 0008 EE0F lsl r30 |
92 000a FF1F rol r31 |
93 000c E050 subi r30,lo8(-(CamConfig_txFifo)) |
94 000e F040 sbci r31,hi8(-(CamConfig_txFifo)) |
95 0010 9183 std Z+1,r25 |
96 0012 8083 st Z,r24 |
160:CamConfig.c **** |
161:CamConfig.c **** /* see if we need to wrap */ |
162:CamConfig.c **** tmpHead = (CamConfig_txFifoHead+1) & (CAM_CONFIG_TX_FIFO_MASK); |
97 .stabn 68,0,162,.LM2-CamConfig_writeTxFifo |
98 .LM2: |
99 0014 2F5F subi r18,lo8(-(1)) |
100 0016 2770 andi r18,lo8(7) |
163:CamConfig.c **** CamConfig_txFifoHead = tmpHead; |
101 .stabn 68,0,163,.LM3-CamConfig_writeTxFifo |
102 .LM3: |
103 0018 2093 0000 sts CamConfig_txFifoHead,r18 |
104 001c 90E0 ldi r25,lo8(0) |
105 001e 8091 0000 lds r24,CamConfig_txFifoTail |
106 0022 2817 cp r18,r24 |
107 0024 09F4 brne .L2 |
108 .stabn 68,0,163,.LM4-CamConfig_writeTxFifo |
109 .LM4: |
110 0026 91E0 ldi r25,lo8(1) |
111 .L2: |
112 0028 81E0 ldi r24,lo8(1) |
113 002a 8927 eor r24,r25 |
164:CamConfig.c **** |
165:CamConfig.c **** /* check to see if we have filled up the queue */ |
166:CamConfig.c **** if (CamConfig_txFifoHead == CamConfig_txFifoTail) |
167:CamConfig.c **** { |
168:CamConfig.c **** /* we wrapped the fifo...return false */ |
169:CamConfig.c **** retVal = FALSE; |
170:CamConfig.c **** } |
171:CamConfig.c **** return(retVal); |
172:CamConfig.c **** } |
GAS LISTING /tmp/cctTSiV3.s page 6 |
114 .stabn 68,0,172,.LM5-CamConfig_writeTxFifo |
115 .LM5: |
116 002c 9927 clr r25 |
117 /* epilogue: frame size=0 */ |
118 002e 0895 ret |
119 /* epilogue end (size=1) */ |
120 /* function CamConfig_writeTxFifo size 24 (23) */ |
121 .size CamConfig_writeTxFifo, .-CamConfig_writeTxFifo |
122 .stabs "tmpHead:r(0,11)",64,0,156,18 |
123 .stabn 192,0,0,CamConfig_writeTxFifo-CamConfig_writeTxFifo |
124 .stabn 224,0,0,.Lscope0-CamConfig_writeTxFifo |
125 .Lscope0: |
126 .stabs "",36,0,0,.Lscope0-CamConfig_writeTxFifo |
127 .stabd 78,0,0 |
128 .stabs "CamConfig_setCamReg:F(0,15)",36,0,107,CamConfig_setCamReg |
129 .stabs "reg:P(0,11)",64,0,106,24 |
130 .stabs "val:P(0,11)",64,0,106,22 |
131 .global CamConfig_setCamReg |
132 .type CamConfig_setCamReg, @function |
133 CamConfig_setCamReg: |
134 .stabd 46,0,0 |
135 .stabn 68,0,107,.LM6-CamConfig_setCamReg |
136 .LM6: |
137 /* prologue: frame size=0 */ |
138 /* prologue end (size=0) */ |
139 .stabn 68,0,110,.LM7-CamConfig_setCamReg |
140 .LM7: |
141 0030 282F mov r18,r24 |
142 .stabn 68,0,111,.LM8-CamConfig_setCamReg |
143 .LM8: |
144 0032 362F mov r19,r22 |
145 .stabn 68,0,113,.LM9-CamConfig_setCamReg |
146 .LM9: |
147 0034 C901 movw r24,r18 |
148 0036 E4DF rcall CamConfig_writeTxFifo |
149 /* epilogue: frame size=0 */ |
150 0038 0895 ret |
151 /* epilogue end (size=1) */ |
152 /* function CamConfig_setCamReg size 5 (4) */ |
153 .size CamConfig_setCamReg, .-CamConfig_setCamReg |
154 .stabs "cmd:r(6,1)",64,0,108,18 |
155 .stabn 192,0,0,CamConfig_setCamReg-CamConfig_setCamReg |
156 .stabn 224,0,0,.Lscope1-CamConfig_setCamReg |
157 .Lscope1: |
158 .stabs "",36,0,0,.Lscope1-CamConfig_setCamReg |
159 .stabd 78,0,0 |
160 .stabs "CamConfig_sendFifoCmds:F(0,15)",36,0,132,CamConfig_sendFifoCmds |
161 .global CamConfig_sendFifoCmds |
162 .type CamConfig_sendFifoCmds, @function |
163 CamConfig_sendFifoCmds: |
164 .stabd 46,0,0 |
165 .stabn 68,0,132,.LM10-CamConfig_sendFifoCmds |
166 .LM10: |
167 /* prologue: frame size=2 */ |
168 003a 0F93 push r16 |
169 003c 1F93 push r17 |
170 003e CF93 push r28 |
GAS LISTING /tmp/cctTSiV3.s page 7 |
171 0040 DF93 push r29 |
172 0042 CDB7 in r28,__SP_L__ |
173 0044 DEB7 in r29,__SP_H__ |
174 0046 2297 sbiw r28,2 |
175 0048 0FB6 in __tmp_reg__,__SREG__ |
176 004a F894 cli |
177 004c DEBF out __SP_H__,r29 |
178 004e 0FBE out __SREG__,__tmp_reg__ |
179 0050 CDBF out __SP_L__,r28 |
180 /* prologue end (size=12) */ |
181 0052 8E01 movw r16,r28 |
182 0054 0F5F subi r16,lo8(-(1)) |
183 0056 1F4F sbci r17,hi8(-(1)) |
184 0058 19C0 rjmp .L7 |
185 .L8: |
186 .LBB4: |
187 .LBB5: |
173:CamConfig.c **** |
174:CamConfig.c **** /*********************************************************** |
175:CamConfig.c **** Function Name: CamConfig_readTxFifo |
176:CamConfig.c **** Function Description: This function is responsible for |
177:CamConfig.c **** reading a cmd out of the tx fifo. |
178:CamConfig.c **** Inputs: none |
179:CamConfig.c **** Outputs: i2cCmd_t - the cmd read from the fifo |
180:CamConfig.c **** ***********************************************************/ |
181:CamConfig.c **** static i2cCmd_t CamConfig_readTxFifo(void) |
182:CamConfig.c **** { |
183:CamConfig.c **** i2cCmd_t cmd; |
184:CamConfig.c **** unsigned char tmpTail; |
185:CamConfig.c **** |
186:CamConfig.c **** /* just return the current tail from the rx fifo */ |
187:CamConfig.c **** cmd = CamConfig_txFifo[CamConfig_txFifoTail]; |
188 .stabn 68,0,187,.LM11-CamConfig_sendFifoCmds |
189 .LM11: |
190 005a E32F mov r30,r19 |
191 005c FF27 clr r31 |
192 005e EE0F lsl r30 |
193 0060 FF1F rol r31 |
194 0062 E050 subi r30,lo8(-(CamConfig_txFifo)) |
195 0064 F040 sbci r31,hi8(-(CamConfig_txFifo)) |
196 0066 9181 ldd r25,Z+1 |
197 0068 2081 ld r18,Z |
188:CamConfig.c **** tmpTail = (CamConfig_txFifoTail+1) & (CAM_CONFIG_TX_FIFO_MASK); |
189:CamConfig.c **** CamConfig_txFifoTail = tmpTail; |
198 .stabn 68,0,189,.LM12-CamConfig_sendFifoCmds |
199 .LM12: |
200 006a 832F mov r24,r19 |
201 006c 8F5F subi r24,lo8(-(1)) |
202 006e 8770 andi r24,lo8(7) |
203 0070 8093 0000 sts CamConfig_txFifoTail,r24 |
204 .stabn 68,0,137,.LM13-CamConfig_sendFifoCmds |
205 .LM13: |
206 0074 9A83 std Y+2,r25 |
207 0076 2983 std Y+1,r18 |
208 .LBE5: |
209 .LBE4: |
210 .stabn 68,0,138,.LM14-CamConfig_sendFifoCmds |
GAS LISTING /tmp/cctTSiV3.s page 8 |
211 .LM14: |
212 0078 42E0 ldi r20,lo8(2) |
213 007a B801 movw r22,r16 |
214 007c 80E6 ldi r24,lo8(96) |
215 007e 00D0 rcall I2CInt_writeData |
216 .stabn 68,0,139,.LM15-CamConfig_sendFifoCmds |
217 .LM15: |
218 0080 84E6 ldi r24,lo8(100) |
219 0082 90E0 ldi r25,hi8(100) |
220 0084 00D0 rcall Utility_delay |
221 .L9: |
222 .stabn 68,0,141,.LM16-CamConfig_sendFifoCmds |
223 .LM16: |
224 0086 00D0 rcall I2CInt_isI2cBusy |
225 0088 8130 cpi r24,lo8(1) |
226 008a E9F3 breq .L9 |
227 .L7: |
228 .stabn 68,0,135,.LM17-CamConfig_sendFifoCmds |
229 .LM17: |
230 008c 3091 0000 lds r19,CamConfig_txFifoTail |
231 0090 8091 0000 lds r24,CamConfig_txFifoHead |
232 0094 8317 cp r24,r19 |
233 0096 09F7 brne .L8 |
234 /* epilogue: frame size=2 */ |
235 0098 2296 adiw r28,2 |
236 009a 0FB6 in __tmp_reg__,__SREG__ |
237 009c F894 cli |
238 009e DEBF out __SP_H__,r29 |
239 00a0 0FBE out __SREG__,__tmp_reg__ |
240 00a2 CDBF out __SP_L__,r28 |
241 00a4 DF91 pop r29 |
242 00a6 CF91 pop r28 |
243 00a8 1F91 pop r17 |
244 00aa 0F91 pop r16 |
245 00ac 0895 ret |
246 /* epilogue end (size=11) */ |
247 /* function CamConfig_sendFifoCmds size 58 (35) */ |
248 .size CamConfig_sendFifoCmds, .-CamConfig_sendFifoCmds |
249 .stabs "cmd:(6,1)",128,0,133,1 |
250 .stabn 192,0,0,CamConfig_sendFifoCmds-CamConfig_sendFifoCmds |
251 .stabn 224,0,0,.Lscope2-CamConfig_sendFifoCmds |
252 .Lscope2: |
253 .stabs "",36,0,0,.Lscope2-CamConfig_sendFifoCmds |
254 .stabd 78,0,0 |
255 .stabs "CamConfig_init:F(0,15)",36,0,85,CamConfig_init |
256 .global CamConfig_init |
257 .type CamConfig_init, @function |
258 CamConfig_init: |
259 .stabd 46,0,0 |
260 .stabn 68,0,85,.LM18-CamConfig_init |
261 .LM18: |
262 /* prologue: frame size=0 */ |
263 /* prologue end (size=0) */ |
264 .stabn 68,0,86,.LM19-CamConfig_init |
265 .LM19: |
266 00ae 60E2 ldi r22,lo8(32) |
267 00b0 84E1 ldi r24,lo8(20) |
GAS LISTING /tmp/cctTSiV3.s page 9 |
268 00b2 BEDF rcall CamConfig_setCamReg |
269 .stabn 68,0,87,.LM20-CamConfig_init |
270 .LM20: |
271 00b4 60E4 ldi r22,lo8(64) |
272 00b6 89E3 ldi r24,lo8(57) |
273 00b8 BBDF rcall CamConfig_setCamReg |
274 .stabn 68,0,88,.LM21-CamConfig_init |
275 .LM21: |
276 00ba 68E2 ldi r22,lo8(40) |
277 00bc 82E1 ldi r24,lo8(18) |
278 00be B8DF rcall CamConfig_setCamReg |
279 .stabn 68,0,89,.LM22-CamConfig_init |
280 .LM22: |
281 00c0 65E0 ldi r22,lo8(5) |
282 00c2 88E2 ldi r24,lo8(40) |
283 00c4 B5DF rcall CamConfig_setCamReg |
284 .stabn 68,0,90,.LM23-CamConfig_init |
285 .LM23: |
286 00c6 61E0 ldi r22,lo8(1) |
287 00c8 83E1 ldi r24,lo8(19) |
288 00ca B2DF rcall CamConfig_setCamReg |
289 .stabn 68,0,93,.LM24-CamConfig_init |
290 .LM24: |
291 00cc B6DF rcall CamConfig_sendFifoCmds |
292 /* epilogue: frame size=0 */ |
293 00ce 0895 ret |
294 /* epilogue end (size=1) */ |
295 /* function CamConfig_init size 17 (16) */ |
296 .size CamConfig_init, .-CamConfig_init |
297 .Lscope3: |
298 .stabs "",36,0,0,.Lscope3-CamConfig_init |
299 .stabd 78,0,0 |
300 .global CamConfig_txFifoHead |
301 .global CamConfig_txFifoHead |
302 .section .bss |
303 .type CamConfig_txFifoHead, @object |
304 .size CamConfig_txFifoHead, 1 |
305 CamConfig_txFifoHead: |
306 0000 00 .skip 1,0 |
307 .global CamConfig_txFifoTail |
308 .global CamConfig_txFifoTail |
309 .type CamConfig_txFifoTail, @object |
310 .size CamConfig_txFifoTail, 1 |
311 CamConfig_txFifoTail: |
312 0001 00 .skip 1,0 |
313 .comm CamConfig_txFifo,16,1 |
314 .stabs "CamConfig_txFifo:G(0,16)=ar(0,17)=r(0,17);0;0177777;;0;7;(6,1)",32,0,73,0 |
315 .stabs "CamConfig_txFifoHead:G(0,11)",32,0,74,0 |
316 .stabs "CamConfig_txFifoTail:G(0,11)",32,0,75,0 |
317 .text |
318 .stabs "",100,0,0,.Letext0 |
319 .Letext0: |
320 /* File "CamConfig.c": code 104 = 0x0068 ( 78), prologues 12, epilogues 14 */ |
GAS LISTING /tmp/cctTSiV3.s page 10 |
DEFINED SYMBOLS |
*ABS*:00000000 CamConfig.c |
/tmp/cctTSiV3.s:3 *ABS*:0000003f __SREG__ |
/tmp/cctTSiV3.s:4 *ABS*:0000003e __SP_H__ |
/tmp/cctTSiV3.s:5 *ABS*:0000003d __SP_L__ |
/tmp/cctTSiV3.s:6 *ABS*:00000000 __tmp_reg__ |
/tmp/cctTSiV3.s:7 *ABS*:00000001 __zero_reg__ |
/tmp/cctTSiV3.s:80 .text:00000000 CamConfig_writeTxFifo |
/tmp/cctTSiV3.s:305 .bss:00000000 CamConfig_txFifoHead |
*COM*:00000010 CamConfig_txFifo |
/tmp/cctTSiV3.s:311 .bss:00000001 CamConfig_txFifoTail |
/tmp/cctTSiV3.s:133 .text:00000030 CamConfig_setCamReg |
/tmp/cctTSiV3.s:163 .text:0000003a CamConfig_sendFifoCmds |
/tmp/cctTSiV3.s:258 .text:000000ae CamConfig_init |
UNDEFINED SYMBOLS |
__do_copy_data |
__do_clear_bss |
I2CInt_writeData |
Utility_delay |
I2CInt_isI2cBusy |
/programy/C/avr/AVRcam/CamInterface.lst |
---|
0,0 → 1,780 |
GAS LISTING /tmp/cc4KZ7ps.s page 1 |
1 .file "CamInterface.c" |
2 .arch atmega8 |
3 __SREG__ = 0x3f |
4 __SP_H__ = 0x3e |
5 __SP_L__ = 0x3d |
6 __tmp_reg__ = 0 |
7 __zero_reg__ = 1 |
8 .global __do_copy_data |
9 .global __do_clear_bss |
10 .stabs "/home/kaklik/projects/programy/Atmel_C/AVRcam/",100,0,2,.Ltext0 |
11 .stabs "CamInterface.c",100,0,2,.Ltext0 |
12 .text |
13 .Ltext0: |
14 .stabs "gcc2_compiled.",60,0,0,0 |
15 .stabs "int:t(0,1)=r(0,1);-32768;32767;",128,0,0,0 |
16 .stabs "char:t(0,2)=@s8;r(0,2);0;255;",128,0,0,0 |
17 .stabs "long int:t(0,3)=@s32;r(0,3);020000000000;017777777777;",128,0,0,0 |
18 .stabs "unsigned int:t(0,4)=r(0,4);0;0177777;",128,0,0,0 |
19 .stabs "long unsigned int:t(0,5)=@s32;r(0,5);0;037777777777;",128,0,0,0 |
20 .stabs "long long int:t(0,6)=@s64;r(0,6);01000000000000000000000;0777777777777777777777;",128,0,0, |
21 .stabs "long long unsigned int:t(0,7)=@s64;r(0,7);0;01777777777777777777777;",128,0,0,0 |
22 .stabs "short int:t(0,8)=r(0,8);-32768;32767;",128,0,0,0 |
23 .stabs "short unsigned int:t(0,9)=r(0,9);0;0177777;",128,0,0,0 |
24 .stabs "signed char:t(0,10)=@s8;r(0,10);-128;127;",128,0,0,0 |
25 .stabs "unsigned char:t(0,11)=@s8;r(0,11);0;255;",128,0,0,0 |
26 .stabs "float:t(0,12)=r(0,1);4;0;",128,0,0,0 |
27 .stabs "double:t(0,13)=r(0,1);4;0;",128,0,0,0 |
28 .stabs "long double:t(0,14)=r(0,1);4;0;",128,0,0,0 |
29 .stabs "void:t(0,15)=(0,15)",128,0,0,0 |
30 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/interrupt.h",130,0,0,0 |
31 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/io.h",130,0,0,0 |
32 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/sfr_defs.h",130,0,0,0 |
33 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/inttypes.h",130,0,0,0 |
34 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/stdint.h",130,0,0,0 |
35 .stabs "int8_t:t(5,1)=(0,10)",128,0,116,0 |
36 .stabs "uint8_t:t(5,2)=(0,11)",128,0,117,0 |
37 .stabs "int16_t:t(5,3)=(0,1)",128,0,118,0 |
38 .stabs "uint16_t:t(5,4)=(0,4)",128,0,119,0 |
39 .stabs "int32_t:t(5,5)=(0,3)",128,0,120,0 |
40 .stabs "uint32_t:t(5,6)=(0,5)",128,0,121,0 |
41 .stabs "int64_t:t(5,7)=(0,6)",128,0,122,0 |
42 .stabs "uint64_t:t(5,8)=(0,7)",128,0,123,0 |
43 .stabs "intptr_t:t(5,9)=(5,3)",128,0,135,0 |
44 .stabs "uintptr_t:t(5,10)=(5,4)",128,0,140,0 |
45 .stabs "int_least8_t:t(5,11)=(5,1)",128,0,152,0 |
46 .stabs "uint_least8_t:t(5,12)=(5,2)",128,0,157,0 |
47 .stabs "int_least16_t:t(5,13)=(5,3)",128,0,162,0 |
48 .stabs "uint_least16_t:t(5,14)=(5,4)",128,0,167,0 |
49 .stabs "int_least32_t:t(5,15)=(5,5)",128,0,172,0 |
50 .stabs "uint_least32_t:t(5,16)=(5,6)",128,0,177,0 |
51 .stabs "int_least64_t:t(5,17)=(5,7)",128,0,182,0 |
52 .stabs "uint_least64_t:t(5,18)=(5,8)",128,0,187,0 |
53 .stabs "int_fast8_t:t(5,19)=(5,1)",128,0,200,0 |
54 .stabs "uint_fast8_t:t(5,20)=(5,2)",128,0,205,0 |
55 .stabs "int_fast16_t:t(5,21)=(5,3)",128,0,210,0 |
56 .stabs "uint_fast16_t:t(5,22)=(5,4)",128,0,215,0 |
57 .stabs "int_fast32_t:t(5,23)=(5,5)",128,0,220,0 |
GAS LISTING /tmp/cc4KZ7ps.s page 2 |
58 .stabs "uint_fast32_t:t(5,24)=(5,6)",128,0,225,0 |
59 .stabs "int_fast64_t:t(5,25)=(5,7)",128,0,230,0 |
60 .stabs "uint_fast64_t:t(5,26)=(5,8)",128,0,235,0 |
61 .stabs "intmax_t:t(5,27)=(5,7)",128,0,249,0 |
62 .stabs "uintmax_t:t(5,28)=(5,8)",128,0,254,0 |
63 .stabn 162,0,0,0 |
64 .stabs "int_farptr_t:t(4,1)=(5,5)",128,0,76,0 |
65 .stabs "uint_farptr_t:t(4,2)=(5,6)",128,0,80,0 |
66 .stabn 162,0,0,0 |
67 .stabn 162,0,0,0 |
68 .stabn 162,0,0,0 |
69 .stabn 162,0,0,0 |
70 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h",130,0,0,0 |
71 .stabs "/usr/lib/gcc/avr/4.1.0/include/stddef.h",130,0,0,0 |
72 .stabs "size_t:t(7,1)=(0,4)",128,0,214,0 |
73 .stabn 162,0,0,0 |
74 .stabn 162,0,0,0 |
75 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/stdlib.h",130,0,0,0 |
76 .stabs "/usr/lib/gcc/avr/4.1.0/include/stddef.h",130,0,0,0 |
77 .stabs "wchar_t:t(9,1)=(0,1)",128,0,326,0 |
78 .stabn 162,0,0,0 |
79 .stabs "div_t:t(8,1)=(8,2)=s4quot:(0,1),0,16;rem:(0,1),16,16;;",128,0,69,0 |
80 .stabs "ldiv_t:t(8,3)=(8,4)=s8quot:(0,3),0,32;rem:(0,3),32,32;;",128,0,75,0 |
81 .stabs "__compar_fn_t:t(8,5)=(8,6)=*(8,7)=f(0,1)",128,0,78,0 |
82 .stabn 162,0,0,0 |
83 .stabs "CommonDefs.h",130,0,0,0 |
84 .stabs "bool_t:t(10,1)=(0,11)",128,0,56,0 |
85 .stabn 162,0,0,0 |
86 .stabs "CamInt_resetCam:F(0,15)",36,0,225,CamInt_resetCam |
87 .global CamInt_resetCam |
88 .type CamInt_resetCam, @function |
89 CamInt_resetCam: |
90 .stabd 46,0,0 |
1:CamInterface.c **** /* |
2:CamInterface.c **** Copyright (C) 2004 John Orlando |
3:CamInterface.c **** |
4:CamInterface.c **** AVRcam: a small real-time image processing engine. |
5:CamInterface.c **** |
6:CamInterface.c **** This program is free software; you can redistribute it and/or |
7:CamInterface.c **** modify it under the terms of the GNU General Public |
8:CamInterface.c **** License as published by the Free Software Foundation; either |
9:CamInterface.c **** version 2 of the License, or (at your option) any later version. |
10:CamInterface.c **** |
11:CamInterface.c **** This program is distributed in the hope that it will be useful, |
12:CamInterface.c **** but WITHOUT ANY WARRANTY; without even the implied warranty of |
13:CamInterface.c **** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14:CamInterface.c **** General Public License for more details. |
15:CamInterface.c **** |
16:CamInterface.c **** You should have received a copy of the GNU General Public |
17:CamInterface.c **** License along with this program; if not, write to the Free Software |
18:CamInterface.c **** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19:CamInterface.c **** |
20:CamInterface.c **** For more information on the AVRcam, please contact: |
21:CamInterface.c **** |
22:CamInterface.c **** john@jrobot.net |
23:CamInterface.c **** |
24:CamInterface.c **** or go to www.jrobot.net for more details regarding the system. |
GAS LISTING /tmp/cc4KZ7ps.s page 3 |
25:CamInterface.c **** */ |
26:CamInterface.c **** /*********************************************************** |
27:CamInterface.c **** Module Name: CamInterface.c |
28:CamInterface.c **** Module Date: 04/12/2004 |
29:CamInterface.c **** Module Auth: John Orlando |
30:CamInterface.c **** |
31:CamInterface.c **** Description: This file is responsible for providing an |
32:CamInterface.c **** interface to the OV6620 camera hardware. This includes |
33:CamInterface.c **** an interface to CamInterface.S for certain low-level, |
34:CamInterface.c **** optimized camera access routines. |
35:CamInterface.c **** |
36:CamInterface.c **** Revision History: |
37:CamInterface.c **** Date Rel Ver. Notes |
38:CamInterface.c **** 4/10/2004 0.1 Module created |
39:CamInterface.c **** 6/30/2004 1.0 Initial release for Circuit Cellar |
40:CamInterface.c **** contest. |
41:CamInterface.c **** 11/15/2004 1.2 ifdef'd out the resetCam routine, since |
42:CamInterface.c **** resetting the cam now causes the OV6620's |
43:CamInterface.c **** clock to not be output (we have to start |
44:CamInterface.c **** it up after each reset with the external |
45:CamInterface.c **** tiny12 processor). |
46:CamInterface.c **** 1/16/2005 1.4 Ensure that the TCCR1B register is set so |
47:CamInterface.c **** nothing is clocking timer1 at startup. |
48:CamInterface.c **** ***********************************************************/ |
49:CamInterface.c **** |
50:CamInterface.c **** /* Includes */ |
51:CamInterface.c **** #include <avr/interrupt.h> |
52:CamInterface.c **** #include <avr/sleep.h> |
53:CamInterface.c **** #include <avr/eeprom.h> |
54:CamInterface.c **** #include <stdlib.h> |
55:CamInterface.c **** #include <string.h> |
56:CamInterface.c **** #include "CommonDefs.h" |
57:CamInterface.c **** #include "CamInterface.h" |
58:CamInterface.c **** #include "Utility.h" |
59:CamInterface.c **** #include "UIMgr.h" |
60:CamInterface.c **** #include "Executive.h" |
61:CamInterface.c **** #include "UartInterface.h" |
62:CamInterface.c **** |
63:CamInterface.c **** /* Local Variables */ |
64:CamInterface.c **** |
65:CamInterface.c **** /* Local Structures and Typedefs */ |
66:CamInterface.c **** |
67:CamInterface.c **** /* Definitions */ |
68:CamInterface.c **** //#define OUTPUT_INITIAL_COLOR_MAP 1 |
69:CamInterface.c **** |
70:CamInterface.c **** #define FAST_ACQUIRE 1 |
71:CamInterface.c **** #define CAM_G_BUS PINB |
72:CamInterface.c **** #define CAM_G_BUS_DIR DDRB |
73:CamInterface.c **** #define CAM_RB_BUS PINC |
74:CamInterface.c **** #define CAM_RB_BUS_DIR DDRC |
75:CamInterface.c **** |
76:CamInterface.c **** #define CAM_CONTROL_PORT PORTD |
77:CamInterface.c **** #define CAM_CONTROL_PORT_DIR DDRD |
78:CamInterface.c **** #define CAM_RESET_LINE BIT7 |
79:CamInterface.c **** #define CAM_PIXEL_CLK_COUNT BIT5 |
80:CamInterface.c **** #define CAM_HREF BIT4 |
81:CamInterface.c **** #define CAM_PIXEL_CLK_INT BIT3 |
GAS LISTING /tmp/cc4KZ7ps.s page 4 |
82:CamInterface.c **** #define CAM_VSYNC BIT2 |
83:CamInterface.c **** |
84:CamInterface.c **** /* Global Variables */ |
85:CamInterface.c **** /* NOTE: This file MUST appear first in the Makefile for these variables to |
86:CamInterface.c **** be placed properly in RAM */ |
87:CamInterface.c **** |
88:CamInterface.c **** /* The colorMap[] table provides the membership lookup table to convert |
89:CamInterface.c **** RGB or YUV pixel values into actual colors. The membership table contains |
90:CamInterface.c **** 16 elements for each color channel, concatenated together. The Red (or Y) |
91:CamInterface.c **** value is located in the first 16 bytes, the G (or U) value is located in |
92:CamInterface.c **** the second 16 bytes, and the B (or V) value is located in the last 16 bytes: |
93:CamInterface.c **** |
94:CamInterface.c **** ---------------------------------------------------------------------------------- |
95:CamInterface.c **** |red0|red1|red2|...|red15|green0|green1|green2|...|green15|blue0|blue1|...|blue15| |
96:CamInterface.c **** mem:|0x00 0x01 0x02 0x15 0x16 0x17 0x18 0x31 0x32 0x33 0x47 | |
97:CamInterface.c **** --------------------------------------------------------------------------------- |
98:CamInterface.c **** Thus, the red lookup is accessed at colorMap+0, the green lookup is accessed |
99:CamInterface.c **** at colorMap+16, and the blue lookup is accessed at colorMap+32. */ |
100:CamInterface.c **** unsigned char colorMap[NUM_ELEMENTS_IN_COLOR_MAP] __attribute__ ((section (".noinit"))); |
101:CamInterface.c **** |
102:CamInterface.c **** /* Extern Variables */ |
103:CamInterface.c **** /* These two buffers hold the current and previous lines |
104:CamInterface.c **** of pixel data. They are sized to the worst case scenario, |
105:CamInterface.c **** where the color changes between every pixel (unrealistic). |
106:CamInterface.c **** The format of each buffer is for all the even bytes to hold |
107:CamInterface.c **** the run-length, and the odd bytes to hold the color data. */ |
108:CamInterface.c **** |
109:CamInterface.c **** /* In addition, if we are in frameDump mode, we use these buffers |
110:CamInterface.c **** to store the acquired line data...we are actually grabbing ALL of the |
111:CamInterface.c **** pixels in a line (176) instead of the 88 we get normally during tracking. |
112:CamInterface.c **** But since we have enough to hold 88-RLE blocks, we already have the 176 |
113:CamInterface.c **** allocated for this... */ |
114:CamInterface.c **** unsigned char currentLineBuffer[LENGTH_OF_LINE_BUFFER]; |
115:CamInterface.c **** unsigned char previousLineBuffer[LENGTH_OF_LINE_BUFFER]; |
116:CamInterface.c **** |
117:CamInterface.c **** /* Extern Functions */ |
118:CamInterface.c **** /* These functions are located in assembly files, and thus |
119:CamInterface.c **** must be externed here so they can be referenced in the source below. */ |
120:CamInterface.c **** extern void CamIntAsm_waitForNewTrackingFrame(unsigned char *pBuffer, unsigned char *pMemLookup); |
121:CamInterface.c **** extern void CamIntAsm_waitForNewDumpFrame(unsigned char *pCurrBuffer, unsigned char *pPrevBuffer); |
122:CamInterface.c **** extern void CamIntAsm_acquireTrackingLine(unsigned char *pBuffer, unsigned char *pMemLookup); |
123:CamInterface.c **** extern void CamIntAsm_acquireDumpLine(unsigned char *pCurrBuffer, unsigned char *pPrevBuffer); |
124:CamInterface.c **** |
125:CamInterface.c **** /*********************************************************** |
126:CamInterface.c **** Function Name: CamInt_init |
127:CamInterface.c **** Function Description: This function is responsible |
128:CamInterface.c **** for initializing the camera interface. This includes |
129:CamInterface.c **** setting up the i/o ports that are used to read the |
130:CamInterface.c **** camera busses, as well as resetting the camera. |
131:CamInterface.c **** Inputs: none |
132:CamInterface.c **** Outputs: none |
133:CamInterface.c **** ***********************************************************/ |
134:CamInterface.c **** void CamInt_init(void) |
135:CamInterface.c **** { |
136:CamInterface.c **** #if OUTPUT_INITIAL_COLOR_MAP |
137:CamInterface.c **** unsigned char asciiBuffer[5]; |
138:CamInterface.c **** unsigned char i; |
GAS LISTING /tmp/cc4KZ7ps.s page 5 |
139:CamInterface.c **** #endif |
140:CamInterface.c **** |
141:CamInterface.c **** /* set up the mega8 ports that will be interfacing |
142:CamInterface.c **** with the camera */ |
143:CamInterface.c **** CAM_CONTROL_PORT_DIR |= (1<<CAM_RESET_LINE); /* cam reset is output */ |
144:CamInterface.c **** CAM_CONTROL_PORT_DIR |= 0x80; /* set just the MSB as an output */ |
145:CamInterface.c **** CAM_CONTROL_PORT_DIR &= 0xFB; /* make sure bit2 is clear (input) */ |
146:CamInterface.c **** CAM_CONTROL_PORT &= 0x7F; /* set reset line low */ |
147:CamInterface.c **** CAM_G_BUS_DIR &= 0xF0; /* 4-bit G bus all inputs */ |
148:CamInterface.c **** CAM_G_BUS_DIR |= 0xF0; /* disable the pull-up on PB4 and PB5 */ |
149:CamInterface.c **** CAM_RB_BUS_DIR &= 0xF0; /* 4-bit RB bus all inputs */ |
150:CamInterface.c **** |
151:CamInterface.c **** /* ensure that timer1 is disabled to start...eventually, when PCLK needs |
152:CamInterface.c **** to feed timer1 through the external counter, it will be enabled on an |
153:CamInterface.c **** "as needed" basis...*/ |
154:CamInterface.c **** TCCR1B &= ~( (1<<CS12)|(1<<CS11)|(1<<CS10) ); |
155:CamInterface.c **** |
156:CamInterface.c **** /* we'll turn on the interrupt after we assign the initial TCNT value */ |
157:CamInterface.c **** |
158:CamInterface.c **** /* set up External Interrupt1 to interrupt us on rising edges (HREF)... |
159:CamInterface.c **** this is needed to indicate when the first pixel of each line is about to start, so |
160:CamInterface.c **** we can synch up with it...this interrupt will be disabled once HREF goes high */ |
161:CamInterface.c **** |
162:CamInterface.c **** MCUCR |= (1<<ISC11) | (1<<ISC10); /* rising edge interrupt */ |
163:CamInterface.c **** /* the interrupt will be enabled when we are ready to detect the rising edge of |
164:CamInterface.c **** HREF...its now primed and ready to go */ |
165:CamInterface.c **** |
166:CamInterface.c **** /* set up External Interrupt0 to interrupt us on rising edges (VSYNC) */ |
167:CamInterface.c **** MCUCR |= (1<<ISC01) | (1<<ISC00); /* rising edge interrupt */ |
168:CamInterface.c **** GICR |= (1<<INT0); /* interrupt request enabled */ |
169:CamInterface.c **** |
170:CamInterface.c **** /* set up TimerO to count and be clocked from an external pulse source |
171:CamInterface.c **** (HREF) on falling edges...eventually, we need to enable the interrupt |
172:CamInterface.c **** for this! FIX THIS */ |
173:CamInterface.c **** TCCR0 = (1<<CS02)|(1<<CS01)|(0<<CS00); |
174:CamInterface.c **** |
175:CamInterface.c **** /* setting up the PCLK counter with Timer1 will be done right after |
176:CamInterface.c **** we start receiving pixels in each line...we sacrifice the first pixel |
177:CamInterface.c **** in each line, but we'll account for it...*/ |
178:CamInterface.c **** |
179:CamInterface.c **** /* set up the mega8 so that its sleep mode puts it in an IDLE sleep |
180:CamInterface.c **** mode, where it can wake up as fast as possible */ |
181:CamInterface.c **** set_sleep_mode(SLEEP_MODE_IDLE); |
182:CamInterface.c **** /* umm....we need to actually enable the sleep mode...*/ |
183:CamInterface.c **** MCUCR |= 0x80; |
184:CamInterface.c **** |
185:CamInterface.c **** /* initialize the memLookup table */ |
186:CamInterface.c **** memset(colorMap,0x00,NUM_ELEMENTS_IN_COLOR_MAP); |
187:CamInterface.c **** |
188:CamInterface.c **** /* read the color map out of EEPROM */ |
189:CamInterface.c **** eeprom_read_block(colorMap, (unsigned char*)0x01,NUM_ELEMENTS_IN_COLOR_MAP); |
190:CamInterface.c **** |
191:CamInterface.c **** #if OUTPUT_INITIAL_COLOR_MAP |
192:CamInterface.c **** UIMgr_txBuffer("\r\n",2); |
193:CamInterface.c **** for (i=0; i<NUM_ELEMENTS_IN_COLOR_MAP; i++) |
194:CamInterface.c **** { |
195:CamInterface.c **** memset(asciiBuffer,0x00,5); |
GAS LISTING /tmp/cc4KZ7ps.s page 6 |
196:CamInterface.c **** itoa(colorMap[i],asciiBuffer,10); |
197:CamInterface.c **** UIMgr_txBuffer(asciiBuffer,3); |
198:CamInterface.c **** UIMgr_txBuffer(" ",1); |
199:CamInterface.c **** if (i==15 || i == 31) |
200:CamInterface.c **** { |
201:CamInterface.c **** /* break up the output */ |
202:CamInterface.c **** UIMgr_txBuffer("\r\n",2); |
203:CamInterface.c **** } |
204:CamInterface.c **** } |
205:CamInterface.c **** #endif |
206:CamInterface.c **** |
207:CamInterface.c **** #ifndef NO_CRYSTAL |
208:CamInterface.c **** CamInt_resetCam(); |
209:CamInterface.c **** #endif |
210:CamInterface.c **** } |
211:CamInterface.c **** |
212:CamInterface.c **** /*********************************************************** |
213:CamInterface.c **** Function Name: CamInt_resetCam |
214:CamInterface.c **** Function Description: This function is responsible |
215:CamInterface.c **** for resetting the camera. This is accomplished by |
216:CamInterface.c **** toggling the reset line on the OV6620 for ~100 mS. |
217:CamInterface.c **** Inputs: none |
218:CamInterface.c **** Outputs: none |
219:CamInterface.c **** IMPORTANT NOTE: This function has effectively been removed |
220:CamInterface.c **** since resetting the camera now causes the camera to not |
221:CamInterface.c **** output the clock signal. Thus, if we reset the cam, the |
222:CamInterface.c **** AVR has no clock, and thus doesn't run... |
223:CamInterface.c **** ***********************************************************/ |
224:CamInterface.c **** void CamInt_resetCam(void) |
225:CamInterface.c **** { |
91 .stabn 68,0,225,.LM0-CamInt_resetCam |
92 .LM0: |
93 /* prologue: frame size=0 */ |
94 /* prologue end (size=0) */ |
95 /* epilogue: frame size=0 */ |
96 0000 0895 ret |
97 /* epilogue end (size=1) */ |
98 /* function CamInt_resetCam size 1 (0) */ |
99 .size CamInt_resetCam, .-CamInt_resetCam |
100 .Lscope0: |
101 .stabs "",36,0,0,.Lscope0-CamInt_resetCam |
102 .stabd 78,0,0 |
103 .stabs "CamInt_init:F(0,15)",36,0,135,CamInt_init |
104 .global CamInt_init |
105 .type CamInt_init, @function |
106 CamInt_init: |
107 .stabd 46,0,0 |
108 .stabn 68,0,135,.LM1-CamInt_init |
109 .LM1: |
110 /* prologue: frame size=0 */ |
111 /* prologue end (size=0) */ |
112 .stabn 68,0,143,.LM2-CamInt_init |
113 .LM2: |
114 0002 8F9A sbi 49-0x20,7 |
115 .stabn 68,0,144,.LM3-CamInt_init |
116 .LM3: |
117 0004 8F9A sbi 49-0x20,7 |
GAS LISTING /tmp/cc4KZ7ps.s page 7 |
118 .stabn 68,0,145,.LM4-CamInt_init |
119 .LM4: |
120 0006 8A98 cbi 49-0x20,2 |
121 .stabn 68,0,146,.LM5-CamInt_init |
122 .LM5: |
123 0008 9798 cbi 50-0x20,7 |
124 .stabn 68,0,147,.LM6-CamInt_init |
125 .LM6: |
126 000a 87B3 in r24,55-0x20 |
127 000c 807F andi r24,lo8(-16) |
128 000e 87BB out 55-0x20,r24 |
129 .stabn 68,0,148,.LM7-CamInt_init |
130 .LM7: |
131 0010 87B3 in r24,55-0x20 |
132 0012 806F ori r24,lo8(-16) |
133 0014 87BB out 55-0x20,r24 |
134 .stabn 68,0,149,.LM8-CamInt_init |
135 .LM8: |
136 0016 84B3 in r24,52-0x20 |
137 0018 807F andi r24,lo8(-16) |
138 001a 84BB out 52-0x20,r24 |
139 .stabn 68,0,154,.LM9-CamInt_init |
140 .LM9: |
141 001c 8EB5 in r24,78-0x20 |
142 001e 887F andi r24,lo8(-8) |
143 0020 8EBD out 78-0x20,r24 |
144 .stabn 68,0,162,.LM10-CamInt_init |
145 .LM10: |
146 0022 85B7 in r24,85-0x20 |
147 0024 8C60 ori r24,lo8(12) |
148 0026 85BF out 85-0x20,r24 |
149 .stabn 68,0,167,.LM11-CamInt_init |
150 .LM11: |
151 0028 85B7 in r24,85-0x20 |
152 002a 8360 ori r24,lo8(3) |
153 002c 85BF out 85-0x20,r24 |
154 .stabn 68,0,168,.LM12-CamInt_init |
155 .LM12: |
156 002e 8BB7 in r24,91-0x20 |
157 0030 8064 ori r24,lo8(64) |
158 0032 8BBF out 91-0x20,r24 |
159 .stabn 68,0,173,.LM13-CamInt_init |
160 .LM13: |
161 0034 86E0 ldi r24,lo8(6) |
162 0036 83BF out 83-0x20,r24 |
163 .stabn 68,0,181,.LM14-CamInt_init |
164 .LM14: |
165 0038 85B7 in r24,85-0x20 |
166 003a 8F78 andi r24,lo8(-113) |
167 003c 85BF out 85-0x20,r24 |
168 .stabn 68,0,183,.LM15-CamInt_init |
169 .LM15: |
170 003e 85B7 in r24,85-0x20 |
171 0040 8068 ori r24,lo8(-128) |
172 0042 85BF out 85-0x20,r24 |
173 .stabn 68,0,186,.LM16-CamInt_init |
174 .LM16: |
GAS LISTING /tmp/cc4KZ7ps.s page 8 |
175 0044 E0E0 ldi r30,lo8(colorMap) |
176 0046 F0E0 ldi r31,hi8(colorMap) |
177 0048 80E3 ldi r24,lo8(48) |
178 004a DF01 movw r26,r30 |
179 004c 982F mov r25,r24 |
180 004e 1D92 st X+,__zero_reg__ |
181 0050 9A95 dec r25 |
182 0052 E9F7 brne .-6 |
183 .LBB6: |
184 .LBB7: |
185 .LBB8: |
186 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h",132,0,0,.Ltext1 |
187 .Ltext1: |
1:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** /* Copyright (c) 2002, 2003, 2004 Marek Michalkiewicz |
2:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** Copyright (c) 2005, 2006 Bjoern Haase |
3:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** All rights reserved. |
4:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
5:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** Redistribution and use in source and binary forms, with or without |
6:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** modification, are permitted provided that the following conditions are met: |
7:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
8:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** * Redistributions of source code must retain the above copyright |
9:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** notice, this list of conditions and the following disclaimer. |
10:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
11:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** * Redistributions in binary form must reproduce the above copyright |
12:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** notice, this list of conditions and the following disclaimer in |
13:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** the documentation and/or other materials provided with the |
14:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** distribution. |
15:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
16:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** * Neither the name of the copyright holders nor the names of |
17:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** contributors may be used to endorse or promote products derived |
18:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** from this software without specific prior written permission. |
19:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
20:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
21:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
22:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
23:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
24:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
25:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
26:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
27:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
28:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
29:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
30:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** POSSIBILITY OF SUCH DAMAGE. */ |
31:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
32:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** /* $Id: eeprom.h,v 1.17.2.1 2006/02/26 21:51:04 aesok Exp $ */ |
33:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
34:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** /* |
35:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** eeprom.h |
36:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
37:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** Contributors: |
38:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** Created by Marek Michalkiewicz <marekm@linux.org.pl> |
39:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** eeprom_write_word and eeprom_write_block added by Artur Lipowski |
40:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** <LAL@pro.onet.pl> |
41:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** Complete rewrite using the original interface by Bjoern Haase |
42:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** <bjoern.haase@de.bosch.com>. |
43:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** */ |
44:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
GAS LISTING /tmp/cc4KZ7ps.s page 9 |
45:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #ifndef _EEPROM_H_ |
46:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #define _EEPROM_H_ 1 |
47:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
48:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #define __need_size_t |
49:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #include <stddef.h> |
50:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #include <inttypes.h> |
51:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
52:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
53:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #ifdef __AVR_MEGA__ |
54:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #define XCALL "call" |
55:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #else |
56:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #define XCALL "rcall" |
57:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #endif |
58:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
59:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #include <avr/io.h> |
60:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #ifndef __EEPROM_REG_LOCATIONS__ |
61:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** /** \def __EEPROM_REG_LOCATIONS__ |
62:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** \ingroup avr_eeprom |
63:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** In order to be able to work without a requiring a multilib |
64:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** approach for dealing with controllers having the EEPROM registers |
65:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** at different positions in memory space, the eeprom functions evaluate |
66:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** __EEPROM_REG_LOCATIONS__: It is assumed to be defined by |
67:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** the device io header and contains 6 uppercase hex digits encoding the |
68:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** addresses of EECR,EEDR and EEAR. |
69:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** First two letters: EECR address. |
70:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** Second two letters: EEDR address. |
71:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** Last two letters: EEAR address. |
72:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** The default 1C1D1E corresponds to the |
73:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** register location that is valid for most controllers. The value |
74:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** of this define symbol is used for appending it to the base name of the |
75:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** assembler functions. */ |
76:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #define __EEPROM_REG_LOCATIONS__ 1C1D1E |
77:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #endif |
78:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #define _STR2(EXP) _STR1(EXP) |
79:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #define _STR1(EXP) #EXP |
80:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #define _REG_LOCATION_SUFFIX _STR2(__EEPROM_REG_LOCATIONS__) |
81:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
82:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #ifndef CR_TAB |
83:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #define CR_TAB "\n\t" |
84:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #endif |
85:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
86:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
87:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** /** \defgroup avr_eeprom <avr/eeprom.h>: EEPROM handling |
88:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** \code #include <avr/eeprom.h> \endcode |
89:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
90:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** This header file declares the interface to some simple library |
91:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** routines suitable for handling the data EEPROM contained in the |
92:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** AVR microcontrollers. The implementation uses a simple polled |
93:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** mode interface. Applications that require interrupt-controlled |
94:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** EEPROM access to ensure that no time will be wasted in spinloops |
95:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** will have to deploy their own implementation. |
96:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
97:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** \note All of the read/write functions first make sure the EEPROM |
98:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** is ready to be accessed. Since this may cause long delays if a |
99:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** write operation is still pending, time-critical applications |
100:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** should first poll the EEPROM e. g. using eeprom_is_ready() before |
101:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** attempting any actual I/O. |
GAS LISTING /tmp/cc4KZ7ps.s page 10 |
102:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
103:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** \note This header file declares inline functions that call the |
104:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** assembler subroutines directly. This prevents that the compiler |
105:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** generates push/pops for the call-clobbered registers. This way |
106:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** also a specific calling convention could be used for the eeprom |
107:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** routines e.g. by passing values in __tmp_reg__, eeprom addresses in |
108:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** X and memory addresses in Z registers. Method is optimized for code |
109:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** size. |
110:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
111:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** \note Presently supported are two locations of the EEPROM register |
112:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** set: 0x1F,0x20,0x21 and 0x1C,0x1D,0x1E |
113:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** (see ::__EEPROM_REG_LOCATIONS__). |
114:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
115:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** \note As these functions modify IO registers, they are known to be |
116:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** non-reentrant. If any of these functions are used from both, |
117:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** standard and interrupt context, the applications must ensure |
118:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** proper protection (e.g. by disabling interrupts before accessing |
119:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** them). |
120:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
121:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** */ |
122:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
123:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
124:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** /* forward declarations of the inline functions so that doxygen does |
125:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** not get confused by the attribute expression. */ |
126:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
127:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** static inline uint8_t __attribute__ ((always_inline)) |
128:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** eeprom_read_byte (const uint8_t *addr); |
129:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
130:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** static inline uint16_t __attribute__ ((always_inline)) |
131:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** eeprom_read_word (const uint16_t *addr); |
132:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
133:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** static inline void __attribute__ ((always_inline)) |
134:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** eeprom_read_block (void *pointer_ram, |
135:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** const void *pointer_eeprom, |
136:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** size_t size); |
137:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
138:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** static inline void __attribute__ ((always_inline)) |
139:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** eeprom_write_byte (uint8_t *addr,uint8_t value); |
140:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
141:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** static inline void __attribute__ ((always_inline)) |
142:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** eeprom_write_word (uint16_t *addr,uint16_t value); |
143:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
144:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** static inline void __attribute__ ((always_inline)) |
145:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** eeprom_write_block (const void *pointer_ram, |
146:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** void *pointer_eeprom, |
147:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** size_t size); |
148:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
149:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** /** \name avr-libc declarations */ |
150:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
151:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** /*@{*/ |
152:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
153:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** /** \def EEMEM |
154:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** \ingroup avr_eeprom |
155:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** Attribute expression causing a variable to be allocated within the .eeprom |
156:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** section. */ |
157:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #define EEMEM __attribute__((section(".eeprom"))) |
158:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
GAS LISTING /tmp/cc4KZ7ps.s page 11 |
159:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** /** \def eeprom_is_ready |
160:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** \ingroup avr_eeprom |
161:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** \returns 1 if EEPROM is ready for a new read/write operation, 0 if not. */ |
162:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
163:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #if defined(__DOXYGEN__) |
164:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** # define eeprom_is_ready() |
165:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #elif defined(EEWE) |
166:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** # define eeprom_is_ready() bit_is_clear(EECR, EEWE) |
167:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #elif defined(EEPE) |
168:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** # define eeprom_is_ready() bit_is_clear(EECR, EEPE) |
169:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #elif defined(DEECR) && defined(EEL) |
170:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** # define eeprom_is_ready() bit_is_clear(DEECR, EEL) |
171:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #else |
172:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** # error "No write enable bit known for this device's EEPROM." |
173:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #endif |
174:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
175:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** /** \def eeprom_busy_wait |
176:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** \ingroup avr_eeprom |
177:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
178:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** Loops until the eeprom is no longer busy. |
179:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
180:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** \returns Nothing. */ |
181:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
182:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #define eeprom_busy_wait() do {} while (!eeprom_is_ready()) |
183:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
184:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
185:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** /** \ingroup avr_eeprom |
186:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** Read one byte from EEPROM address \c addr. */ |
187:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
188:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** uint8_t |
189:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** eeprom_read_byte (const uint8_t *addr) |
190:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** { |
191:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** uint8_t result; |
192:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** asm volatile |
193:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** ( XCALL " __eeprom_read_byte_" _REG_LOCATION_SUFFIX CR_TAB |
194:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** "mov %1,__tmp_reg__" |
195:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** : "+x" (addr), |
196:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** "=r" (result) |
197:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** : ); |
198:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** return result; |
199:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** } |
200:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
201:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** /** \ingroup avr_eeprom |
202:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** Read one 16-bit word (little endian) from EEPROM address \c addr. */ |
203:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** uint16_t |
204:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** eeprom_read_word (const uint16_t *addr) |
205:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** { |
206:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** uint16_t result; |
207:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
208:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** asm ( |
209:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** XCALL " __eeprom_read_word_" _REG_LOCATION_SUFFIX CR_TAB |
210:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** : "+x" (addr), |
211:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** "=z" (result) |
212:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** : ); |
213:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** return result; |
214:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** } |
215:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
GAS LISTING /tmp/cc4KZ7ps.s page 12 |
216:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** /** \ingroup avr_eeprom |
217:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** Read a block of \c n bytes from EEPROM address \c pointer_eeprom to |
218:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** \c pointer_ram. For constant n <= 256 bytes a library function is used. |
219:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** For block sizes unknown at compile time or block sizes > 256 an inline |
220:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** loop is expanded. */ |
221:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
222:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** void |
223:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** eeprom_read_block (void *pointer_ram, |
224:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** const void *pointer_eeprom, |
225:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** size_t n) |
226:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** { |
227:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** if (!__builtin_constant_p (n) |
228:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** || n > 256) |
229:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** { |
230:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** /* make sure size is a 16 bit variable. */ |
231:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** uint16_t size = n; |
232:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
233:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** asm volatile ( |
234:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** ".%=_start:" CR_TAB |
235:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** "sbiw %2,1" CR_TAB |
236:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** "brlt .%=_finished" CR_TAB |
237:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** XCALL " __eeprom_read_byte_" _REG_LOCATION_SUFFIX CR_TAB |
238:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** "st z+,__tmp_reg__" CR_TAB |
239:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** "rjmp .%=_start" CR_TAB |
240:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** ".%=_finished:" |
241:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** : "=x" (pointer_eeprom), |
242:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** "=z" (pointer_ram), |
243:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** "+w" (size) |
244:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** : "x" (pointer_eeprom), |
245:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** "z" (pointer_ram) |
246:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** : "memory"); |
247:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** } |
248:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** else |
249:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** { |
250:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** if (n != 0) |
251:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** { |
252:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** if (n == 256) |
253:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** { |
254:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** asm volatile ( |
255:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** XCALL " __eeprom_read_block_" _REG_LOCATION_SUFFIX |
256:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** : "+x" (pointer_eeprom), |
257:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** "=z" (pointer_ram) |
258:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** : "z" (pointer_ram) |
259:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** : "memory"); |
260:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** } |
261:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** else |
262:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** { |
263:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** /* Needed in order to truncate to 8 bit. */ |
264:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** uint8_t len; |
265:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** len = (uint8_t) n; |
266:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
267:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** asm volatile ( |
188 .stabn 68,0,267,.LM17-CamInt_init |
189 .LM17: |
190 0054 A1E0 ldi r26,lo8(1) |
191 0056 B0E0 ldi r27,hi8(1) |
192 /* #APP */ |
GAS LISTING /tmp/cc4KZ7ps.s page 13 |
193 0058 182E mov __zero_reg__,r24 |
194 005a 00D0 rcall __eeprom_read_block_1C1D1E |
195 /* #NOAPP */ |
196 .LBE8: |
197 .LBE7: |
198 .LBE6: |
199 /* epilogue: frame size=0 */ |
200 005c 0895 ret |
201 /* epilogue end (size=1) */ |
202 /* function CamInt_init size 48 (47) */ |
203 .size CamInt_init, .-CamInt_init |
204 .stabs "pointer_eeprom:r(0,16)=*(0,17)=k(0,15)",64,0,189,26 |
205 .stabs "pointer_ram:r(0,18)=*(0,15)",64,0,189,30 |
206 .stabn 192,0,0,.LBB6-CamInt_init |
207 .stabn 224,0,0,.LBE6-CamInt_init |
208 .Lscope1: |
209 .stabs "",36,0,0,.Lscope1-CamInt_init |
210 .stabd 78,0,0 |
211 .comm currentLineBuffer,176,1 |
212 .comm previousLineBuffer,176,1 |
213 .global colorMap |
214 .section .noinit,"aw",@nobits |
215 .type colorMap, @object |
216 .size colorMap, 48 |
217 colorMap: |
218 0000 0000 0000 .skip 48,0 |
218 0000 0000 |
218 0000 0000 |
218 0000 0000 |
218 0000 0000 |
219 .stabs "currentLineBuffer:G(0,19)=ar(0,20)=r(0,20);0;0177777;;0;175;(0,11)",32,0,114,0 |
220 .stabs "previousLineBuffer:G(0,19)",32,0,115,0 |
221 .stabs "colorMap:G(0,21)=ar(0,20);0;47;(0,11)",32,0,100,0 |
222 .text |
223 .stabs "",100,0,0,.Letext0 |
224 .Letext0: |
225 /* File "CamInterface.c": code 49 = 0x0031 ( 47), prologues 0, epilogues 2 */ |
GAS LISTING /tmp/cc4KZ7ps.s page 14 |
DEFINED SYMBOLS |
*ABS*:00000000 CamInterface.c |
/tmp/cc4KZ7ps.s:3 *ABS*:0000003f __SREG__ |
/tmp/cc4KZ7ps.s:4 *ABS*:0000003e __SP_H__ |
/tmp/cc4KZ7ps.s:5 *ABS*:0000003d __SP_L__ |
/tmp/cc4KZ7ps.s:6 *ABS*:00000000 __tmp_reg__ |
/tmp/cc4KZ7ps.s:7 *ABS*:00000001 __zero_reg__ |
/tmp/cc4KZ7ps.s:89 .text:00000000 CamInt_resetCam |
/tmp/cc4KZ7ps.s:106 .text:00000002 CamInt_init |
/tmp/cc4KZ7ps.s:217 .noinit:00000000 colorMap |
*COM*:000000b0 currentLineBuffer |
*COM*:000000b0 previousLineBuffer |
UNDEFINED SYMBOLS |
__do_copy_data |
__do_clear_bss |
__eeprom_read_block_1C1D1E |
/programy/C/avr/AVRcam/CamInterfaceAsm.lst |
---|
0,0 → 1,1778 |
GAS LISTING /tmp/ccCMjSjd.s page 1 |
1 # 1 "CamInterfaceAsm.S" |
2 # 1 "<built-in>" |
1 ; |
0 |
0 |
2 ; Copyright (C) 2004 John Orlando |
3 ; |
4 ; AVRcam: a small real-time image processing engine. |
5 |
6 ; This program is free software; you can redistribute it and/or |
7 ; modify it under the terms of the GNU General Public |
8 ; License as published by the Free Software Foundation; either |
9 ; version 2 of the License, or (at your option) any later version. |
10 |
11 ; This program is distributed in the hope that it will be useful, |
12 ; but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 ; General Public License for more details. |
15 |
16 ; You should have received a copy of the GNU General Public |
17 ; License along with this program; if not, write to the Free Software |
18 ; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 |
20 ; For more information on the AVRcam, please contact: |
21 |
22 ; john@jrobot.net |
23 |
24 ; or go to www.jrobot.net for more details regarding the system. |
25 ;********************************************************************** |
26 ; Module Name: CanInterfaceAsm.S |
27 ; Module Date: 04/14/2004 |
28 ; Module Auth: John Orlando |
29 ; |
30 ; Description: This module provides the low-level interface |
31 ; to the OV6620 camera hardware. It is responsible for |
32 ; acquiring each pixel block (R,G,B), performing the mapping |
33 ; into an actual color (orange, purple, etc), run-length |
34 ; encoding the data, and storing the info off to the appropriate |
35 ; line buffer. This routine is synchronized with the pixel data |
36 ; so that no polling of the camera data needs to be done (the |
37 ; OV6620 is clocked off of the same crystal source as the mega8, |
38 ; thus providing inherent synchronization between the two). |
39 ; |
40 ; Revision History: |
41 ; Date Rel Ver. Notes |
42 ; 4/10/2004 0.1 Module created |
43 ; 6/30/2004 1.0 Initial release for Circuit Cellar |
44 ; contest. |
45 ; 1/16/2005 1.4 Fixed issue with the TCCR1B register |
46 ; where PCLK was getting routed to the |
47 ; timer1 even when it wasn't needed. |
48 ; This caused excessive counter overflow |
49 ; interrupts, and caused problems. Now, |
50 ; the "PCLK" pipe feeds timer1 when needed, |
51 ; and is turned off when it isn't needed. |
52 |
53 #include <avr/io.h> |
GAS LISTING /tmp/ccCMjSjd.s page 2 |
1 /* Copyright (c) 2002,2003,2005,2006, Marek Michalkiewicz, Joerg Wunsch |
2 All rights reserved. |
3 |
4 Redistribution and use in source and binary forms, with or without |
5 modification, are permitted provided that the following conditions are met: |
6 |
7 * Redistributions of source code must retain the above copyright |
8 notice, this list of conditions and the following disclaimer. |
9 |
10 * Redistributions in binary form must reproduce the above copyright |
11 notice, this list of conditions and the following disclaimer in |
12 the documentation and/or other materials provided with the |
13 distribution. |
14 |
15 * Neither the name of the copyright holders nor the names of |
16 contributors may be used to endorse or promote products derived |
17 from this software without specific prior written permission. |
18 |
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
20 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
21 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
22 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
23 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
24 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
25 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
26 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
27 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
28 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
29 POSSIBILITY OF SUCH DAMAGE. */ |
30 |
31 /* $Id: io.h,v 1.24.2.7 2006/04/19 16:53:25 aesok Exp $ */ |
32 |
33 /** \defgroup avr_io <avr/io.h>: AVR device-specific IO definitions |
34 \code #include <avr/io.h> \endcode |
35 |
36 This header file includes the apropriate IO definitions for the |
37 device that has been specified by the <tt>-mmcu=</tt> compiler |
38 command-line switch. This is done by diverting to the appropriate |
39 file <tt><avr/io</tt><em>XXXX</em><tt>.h></tt> which should |
40 never be included directly. Some register names common to all |
41 AVR devices are defined directly within <tt><avr/io.h></tt>, |
42 but most of the details come from the respective include file. |
43 |
44 Note that this file always includes |
45 \code #include <avr/sfr_defs.h> \endcode |
46 See \ref avr_sfr for the details. |
47 |
48 Included are definitions of the IO register set and their |
49 respective bit values as specified in the Atmel documentation. |
50 Note that Atmel is not very consistent in its naming conventions, |
51 so even identical functions sometimes get different names on |
52 different devices. |
53 |
54 Also included are the specific names useable for interrupt |
55 function definitions as documented |
56 \ref avr_signames "here". |
57 |
GAS LISTING /tmp/ccCMjSjd.s page 3 |
58 Finally, the following macros are defined: |
59 |
60 - \b RAMEND |
61 <br> |
62 A constant describing the last on-chip RAM location. |
63 <br> |
64 - \b XRAMEND |
65 <br> |
66 A constant describing the last possible location in RAM. |
67 This is equal to RAMEND for devices that do not allow for |
68 external RAM. |
69 <br> |
70 - \b E2END |
71 <br> |
72 A constant describing the address of the last EEPROM cell. |
73 <br> |
74 - \b FLASHEND |
75 <br> |
76 A constant describing the last byte address in flash ROM. |
77 <br> |
78 - \b SPM_PAGESIZE |
79 <br> |
80 For devices with bootloader support, the flash pagesize |
81 (in bytes) to be used for the \c SPM instruction. */ |
82 |
83 #ifndef _AVR_IO_H_ |
84 #define _AVR_IO_H_ |
85 |
86 #include <avr/sfr_defs.h> |
1 /* Copyright (c) 2002, Marek Michalkiewicz <marekm@amelek.gda.pl> |
2 All rights reserved. |
3 |
4 Redistribution and use in source and binary forms, with or without |
5 modification, are permitted provided that the following conditions are met: |
6 |
7 * Redistributions of source code must retain the above copyright |
8 notice, this list of conditions and the following disclaimer. |
9 |
10 * Redistributions in binary form must reproduce the above copyright |
11 notice, this list of conditions and the following disclaimer in |
12 the documentation and/or other materials provided with the |
13 distribution. |
14 |
15 * Neither the name of the copyright holders nor the names of |
16 contributors may be used to endorse or promote products derived |
17 from this software without specific prior written permission. |
18 |
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
20 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
21 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
22 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
23 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
24 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
25 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
26 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
27 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
28 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
GAS LISTING /tmp/ccCMjSjd.s page 4 |
29 POSSIBILITY OF SUCH DAMAGE. */ |
30 |
31 /* avr/sfr_defs.h - macros for accessing AVR special function registers */ |
32 |
33 /* $Id: sfr_defs.h,v 1.16 2005/09/10 21:31:13 joerg_wunsch Exp $ */ |
34 |
35 #ifndef _AVR_SFR_DEFS_H_ |
36 #define _AVR_SFR_DEFS_H_ 1 |
37 |
38 /** \defgroup avr_sfr_notes Additional notes from <avr/sfr_defs.h> |
39 \ingroup avr_sfr |
40 |
41 The \c <avr/sfr_defs.h> file is included by all of the \c <avr/ioXXXX.h> |
42 files, which use macros defined here to make the special function register |
43 definitions look like C variables or simple constants, depending on the |
44 <tt>_SFR_ASM_COMPAT</tt> define. Some examples from \c <avr/iom128.h> to |
45 show how to define such macros: |
46 |
47 \code |
48 #define PORTA _SFR_IO8(0x1b) |
49 #define TCNT1 _SFR_IO16(0x2c) |
50 #define PORTF _SFR_MEM8(0x61) |
51 #define TCNT3 _SFR_MEM16(0x88) |
52 \endcode |
53 |
54 If \c _SFR_ASM_COMPAT is not defined, C programs can use names like |
55 <tt>PORTA</tt> directly in C expressions (also on the left side of |
56 assignment operators) and GCC will do the right thing (use short I/O |
57 instructions if possible). The \c __SFR_OFFSET definition is not used in |
58 any way in this case. |
59 |
60 Define \c _SFR_ASM_COMPAT as 1 to make these names work as simple constants |
61 (addresses of the I/O registers). This is necessary when included in |
62 preprocessed assembler (*.S) source files, so it is done automatically if |
63 \c __ASSEMBLER__ is defined. By default, all addresses are defined as if |
64 they were memory addresses (used in \c lds/sts instructions). To use these |
65 addresses in \c in/out instructions, you must subtract 0x20 from them. |
66 |
67 For more backwards compatibility, insert the following at the start of your |
68 old assembler source file: |
69 |
70 \code |
71 #define __SFR_OFFSET 0 |
72 \endcode |
73 |
74 This automatically subtracts 0x20 from I/O space addresses, but it's a |
75 hack, so it is recommended to change your source: wrap such addresses in |
76 macros defined here, as shown below. After this is done, the |
77 <tt>__SFR_OFFSET</tt> definition is no longer necessary and can be removed. |
78 |
79 Real example - this code could be used in a boot loader that is portable |
80 between devices with \c SPMCR at different addresses. |
81 |
82 \verbatim |
83 <avr/iom163.h>: #define SPMCR _SFR_IO8(0x37) |
84 <avr/iom128.h>: #define SPMCR _SFR_MEM8(0x68) |
85 \endverbatim |
GAS LISTING /tmp/ccCMjSjd.s page 5 |
86 |
87 \code |
87 |
88 #ifndef __AVR_HAVE_MOVW__ |
89 # if defined(__AVR_ENHANCED__) && __AVR_ENHANCED__ |
90 # define __AVR_HAVE_MOVW__ 1 |
91 # endif |
92 #endif |
93 |
94 #ifndef __AVR_HAVE_LPMX__ |
95 # if defined(__AVR_ENHANCED__) && __AVR_ENHANCED__ |
96 # define __AVR_HAVE_LPMX__ 1 |
97 # endif |
98 #endif |
99 |
100 /* |
101 * Registers common to all AVR devices. |
102 */ |
103 |
104 #if __AVR_ARCH__ != 1 |
105 /* |
106 * AVR architecture 1 has no RAM, thus no stack pointer. |
107 * |
108 * All other archs do have a stack pointer. Some devices have only |
109 * less than 256 bytes of possible RAM locations (128 Bytes of SRAM |
110 * and no option for external RAM), thus SPH is officially "reserved" |
111 * for them. We catch this case below after including the |
112 * device-specific ioXXXX.h file, by examining XRAMEND, and |
113 * #undef-ining SP and SPH in that case. |
114 */ |
115 /* Stack Pointer */ |
116 #define SP _SFR_IO16(0x3D) |
117 #define SPL _SFR_IO8(0x3D) |
118 #define SPH _SFR_IO8(0x3E) |
119 #endif /* #if __AVR_ARCH__ != 1 */ |
120 |
121 /* Status REGister */ |
122 #define SREG _SFR_IO8(0x3F) |
123 |
124 /* Status Register - SREG */ |
125 #define SREG_I 7 |
126 #define SREG_T 6 |
127 #define SREG_H 5 |
128 #define SREG_S 4 |
129 #define SREG_V 3 |
130 #define SREG_N 2 |
131 #define SREG_Z 1 |
132 #define SREG_C 0 |
133 |
134 /* Pointer definition */ |
135 #if __AVR_ARCH__ != 1 |
136 /* avr1 has only the Z pointer */ |
137 #define XL r26 |
138 #define XH r27 |
139 #define YL r28 |
140 #define YH r29 |
141 #endif /* #if __AVR_ARCH__ != 1 */ |
GAS LISTING /tmp/ccCMjSjd.s page 6 |
142 #define ZL r30 |
143 #define ZH r31 |
144 |
145 /* |
146 * Only few devices come without EEPROM. In order to assemble the |
147 * EEPROM library components without defining a specific device, we |
148 * keep the EEPROM-related definitions here. |
149 */ |
150 #if defined(__COMPILING_AVR_LIBC__) |
151 |
152 /* EEPROM Control Register */ |
153 #define EECR _SFR_IO8(0x1C) |
154 |
155 /* EEPROM Data Register */ |
156 #define EEDR _SFR_IO8(0x1D) |
157 |
158 /* EEPROM Address Register */ |
159 #define EEAR _SFR_IO16(0x1E) |
160 #define EEARL _SFR_IO8(0x1E) |
161 #define EEARH _SFR_IO8(0x1F) |
162 |
163 /* EEPROM Control Register */ |
164 #define EERIE 3 |
165 #define EEMWE 2 |
166 #define EEWE 1 |
167 #define EERE 0 |
168 |
169 #endif /* __COMPILING_AVR_LIBC__ */ |
170 |
171 #if defined (__AVR_AT94K__) |
172 # include <avr/ioat94k.h> |
173 #elif defined (__AVR_AT43USB320__) |
174 # include <avr/io43u32x.h> |
175 #elif defined (__AVR_AT43USB355__) |
176 # include <avr/io43u35x.h> |
177 #elif defined (__AVR_AT76C711__) |
178 # include <avr/io76c711.h> |
179 #elif defined (__AVR_AT86RF401__) |
180 # include <avr/io86r401.h> |
181 #elif defined (__AVR_AT90PWM2__) |
182 # include <avr/io90pwmx.h> |
183 #elif defined (__AVR_AT90PWM3__) |
184 # include <avr/io90pwmx.h> |
185 #elif defined (__AVR_ATmega128__) |
186 # include <avr/iom128.h> |
187 #elif defined (__AVR_ATmega1280__) |
188 # include <avr/iom1280.h> |
189 #elif defined (__AVR_ATmega1281__) |
190 # include <avr/iom1281.h> |
191 #elif defined (__AVR_AT90CAN32__) |
192 # include <avr/iocan32.h> |
193 #elif defined (__AVR_AT90CAN64__) |
194 # include <avr/iocan64.h> |
195 #elif defined (__AVR_AT90CAN128__) |
196 # include <avr/iocan128.h> |
197 #elif defined (__AVR_AT90USB646__) |
198 # include <avr/iousb646.h> |
GAS LISTING /tmp/ccCMjSjd.s page 7 |
199 #elif defined (__AVR_AT90USB647__) |
200 # include <avr/iousb647.h> |
201 #elif defined (__AVR_AT90USB1286__) |
202 # include <avr/iousb1286.h> |
203 #elif defined (__AVR_AT90USB1287__) |
204 # include <avr/iousb1287.h> |
205 #elif defined (__AVR_ATmega64__) |
206 # include <avr/iom64.h> |
207 #elif defined (__AVR_ATmega640__) |
208 # include <avr/iom640.h> |
209 #elif defined (__AVR_ATmega644__) |
210 # include <avr/iom644.h> |
211 #elif defined (__AVR_ATmega644P__) |
212 # include <avr/iom644.h> |
213 #elif defined (__AVR_ATmega645__) |
214 # include <avr/iom645.h> |
215 #elif defined (__AVR_ATmega6450__) |
216 # include <avr/iom6450.h> |
217 #elif defined (__AVR_ATmega649__) |
218 # include <avr/iom649.h> |
219 #elif defined (__AVR_ATmega6490__) |
220 # include <avr/iom6490.h> |
221 #elif defined (__AVR_ATmega103__) |
222 # include <avr/iom103.h> |
223 #elif defined (__AVR_ATmega32__) |
224 # include <avr/iom32.h> |
225 #elif defined (__AVR_ATmega323__) |
226 # include <avr/iom323.h> |
227 #elif defined (__AVR_ATmega324P__) |
228 # include <avr/iom324.h> |
229 #elif defined (__AVR_ATmega325__) |
230 # include <avr/iom325.h> |
231 #elif defined (__AVR_ATmega3250__) |
232 # include <avr/iom3250.h> |
233 #elif defined (__AVR_ATmega329__) |
234 # include <avr/iom329.h> |
235 #elif defined (__AVR_ATmega3290__) |
236 # include <avr/iom3290.h> |
237 #elif defined (__AVR_ATmega406__) |
238 # include <avr/iom406.h> |
239 #elif defined (__AVR_ATmega16__) |
240 # include <avr/iom16.h> |
241 #elif defined (__AVR_ATmega161__) |
242 # include <avr/iom161.h> |
243 #elif defined (__AVR_ATmega162__) |
244 # include <avr/iom162.h> |
245 #elif defined (__AVR_ATmega163__) |
246 # include <avr/iom163.h> |
247 #elif defined (__AVR_ATmega164P__) |
248 # include <avr/iom164.h> |
249 #elif defined (__AVR_ATmega165__) |
250 # include <avr/iom165.h> |
251 #elif defined (__AVR_ATmega168__) |
252 # include <avr/iom168.h> |
253 #elif defined (__AVR_ATmega169__) |
254 # include <avr/iom169.h> |
255 #elif defined (__AVR_ATmega8__) |
GAS LISTING /tmp/ccCMjSjd.s page 8 |
256 # include <avr/iom8.h> |
1 /* Copyright (c) 2002, Marek Michalkiewicz |
2 All rights reserved. |
3 |
4 Redistribution and use in source and binary forms, with or without |
5 modification, are permitted provided that the following conditions are met: |
6 |
7 * Redistributions of source code must retain the above copyright |
8 notice, this list of conditions and the following disclaimer. |
9 |
10 * Redistributions in binary form must reproduce the above copyright |
11 notice, this list of conditions and the following disclaimer in |
12 the documentation and/or other materials provided with the |
13 distribution. |
14 |
15 * Neither the name of the copyright holders nor the names of |
16 contributors may be used to endorse or promote products derived |
17 from this software without specific prior written permission. |
18 |
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
20 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
21 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
22 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
23 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
24 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
25 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
26 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
27 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
28 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
29 POSSIBILITY OF SUCH DAMAGE. */ |
30 |
31 /* $Id: iom8.h,v 1.13 2005/10/30 22:11:23 joerg_wunsch Exp $ */ |
32 |
33 /* avr/iom8.h - definitions for ATmega8 */ |
34 |
35 #ifndef _AVR_IOM8_H_ |
36 #define _AVR_IOM8_H_ 1 |
37 |
38 /* This file should only be included from <avr/io.h>, never directly. */ |
39 |
40 #ifndef _AVR_IO_H_ |
41 # error "Include <avr/io.h> instead of this file." |
42 #endif |
43 |
44 #ifndef _AVR_IOXXX_H_ |
45 # define _AVR_IOXXX_H_ "iom8.h" |
46 #else |
47 # error "Attempt to include more than one <avr/ioXXX.h> file." |
48 #endif |
49 |
50 /* I/O registers */ |
51 |
52 /* TWI stands for "Two Wire Interface" or "TWI Was I2C(tm)" */ |
53 #define TWBR _SFR_IO8(0x00) |
54 #define TWSR _SFR_IO8(0x01) |
55 #define TWAR _SFR_IO8(0x02) |
56 #define TWDR _SFR_IO8(0x03) |
GAS LISTING /tmp/ccCMjSjd.s page 9 |
57 |
58 /* ADC */ |
59 #define ADCW _SFR_IO16(0x04) |
60 #ifndef __ASSEMBLER__ |
61 #define ADC _SFR_IO16(0x04) |
62 #endif |
63 #define ADCL _SFR_IO8(0x04) |
64 #define ADCH _SFR_IO8(0x05) |
65 #define ADCSR _SFR_IO8(0x06) |
66 #define ADCSRA _SFR_IO8(0x06) /* Changed in 2486H-AVR-09/02 */ |
67 #define ADMUX _SFR_IO8(0x07) |
68 |
69 /* analog comparator */ |
70 #define ACSR _SFR_IO8(0x08) |
71 |
72 /* USART */ |
73 #define UBRRL _SFR_IO8(0x09) |
74 #define UCSRB _SFR_IO8(0x0A) |
75 #define UCSRA _SFR_IO8(0x0B) |
76 #define UDR _SFR_IO8(0x0C) |
77 |
78 /* SPI */ |
79 #define SPCR _SFR_IO8(0x0D) |
80 #define SPSR _SFR_IO8(0x0E) |
81 #define SPDR _SFR_IO8(0x0F) |
82 |
83 /* Port D */ |
84 #define PIND _SFR_IO8(0x10) |
85 #define DDRD _SFR_IO8(0x11) |
86 #define PORTD _SFR_IO8(0x12) |
87 |
88 /* Port C */ |
89 #define PINC _SFR_IO8(0x13) |
90 #define DDRC _SFR_IO8(0x14) |
91 #define PORTC _SFR_IO8(0x15) |
92 |
93 /* Port B */ |
94 #define PINB _SFR_IO8(0x16) |
95 #define DDRB _SFR_IO8(0x17) |
96 #define PORTB _SFR_IO8(0x18) |
97 |
98 /* EEPROM Control Register */ |
99 #define EECR _SFR_IO8(0x1C) |
100 |
101 /* EEPROM Data Register */ |
102 #define EEDR _SFR_IO8(0x1D) |
103 |
104 /* EEPROM Address Register */ |
105 #define EEAR _SFR_IO16(0x1E) |
106 #define EEARL _SFR_IO8(0x1E) |
107 #define EEARH _SFR_IO8(0x1F) |
108 |
109 #define UCSRC _SFR_IO8(0x20) |
110 #define UBRRH _SFR_IO8(0x20) |
111 |
112 #define WDTCR _SFR_IO8(0x21) |
113 #define ASSR _SFR_IO8(0x22) |
GAS LISTING /tmp/ccCMjSjd.s page 10 |
114 |
115 /* Timer 2 */ |
116 #define OCR2 _SFR_IO8(0x23) |
117 #define TCNT2 _SFR_IO8(0x24) |
118 #define TCCR2 _SFR_IO8(0x25) |
119 |
120 /* Timer 1 */ |
121 #define ICR1 _SFR_IO16(0x26) |
122 #define ICR1L _SFR_IO8(0x26) |
123 #define ICR1H _SFR_IO8(0x27) |
124 #define OCR1B _SFR_IO16(0x28) |
125 #define OCR1BL _SFR_IO8(0x28) |
126 #define OCR1BH _SFR_IO8(0x29) |
127 #define OCR1A _SFR_IO16(0x2A) |
128 #define OCR1AL _SFR_IO8(0x2A) |
129 #define OCR1AH _SFR_IO8(0x2B) |
130 #define TCNT1 _SFR_IO16(0x2C) |
131 #define TCNT1L _SFR_IO8(0x2C) |
132 #define TCNT1H _SFR_IO8(0x2D) |
133 #define TCCR1B _SFR_IO8(0x2E) |
134 #define TCCR1A _SFR_IO8(0x2F) |
135 |
136 #define SFIOR _SFR_IO8(0x30) |
137 |
138 #define OSCCAL _SFR_IO8(0x31) |
139 |
140 /* Timer 0 */ |
141 #define TCNT0 _SFR_IO8(0x32) |
142 #define TCCR0 _SFR_IO8(0x33) |
143 |
144 #define MCUCSR _SFR_IO8(0x34) |
145 #define MCUCR _SFR_IO8(0x35) |
146 |
147 #define TWCR _SFR_IO8(0x36) |
148 |
149 #define SPMCR _SFR_IO8(0x37) |
150 |
151 #define TIFR _SFR_IO8(0x38) |
152 #define TIMSK _SFR_IO8(0x39) |
153 |
154 #define GIFR _SFR_IO8(0x3A) |
155 #define GIMSK _SFR_IO8(0x3B) |
156 #define GICR _SFR_IO8(0x3B) /* Changed in 2486H-AVR-09/02 */ |
157 |
158 /* 0x3C reserved (OCR0?) */ |
159 |
160 /* 0x3D..0x3E SP */ |
161 |
162 /* 0x3F SREG */ |
163 |
164 /* Interrupt vectors */ |
165 |
166 /* External Interrupt Request 0 */ |
167 #define INT0_vect _VECTOR(1) |
168 #define SIG_INTERRUPT0 _VECTOR(1) |
169 |
170 /* External Interrupt Request 1 */ |
GAS LISTING /tmp/ccCMjSjd.s page 11 |
171 #define INT1_vect _VECTOR(2) |
172 #define SIG_INTERRUPT1 _VECTOR(2) |
173 |
174 /* Timer/Counter2 Compare Match */ |
175 #define TIMER2_COMP_vect _VECTOR(3) |
176 #define SIG_OUTPUT_COMPARE2 _VECTOR(3) |
177 |
178 /* Timer/Counter2 Overflow */ |
179 #define TIMER2_OVF_vect _VECTOR(4) |
180 #define SIG_OVERFLOW2 _VECTOR(4) |
181 |
182 /* Timer/Counter1 Capture Event */ |
183 #define TIMER1_CAPT_vect _VECTOR(5) |
184 #define SIG_INPUT_CAPTURE1 _VECTOR(5) |
185 |
186 /* Timer/Counter1 Compare Match A */ |
187 #define TIMER1_COMPA_vect _VECTOR(6) |
188 #define SIG_OUTPUT_COMPARE1A _VECTOR(6) |
189 |
190 /* Timer/Counter1 Compare Match B */ |
191 #define TIMER1_COMPB_vect _VECTOR(7) |
192 #define SIG_OUTPUT_COMPARE1B _VECTOR(7) |
193 |
194 /* Timer/Counter1 Overflow */ |
195 #define TIMER1_OVF_vect _VECTOR(8) |
196 #define SIG_OVERFLOW1 _VECTOR(8) |
197 |
198 /* Timer/Counter0 Overflow */ |
199 #define TIMER0_OVF_vect _VECTOR(9) |
200 #define SIG_OVERFLOW0 _VECTOR(9) |
201 |
202 /* Serial Transfer Complete */ |
203 #define SPI_STC_vect _VECTOR(10) |
204 #define SIG_SPI _VECTOR(10) |
205 |
206 /* USART, Rx Complete */ |
207 #define USART_RXC_vect _VECTOR(11) |
208 #define SIG_UART_RECV _VECTOR(11) |
209 |
210 /* USART Data Register Empty */ |
211 #define USART_UDRE_vect _VECTOR(12) |
212 #define SIG_UART_DATA _VECTOR(12) |
213 |
214 /* USART, Tx Complete */ |
215 #define USART_TXC_vect _VECTOR(13) |
216 #define SIG_UART_TRANS _VECTOR(13) |
217 |
218 /* ADC Conversion Complete */ |
219 #define ADC_vect _VECTOR(14) |
220 #define SIG_ADC _VECTOR(14) |
221 |
222 /* EEPROM Ready */ |
223 #define EE_RDY_vect _VECTOR(15) |
224 #define SIG_EEPROM_READY _VECTOR(15) |
225 |
226 /* Analog Comparator */ |
227 #define ANA_COMP_vect _VECTOR(16) |
GAS LISTING /tmp/ccCMjSjd.s page 12 |
228 #define SIG_COMPARATOR _VECTOR(16) |
229 |
230 /* 2-wire Serial Interface */ |
231 #define TWI_vect _VECTOR(17) |
232 #define SIG_2WIRE_SERIAL _VECTOR(17) |
233 |
234 /* Store Program Memory Ready */ |
235 #define SPM_RDY_vect _VECTOR(18) |
236 #define SIG_SPM_READY _VECTOR(18) |
237 |
238 #define _VECTORS_SIZE 38 |
239 |
240 /* Bit numbers */ |
241 |
242 /* GIMSK / GICR */ |
243 #define INT1 7 |
244 #define INT0 6 |
245 #define IVSEL 1 |
246 #define IVCE 0 |
247 |
248 /* GIFR */ |
249 #define INTF1 7 |
250 #define INTF0 6 |
251 |
252 /* TIMSK */ |
253 #define OCIE2 7 |
254 #define TOIE2 6 |
255 #define TICIE1 5 |
256 #define OCIE1A 4 |
257 #define OCIE1B 3 |
257 #elif defined (__AVR_ATmega48__) |
258 # include <avr/iom48.h> |
259 #elif defined (__AVR_ATmega88__) |
260 # include <avr/iom88.h> |
261 #elif defined (__AVR_ATmega8515__) |
262 # include <avr/iom8515.h> |
263 #elif defined (__AVR_ATmega8535__) |
264 # include <avr/iom8535.h> |
265 #elif defined (__AVR_AT90S8535__) |
266 # include <avr/io8535.h> |
267 #elif defined (__AVR_AT90C8534__) |
268 # include <avr/io8534.h> |
269 #elif defined (__AVR_AT90S8515__) |
270 # include <avr/io8515.h> |
271 #elif defined (__AVR_AT90S4434__) |
272 # include <avr/io4434.h> |
273 #elif defined (__AVR_AT90S4433__) |
274 # include <avr/io4433.h> |
275 #elif defined (__AVR_AT90S4414__) |
276 # include <avr/io4414.h> |
277 #elif defined (__AVR_ATtiny22__) |
278 # include <avr/iotn22.h> |
279 #elif defined (__AVR_ATtiny26__) |
280 # include <avr/iotn26.h> |
281 #elif defined (__AVR_AT90S2343__) |
282 # include <avr/io2343.h> |
283 #elif defined (__AVR_AT90S2333__) |
GAS LISTING /tmp/ccCMjSjd.s page 13 |
284 # include <avr/io2333.h> |
285 #elif defined (__AVR_AT90S2323__) |
286 # include <avr/io2323.h> |
287 #elif defined (__AVR_AT90S2313__) |
288 # include <avr/io2313.h> |
289 #elif defined (__AVR_ATtiny2313__) |
290 # include <avr/iotn2313.h> |
291 #elif defined (__AVR_ATtiny13__) |
292 # include <avr/iotn13.h> |
293 #elif defined (__AVR_ATtiny25__) |
294 # include <avr/iotn25.h> |
295 #elif defined (__AVR_ATtiny45__) |
296 # include <avr/iotn45.h> |
297 #elif defined (__AVR_ATtiny85__) |
298 # include <avr/iotn85.h> |
299 #elif defined (__AVR_ATtiny24__) |
300 # include <avr/iotn24.h> |
301 #elif defined (__AVR_ATtiny44__) |
302 # include <avr/iotn44.h> |
303 #elif defined (__AVR_ATtiny84__) |
304 # include <avr/iotn84.h> |
305 #elif defined (__AVR_ATtiny261__) |
306 # include <avr/iotn261.h> |
307 #elif defined (__AVR_ATtiny461__) |
308 # include <avr/iotn461.h> |
309 #elif defined (__AVR_ATtiny861__) |
310 # include <avr/iotn861.h> |
311 /* avr1: the following only supported for assembler programs */ |
312 #elif defined (__AVR_ATtiny28__) |
313 # include <avr/iotn28.h> |
314 #elif defined (__AVR_AT90S1200__) |
315 # include <avr/io1200.h> |
316 #elif defined (__AVR_ATtiny15__) |
317 # include <avr/iotn15.h> |
318 #elif defined (__AVR_ATtiny12__) |
319 # include <avr/iotn12.h> |
320 #elif defined (__AVR_ATtiny11__) |
321 # include <avr/iotn11.h> |
322 #else |
323 # if !defined(__COMPILING_AVR_LIBC__) |
324 # warning "device type not defined" |
325 # endif |
326 #endif |
327 |
328 #include <avr/portpins.h> |
1 /* Copyright (c) 2003 Theodore A. Roth |
2 All rights reserved. |
3 |
4 Redistribution and use in source and binary forms, with or without |
5 modification, are permitted provided that the following conditions are met: |
6 |
7 * Redistributions of source code must retain the above copyright |
8 notice, this list of conditions and the following disclaimer. |
9 |
10 * Redistributions in binary form must reproduce the above copyright |
11 notice, this list of conditions and the following disclaimer in |
12 the documentation and/or other materials provided with the |
GAS LISTING /tmp/ccCMjSjd.s page 14 |
13 distribution. |
14 |
15 * Neither the name of the copyright holders nor the names of |
16 contributors may be used to endorse or promote products derived |
17 from this software without specific prior written permission. |
18 |
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
20 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
21 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
22 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
23 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
24 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
25 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
26 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
27 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
28 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
29 POSSIBILITY OF SUCH DAMAGE. */ |
30 |
31 /* $Id: portpins.h,v 1.3.4.1 2006/03/10 16:22:38 aesok Exp $ */ |
32 |
33 #ifndef _AVR_PORTPINS_H_ |
34 #define _AVR_PORTPINS_H_ 1 |
35 |
36 /* This file should only be included from <avr/io.h>, never directly. */ |
37 |
38 #ifndef _AVR_IO_H_ |
39 # error "Include <avr/io.h> instead of this file." |
40 #endif |
41 |
42 /* Define Generic PORTn, DDn, and PINn values. */ |
43 |
44 /* Port Data Register (generic) */ |
45 #define PORT7 7 |
46 #define PORT6 6 |
47 #define PORT5 5 |
48 #define PORT4 4 |
49 #define PORT3 3 |
50 #define PORT2 2 |
51 #define PORT1 1 |
52 #define PORT0 0 |
53 |
54 /* Port Data Direction Register (generic) */ |
55 #define DD7 7 |
56 #define DD6 6 |
57 #define DD5 5 |
58 #define DD4 4 |
59 #define DD3 3 |
60 #define DD2 2 |
61 #define DD1 1 |
62 #define DD0 0 |
63 |
64 /* Port Input Pins (generic) */ |
65 #define PIN7 7 |
66 #define PIN6 6 |
67 #define PIN5 5 |
68 #define PIN4 4 |
69 #define PIN3 3 |
GAS LISTING /tmp/ccCMjSjd.s page 15 |
70 #define PIN2 2 |
71 #define PIN1 1 |
72 #define PIN0 0 |
73 |
74 /* Define PORTxn values for all possible port pins. */ |
75 |
76 /* PORT A */ |
77 |
78 #if defined(PA0) |
79 # define PORTA0 PA0 |
80 #endif |
81 #if defined(PA1) |
82 # define PORTA1 PA1 |
83 #endif |
84 #if defined(PA2) |
85 # define PORTA2 PA2 |
86 #endif |
87 #if defined(PA3) |
88 # define PORTA3 PA3 |
89 #endif |
90 #if defined(PA4) |
91 # define PORTA4 PA4 |
92 #endif |
93 #if defined(PA5) |
94 # define PORTA5 PA5 |
95 #endif |
96 #if defined(PA6) |
97 # define PORTA6 PA6 |
98 #endif |
99 #if defined(PA7) |
100 # define PORTA7 PA7 |
101 #endif |
102 |
103 /* PORT B */ |
104 |
105 #if defined(PB0) |
106 # define PORTB0 PB0 |
107 #endif |
108 #if defined(PB1) |
109 # define PORTB1 PB1 |
110 #endif |
111 #if defined(PB2) |
112 # define PORTB2 PB2 |
113 #endif |
114 #if defined(PB3) |
115 # define PORTB3 PB3 |
116 #endif |
117 #if defined(PB4) |
118 # define PORTB4 PB4 |
119 #endif |
120 #if defined(PB5) |
121 # define PORTB5 PB5 |
122 #endif |
123 #if defined(PB6) |
124 # define PORTB6 PB6 |
125 #endif |
126 #if defined(PB7) |
GAS LISTING /tmp/ccCMjSjd.s page 16 |
127 # define PORTB7 PB7 |
128 #endif |
129 |
130 /* PORT C */ |
131 |
132 #if defined(PC0) |
133 # define PORTC0 PC0 |
134 #endif |
135 #if defined(PC1) |
136 # define PORTC1 PC1 |
137 #endif |
138 #if defined(PC2) |
139 # define PORTC2 PC2 |
140 #endif |
141 #if defined(PC3) |
142 # define PORTC3 PC3 |
143 #endif |
144 #if defined(PC4) |
145 # define PORTC4 PC4 |
146 #endif |
147 #if defined(PC5) |
148 # define PORTC5 PC5 |
149 #endif |
150 #if defined(PC6) |
151 # define PORTC6 PC6 |
152 #endif |
153 #if defined(PC7) |
154 # define PORTC7 PC7 |
155 #endif |
156 |
157 /* PORT D */ |
158 |
159 #if defined(PD0) |
160 # define PORTD0 PD0 |
161 #endif |
162 #if defined(PD1) |
163 # define PORTD1 PD1 |
164 #endif |
165 #if defined(PD2) |
166 # define PORTD2 PD2 |
167 #endif |
168 #if defined(PD3) |
169 # define PORTD3 PD3 |
170 #endif |
171 #if defined(PD4) |
172 # define PORTD4 PD4 |
173 #endif |
174 #if defined(PD5) |
175 # define PORTD5 PD5 |
176 #endif |
177 #if defined(PD6) |
178 # define PORTD6 PD6 |
179 #endif |
180 #if defined(PD7) |
181 # define PORTD7 PD7 |
182 #endif |
183 |
GAS LISTING /tmp/ccCMjSjd.s page 17 |
184 /* PORT E */ |
185 |
186 #if defined(PE0) |
187 # define PORTE0 PE0 |
188 #endif |
189 #if defined(PE1) |
190 # define PORTE1 PE1 |
191 #endif |
192 #if defined(PE2) |
193 # define PORTE2 PE2 |
194 #endif |
195 #if defined(PE3) |
196 # define PORTE3 PE3 |
197 #endif |
198 #if defined(PE4) |
199 # define PORTE4 PE4 |
200 #endif |
201 #if defined(PE5) |
202 # define PORTE5 PE5 |
203 #endif |
204 #if defined(PE6) |
205 # define PORTE6 PE6 |
206 #endif |
207 #if defined(PE7) |
208 # define PORTE7 PE7 |
209 #endif |
210 |
211 /* PORT F */ |
212 |
213 #if defined(PF0) |
214 # define PORTF0 PF0 |
215 #endif |
216 #if defined(PF1) |
217 # define PORTF1 PF1 |
218 #endif |
219 #if defined(PF2) |
220 # define PORTF2 PF2 |
221 #endif |
222 #if defined(PF3) |
223 # define PORTF3 PF3 |
224 #endif |
225 #if defined(PF4) |
226 # define PORTF4 PF4 |
227 #endif |
228 #if defined(PF5) |
229 # define PORTF5 PF5 |
230 #endif |
231 #if defined(PF6) |
232 # define PORTF6 PF6 |
233 #endif |
234 #if defined(PF7) |
235 # define PORTF7 PF7 |
236 #endif |
237 |
238 /* PORT G */ |
239 |
240 #if defined(PG0) |
GAS LISTING /tmp/ccCMjSjd.s page 18 |
241 # define PORTG0 PG0 |
242 #endif |
243 #if defined(PG1) |
244 # define PORTG1 PG1 |
245 #endif |
246 #if defined(PG2) |
247 # define PORTG2 PG2 |
248 #endif |
249 #if defined(PG3) |
250 # define PORTG3 PG3 |
251 #endif |
252 #if defined(PG4) |
253 # define PORTG4 PG4 |
254 #endif |
255 #if defined(PG5) |
256 # define PORTG5 PG5 |
257 #endif |
258 #if defined(PG6) |
259 # define PORTG6 PG6 |
260 #endif |
261 #if defined(PG7) |
262 # define PORTG7 PG7 |
263 #endif |
264 |
265 /* PORT H */ |
266 |
267 #if defined(PH0) |
268 # define PORTH0 PH0 |
269 #endif |
270 #if defined(PH1) |
271 # define PORTH1 PH1 |
272 #endif |
273 #if defined(PH2) |
274 # define PORTH2 PH2 |
275 #endif |
276 #if defined(PH3) |
277 # define PORTH3 PH3 |
278 #endif |
279 #if defined(PH4) |
280 # define PORTH4 PH4 |
281 #endif |
282 #if defined(PH5) |
283 # define PORTH5 PH5 |
284 #endif |
285 #if defined(PH6) |
286 # define PORTH6 PH6 |
287 #endif |
288 #if defined(PH7) |
289 # define PORTH7 PH7 |
290 #endif |
291 |
292 /* PORT J */ |
293 |
294 #if defined(PJ0) |
295 # define PORTJ0 PJ0 |
296 #endif |
297 #if defined(PJ1) |
GAS LISTING /tmp/ccCMjSjd.s page 19 |
298 # define PORTJ1 PJ1 |
299 #endif |
300 #if defined(PJ2) |
301 # define PORTJ2 PJ2 |
302 #endif |
303 #if defined(PJ3) |
304 # define PORTJ3 PJ3 |
305 #endif |
306 #if defined(PJ4) |
307 # define PORTJ4 PJ4 |
308 #endif |
309 #if defined(PJ5) |
310 # define PORTJ5 PJ5 |
311 #endif |
312 #if defined(PJ6) |
313 # define PORTJ6 PJ6 |
314 #endif |
315 #if defined(PJ7) |
316 # define PORTJ7 PJ7 |
317 #endif |
318 |
319 /* PORT K */ |
320 |
321 #if defined(PK0) |
322 # define PORTK0 PK0 |
323 #endif |
324 #if defined(PK1) |
325 # define PORTK1 PK1 |
326 #endif |
327 #if defined(PK2) |
328 # define PORTK2 PK2 |
329 #endif |
329 |
330 #if __AVR_ARCH__ != 1 |
331 # if XRAMEND < 0x100 && !defined(__COMPILING_AVR_LIBC__) |
332 # undef SP |
333 # define SP _SFR_IO8(0x3D) |
334 # undef SPH |
335 # endif |
336 #endif |
337 |
338 #include <avr/version.h> |
1 /* Copyright (c) 2005, Joerg Wunsch -*- c -*- |
2 All rights reserved. |
3 |
4 Redistribution and use in source and binary forms, with or without |
5 modification, are permitted provided that the following conditions are met: |
6 |
7 * Redistributions of source code must retain the above copyright |
8 notice, this list of conditions and the following disclaimer. |
9 |
10 * Redistributions in binary form must reproduce the above copyright |
11 notice, this list of conditions and the following disclaimer in |
12 the documentation and/or other materials provided with the |
13 distribution. |
14 |
15 * Neither the name of the copyright holders nor the names of |
GAS LISTING /tmp/ccCMjSjd.s page 20 |
16 contributors may be used to endorse or promote products derived |
17 from this software without specific prior written permission. |
18 |
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
20 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
21 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
22 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
23 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
24 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
25 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
26 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
27 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
28 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
29 POSSIBILITY OF SUCH DAMAGE. */ |
30 |
31 /* $Id: version.h.in,v 1.1 2005/09/12 20:18:12 joerg_wunsch Exp $ */ |
32 |
33 /** \defgroup avr_version <avr/version.h>: avr-libc version macros |
34 \code #include <avr/version.h> \endcode |
35 |
36 This header file defines macros that contain version numbers and |
37 strings describing the current version of avr-libc. |
38 |
39 The version number itself basically consists of three pieces that |
40 are separated by a dot: the major number, the minor number, and |
41 the revision number. For development versions (which use an odd |
42 minor number), the string representation additionally gets the |
43 date code (YYYYMMDD) appended. |
44 |
45 This file will also be included by \c <avr/io.h>. That way, |
46 portable tests can be implemented using \c <avr/io.h> that can be |
47 used in code that wants to remain backwards-compatible to library |
48 versions prior to the date when the library version API had been |
49 added, as referenced but undefined C preprocessor macros |
50 automatically evaluate to 0. |
51 */ |
52 |
53 #ifndef _AVR_VERSION_H_ |
54 #define _AVR_VERSION_H_ |
55 |
56 /** \ingroup avr_version |
57 String literal representation of the current library version. */ |
58 #define __AVR_LIBC_VERSION_STRING__ "1.4.4" |
59 |
60 /** \ingroup avr_version |
61 Numerical representation of the current library version. |
62 |
63 In the numerical representation, the major number is multiplied by |
64 10000, the minor number by 100, and all three parts are then |
65 added. It is intented to provide a monotonically increasing |
66 numerical value that can easily be used in numerical checks. |
67 */ |
68 #define __AVR_LIBC_VERSION__ 10404UL |
69 |
70 /** \ingroup avr_version |
71 String literal representation of the release date. */ |
72 #define __AVR_LIBC_DATE_STRING__ "20060420" |
GAS LISTING /tmp/ccCMjSjd.s page 21 |
73 |
74 /** \ingroup avr_version |
75 Numerical representation of the release date. */ |
76 #define __AVR_LIBC_DATE_ 20060420UL |
77 |
78 /** \ingroup avr_version |
79 Library major version number. */ |
80 #define __AVR_LIBC_MAJOR__ 1 |
81 |
82 /** \ingroup avr_version |
83 Library minor version number. */ |
84 #define __AVR_LIBC_MINOR__ 4 |
85 |
86 /** \ingroup avr_version |
87 Library revision number. */ |
88 #define __AVR_LIBC_REVISION__ 4 |
89 |
90 #endif /* _AVR_VERSION_H_ */ |
91 ... |
339 |
54 #include "Events.h" |
1 #ifndef EVENTS_H |
2 #define EVENTS_H |
3 |
4 /* |
5 Copyright (C) 2004 John Orlando |
6 |
7 AVRcam: a small real-time image processing engine. |
8 |
9 This program is free software; you can redistribute it and/or |
10 modify it under the terms of the GNU General Public |
11 License as published by the Free Software Foundation; either |
12 version 2 of the License, or (at your option) any later version. |
13 |
14 This program is distributed in the hope that it will be useful, |
15 but WITHOUT ANY WARRANTY; without even the implied warranty of |
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
17 General Public License for more details. |
18 |
19 You should have received a copy of the GNU General Public |
20 License along with this program; if not, write to the Free Software |
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
22 |
23 For more information on the AVRcam, please contact: |
24 |
25 john@jrobot.net |
26 |
27 or go to www.jrobot.net for more details regarding the system. |
28 */ |
29 /*********************************************************** |
30 Module Name: Events.h |
31 Module Date: 05/23/2004 |
32 Module Auth: John Orlando |
33 |
34 Description: This file provides the external interface |
35 to the events that can be published/processed in the |
36 system. It is specifically by itself (and nothing |
GAS LISTING /tmp/ccCMjSjd.s page 22 |
37 else should be defined in here) so that both .c and |
38 .S (assembly) files can include this file without |
39 a problem. |
40 |
41 Revision History: |
42 Date Rel Ver. Notes |
43 4/10/2004 0.1 Module created |
44 6/30/2004 1.0 Initial release for Circuit Cellar |
45 contest. |
46 *******************************************************/ |
47 |
48 /* Definitions */ |
49 /* Originally, all events were passed in a bitmask...however, |
50 an event FIFO was finally used, but the coding of the event |
51 definitions were never translated back....doesn't make a |
52 difference, but looks a little weird */ |
53 #define EV_SERIAL_DATA_RECEIVED 0x01 |
54 #define EV_DUMP_FRAME 0x02 |
55 #define EV_PROCESS_FRAME_COMPLETE 0x04 |
55 |
56 .extern fastEventBitmask ; This is the flag used to indicate to the rest |
57 ; of the system that the line is complete |
58 |
59 #define HREF_INTERRUPT_ENABLE_MASK 0x80 |
60 #define HREF_INTERRUPT_DISABLE_MASK 0x7F |
61 #define ENABLE_PCLK_TIMER1_OVERFLOW_BITMASK 0x04 |
62 #define DISABLE_PCLK_TIMER1_OVERFLOW_BITMASK 0xFB |
63 #define G_PORT _SFR_IO_ADDR(PINC) |
64 #define RB_PORT _SFR_IO_ADDR(PINB) |
65 #define PIXEL_RUN_START_INITIAL 0x50 ; This value causes our pixel counter (TCNT1) |
66 ; to overflow after 176 (horizontal) pixels |
67 |
68 #define RED_MEM_OFFSET 0x00 |
69 #define GREEN_MEM_OFFSET 0x10 |
70 #define BLUE_MEM_OFFSET 0x20 |
71 |
72 ; A pixelBlock is defined as a contiguous group of 4 pixels that are combined |
73 ; together to form a specific color. Typically, this is formed by sampling a |
74 ; a green value, followed by a red and blue value (since we are dealing |
75 ; with Bayer color data). We could optionally sample a second green with |
76 ; the red and average the greens, because the eye is more sensitive to |
77 ; green, but for speed we don't do this. These three values (RGB) are then |
78 ; used as indices into the color membership lookup table (memLookup) to |
79 ; determine which color the pixelBlock maps into. The memLookup table is |
80 ; manually generated for now (though it will hopefully be modified over |
81 ; the serial interface eventually). |
82 ; |
83 ; Here is a pixel block: |
84 ; ...G G G G... (row x) |
85 ; ...B R B R... (row x+1) |
86 ; | | | |--this is skipped |
87 ; | | |--this is skipped |
88 ; | |--this is sampled |
89 ; |--this is sampled |
90 |
91 ; As pixel blocks are sampled, the red, green, and blue values are |
92 ; used to index into their respective color maps. The color maps |
GAS LISTING /tmp/ccCMjSjd.s page 23 |
93 ; return values that can be logically ANDed together so that a |
94 ; particular RGB triplet will result in a single bit being set |
95 ; after the AND operation. This single bit indicates which color |
96 ; the RGB triplet represents. It is also possible for no bits to |
97 ; be set after the AND process, indicating that the RGB triplet |
98 ; does not map to any of the colors configured in the color map. |
99 ; This isn't quite as fast as a pure RGB lookup table, but |
100 ; it then again it doesn't require 2^12 (4-bits for each color |
101 ; channel) bytes to store the lookup table. It takes just a few |
102 ; more cycles, and only requires 48 bytes of precious RAM (16 |
103 ; per color channel, since our resolution on each color channel |
104 ; is only 4-bits). Not bad....for more information, see: |
105 ; http://www.cs.cmu.edu/~trb/papers/wirevision00.pdf for more |
106 ; information on this color segmentation technique. |
107 |
108 ; One other note: this code does depend on the colorMap residing |
109 ; at a well-defined position in memory; specifically, it mus |
110 ; start at a 256-byte boundary so that the lowest byte in the |
111 ; map is set to 0x00. Currently, the colorMap is forced to |
112 ; start at RAM location 0x300. This could potentially be changed |
113 ; by the developer if needed, but offsets would have to be added |
114 ; in to the colorMap look-up code below to make it work. |
115 |
116 |
117 ; These are the registers that will be used throughout this |
118 ; module for acquiring each line of pixel data |
119 pixelCount = 16 |
120 pixelRunStart = 17 |
121 lastColor = 18 |
122 tmp1 = 19 ; be sure to not use tmp1 and color simultaneously |
123 tmp2 = 20 |
124 color = 19 |
125 greenData = 20 |
126 blueData = 21 |
127 colorMapLow = 22 |
128 colorMapHigh = 23 |
129 prevLineBuffLow = 22 ; overlaps with memLookupLow (but orthogonal) |
130 prevLineBuffHigh = 23 ; overlaps with memLookupHigh (but orthogonal) |
131 currLineBuffLow = 24 |
132 currLineBuffHigh = 25 |
133 |
134 .section .text |
135 |
136 ; These are the global assembly function names that are accessed via other |
137 ; C functions |
138 .global CamIntAsm_waitForNewTrackingFrame |
139 .global CamIntAsm_waitForNewDumpFrame |
140 .global CamIntAsm_acquireDumpLine |
141 .global CamIntAsm_acquireTrackingLine |
142 .global SIG_INTERRUPT0 |
143 .global SIG_INTERRUPT1 |
144 .global SIG_OVERFLOW0 |
145 .global SIG_OVERFLOW1 |
146 |
147 ;***************************************************************** |
148 ; Function Name: CamIntAsm_waitForNewTrackingFrame |
149 ; Function Description: This function is responsible for |
GAS LISTING /tmp/ccCMjSjd.s page 24 |
150 ; going to sleep until a new frame begins (indicated by |
151 ; VSYNC transitioning from low to high. This will wake |
152 ; the "VSYNC sleep" up and allow it to continue with |
153 ; the acquireLine function, where the system waits for |
154 ; an "HREF sleep" that we use to synchronize with the |
155 ; data. |
156 ; Inputs: r25 - MSB of currentLineBuffer |
157 ; r24 - LSB of currentLineBuffer |
158 ; r23 - MSB of colorMap |
159 ; r22 - LSB of colorMap |
160 ; Outputs: none |
161 ; NOTES: This function doesn't really return...it sorta just |
162 ; floats into the acquireLine function after the "VSYNC sleep" |
163 ; is awoken, then begins processing the line data. Once |
164 ; 176 pixels are sampled (and the counter overflows), then |
165 ; an interrupt will occur, the 'T' bit in the SREG will be |
166 ; set, and the function will return. |
167 ;***************************************************************** |
168 |
169 CamIntAsm_waitForNewTrackingFrame: |
170:CamInterfaceAsm.S **** sbi _SFR_IO_ADDR(PORTD),PD6 ; For testing... |
171:CamInterfaceAsm.S **** cbi _SFR_IO_ADDR(PORTD),PD6 |
172:CamInterfaceAsm.S **** sleep |
173 |
174 ;***************************************************************** |
175 ; REMEMBER...everything from here on out is critically timed to be |
176 ; synchronized with the flow of pixel data from the camera... |
177 ;***************************************************************** |
178 |
179 CamIntAsm_acquireTrackingLine: |
180:CamInterfaceAsm.S **** brts _cleanUp |
181 ;sbi _SFR_IO_ADDR(PORTD),PD6 ; For testing... |
182 ;cbi _SFR_IO_ADDR(PORTD),PD6 |
183 |
184:CamInterfaceAsm.S **** in tmp1,_SFR_IO_ADDR(TCCR1B) ; Enable the PCLK line to actually |
185:CamInterfaceAsm.S **** ori tmp1, 0x07 ; feed Timer1 |
186:CamInterfaceAsm.S **** out _SFR_IO_ADDR(TCCR1B),tmp1 |
187 ; The line is about to start... |
188:CamInterfaceAsm.S **** ldi pixelCount,0 ; Initialize the RLE stats... |
189:CamInterfaceAsm.S **** ldi pixelRunStart,PIXEL_RUN_START_INITIAL ; Remember, we always calculate |
190 ; the pixel run length as |
191 ; TCNT1L - pixelRunStart |
192 |
193:CamInterfaceAsm.S **** ldi lastColor,0x00 ; clear out the last color before we start |
194 |
195:CamInterfaceAsm.S **** mov XH,currLineBuffHigh ; Load the pointer to the current line |
196:CamInterfaceAsm.S **** mov XL,currLineBuffLow ; buffer into the X pointer regs |
197 |
198:CamInterfaceAsm.S **** mov ZH,colorMapHigh ; Load the pointers to the membership |
199:CamInterfaceAsm.S **** mov ZL,colorMapLow ; lookup tables (ZL and YL will be overwritten |
200:CamInterfaceAsm.S **** mov YH,colorMapHigh ; as soon as we start reading data) to Z and Y |
201 |
202:CamInterfaceAsm.S **** in tmp1, _SFR_IO_ADDR(TIMSK) ; enable TIMER1 to start counting |
203:CamInterfaceAsm.S **** ori tmp1, ENABLE_PCLK_TIMER1_OVERFLOW_BITMASK ; external PCLK pulses and interrupt on |
204:CamInterfaceAsm.S **** out _SFR_IO_ADDR(TIMSK),tmp1 ; overflow |
205 |
206:CamInterfaceAsm.S **** ldi tmp1,PIXEL_RUN_START_INITIAL ; set up the TCNT1 to overflow (and |
GAS LISTING /tmp/ccCMjSjd.s page 25 |
207:CamInterfaceAsm.S **** ldi tmp2,0xFF ; interrupts) after 176 pixels |
208:CamInterfaceAsm.S **** out _SFR_IO_ADDR(TCNT1H),tmp2 |
209:CamInterfaceAsm.S **** out _SFR_IO_ADDR(TCNT1L),tmp1 |
210 |
211:CamInterfaceAsm.S **** mov YL,colorMapLow |
212 |
213:CamInterfaceAsm.S **** in tmp1, _SFR_IO_ADDR(GICR) ; enable the HREF interrupt...remember, we |
214 ; only use this interrupt to synchronize |
215 ; the beginning of the line |
216:CamInterfaceAsm.S **** ori tmp1, HREF_INTERRUPT_ENABLE_MASK |
217:CamInterfaceAsm.S **** out _SFR_IO_ADDR(GICR), tmp1 |
218 |
219 ;******************************************************************************************* |
220 ; Track Frame handler |
221 ;******************************************************************************************* |
222 |
223 _trackFrame: |
224:CamInterfaceAsm.S **** sbi _SFR_IO_ADDR(PORTD),PD6 |
225:CamInterfaceAsm.S **** sleep ; ...And we wait... |
226 |
227 ; Returning from the interrupt/sleep wakeup will consume |
228 ; 14 clock cycles (7 to wakeup from idle sleep, 3 to vector, and 4 to return) |
229 |
230 ; Disable the HREF interrupt |
231:CamInterfaceAsm.S **** cbi _SFR_IO_ADDR(PORTD),PD6 |
232:CamInterfaceAsm.S **** in tmp1, _SFR_IO_ADDR(GICR) |
233:CamInterfaceAsm.S **** andi tmp1, HREF_INTERRUPT_DISABLE_MASK |
234:CamInterfaceAsm.S **** out _SFR_IO_ADDR(GICR), tmp1 |
235 |
236 ; A couple of NOPs are needed here to sync up the pixel data...the number (2) |
237 ; of NOPs was determined emperically by trial and error. |
238:CamInterfaceAsm.S **** nop |
239:CamInterfaceAsm.S **** nop |
240 _acquirePixelBlock: ; Clock Cycle Count |
241:CamInterfaceAsm.S **** in ZL,RB_PORT ; sample the red value (PINB) (1) |
242:CamInterfaceAsm.S **** in YL,G_PORT ; sample the green value (PINC) (1) |
243:CamInterfaceAsm.S **** andi YL,0x0F ; clear the high nibble (1) |
244:CamInterfaceAsm.S **** ldd color,Z+RED_MEM_OFFSET ; lookup the red membership (2) |
245:CamInterfaceAsm.S **** in ZL,RB_PORT ; sample the blue value (PINB) (1) |
246:CamInterfaceAsm.S **** ldd greenData,Y+GREEN_MEM_OFFSET; lookup the green membership (2) |
247:CamInterfaceAsm.S **** ldd blueData,Z+BLUE_MEM_OFFSET ; lookup the blue membership (2) |
248:CamInterfaceAsm.S **** and color,greenData ; mask memberships together (1) |
249:CamInterfaceAsm.S **** and color,blueData ; to produce the final color (1) |
250:CamInterfaceAsm.S **** brts _cleanUpTrackingLine ; if some interrupt routine has (1...not set) |
251 ; come in and set our T flag in |
252 ; SREG, then we need to hop out |
253 ; and blow away this frames data (common cleanup) |
254:CamInterfaceAsm.S **** cp color,lastColor ; check to see if the run continues (1) |
255:CamInterfaceAsm.S **** breq _acquirePixelBlock ; (2...equal) |
256 ; ___________ |
257 ; 16 clock cycles |
258 ; (16 clock cycles = 1 uS = 1 pixelBlock time) |
259 |
260 ; Toggle the debug line to indicate a color change |
261:CamInterfaceAsm.S **** sbi _SFR_IO_ADDR(PORTD),PD6 |
262:CamInterfaceAsm.S **** nop |
263:CamInterfaceAsm.S **** cbi _SFR_IO_ADDR(PORTD),PD6 |
GAS LISTING /tmp/ccCMjSjd.s page 26 |
264 |
265:CamInterfaceAsm.S **** mov tmp2,pixelRunStart ; get the count value of the |
266 ; current pixel run |
267:CamInterfaceAsm.S **** in pixelCount,_SFR_IO_ADDR(TCNT1L) ; get the current TCNT1 value |
268:CamInterfaceAsm.S **** mov pixelRunStart,pixelCount ; reload pixelRunStart for the |
269 ; next run |
270:CamInterfaceAsm.S **** sub pixelCount,tmp2 ; pixelCount = TCNT1L - pixelRunStart |
271 |
272:CamInterfaceAsm.S **** st X+,lastColor ; record the color run in the current line buffer |
273:CamInterfaceAsm.S **** st X+,pixelCount ; with its length |
274:CamInterfaceAsm.S **** mov lastColor,color ; set lastColor so we can figure out when it changes |
275 |
276:CamInterfaceAsm.S **** nop ; waste one more cycle for a total of 16 |
277:CamInterfaceAsm.S **** rjmp _acquirePixelBlock |
278 |
279 ; _cleanUpTrackingLine is used to write the last run length block off to the currentLineBuffer so |
280 ; that all 176 pixels in the line are accounted for. |
281 _cleanUpTrackingLine: |
282:CamInterfaceAsm.S **** ldi pixelCount,0xFF ; the length of the last run is ALWAYS 0xFF minus the last |
283:CamInterfaceAsm.S **** sub pixelCount,pixelRunStart ; pixelRunStart |
284 |
285:CamInterfaceAsm.S **** inc pixelCount ; increment pixelCount since we actually need to account |
286 ; for the overflow of TCNT1 |
287 |
288:CamInterfaceAsm.S **** st X+,color ; record the color run in the current line buffer |
289:CamInterfaceAsm.S **** st X,pixelCount |
290:CamInterfaceAsm.S **** rjmp _cleanUp |
291 |
292 _cleanUpDumpLine: |
293 ; NOTE: If serial data is received, to interrupt the tracking of a line, we'll |
294 ; get a EV_SERIAL_DATA_RECEIVED event, and the T bit set so we will end the |
295 ; line's processing...however, the PCLK will keep on ticking for the rest of |
296 ; the frame/line, which will cause the TCNT to eventually overflow and |
297 ; interrupt us, generating a EV_ACQUIRE_LINE_COMPLETE event. We don't want |
298 ; this, so we need to actually turn off the PCLK counting each time we exit |
299 ; this loop, and only turn it on when we begin acquiring lines.... |
300 ; NOT NEEDED FOR NOW... |
301 ;in tmp1, _SFR_IO_ADDR(TIMSK) ; disable TIMER1 to stop counting |
302 ;andi tmp1, DISABLE_PCLK_TIMER1_OVERFLOW_BITMASK ; external PCLK pulses |
303 ;out _SFR_IO_ADDR(TIMSK),tmp1 |
304 |
305 _cleanUp: |
306 ; Disable the external clocking of the Timer1 counter |
307:CamInterfaceAsm.S **** in tmp1, _SFR_IO_ADDR(TCCR1B) |
308:CamInterfaceAsm.S **** andi tmp1, 0xF8 |
309:CamInterfaceAsm.S **** out _SFR_IO_ADDR(TCCR1B),tmp1 |
310 |
311 ; Toggle the debug line to indicate the line is complete |
312:CamInterfaceAsm.S **** sbi _SFR_IO_ADDR(PORTD),PD6 |
313:CamInterfaceAsm.S **** cbi _SFR_IO_ADDR(PORTD),PD6 |
314:CamInterfaceAsm.S **** clt ; clear out the T bit since we have detected |
315 ; the interruption and are exiting to handle it |
316 _exit: |
317:CamInterfaceAsm.S **** ret |
318 |
319 ;***************************************************************** |
320 ; Function Name: CamIntAsm_waitForNewDumpFrame |
GAS LISTING /tmp/ccCMjSjd.s page 27 |
321 ; Function Description: This function is responsible for |
322 ; going to sleep until a new frame begins (indicated by |
323 ; VSYNC transitioning from low to high. This will wake |
324 ; the "VSYNC sleep" up and allow it to continue with |
325 ; acquiring a line of pixel data to dump out to the UI. |
326 ; Inputs: r25 - MSB of currentLineBuffer |
327 ; r24 - LSB of currentLineBuffer |
328 ; r23 - MSB of prevLineBuffer |
329 ; r22 - LSB of prevLineBuffer |
330 ; Outputs: none |
331 ; NOTES: This function doesn't really return...it sorta just |
332 ; floats into the acquireDumpLine function after the "VSYNC sleep" |
333 ; is awoken. |
334 ;***************************************************************** |
335 CamIntAsm_waitForNewDumpFrame: |
336:CamInterfaceAsm.S **** sbi _SFR_IO_ADDR(PORTD),PD6 ; For testing... |
337:CamInterfaceAsm.S **** cbi _SFR_IO_ADDR(PORTD),PD6 |
338:CamInterfaceAsm.S **** sleep |
339 |
340 ;***************************************************************** |
341 ; REMEMBER...everything from here on out is critically timed to be |
342 ; synchronized with the flow of pixel data from the camera... |
343 ;***************************************************************** |
344 |
345 CamIntAsm_acquireDumpLine: |
346:CamInterfaceAsm.S **** brts _cleanUp |
347 ;sbi _SFR_IO_ADDR(PORTD),PD6 ; For testing... |
348 ;cbi _SFR_IO_ADDR(PORTD),PD6 |
349 |
350:CamInterfaceAsm.S **** mov XH,currLineBuffHigh ; Load the pointer to the current line |
351:CamInterfaceAsm.S **** mov XL,currLineBuffLow ; buffer into the X pointer regs |
352 |
353:CamInterfaceAsm.S **** mov YH,prevLineBuffHigh ; Load the pointer to the previous line |
354:CamInterfaceAsm.S **** mov YL,prevLineBuffLow ; buffer into the Y pointer regs |
355 |
356:CamInterfaceAsm.S **** ldi tmp1,PIXEL_RUN_START_INITIAL ; set up the TCNT1 to overflow (and |
357:CamInterfaceAsm.S **** ldi tmp2,0xFF ; interrupts) after 176 pixels |
358:CamInterfaceAsm.S **** out _SFR_IO_ADDR(TCNT1H),tmp2 |
359:CamInterfaceAsm.S **** out _SFR_IO_ADDR(TCNT1L),tmp1 |
360 |
361:CamInterfaceAsm.S **** in tmp1, _SFR_IO_ADDR(TCCR1B) ; Enable the PCLK line to actually |
362:CamInterfaceAsm.S **** ori tmp1, 0x07 ; feed Timer1 |
363:CamInterfaceAsm.S **** out _SFR_IO_ADDR(TCCR1B),tmp1 |
364:CamInterfaceAsm.S **** nop |
365 |
366:CamInterfaceAsm.S **** in tmp1, _SFR_IO_ADDR(TIMSK) ; enable TIMER1 to start counting |
367:CamInterfaceAsm.S **** ori tmp1, ENABLE_PCLK_TIMER1_OVERFLOW_BITMASK ; external PCLK pulses and interrupt on |
368:CamInterfaceAsm.S **** out _SFR_IO_ADDR(TIMSK),tmp1 ; overflow |
369 |
370:CamInterfaceAsm.S **** in tmp1, _SFR_IO_ADDR(GICR) ; enable the HREF interrupt...remember, we |
371 ; only use this interrupt to synchronize |
372 ; the beginning of the line |
373:CamInterfaceAsm.S **** ori tmp1, HREF_INTERRUPT_ENABLE_MASK |
374:CamInterfaceAsm.S **** out _SFR_IO_ADDR(GICR), tmp1 |
375 |
376 ;******************************************************************************************* |
377 ; Dump Frame handler |
GAS LISTING /tmp/ccCMjSjd.s page 28 |
378 ;******************************************************************************************* |
379 |
380 _dumpFrame: |
381:CamInterfaceAsm.S **** sbi _SFR_IO_ADDR(PORTD),PD6 |
382:CamInterfaceAsm.S **** sleep ; ...And we wait... |
383 |
384:CamInterfaceAsm.S **** cbi _SFR_IO_ADDR(PORTD),PD6 |
385:CamInterfaceAsm.S **** in tmp1, _SFR_IO_ADDR(GICR) ; disable the HREF interrupt |
386:CamInterfaceAsm.S **** andi tmp1, HREF_INTERRUPT_DISABLE_MASK ; so we don't get interrupted |
387:CamInterfaceAsm.S **** out _SFR_IO_ADDR(GICR), tmp1 ; while dumping the line |
388 |
389:CamInterfaceAsm.S **** nop ; Remember...if we ever remove the "cbi" instruction above, |
390 ; we need to add two more NOPs to cover this |
391 |
392 ; Ok...the following loop needs to run in 8 clock cycles, so we can get every |
393 ; pixel in the line...this shouldn't be a problem, since the PCLK timing was |
394 ; reduced by a factor of 2 whenever we go to dump a line (this is to give us |
395 ; enough time to do the sampling and storing of the pixel data). In addition, |
396 ; it is assumed that we will have to do some minor processing on the data right |
397 ; before we send it out, like mask off the top 4-bits of each, and then pack both |
398 ; low nibbles into a single byte for transmission...we just don't have time to |
399 ; do that here (only 8 instruction cycles :-) ) |
400 _sampleDumpPixel: |
401:CamInterfaceAsm.S **** in tmp1,G_PORT ; sample the G value (1) |
402:CamInterfaceAsm.S **** in tmp2,RB_PORT ; sample the R/B value (1) |
403:CamInterfaceAsm.S **** st X+,tmp1 ; store to the currLineBuff and inc ptrs(2) |
404:CamInterfaceAsm.S **** st Y+,tmp2 ; store to the prevLineBuff and inc ptrs(2) |
405:CamInterfaceAsm.S **** brtc _sampleDumpPixel ; loop back unless flag is set (2...if not set) |
406 ; ___________ |
407 ; 8 cycles normally |
408 |
409 ; if we make it here, it means the T flag is set, and we must have been interrupted |
410 ; so we need to exit (what if we were interrupted for serial? should we disable it?) |
411:CamInterfaceAsm.S **** rjmp _cleanUpDumpLine |
412 |
413 ;*********************************************************** |
414 ; Function Name: <interrupt handler for External Interrupt0> |
415 ; Function Description: This function is responsible |
416 ; for handling a rising edge on the Ext Interrupt 0. This |
417 ; routine simply returns, since we just want to wake up |
418 ; whenever the VSYNC transitions (meaning the start of a new |
419 ; frame). |
420 ; Inputs: none |
421 ; Outputs: none |
422 ;*********************************************************** |
423 SIG_INTERRUPT0: |
424 ; This will wake us up when VSYNC transitions high...we just want to return |
425:CamInterfaceAsm.S **** reti |
426 |
427 ;*********************************************************** |
428 ; Function Name: <interrupt handler for External Interrupt1> |
429 ; Function Description: This function is responsible |
430 ; for handling a falling edge on the Ext Interrupt 1. This |
431 ; routine simply returns, since we just want to wake up |
432 ; whenever the HREF transitions (meaning the pixels |
433 ; are starting after VSYNC transitioned, and we need to |
434 ; start acquiring the pixel blocks |
GAS LISTING /tmp/ccCMjSjd.s page 29 |
435 ; Inputs: none |
436 ; Outputs: none |
437 ;*********************************************************** |
438 SIG_INTERRUPT1: |
439 ; This will wake us up when HREF transitions high...we just want to return |
440:CamInterfaceAsm.S **** reti |
441 |
442 ;*********************************************************** |
443 ; Function Name: <interrupt handler for Timer0 overflow> |
444 ; Function Description: This function is responsible |
445 ; for handling the Timer0 overflow (hooked up to indicate |
446 ; when we have reached the number of HREFs required in a |
447 ; single frame). We set the T flag in the SREG to |
448 ; indicate to the _acquirePixelBlock routine that it needs |
449 ; to exit, and then set the appropriate action to take in |
450 ; the eventList of the Executive module. |
451 ; Inputs: none |
452 ; Outputs: none |
453 ; Note: Originally, the HREF pulses were also going to |
454 ; be counted by a hardware counter, but it didn't end up |
455 ; being necessary |
456 ;*********************************************************** |
457 ;SIG_OVERFLOW0: |
458 ; set ; set the T bit in SREG |
459 ; lds tmp1,eventBitmask |
460 ; ori tmp1,EV_ACQUIRE_FRAME_COMPLETE |
461 ; sts eventBitmask,tmp1 |
462 ; reti |
463 |
464 ;*********************************************************** |
465 ; Function Name: <interrupt handler for Timer1 overflow> |
466 ; Function Description: This function is responsible |
467 ; for handling the Timer1 overflow (hooked up to indicate |
468 ; when we have reached the end of a line of pixel data, |
469 ; since PCLK is hooked up to overflow TCNT1 after 176 |
470 ; pixels). This routine generates an acquire line complete |
471 ; event in the fastEventBitmask, which is streamlined for |
472 ; efficiency reasons. |
473 ;*********************************************************** |
474 SIG_OVERFLOW1: |
475:CamInterfaceAsm.S **** lds tmp1,fastEventBitmask ; set a flag indicating |
476:CamInterfaceAsm.S **** ori tmp1,FEV_ACQUIRE_LINE_COMPLETE ; a line is complete |
477:CamInterfaceAsm.S **** sts fastEventBitmask,tmp1 |
478:CamInterfaceAsm.S **** set ; set the T bit in SREG |
479 ;sbi _SFR_IO_ADDR(PORTD),PD6 ; For testing... |
480 ;cbi _SFR_IO_ADDR(PORTD),PD6 ; For testing... |
481 |
482:CamInterfaceAsm.S **** reti |
483 |
484 ; This is the default handler for all interrupts that don't |
485 ; have handler routines specified for them. |
486 .global __vector_default |
487 __vector_default: |
488:CamInterfaceAsm.S **** reti |
489 |
490 .end |
GAS LISTING /tmp/ccCMjSjd.s page 30 |
DEFINED SYMBOLS |
*ABS*:00000000 CamInterfaceAsm.S |
CamInterfaceAsm.S:119 *ABS*:00000010 pixelCount |
CamInterfaceAsm.S:120 *ABS*:00000011 pixelRunStart |
CamInterfaceAsm.S:121 *ABS*:00000012 lastColor |
CamInterfaceAsm.S:122 *ABS*:00000013 tmp1 |
CamInterfaceAsm.S:123 *ABS*:00000014 tmp2 |
CamInterfaceAsm.S:124 *ABS*:00000013 color |
CamInterfaceAsm.S:125 *ABS*:00000014 greenData |
CamInterfaceAsm.S:126 *ABS*:00000015 blueData |
CamInterfaceAsm.S:127 *ABS*:00000016 colorMapLow |
CamInterfaceAsm.S:128 *ABS*:00000017 colorMapHigh |
CamInterfaceAsm.S:129 *ABS*:00000016 prevLineBuffLow |
CamInterfaceAsm.S:130 *ABS*:00000017 prevLineBuffHigh |
CamInterfaceAsm.S:131 *ABS*:00000018 currLineBuffLow |
CamInterfaceAsm.S:132 *ABS*:00000019 currLineBuffHigh |
CamInterfaceAsm.S:169 .text:00000000 CamIntAsm_waitForNewTrackingFrame |
CamInterfaceAsm.S:335 .text:0000008e CamIntAsm_waitForNewDumpFrame |
CamInterfaceAsm.S:345 .text:00000094 CamIntAsm_acquireDumpLine |
CamInterfaceAsm.S:179 .text:00000006 CamIntAsm_acquireTrackingLine |
CamInterfaceAsm.S:423 .text:000000d4 __vector_1 |
CamInterfaceAsm.S:438 .text:000000d6 __vector_2 |
CamInterfaceAsm.S:474 .text:000000d8 __vector_8 |
CamInterfaceAsm.S:305 .text:00000080 _cleanUp |
CamInterfaceAsm.S:223 .text:00000034 _trackFrame |
CamInterfaceAsm.S:240 .text:00000044 _acquirePixelBlock |
CamInterfaceAsm.S:281 .text:00000074 _cleanUpTrackingLine |
CamInterfaceAsm.S:292 .text:00000080 _cleanUpDumpLine |
CamInterfaceAsm.S:316 .text:0000008c _exit |
CamInterfaceAsm.S:380 .text:000000ba _dumpFrame |
CamInterfaceAsm.S:400 .text:000000c8 _sampleDumpPixel |
CamInterfaceAsm.S:487 .text:000000e6 __vector_default |
UNDEFINED SYMBOLS |
__vector_9 |
fastEventBitmask |
/programy/C/avr/AVRcam/DebugInterface.lst |
---|
0,0 → 1,264 |
GAS LISTING /tmp/ccz6pioi.s page 1 |
1 .file "DebugInterface.c" |
2 .arch atmega8 |
3 __SREG__ = 0x3f |
4 __SP_H__ = 0x3e |
5 __SP_L__ = 0x3d |
6 __tmp_reg__ = 0 |
7 __zero_reg__ = 1 |
8 .global __do_copy_data |
9 .global __do_clear_bss |
10 .stabs "/home/kaklik/projects/programy/Atmel_C/AVRcam/",100,0,2,.Ltext0 |
11 .stabs "DebugInterface.c",100,0,2,.Ltext0 |
12 .text |
13 .Ltext0: |
14 .stabs "gcc2_compiled.",60,0,0,0 |
15 .stabs "int:t(0,1)=r(0,1);-32768;32767;",128,0,0,0 |
16 .stabs "char:t(0,2)=@s8;r(0,2);0;255;",128,0,0,0 |
17 .stabs "long int:t(0,3)=@s32;r(0,3);020000000000;017777777777;",128,0,0,0 |
18 .stabs "unsigned int:t(0,4)=r(0,4);0;0177777;",128,0,0,0 |
19 .stabs "long unsigned int:t(0,5)=@s32;r(0,5);0;037777777777;",128,0,0,0 |
20 .stabs "long long int:t(0,6)=@s64;r(0,6);01000000000000000000000;0777777777777777777777;",128,0,0, |
21 .stabs "long long unsigned int:t(0,7)=@s64;r(0,7);0;01777777777777777777777;",128,0,0,0 |
22 .stabs "short int:t(0,8)=r(0,8);-32768;32767;",128,0,0,0 |
23 .stabs "short unsigned int:t(0,9)=r(0,9);0;0177777;",128,0,0,0 |
24 .stabs "signed char:t(0,10)=@s8;r(0,10);-128;127;",128,0,0,0 |
25 .stabs "unsigned char:t(0,11)=@s8;r(0,11);0;255;",128,0,0,0 |
26 .stabs "float:t(0,12)=r(0,1);4;0;",128,0,0,0 |
27 .stabs "double:t(0,13)=r(0,1);4;0;",128,0,0,0 |
28 .stabs "long double:t(0,14)=r(0,1);4;0;",128,0,0,0 |
29 .stabs "void:t(0,15)=(0,15)",128,0,0,0 |
30 .stabs "CommonDefs.h",130,0,0,0 |
31 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/interrupt.h",130,0,0,0 |
32 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/io.h",130,0,0,0 |
33 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/sfr_defs.h",130,0,0,0 |
34 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/inttypes.h",130,0,0,0 |
35 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/stdint.h",130,0,0,0 |
36 .stabs "int8_t:t(6,1)=(0,10)",128,0,116,0 |
37 .stabs "uint8_t:t(6,2)=(0,11)",128,0,117,0 |
38 .stabs "int16_t:t(6,3)=(0,1)",128,0,118,0 |
39 .stabs "uint16_t:t(6,4)=(0,4)",128,0,119,0 |
40 .stabs "int32_t:t(6,5)=(0,3)",128,0,120,0 |
41 .stabs "uint32_t:t(6,6)=(0,5)",128,0,121,0 |
42 .stabs "int64_t:t(6,7)=(0,6)",128,0,122,0 |
43 .stabs "uint64_t:t(6,8)=(0,7)",128,0,123,0 |
44 .stabs "intptr_t:t(6,9)=(6,3)",128,0,135,0 |
45 .stabs "uintptr_t:t(6,10)=(6,4)",128,0,140,0 |
46 .stabs "int_least8_t:t(6,11)=(6,1)",128,0,152,0 |
47 .stabs "uint_least8_t:t(6,12)=(6,2)",128,0,157,0 |
48 .stabs "int_least16_t:t(6,13)=(6,3)",128,0,162,0 |
49 .stabs "uint_least16_t:t(6,14)=(6,4)",128,0,167,0 |
50 .stabs "int_least32_t:t(6,15)=(6,5)",128,0,172,0 |
51 .stabs "uint_least32_t:t(6,16)=(6,6)",128,0,177,0 |
52 .stabs "int_least64_t:t(6,17)=(6,7)",128,0,182,0 |
53 .stabs "uint_least64_t:t(6,18)=(6,8)",128,0,187,0 |
54 .stabs "int_fast8_t:t(6,19)=(6,1)",128,0,200,0 |
55 .stabs "uint_fast8_t:t(6,20)=(6,2)",128,0,205,0 |
56 .stabs "int_fast16_t:t(6,21)=(6,3)",128,0,210,0 |
57 .stabs "uint_fast16_t:t(6,22)=(6,4)",128,0,215,0 |
GAS LISTING /tmp/ccz6pioi.s page 2 |
58 .stabs "int_fast32_t:t(6,23)=(6,5)",128,0,220,0 |
59 .stabs "uint_fast32_t:t(6,24)=(6,6)",128,0,225,0 |
60 .stabs "int_fast64_t:t(6,25)=(6,7)",128,0,230,0 |
61 .stabs "uint_fast64_t:t(6,26)=(6,8)",128,0,235,0 |
62 .stabs "intmax_t:t(6,27)=(6,7)",128,0,249,0 |
63 .stabs "uintmax_t:t(6,28)=(6,8)",128,0,254,0 |
64 .stabn 162,0,0,0 |
65 .stabs "int_farptr_t:t(5,1)=(6,5)",128,0,76,0 |
66 .stabs "uint_farptr_t:t(5,2)=(6,6)",128,0,80,0 |
67 .stabn 162,0,0,0 |
68 .stabn 162,0,0,0 |
69 .stabn 162,0,0,0 |
70 .stabn 162,0,0,0 |
71 .stabs "bool_t:t(1,1)=(0,11)",128,0,56,0 |
72 .stabn 162,0,0,0 |
73 .stabs "DebugInt_init:F(0,15)",36,0,71,DebugInt_init |
74 .global DebugInt_init |
75 .type DebugInt_init, @function |
76 DebugInt_init: |
77 .stabd 46,0,0 |
1:DebugInterface.c **** /* |
2:DebugInterface.c **** Copyright (C) 2004 John Orlando |
3:DebugInterface.c **** |
4:DebugInterface.c **** AVRcam: a small real-time image processing engine. |
5:DebugInterface.c **** |
6:DebugInterface.c **** This program is free software; you can redistribute it and/or |
7:DebugInterface.c **** modify it under the terms of the GNU General Public |
8:DebugInterface.c **** License as published by the Free Software Foundation; either |
9:DebugInterface.c **** version 2 of the License, or (at your option) any later version. |
10:DebugInterface.c **** |
11:DebugInterface.c **** This program is distributed in the hope that it will be useful, |
12:DebugInterface.c **** but WITHOUT ANY WARRANTY; without even the implied warranty of |
13:DebugInterface.c **** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14:DebugInterface.c **** General Public License for more details. |
15:DebugInterface.c **** |
16:DebugInterface.c **** You should have received a copy of the GNU General Public |
17:DebugInterface.c **** License along with this program; if not, write to the Free Software |
18:DebugInterface.c **** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19:DebugInterface.c **** |
20:DebugInterface.c **** For more information on the AVRcam, please contact: |
21:DebugInterface.c **** |
22:DebugInterface.c **** john@jrobot.net |
23:DebugInterface.c **** |
24:DebugInterface.c **** or go to www.jrobot.net for more details regarding the system. |
25:DebugInterface.c **** */ |
26:DebugInterface.c **** /*********************************************************** |
27:DebugInterface.c **** Module Name: DebugInterface.c |
28:DebugInterface.c **** Module Date: 04/15/2004 |
29:DebugInterface.c **** Module Auth: John Orlando |
30:DebugInterface.c **** |
31:DebugInterface.c **** Description: This module is responsible for providing a |
32:DebugInterface.c **** debug interface to the system. Currently, the only |
33:DebugInterface.c **** debugging that is available is through the on-board |
34:DebugInterface.c **** UART (which is used by the main application as well) in |
35:DebugInterface.c **** addition to the LED hooked up at PORTD bit 6. |
36:DebugInterface.c **** |
37:DebugInterface.c **** Revision History: |
GAS LISTING /tmp/ccz6pioi.s page 3 |
38:DebugInterface.c **** Date Rel Ver. Notes |
39:DebugInterface.c **** 4/10/2004 0.1 Module created |
40:DebugInterface.c **** 6/30/2004 1.0 Initial release for Circuit Cellar |
41:DebugInterface.c **** contest. |
42:DebugInterface.c **** ***********************************************************/ |
43:DebugInterface.c **** |
44:DebugInterface.c **** /* Includes */ |
45:DebugInterface.c **** #include "CommonDefs.h" |
46:DebugInterface.c **** #include "UartInterface.h" |
47:DebugInterface.c **** #include "Utility.h" |
48:DebugInterface.c **** |
49:DebugInterface.c **** /* Local Variables */ |
50:DebugInterface.c **** |
51:DebugInterface.c **** /* Local Structures and Typedefs */ |
52:DebugInterface.c **** |
53:DebugInterface.c **** /* Extern Variables */ |
54:DebugInterface.c **** |
55:DebugInterface.c **** /* Definitions */ |
56:DebugInterface.c **** |
57:DebugInterface.c **** /*********************************************************** |
58:DebugInterface.c **** Function Name: DebugInt_init |
59:DebugInterface.c **** Function Description: This function is responsible for |
60:DebugInterface.c **** initializing the debug module. It sets up the debug LED |
61:DebugInterface.c **** as well as any other debugging that will be done. The |
62:DebugInterface.c **** LED blinks four times, which indicates to the user |
63:DebugInterface.c **** that the system is available for re-programming if |
64:DebugInterface.c **** necessary. This works because the data lines on the |
65:DebugInterface.c **** OV6620 are still tri-stated at this point, but won't |
66:DebugInterface.c **** be for long after this function returns. |
67:DebugInterface.c **** Inputs: none |
68:DebugInterface.c **** Outputs: none |
69:DebugInterface.c **** ***********************************************************/ |
70:DebugInterface.c **** void DebugInt_init(void) |
71:DebugInterface.c **** { |
78 .stabn 68,0,71,.LM0-DebugInt_init |
79 .LM0: |
80 /* prologue: frame size=0 */ |
81 /* prologue end (size=0) */ |
72:DebugInterface.c **** /* set PortD pin6 for output */ |
73:DebugInterface.c **** DDRD |= 0x40; |
82 .stabn 68,0,73,.LM1-DebugInt_init |
83 .LM1: |
84 0000 8E9A sbi 49-0x20,6 |
74:DebugInterface.c **** /* turn on LED */ |
75:DebugInterface.c **** PORTD |= 0x40; |
85 .stabn 68,0,75,.LM2-DebugInt_init |
86 .LM2: |
87 0002 969A sbi 50-0x20,6 |
76:DebugInterface.c **** Utility_delay(500); |
88 .stabn 68,0,76,.LM3-DebugInt_init |
89 .LM3: |
90 0004 84EF ldi r24,lo8(500) |
91 0006 91E0 ldi r25,hi8(500) |
92 0008 00D0 rcall Utility_delay |
77:DebugInterface.c **** PORTD &= 0xBF; |
93 .stabn 68,0,77,.LM4-DebugInt_init |
94 .LM4: |
GAS LISTING /tmp/ccz6pioi.s page 4 |
95 000a 9698 cbi 50-0x20,6 |
78:DebugInterface.c **** Utility_delay(500); |
96 .stabn 68,0,78,.LM5-DebugInt_init |
97 .LM5: |
98 000c 84EF ldi r24,lo8(500) |
99 000e 91E0 ldi r25,hi8(500) |
100 0010 00D0 rcall Utility_delay |
79:DebugInterface.c **** PORTD |= 0x40; |
101 .stabn 68,0,79,.LM6-DebugInt_init |
102 .LM6: |
103 0012 969A sbi 50-0x20,6 |
80:DebugInterface.c **** Utility_delay(500); |
104 .stabn 68,0,80,.LM7-DebugInt_init |
105 .LM7: |
106 0014 84EF ldi r24,lo8(500) |
107 0016 91E0 ldi r25,hi8(500) |
108 0018 00D0 rcall Utility_delay |
81:DebugInterface.c **** PORTD &= 0xBF; |
109 .stabn 68,0,81,.LM8-DebugInt_init |
110 .LM8: |
111 001a 9698 cbi 50-0x20,6 |
82:DebugInterface.c **** Utility_delay(500); |
112 .stabn 68,0,82,.LM9-DebugInt_init |
113 .LM9: |
114 001c 84EF ldi r24,lo8(500) |
115 001e 91E0 ldi r25,hi8(500) |
116 0020 00D0 rcall Utility_delay |
83:DebugInterface.c **** PORTD |= 0x40; |
117 .stabn 68,0,83,.LM10-DebugInt_init |
118 .LM10: |
119 0022 969A sbi 50-0x20,6 |
84:DebugInterface.c **** Utility_delay(500); |
120 .stabn 68,0,84,.LM11-DebugInt_init |
121 .LM11: |
122 0024 84EF ldi r24,lo8(500) |
123 0026 91E0 ldi r25,hi8(500) |
124 0028 00D0 rcall Utility_delay |
85:DebugInterface.c **** PORTD &= 0xBF; |
125 .stabn 68,0,85,.LM12-DebugInt_init |
126 .LM12: |
127 002a 9698 cbi 50-0x20,6 |
86:DebugInterface.c **** Utility_delay(500); |
128 .stabn 68,0,86,.LM13-DebugInt_init |
129 .LM13: |
130 002c 84EF ldi r24,lo8(500) |
131 002e 91E0 ldi r25,hi8(500) |
132 0030 00D0 rcall Utility_delay |
87:DebugInterface.c **** PORTD |= 0x40; |
133 .stabn 68,0,87,.LM14-DebugInt_init |
134 .LM14: |
135 0032 969A sbi 50-0x20,6 |
136 /* epilogue: frame size=0 */ |
137 0034 0895 ret |
138 /* epilogue end (size=1) */ |
139 /* function DebugInt_init size 27 (26) */ |
140 .size DebugInt_init, .-DebugInt_init |
141 .Lscope0: |
GAS LISTING /tmp/ccz6pioi.s page 5 |
142 .stabs "",36,0,0,.Lscope0-DebugInt_init |
143 .stabd 78,0,0 |
144 .stabs "",100,0,0,.Letext0 |
145 .Letext0: |
146 /* File "DebugInterface.c": code 27 = 0x001b ( 26), prologues 0, epilogues 1 */ |
GAS LISTING /tmp/ccz6pioi.s page 6 |
DEFINED SYMBOLS |
*ABS*:00000000 DebugInterface.c |
/tmp/ccz6pioi.s:3 *ABS*:0000003f __SREG__ |
/tmp/ccz6pioi.s:4 *ABS*:0000003e __SP_H__ |
/tmp/ccz6pioi.s:5 *ABS*:0000003d __SP_L__ |
/tmp/ccz6pioi.s:6 *ABS*:00000000 __tmp_reg__ |
/tmp/ccz6pioi.s:7 *ABS*:00000001 __zero_reg__ |
/tmp/ccz6pioi.s:76 .text:00000000 DebugInt_init |
UNDEFINED SYMBOLS |
__do_copy_data |
__do_clear_bss |
Utility_delay |
/programy/C/avr/AVRcam/Doxyfile |
---|
0,0 → 1,275 |
# Doxyfile 1.4.1-KDevelop |
#--------------------------------------------------------------------------- |
# Project related configuration options |
#--------------------------------------------------------------------------- |
PROJECT_NAME = AVRcam.kdevelop |
PROJECT_NUMBER = $VERSION$ |
OUTPUT_DIRECTORY = |
CREATE_SUBDIRS = NO |
OUTPUT_LANGUAGE = English |
USE_WINDOWS_ENCODING = NO |
BRIEF_MEMBER_DESC = YES |
REPEAT_BRIEF = YES |
ABBREVIATE_BRIEF = "The $name class" \ |
"The $name widget" \ |
"The $name file" \ |
is \ |
provides \ |
specifies \ |
contains \ |
represents \ |
a \ |
an \ |
the |
ALWAYS_DETAILED_SEC = NO |
INLINE_INHERITED_MEMB = NO |
FULL_PATH_NAMES = YES |
STRIP_FROM_PATH = /home/kaklik/projects/programy/Atmel_C/AVRcam/ |
STRIP_FROM_INC_PATH = |
SHORT_NAMES = NO |
JAVADOC_AUTOBRIEF = NO |
MULTILINE_CPP_IS_BRIEF = NO |
DETAILS_AT_TOP = NO |
INHERIT_DOCS = YES |
DISTRIBUTE_GROUP_DOC = NO |
TAB_SIZE = 8 |
ALIASES = |
OPTIMIZE_OUTPUT_FOR_C = NO |
OPTIMIZE_OUTPUT_JAVA = NO |
SUBGROUPING = YES |
#--------------------------------------------------------------------------- |
# Build related configuration options |
#--------------------------------------------------------------------------- |
EXTRACT_ALL = NO |
EXTRACT_PRIVATE = NO |
EXTRACT_STATIC = NO |
EXTRACT_LOCAL_CLASSES = YES |
EXTRACT_LOCAL_METHODS = NO |
HIDE_UNDOC_MEMBERS = NO |
HIDE_UNDOC_CLASSES = NO |
HIDE_FRIEND_COMPOUNDS = NO |
HIDE_IN_BODY_DOCS = NO |
INTERNAL_DOCS = NO |
CASE_SENSE_NAMES = YES |
HIDE_SCOPE_NAMES = NO |
SHOW_INCLUDE_FILES = YES |
INLINE_INFO = YES |
SORT_MEMBER_DOCS = YES |
SORT_BRIEF_DOCS = NO |
SORT_BY_SCOPE_NAME = NO |
GENERATE_TODOLIST = YES |
GENERATE_TESTLIST = YES |
GENERATE_BUGLIST = YES |
GENERATE_DEPRECATEDLIST= YES |
ENABLED_SECTIONS = |
MAX_INITIALIZER_LINES = 30 |
SHOW_USED_FILES = YES |
SHOW_DIRECTORIES = YES |
FILE_VERSION_FILTER = |
#--------------------------------------------------------------------------- |
# configuration options related to warning and progress messages |
#--------------------------------------------------------------------------- |
QUIET = NO |
WARNINGS = YES |
WARN_IF_UNDOCUMENTED = YES |
WARN_IF_DOC_ERROR = YES |
WARN_NO_PARAMDOC = NO |
WARN_FORMAT = "$file:$line: $text" |
WARN_LOGFILE = |
#--------------------------------------------------------------------------- |
# configuration options related to the input files |
#--------------------------------------------------------------------------- |
INPUT = /home/kaklik/projects/programy/Atmel_C/AVRcam |
FILE_PATTERNS = *.c \ |
*.cc \ |
*.cxx \ |
*.cpp \ |
*.c++ \ |
*.java \ |
*.ii \ |
*.ixx \ |
*.ipp \ |
*.i++ \ |
*.inl \ |
*.h \ |
*.hh \ |
*.hxx \ |
*.hpp \ |
*.h++ \ |
*.idl \ |
*.odl \ |
*.cs \ |
*.php \ |
*.php3 \ |
*.inc \ |
*.m \ |
*.mm \ |
*.dox \ |
*.C \ |
*.CC \ |
*.C++ \ |
*.II \ |
*.I++ \ |
*.H \ |
*.HH \ |
*.H++ \ |
*.CS \ |
*.PHP \ |
*.PHP3 \ |
*.M \ |
*.MM \ |
*.C \ |
*.H \ |
*.tlh \ |
*.diff \ |
*.patch \ |
*.moc \ |
*.xpm \ |
*.dox |
RECURSIVE = yes |
EXCLUDE = |
EXCLUDE_SYMLINKS = NO |
EXCLUDE_PATTERNS = |
EXAMPLE_PATH = |
EXAMPLE_PATTERNS = * |
EXAMPLE_RECURSIVE = NO |
IMAGE_PATH = |
INPUT_FILTER = |
FILTER_PATTERNS = |
FILTER_SOURCE_FILES = NO |
#--------------------------------------------------------------------------- |
# configuration options related to source browsing |
#--------------------------------------------------------------------------- |
SOURCE_BROWSER = NO |
INLINE_SOURCES = NO |
STRIP_CODE_COMMENTS = YES |
REFERENCED_BY_RELATION = YES |
REFERENCES_RELATION = YES |
VERBATIM_HEADERS = YES |
#--------------------------------------------------------------------------- |
# configuration options related to the alphabetical class index |
#--------------------------------------------------------------------------- |
ALPHABETICAL_INDEX = NO |
COLS_IN_ALPHA_INDEX = 5 |
IGNORE_PREFIX = |
#--------------------------------------------------------------------------- |
# configuration options related to the HTML output |
#--------------------------------------------------------------------------- |
GENERATE_HTML = YES |
HTML_OUTPUT = html |
HTML_FILE_EXTENSION = .html |
HTML_HEADER = |
HTML_FOOTER = |
HTML_STYLESHEET = |
HTML_ALIGN_MEMBERS = YES |
GENERATE_HTMLHELP = NO |
CHM_FILE = |
HHC_LOCATION = |
GENERATE_CHI = NO |
BINARY_TOC = NO |
TOC_EXPAND = NO |
DISABLE_INDEX = NO |
ENUM_VALUES_PER_LINE = 4 |
GENERATE_TREEVIEW = NO |
TREEVIEW_WIDTH = 250 |
#--------------------------------------------------------------------------- |
# configuration options related to the LaTeX output |
#--------------------------------------------------------------------------- |
GENERATE_LATEX = YES |
LATEX_OUTPUT = latex |
LATEX_CMD_NAME = latex |
MAKEINDEX_CMD_NAME = makeindex |
COMPACT_LATEX = NO |
PAPER_TYPE = a4wide |
EXTRA_PACKAGES = |
LATEX_HEADER = |
PDF_HYPERLINKS = NO |
USE_PDFLATEX = NO |
LATEX_BATCHMODE = NO |
LATEX_HIDE_INDICES = NO |
#--------------------------------------------------------------------------- |
# configuration options related to the RTF output |
#--------------------------------------------------------------------------- |
GENERATE_RTF = NO |
RTF_OUTPUT = rtf |
COMPACT_RTF = NO |
RTF_HYPERLINKS = NO |
RTF_STYLESHEET_FILE = |
RTF_EXTENSIONS_FILE = |
#--------------------------------------------------------------------------- |
# configuration options related to the man page output |
#--------------------------------------------------------------------------- |
GENERATE_MAN = NO |
MAN_OUTPUT = man |
MAN_EXTENSION = .3 |
MAN_LINKS = NO |
#--------------------------------------------------------------------------- |
# configuration options related to the XML output |
#--------------------------------------------------------------------------- |
GENERATE_XML = yes |
XML_OUTPUT = xml |
XML_SCHEMA = |
XML_DTD = |
XML_PROGRAMLISTING = YES |
#--------------------------------------------------------------------------- |
# configuration options for the AutoGen Definitions output |
#--------------------------------------------------------------------------- |
GENERATE_AUTOGEN_DEF = NO |
#--------------------------------------------------------------------------- |
# configuration options related to the Perl module output |
#--------------------------------------------------------------------------- |
GENERATE_PERLMOD = NO |
PERLMOD_LATEX = NO |
PERLMOD_PRETTY = YES |
PERLMOD_MAKEVAR_PREFIX = |
#--------------------------------------------------------------------------- |
# Configuration options related to the preprocessor |
#--------------------------------------------------------------------------- |
ENABLE_PREPROCESSING = YES |
MACRO_EXPANSION = NO |
EXPAND_ONLY_PREDEF = NO |
SEARCH_INCLUDES = YES |
INCLUDE_PATH = |
INCLUDE_FILE_PATTERNS = |
PREDEFINED = |
EXPAND_AS_DEFINED = |
SKIP_FUNCTION_MACROS = YES |
#--------------------------------------------------------------------------- |
# Configuration::additions related to external references |
#--------------------------------------------------------------------------- |
TAGFILES = |
GENERATE_TAGFILE = AVRcam.tag |
ALLEXTERNALS = NO |
EXTERNAL_GROUPS = YES |
PERL_PATH = /usr/bin/perl |
#--------------------------------------------------------------------------- |
# Configuration options related to the dot tool |
#--------------------------------------------------------------------------- |
CLASS_DIAGRAMS = YES |
HIDE_UNDOC_RELATIONS = YES |
HAVE_DOT = NO |
CLASS_GRAPH = YES |
COLLABORATION_GRAPH = YES |
GROUP_GRAPHS = YES |
UML_LOOK = NO |
TEMPLATE_RELATIONS = NO |
INCLUDE_GRAPH = YES |
INCLUDED_BY_GRAPH = YES |
CALL_GRAPH = NO |
GRAPHICAL_HIERARCHY = YES |
DIRECTORY_GRAPH = YES |
DOT_IMAGE_FORMAT = png |
DOT_PATH = |
DOTFILE_DIRS = |
MAX_DOT_GRAPH_WIDTH = 1024 |
MAX_DOT_GRAPH_HEIGHT = 1024 |
MAX_DOT_GRAPH_DEPTH = 1000 |
DOT_TRANSPARENT = NO |
DOT_MULTI_TARGETS = NO |
GENERATE_LEGEND = YES |
DOT_CLEANUP = YES |
#--------------------------------------------------------------------------- |
# Configuration::additions related to the search engine |
#--------------------------------------------------------------------------- |
SEARCHENGINE = NO |
/programy/C/avr/AVRcam/Executive.lst |
---|
0,0 → 1,637 |
GAS LISTING /tmp/ccYxWDEV.s page 1 |
1 .file "Executive.c" |
2 .arch atmega8 |
3 __SREG__ = 0x3f |
4 __SP_H__ = 0x3e |
5 __SP_L__ = 0x3d |
6 __tmp_reg__ = 0 |
7 __zero_reg__ = 1 |
8 .global __do_copy_data |
9 .global __do_clear_bss |
10 .stabs "/home/kaklik/projects/programy/Atmel_C/AVRcam/",100,0,2,.Ltext0 |
11 .stabs "Executive.c",100,0,2,.Ltext0 |
12 .text |
13 .Ltext0: |
14 .stabs "gcc2_compiled.",60,0,0,0 |
15 .stabs "int:t(0,1)=r(0,1);-32768;32767;",128,0,0,0 |
16 .stabs "char:t(0,2)=@s8;r(0,2);0;255;",128,0,0,0 |
17 .stabs "long int:t(0,3)=@s32;r(0,3);020000000000;017777777777;",128,0,0,0 |
18 .stabs "unsigned int:t(0,4)=r(0,4);0;0177777;",128,0,0,0 |
19 .stabs "long unsigned int:t(0,5)=@s32;r(0,5);0;037777777777;",128,0,0,0 |
20 .stabs "long long int:t(0,6)=@s64;r(0,6);01000000000000000000000;0777777777777777777777;",128,0,0, |
21 .stabs "long long unsigned int:t(0,7)=@s64;r(0,7);0;01777777777777777777777;",128,0,0,0 |
22 .stabs "short int:t(0,8)=r(0,8);-32768;32767;",128,0,0,0 |
23 .stabs "short unsigned int:t(0,9)=r(0,9);0;0177777;",128,0,0,0 |
24 .stabs "signed char:t(0,10)=@s8;r(0,10);-128;127;",128,0,0,0 |
25 .stabs "unsigned char:t(0,11)=@s8;r(0,11);0;255;",128,0,0,0 |
26 .stabs "float:t(0,12)=r(0,1);4;0;",128,0,0,0 |
27 .stabs "double:t(0,13)=r(0,1);4;0;",128,0,0,0 |
28 .stabs "long double:t(0,14)=r(0,1);4;0;",128,0,0,0 |
29 .stabs "void:t(0,15)=(0,15)",128,0,0,0 |
30 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/stdlib.h",130,0,0,0 |
31 .stabs "/usr/lib/gcc/avr/4.1.0/include/stddef.h",130,0,0,0 |
32 .stabs "size_t:t(2,1)=(0,4)",128,0,214,0 |
33 .stabs "wchar_t:t(2,2)=(0,1)",128,0,326,0 |
34 .stabn 162,0,0,0 |
35 .stabs "div_t:t(1,1)=(1,2)=s4quot:(0,1),0,16;rem:(0,1),16,16;;",128,0,69,0 |
36 .stabs "ldiv_t:t(1,3)=(1,4)=s8quot:(0,3),0,32;rem:(0,3),32,32;;",128,0,75,0 |
37 .stabs "__compar_fn_t:t(1,5)=(1,6)=*(1,7)=f(0,1)",128,0,78,0 |
38 .stabn 162,0,0,0 |
39 .stabs "CommonDefs.h",130,0,0,0 |
40 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/interrupt.h",130,0,0,0 |
41 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/io.h",130,0,0,0 |
42 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/sfr_defs.h",130,0,0,0 |
43 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/inttypes.h",130,0,0,0 |
44 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/stdint.h",130,0,0,0 |
45 .stabs "int8_t:t(8,1)=(0,10)",128,0,116,0 |
46 .stabs "uint8_t:t(8,2)=(0,11)",128,0,117,0 |
47 .stabs "int16_t:t(8,3)=(0,1)",128,0,118,0 |
48 .stabs "uint16_t:t(8,4)=(0,4)",128,0,119,0 |
49 .stabs "int32_t:t(8,5)=(0,3)",128,0,120,0 |
50 .stabs "uint32_t:t(8,6)=(0,5)",128,0,121,0 |
51 .stabs "int64_t:t(8,7)=(0,6)",128,0,122,0 |
52 .stabs "uint64_t:t(8,8)=(0,7)",128,0,123,0 |
53 .stabs "intptr_t:t(8,9)=(8,3)",128,0,135,0 |
54 .stabs "uintptr_t:t(8,10)=(8,4)",128,0,140,0 |
55 .stabs "int_least8_t:t(8,11)=(8,1)",128,0,152,0 |
56 .stabs "uint_least8_t:t(8,12)=(8,2)",128,0,157,0 |
57 .stabs "int_least16_t:t(8,13)=(8,3)",128,0,162,0 |
GAS LISTING /tmp/ccYxWDEV.s page 2 |
58 .stabs "uint_least16_t:t(8,14)=(8,4)",128,0,167,0 |
59 .stabs "int_least32_t:t(8,15)=(8,5)",128,0,172,0 |
60 .stabs "uint_least32_t:t(8,16)=(8,6)",128,0,177,0 |
61 .stabs "int_least64_t:t(8,17)=(8,7)",128,0,182,0 |
62 .stabs "uint_least64_t:t(8,18)=(8,8)",128,0,187,0 |
63 .stabs "int_fast8_t:t(8,19)=(8,1)",128,0,200,0 |
64 .stabs "uint_fast8_t:t(8,20)=(8,2)",128,0,205,0 |
65 .stabs "int_fast16_t:t(8,21)=(8,3)",128,0,210,0 |
66 .stabs "uint_fast16_t:t(8,22)=(8,4)",128,0,215,0 |
67 .stabs "int_fast32_t:t(8,23)=(8,5)",128,0,220,0 |
68 .stabs "uint_fast32_t:t(8,24)=(8,6)",128,0,225,0 |
69 .stabs "int_fast64_t:t(8,25)=(8,7)",128,0,230,0 |
70 .stabs "uint_fast64_t:t(8,26)=(8,8)",128,0,235,0 |
71 .stabs "intmax_t:t(8,27)=(8,7)",128,0,249,0 |
72 .stabs "uintmax_t:t(8,28)=(8,8)",128,0,254,0 |
73 .stabn 162,0,0,0 |
74 .stabs "int_farptr_t:t(7,1)=(8,5)",128,0,76,0 |
75 .stabs "uint_farptr_t:t(7,2)=(8,6)",128,0,80,0 |
76 .stabn 162,0,0,0 |
77 .stabn 162,0,0,0 |
78 .stabn 162,0,0,0 |
79 .stabn 162,0,0,0 |
80 .stabs "bool_t:t(3,1)=(0,11)",128,0,56,0 |
81 .stabn 162,0,0,0 |
82 .stabs "CamConfig.h",130,0,0,0 |
83 .stabs "I2CInterface.h",130,0,0,0 |
84 .stabs "i2cCmd_t:t(10,1)=(10,2)=s2configReg:(0,11),0,8;data:(0,11),8,8;;",128,0,53,0 |
85 .stabn 162,0,0,0 |
86 .stabn 162,0,0,0 |
87 .stabs "Exec_writeEventFifo:F(0,15)",36,0,208,Exec_writeEventFifo |
88 .stabs "event:P(0,11)",64,0,207,24 |
89 .global Exec_writeEventFifo |
90 .type Exec_writeEventFifo, @function |
91 Exec_writeEventFifo: |
92 .stabd 46,0,0 |
1:Executive.c **** /* |
2:Executive.c **** Copyright (C) 2004 John Orlando |
3:Executive.c **** |
4:Executive.c **** AVRcam: a small real-time image processing engine. |
5:Executive.c **** |
6:Executive.c **** This program is free software; you can redistribute it and/or |
7:Executive.c **** modify it under the terms of the GNU General Public |
8:Executive.c **** License as published by the Free Software Foundation; either |
9:Executive.c **** version 2 of the License, or (at your option) any later version. |
10:Executive.c **** |
11:Executive.c **** This program is distributed in the hope that it will be useful, |
12:Executive.c **** but WITHOUT ANY WARRANTY; without even the implied warranty of |
13:Executive.c **** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14:Executive.c **** General Public License for more details. |
15:Executive.c **** |
16:Executive.c **** You should have received a copy of the GNU General Public |
17:Executive.c **** License along with this program; if not, write to the Free Software |
18:Executive.c **** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19:Executive.c **** |
20:Executive.c **** For more information on the AVRcam, please contact: |
21:Executive.c **** |
22:Executive.c **** john@jrobot.net |
GAS LISTING /tmp/ccYxWDEV.s page 3 |
23:Executive.c **** |
24:Executive.c **** or go to www.jrobot.net for more details regarding the system. |
25:Executive.c **** */ |
26:Executive.c **** /*********************************************************** |
27:Executive.c **** Module Name: Executive.c |
28:Executive.c **** Module Date: 04/12/2004 |
29:Executive.c **** Module Auth: John Orlando |
30:Executive.c **** |
31:Executive.c **** Description: This file is responsible for implementing a |
32:Executive.c **** minimalist event dispatcher. It keeps track of an event |
33:Executive.c **** fifo that waits for new events to come in, and dispatches |
34:Executive.c **** them to any entities that care about them. |
35:Executive.c **** |
36:Executive.c **** Revision History: |
37:Executive.c **** Date Rel Ver. Notes |
38:Executive.c **** 4/10/2004 0.1 Module created |
39:Executive.c **** 6/30/2004 1.0 Initial release for Circuit Cellar |
40:Executive.c **** contest. |
41:Executive.c **** 1/16/2005 1.4 Fixed issue where the interrupts weren't |
42:Executive.c **** being turned off when the fastEventBitmask |
43:Executive.c **** was being accessed. Also removed redundant |
44:Executive.c **** interrupt masking when accessing the |
45:Executive.c **** main event fifo. Also fixed issue where |
46:Executive.c **** the main event fifo wasn't being checked |
47:Executive.c **** for events if an event was pending in |
48:Executive.c **** the fast event fifo. |
49:Executive.c **** ***********************************************************/ |
50:Executive.c **** |
51:Executive.c **** /* Includes */ |
52:Executive.c **** #include <stdlib.h> |
53:Executive.c **** #include "CommonDefs.h" |
54:Executive.c **** #include "Executive.h" |
55:Executive.c **** #include "FrameMgr.h" |
56:Executive.c **** #include "CamInterface.h" |
57:Executive.c **** #include "UIMgr.h" |
58:Executive.c **** #include "UartInterface.h" |
59:Executive.c **** #include "CamConfig.h" |
60:Executive.c **** #include "Utility.h" |
61:Executive.c **** |
62:Executive.c **** /* Local Variables */ |
63:Executive.c **** unsigned char Exec_eventFifo[EXEC_EVENT_FIFO_SIZE]; |
64:Executive.c **** unsigned char Exec_eventFifoHead=0; |
65:Executive.c **** unsigned char Exec_eventFifoTail=0; |
66:Executive.c **** |
67:Executive.c **** /* Local Function Definitions */ |
68:Executive.c **** static unsigned char Exec_readEventFifo(void); |
69:Executive.c **** |
70:Executive.c **** /* Local Structures and Typedefs */ |
71:Executive.c **** |
72:Executive.c **** /* Extern Variables */ |
73:Executive.c **** /* This bitmask holds events that need to be processed as fast as possible */ |
74:Executive.c **** unsigned char fastEventBitmask = 0x00; |
75:Executive.c **** |
76:Executive.c **** /* Definitions */ |
77:Executive.c **** #define IS_DATA_IN_EVENT_FIFO() (!(Exec_eventFifoHead == Exec_eventFifoTail)) |
78:Executive.c **** /*********************************************************** |
79:Executive.c **** Function Name: Exec_run |
GAS LISTING /tmp/ccYxWDEV.s page 4 |
80:Executive.c **** Function Description: This function is responsible for |
81:Executive.c **** running the main control loop. The control loop is |
82:Executive.c **** based on checking both the fast-event bitmask (for high |
83:Executive.c **** priority events) and the event FIFO to determine if an |
84:Executive.c **** event needs to be handled. The event is then dispatched |
85:Executive.c **** to the appropriate handler. |
86:Executive.c **** Inputs: none |
87:Executive.c **** Outputs: none |
88:Executive.c **** ***********************************************************/ |
89:Executive.c **** void Exec_run(void) |
90:Executive.c **** { |
91:Executive.c **** unsigned char eventGenerated; |
92:Executive.c **** |
93:Executive.c **** while(1) |
94:Executive.c **** { |
95:Executive.c **** if (fastEventBitmask) |
96:Executive.c **** { |
97:Executive.c **** /* an event needing fast processing has been received */ |
98:Executive.c **** /* a received line needs to be processed...this |
99:Executive.c **** needs to be processed as quickly as possible */ |
100:Executive.c **** if (fastEventBitmask & FEV_ACQUIRE_LINE_COMPLETE) |
101:Executive.c **** { |
102:Executive.c **** DISABLE_INTS(); |
103:Executive.c **** fastEventBitmask &= ~FEV_ACQUIRE_LINE_COMPLETE; |
104:Executive.c **** ENABLE_INTS(); |
105:Executive.c **** FrameMgr_processLine(); |
106:Executive.c **** |
107:Executive.c **** /* also check if serial data needs to be sent |
108:Executive.c **** out through UIMgr */ |
109:Executive.c **** UIMgr_transmitPendingData(); |
110:Executive.c **** |
111:Executive.c **** /* we can't just call acquire line again here, |
112:Executive.c **** since we don't know if we need to acquire another |
113:Executive.c **** line or not (it depends on the FrameMgr to figure |
114:Executive.c **** this out) */ |
115:Executive.c **** } |
116:Executive.c **** if (fastEventBitmask & FEV_PROCESS_LINE_COMPLETE) |
117:Executive.c **** { |
118:Executive.c **** DISABLE_INTS(); |
119:Executive.c **** fastEventBitmask &= ~FEV_PROCESS_LINE_COMPLETE; |
120:Executive.c **** ENABLE_INTS(); |
121:Executive.c **** FrameMgr_acquireLine(); |
122:Executive.c **** } |
123:Executive.c **** } |
124:Executive.c **** |
125:Executive.c **** if (IS_DATA_IN_EVENT_FIFO() == TRUE) |
126:Executive.c **** { |
127:Executive.c **** eventGenerated = Exec_readEventFifo(); |
128:Executive.c **** switch(eventGenerated) |
129:Executive.c **** { |
130:Executive.c **** case (EV_DUMP_FRAME): |
131:Executive.c **** FrameMgr_dispatchEvent(eventGenerated); |
132:Executive.c **** break; |
133:Executive.c **** |
134:Executive.c **** case (EV_ENABLE_TRACKING): |
135:Executive.c **** FrameMgr_dispatchEvent(eventGenerated); |
136:Executive.c **** break; |
GAS LISTING /tmp/ccYxWDEV.s page 5 |
137:Executive.c **** |
138:Executive.c **** case (EV_DISABLE_TRACKING): |
139:Executive.c **** FrameMgr_dispatchEvent(eventGenerated); |
140:Executive.c **** break; |
141:Executive.c **** |
142:Executive.c **** case (EV_ACQUIRE_LINE_COMPLETE): |
143:Executive.c **** FrameMgr_dispatchEvent(eventGenerated); |
144:Executive.c **** UIMgr_dispatchEvent(eventGenerated); |
145:Executive.c **** break; |
146:Executive.c **** |
147:Executive.c **** case (EV_ACQUIRE_FRAME_COMPLETE): |
148:Executive.c **** FrameMgr_dispatchEvent(eventGenerated); |
149:Executive.c **** break; |
150:Executive.c **** |
151:Executive.c **** case (EV_PROCESS_LINE_COMPLETE): |
152:Executive.c **** FrameMgr_dispatchEvent(eventGenerated); |
153:Executive.c **** break; |
154:Executive.c **** |
155:Executive.c **** case (EV_PROCESS_FRAME_COMPLETE): |
156:Executive.c **** FrameMgr_dispatchEvent(eventGenerated); |
157:Executive.c **** break; |
158:Executive.c **** |
159:Executive.c **** case (EV_SERIAL_DATA_RECEIVED): |
160:Executive.c **** UIMgr_dispatchEvent(eventGenerated); |
161:Executive.c **** FrameMgr_dispatchEvent(eventGenerated); |
162:Executive.c **** break; |
163:Executive.c **** |
164:Executive.c **** case (EV_SERIAL_DATA_PENDING_TX): |
165:Executive.c **** UIMgr_dispatchEvent(eventGenerated); |
166:Executive.c **** break; |
167:Executive.c **** |
168:Executive.c **** default: |
169:Executive.c **** break; |
170:Executive.c **** } |
171:Executive.c **** } |
172:Executive.c **** |
173:Executive.c **** /* toggle the debug line */ |
174:Executive.c **** |
175:Executive.c **** } |
176:Executive.c **** } |
177:Executive.c **** |
178:Executive.c **** /*********************************************************** |
179:Executive.c **** Function Name: Exec_readEventFifo |
180:Executive.c **** Function Description: This function is responsible for |
181:Executive.c **** reading a single event out of the event fifo. |
182:Executive.c **** Inputs: none |
183:Executive.c **** Outputs: unsigned char-the data read |
184:Executive.c **** ***********************************************************/ |
185:Executive.c **** static unsigned char Exec_readEventFifo(void) |
186:Executive.c **** { |
187:Executive.c **** unsigned char dataByte, tmpTail; |
188:Executive.c **** |
189:Executive.c **** DISABLE_INTS(); |
190:Executive.c **** /* just return the current tail from the tx fifo */ |
191:Executive.c **** dataByte = Exec_eventFifo[Exec_eventFifoTail]; |
192:Executive.c **** tmpTail = (Exec_eventFifoTail+1) & (EXEC_EVENT_FIFO_MASK); |
193:Executive.c **** Exec_eventFifoTail = tmpTail; |
GAS LISTING /tmp/ccYxWDEV.s page 6 |
194:Executive.c **** ENABLE_INTS(); |
195:Executive.c **** |
196:Executive.c **** return(dataByte); |
197:Executive.c **** } |
198:Executive.c **** |
199:Executive.c **** /*********************************************************** |
200:Executive.c **** Function Name: Exec_writeEventFifo |
201:Executive.c **** Function Description: This function is responsible for |
202:Executive.c **** writing a single event to the event fifo and |
203:Executive.c **** updating the appropriate pointers. |
204:Executive.c **** Inputs: data - the byte to write to the Fifo |
205:Executive.c **** Outputs: none |
206:Executive.c **** ***********************************************************/ |
207:Executive.c **** void Exec_writeEventFifo(unsigned char event) |
208:Executive.c **** { |
93 .stabn 68,0,208,.LM0-Exec_writeEventFifo |
94 .LM0: |
95 /* prologue: frame size=0 */ |
96 /* prologue end (size=0) */ |
209:Executive.c **** unsigned char tmpHead; |
210:Executive.c **** |
211:Executive.c **** DISABLE_INTS(); |
97 .stabn 68,0,211,.LM1-Exec_writeEventFifo |
98 .LM1: |
99 /* #APP */ |
100 0000 F894 cli |
212:Executive.c **** Exec_eventFifo[Exec_eventFifoHead] = event; |
101 .stabn 68,0,212,.LM2-Exec_writeEventFifo |
102 .LM2: |
103 /* #NOAPP */ |
104 0002 9091 0000 lds r25,Exec_eventFifoHead |
105 0006 E0E0 ldi r30,lo8(Exec_eventFifo) |
106 0008 F0E0 ldi r31,hi8(Exec_eventFifo) |
107 000a E90F add r30,r25 |
108 000c F11D adc r31,__zero_reg__ |
109 000e 8083 st Z,r24 |
213:Executive.c **** |
214:Executive.c **** /* now move the head up */ |
215:Executive.c **** tmpHead = (Exec_eventFifoHead + 1) & (EXEC_EVENT_FIFO_MASK); |
216:Executive.c **** Exec_eventFifoHead = tmpHead; |
110 .stabn 68,0,216,.LM3-Exec_writeEventFifo |
111 .LM3: |
112 0010 9F5F subi r25,lo8(-(1)) |
113 0012 9770 andi r25,lo8(7) |
114 0014 9093 0000 sts Exec_eventFifoHead,r25 |
217:Executive.c **** ENABLE_INTS(); |
115 .stabn 68,0,217,.LM4-Exec_writeEventFifo |
116 .LM4: |
117 /* #APP */ |
118 0018 7894 sei |
119 /* #NOAPP */ |
120 /* epilogue: frame size=0 */ |
121 001a 0895 ret |
122 /* epilogue end (size=1) */ |
123 /* function Exec_writeEventFifo size 16 (15) */ |
124 .size Exec_writeEventFifo, .-Exec_writeEventFifo |
125 .Lscope0: |
GAS LISTING /tmp/ccYxWDEV.s page 7 |
126 .stabs "",36,0,0,.Lscope0-Exec_writeEventFifo |
127 .stabd 78,0,0 |
128 .stabs "Exec_run:F(0,15)",36,0,90,Exec_run |
129 .global Exec_run |
130 .type Exec_run, @function |
131 Exec_run: |
132 .stabd 46,0,0 |
133 .stabn 68,0,90,.LM5-Exec_run |
134 .LM5: |
135 /* prologue: frame size=0 */ |
136 /* prologue end (size=0) */ |
137 .L30: |
138 .stabn 68,0,95,.LM6-Exec_run |
139 .LM6: |
140 001c 8091 0000 lds r24,fastEventBitmask |
141 0020 8823 tst r24 |
142 0022 99F0 breq .L6 |
143 .stabn 68,0,100,.LM7-Exec_run |
144 .LM7: |
145 0024 80FF sbrs r24,0 |
146 0026 07C0 rjmp .L8 |
147 .stabn 68,0,102,.LM8-Exec_run |
148 .LM8: |
149 /* #APP */ |
150 0028 F894 cli |
151 .stabn 68,0,103,.LM9-Exec_run |
152 .LM9: |
153 /* #NOAPP */ |
154 002a 8E7F andi r24,lo8(-2) |
155 002c 8093 0000 sts fastEventBitmask,r24 |
156 .stabn 68,0,104,.LM10-Exec_run |
157 .LM10: |
158 /* #APP */ |
159 0030 7894 sei |
160 .stabn 68,0,105,.LM11-Exec_run |
161 .LM11: |
162 /* #NOAPP */ |
163 0032 00D0 rcall FrameMgr_processLine |
164 .stabn 68,0,109,.LM12-Exec_run |
165 .LM12: |
166 0034 00D0 rcall UIMgr_transmitPendingData |
167 .L8: |
168 .stabn 68,0,116,.LM13-Exec_run |
169 .LM13: |
170 0036 8091 0000 lds r24,fastEventBitmask |
171 003a 81FF sbrs r24,1 |
172 003c 06C0 rjmp .L6 |
173 .stabn 68,0,118,.LM14-Exec_run |
174 .LM14: |
175 /* #APP */ |
176 003e F894 cli |
177 .stabn 68,0,119,.LM15-Exec_run |
178 .LM15: |
179 /* #NOAPP */ |
180 0040 8D7F andi r24,lo8(-3) |
181 0042 8093 0000 sts fastEventBitmask,r24 |
182 .stabn 68,0,120,.LM16-Exec_run |
GAS LISTING /tmp/ccYxWDEV.s page 8 |
183 .LM16: |
184 /* #APP */ |
185 0046 7894 sei |
186 .stabn 68,0,121,.LM17-Exec_run |
187 .LM17: |
188 /* #NOAPP */ |
189 0048 00D0 rcall FrameMgr_acquireLine |
190 .L6: |
191 .stabn 68,0,125,.LM18-Exec_run |
192 .LM18: |
193 004a 2091 0000 lds r18,Exec_eventFifoTail |
194 004e 8091 0000 lds r24,Exec_eventFifoHead |
195 0052 8217 cp r24,r18 |
196 0054 19F3 breq .L30 |
197 .LBB4: |
198 .LBB5: |
199 .stabn 68,0,189,.LM19-Exec_run |
200 .LM19: |
201 /* #APP */ |
202 0056 F894 cli |
203 .stabn 68,0,191,.LM20-Exec_run |
204 .LM20: |
205 /* #NOAPP */ |
206 0058 E22F mov r30,r18 |
207 005a FF27 clr r31 |
208 005c E050 subi r30,lo8(-(Exec_eventFifo)) |
209 005e F040 sbci r31,hi8(-(Exec_eventFifo)) |
210 0060 9081 ld r25,Z |
211 .stabn 68,0,193,.LM21-Exec_run |
212 .LM21: |
213 0062 822F mov r24,r18 |
214 0064 8F5F subi r24,lo8(-(1)) |
215 0066 8770 andi r24,lo8(7) |
216 0068 8093 0000 sts Exec_eventFifoTail,r24 |
217 .stabn 68,0,194,.LM22-Exec_run |
218 .LM22: |
219 /* #APP */ |
220 006c 7894 sei |
221 /* #NOAPP */ |
222 .LBE5: |
223 .LBE4: |
224 .stabn 68,0,128,.LM23-Exec_run |
225 .LM23: |
226 006e 892F mov r24,r25 |
227 0070 9927 clr r25 |
228 0072 8031 cpi r24,lo8(16) |
229 0074 31F1 breq .L16 |
230 0076 8131 cpi r24,lo8(17) |
231 0078 68F4 brsh .L21 |
232 007a 8230 cpi r24,lo8(2) |
233 007c C9F0 breq .L13 |
234 007e 8330 cpi r24,lo8(3) |
235 0080 18F4 brsh .L22 |
236 0082 8130 cpi r24,lo8(1) |
237 0084 59F6 brne .L30 |
238 0086 2BC0 rjmp .L12 |
239 .L22: |
GAS LISTING /tmp/ccYxWDEV.s page 9 |
240 0088 8430 cpi r24,lo8(4) |
241 008a 31F1 breq .L14 |
242 008c 8830 cpi r24,lo8(8) |
243 008e 09F0 breq .+2 |
244 0090 C5CF rjmp .L30 |
245 0092 1FC0 rjmp .L15 |
246 .L21: |
247 0094 8038 cpi r24,lo8(-128) |
248 0096 79F0 breq .L18 |
249 0098 8138 cpi r24,lo8(-127) |
250 009a 20F4 brsh .L23 |
251 009c 8032 cpi r24,lo8(32) |
252 009e 09F0 breq .+2 |
253 00a0 BDCF rjmp .L30 |
254 00a2 14C0 rjmp .L17 |
255 .L23: |
256 00a4 8138 cpi r24,lo8(-127) |
257 00a6 51F0 breq .L19 |
258 00a8 8039 cpi r24,lo8(-112) |
259 00aa 09F0 breq .+2 |
260 00ac B7CF rjmp .L30 |
261 00ae 1CC0 rjmp .L20 |
262 .L13: |
263 .stabn 68,0,131,.LM24-Exec_run |
264 .LM24: |
265 00b0 82E0 ldi r24,lo8(2) |
266 00b2 00D0 rcall FrameMgr_dispatchEvent |
267 00b4 B3CF rjmp .L30 |
268 .L18: |
269 .stabn 68,0,135,.LM25-Exec_run |
270 .LM25: |
271 00b6 80E8 ldi r24,lo8(-128) |
272 00b8 00D0 rcall FrameMgr_dispatchEvent |
273 00ba B0CF rjmp .L30 |
274 .L19: |
275 .stabn 68,0,139,.LM26-Exec_run |
276 .LM26: |
277 00bc 81E8 ldi r24,lo8(-127) |
278 00be 00D0 rcall FrameMgr_dispatchEvent |
279 00c0 ADCF rjmp .L30 |
280 .L16: |
281 .stabn 68,0,143,.LM27-Exec_run |
282 .LM27: |
283 00c2 80E1 ldi r24,lo8(16) |
284 00c4 00D0 rcall FrameMgr_dispatchEvent |
285 .stabn 68,0,144,.LM28-Exec_run |
286 .LM28: |
287 00c6 80E1 ldi r24,lo8(16) |
288 00c8 00D0 rcall UIMgr_dispatchEvent |
289 00ca A8CF rjmp .L30 |
290 .L17: |
291 .stabn 68,0,148,.LM29-Exec_run |
292 .LM29: |
293 00cc 80E2 ldi r24,lo8(32) |
294 00ce 00D0 rcall FrameMgr_dispatchEvent |
295 00d0 A5CF rjmp .L30 |
296 .L15: |
GAS LISTING /tmp/ccYxWDEV.s page 10 |
297 .stabn 68,0,152,.LM30-Exec_run |
298 .LM30: |
299 00d2 88E0 ldi r24,lo8(8) |
300 00d4 00D0 rcall FrameMgr_dispatchEvent |
301 00d6 A2CF rjmp .L30 |
302 .L14: |
303 .stabn 68,0,156,.LM31-Exec_run |
304 .LM31: |
305 00d8 84E0 ldi r24,lo8(4) |
306 00da 00D0 rcall FrameMgr_dispatchEvent |
307 00dc 9FCF rjmp .L30 |
308 .L12: |
309 .stabn 68,0,160,.LM32-Exec_run |
310 .LM32: |
311 00de 81E0 ldi r24,lo8(1) |
312 00e0 00D0 rcall UIMgr_dispatchEvent |
313 .stabn 68,0,161,.LM33-Exec_run |
314 .LM33: |
315 00e2 81E0 ldi r24,lo8(1) |
316 00e4 00D0 rcall FrameMgr_dispatchEvent |
317 00e6 9ACF rjmp .L30 |
318 .L20: |
319 .stabn 68,0,165,.LM34-Exec_run |
320 .LM34: |
321 00e8 80E9 ldi r24,lo8(-112) |
322 00ea 00D0 rcall UIMgr_dispatchEvent |
323 00ec 97CF rjmp .L30 |
324 /* epilogue: frame size=0 */ |
325 /* epilogue: noreturn */ |
326 /* epilogue end (size=0) */ |
327 /* function Exec_run size 111 (111) */ |
328 .size Exec_run, .-Exec_run |
329 .stabs "dataByte:r(0,11)",64,0,187,25 |
330 .stabn 192,0,0,.LBB5-Exec_run |
331 .stabn 224,0,0,.LBE5-Exec_run |
332 .Lscope1: |
333 .stabs "",36,0,0,.Lscope1-Exec_run |
334 .stabd 78,0,0 |
335 .global Exec_eventFifoHead |
336 .global Exec_eventFifoHead |
337 .section .bss |
338 .type Exec_eventFifoHead, @object |
339 .size Exec_eventFifoHead, 1 |
340 Exec_eventFifoHead: |
341 0000 00 .skip 1,0 |
342 .global Exec_eventFifoTail |
343 .global Exec_eventFifoTail |
344 .type Exec_eventFifoTail, @object |
345 .size Exec_eventFifoTail, 1 |
346 Exec_eventFifoTail: |
347 0001 00 .skip 1,0 |
348 .global fastEventBitmask |
349 .global fastEventBitmask |
350 .type fastEventBitmask, @object |
351 .size fastEventBitmask, 1 |
352 fastEventBitmask: |
353 0002 00 .skip 1,0 |
GAS LISTING /tmp/ccYxWDEV.s page 11 |
354 .comm Exec_eventFifo,8,1 |
355 .stabs "fastEventBitmask:G(0,11)",32,0,74,0 |
356 .stabs "Exec_eventFifo:G(0,16)=ar(0,17)=r(0,17);0;0177777;;0;7;(0,11)",32,0,63,0 |
357 .stabs "Exec_eventFifoHead:G(0,11)",32,0,64,0 |
358 .stabs "Exec_eventFifoTail:G(0,11)",32,0,65,0 |
359 .text |
360 .stabs "",100,0,0,.Letext0 |
361 .Letext0: |
362 /* File "Executive.c": code 127 = 0x007f ( 126), prologues 0, epilogues 1 */ |
GAS LISTING /tmp/ccYxWDEV.s page 12 |
DEFINED SYMBOLS |
*ABS*:00000000 Executive.c |
/tmp/ccYxWDEV.s:3 *ABS*:0000003f __SREG__ |
/tmp/ccYxWDEV.s:4 *ABS*:0000003e __SP_H__ |
/tmp/ccYxWDEV.s:5 *ABS*:0000003d __SP_L__ |
/tmp/ccYxWDEV.s:6 *ABS*:00000000 __tmp_reg__ |
/tmp/ccYxWDEV.s:7 *ABS*:00000001 __zero_reg__ |
/tmp/ccYxWDEV.s:91 .text:00000000 Exec_writeEventFifo |
/tmp/ccYxWDEV.s:340 .bss:00000000 Exec_eventFifoHead |
*COM*:00000008 Exec_eventFifo |
/tmp/ccYxWDEV.s:131 .text:0000001c Exec_run |
/tmp/ccYxWDEV.s:352 .bss:00000002 fastEventBitmask |
/tmp/ccYxWDEV.s:346 .bss:00000001 Exec_eventFifoTail |
UNDEFINED SYMBOLS |
__do_copy_data |
__do_clear_bss |
FrameMgr_processLine |
UIMgr_transmitPendingData |
FrameMgr_acquireLine |
FrameMgr_dispatchEvent |
UIMgr_dispatchEvent |
/programy/C/avr/AVRcam/FrameMgr.lst |
---|
0,0 → 1,2036 |
GAS LISTING /tmp/ccQRbLT3.s page 1 |
1 .file "FrameMgr.c" |
2 .arch atmega8 |
3 __SREG__ = 0x3f |
4 __SP_H__ = 0x3e |
5 __SP_L__ = 0x3d |
6 __tmp_reg__ = 0 |
7 __zero_reg__ = 1 |
8 .global __do_copy_data |
9 .global __do_clear_bss |
10 .stabs "/home/kaklik/projects/programy/Atmel_C/AVRcam/",100,0,2,.Ltext0 |
11 .stabs "FrameMgr.c",100,0,2,.Ltext0 |
12 .text |
13 .Ltext0: |
14 .stabs "gcc2_compiled.",60,0,0,0 |
15 .stabs "int:t(0,1)=r(0,1);-32768;32767;",128,0,0,0 |
16 .stabs "char:t(0,2)=@s8;r(0,2);0;255;",128,0,0,0 |
17 .stabs "long int:t(0,3)=@s32;r(0,3);020000000000;017777777777;",128,0,0,0 |
18 .stabs "unsigned int:t(0,4)=r(0,4);0;0177777;",128,0,0,0 |
19 .stabs "long unsigned int:t(0,5)=@s32;r(0,5);0;037777777777;",128,0,0,0 |
20 .stabs "long long int:t(0,6)=@s64;r(0,6);01000000000000000000000;0777777777777777777777;",128,0,0, |
21 .stabs "long long unsigned int:t(0,7)=@s64;r(0,7);0;01777777777777777777777;",128,0,0,0 |
22 .stabs "short int:t(0,8)=r(0,8);-32768;32767;",128,0,0,0 |
23 .stabs "short unsigned int:t(0,9)=r(0,9);0;0177777;",128,0,0,0 |
24 .stabs "signed char:t(0,10)=@s8;r(0,10);-128;127;",128,0,0,0 |
25 .stabs "unsigned char:t(0,11)=@s8;r(0,11);0;255;",128,0,0,0 |
26 .stabs "float:t(0,12)=r(0,1);4;0;",128,0,0,0 |
27 .stabs "double:t(0,13)=r(0,1);4;0;",128,0,0,0 |
28 .stabs "long double:t(0,14)=r(0,1);4;0;",128,0,0,0 |
29 .stabs "void:t(0,15)=(0,15)",128,0,0,0 |
30 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/stdlib.h",130,0,0,0 |
31 .stabs "/usr/lib/gcc/avr/4.1.0/include/stddef.h",130,0,0,0 |
32 .stabs "size_t:t(2,1)=(0,4)",128,0,214,0 |
33 .stabs "wchar_t:t(2,2)=(0,1)",128,0,326,0 |
34 .stabn 162,0,0,0 |
35 .stabs "div_t:t(1,1)=(1,2)=s4quot:(0,1),0,16;rem:(0,1),16,16;;",128,0,69,0 |
36 .stabs "ldiv_t:t(1,3)=(1,4)=s8quot:(0,3),0,32;rem:(0,3),32,32;;",128,0,75,0 |
37 .stabs "__compar_fn_t:t(1,5)=(1,6)=*(1,7)=f(0,1)",128,0,78,0 |
38 .stabn 162,0,0,0 |
39 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/io.h",130,0,0,0 |
40 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/sfr_defs.h",130,0,0,0 |
41 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/inttypes.h",130,0,0,0 |
42 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/stdint.h",130,0,0,0 |
43 .stabs "int8_t:t(6,1)=(0,10)",128,0,116,0 |
44 .stabs "uint8_t:t(6,2)=(0,11)",128,0,117,0 |
45 .stabs "int16_t:t(6,3)=(0,1)",128,0,118,0 |
46 .stabs "uint16_t:t(6,4)=(0,4)",128,0,119,0 |
47 .stabs "int32_t:t(6,5)=(0,3)",128,0,120,0 |
48 .stabs "uint32_t:t(6,6)=(0,5)",128,0,121,0 |
49 .stabs "int64_t:t(6,7)=(0,6)",128,0,122,0 |
50 .stabs "uint64_t:t(6,8)=(0,7)",128,0,123,0 |
51 .stabs "intptr_t:t(6,9)=(6,3)",128,0,135,0 |
52 .stabs "uintptr_t:t(6,10)=(6,4)",128,0,140,0 |
53 .stabs "int_least8_t:t(6,11)=(6,1)",128,0,152,0 |
54 .stabs "uint_least8_t:t(6,12)=(6,2)",128,0,157,0 |
55 .stabs "int_least16_t:t(6,13)=(6,3)",128,0,162,0 |
56 .stabs "uint_least16_t:t(6,14)=(6,4)",128,0,167,0 |
57 .stabs "int_least32_t:t(6,15)=(6,5)",128,0,172,0 |
GAS LISTING /tmp/ccQRbLT3.s page 2 |
58 .stabs "uint_least32_t:t(6,16)=(6,6)",128,0,177,0 |
59 .stabs "int_least64_t:t(6,17)=(6,7)",128,0,182,0 |
60 .stabs "uint_least64_t:t(6,18)=(6,8)",128,0,187,0 |
61 .stabs "int_fast8_t:t(6,19)=(6,1)",128,0,200,0 |
62 .stabs "uint_fast8_t:t(6,20)=(6,2)",128,0,205,0 |
63 .stabs "int_fast16_t:t(6,21)=(6,3)",128,0,210,0 |
64 .stabs "uint_fast16_t:t(6,22)=(6,4)",128,0,215,0 |
65 .stabs "int_fast32_t:t(6,23)=(6,5)",128,0,220,0 |
66 .stabs "uint_fast32_t:t(6,24)=(6,6)",128,0,225,0 |
67 .stabs "int_fast64_t:t(6,25)=(6,7)",128,0,230,0 |
68 .stabs "uint_fast64_t:t(6,26)=(6,8)",128,0,235,0 |
69 .stabs "intmax_t:t(6,27)=(6,7)",128,0,249,0 |
70 .stabs "uintmax_t:t(6,28)=(6,8)",128,0,254,0 |
71 .stabn 162,0,0,0 |
72 .stabs "int_farptr_t:t(5,1)=(6,5)",128,0,76,0 |
73 .stabs "uint_farptr_t:t(5,2)=(6,6)",128,0,80,0 |
74 .stabn 162,0,0,0 |
75 .stabn 162,0,0,0 |
76 .stabn 162,0,0,0 |
77 .stabs "I2CInterface.h",130,0,0,0 |
78 .stabs "CommonDefs.h",130,0,0,0 |
79 .stabs "bool_t:t(8,1)=(0,11)",128,0,56,0 |
80 .stabn 162,0,0,0 |
81 .stabs "i2cCmd_t:t(7,1)=(7,2)=s2configReg:(0,11),0,8;data:(0,11),8,8;;",128,0,53,0 |
82 .stabn 162,0,0,0 |
83 .stabs " :T(0,16)=@s8;eST_FrameMgr_idle:0,ST_FrameMgr_TrackingFrame:1,ST_FrameMgr_DumpingFrame:2,; |
84 .stabs "FrameMgr_State_t:t(0,17)=(0,11)",128,0,72,0 |
85 .stabs " :T(0,18)=@s8;enotTracked:0,color1:1,color2:2,color3:3,color4:4,color5:5,color6:6,color7:7 |
86 .stabs "trackedColor_t:t(0,19)=(0,11)",128,0,127,0 |
87 .stabs "trackedObject_t:t(0,20)=(0,21)=s8color:(0,19),0,8;lastLineXStart:(0,11),8,8;lastLineXFinis |
88 .stabs "FrameMgr_processFrame:F(0,15)",36,0,517,FrameMgr_processFrame |
89 .global FrameMgr_processFrame |
90 .type FrameMgr_processFrame, @function |
91 FrameMgr_processFrame: |
92 .stabd 46,0,0 |
1:FrameMgr.c **** /* |
2:FrameMgr.c **** Copyright (C) 2004 John Orlando |
3:FrameMgr.c **** |
4:FrameMgr.c **** AVRcam: a small real-time image processing engine. |
5:FrameMgr.c **** |
6:FrameMgr.c **** This program is free software; you can redistribute it and/or |
7:FrameMgr.c **** modify it under the terms of the GNU General Public |
8:FrameMgr.c **** License as published by the Free Software Foundation; either |
9:FrameMgr.c **** version 2 of the License, or (at your option) any later version. |
10:FrameMgr.c **** |
11:FrameMgr.c **** This program is distributed in the hope that it will be useful, |
12:FrameMgr.c **** but WITHOUT ANY WARRANTY; without even the implied warranty of |
13:FrameMgr.c **** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14:FrameMgr.c **** General Public License for more details. |
15:FrameMgr.c **** |
16:FrameMgr.c **** You should have received a copy of the GNU General Public |
17:FrameMgr.c **** License along with this program; if not, write to the Free Software |
18:FrameMgr.c **** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19:FrameMgr.c **** |
20:FrameMgr.c **** For more information on the AVRcam, please contact: |
21:FrameMgr.c **** |
22:FrameMgr.c **** john@jrobot.net |
GAS LISTING /tmp/ccQRbLT3.s page 3 |
23:FrameMgr.c **** |
24:FrameMgr.c **** or go to www.jrobot.net for more details regarding the system. |
25:FrameMgr.c **** */ |
26:FrameMgr.c **** /********************************************************* |
27:FrameMgr.c **** Module Name: FrameMgr.c |
28:FrameMgr.c **** Module Date: 04/10/2004 |
29:FrameMgr.c **** Module Auth: John Orlando |
30:FrameMgr.c **** |
31:FrameMgr.c **** Description: This modules is responsible for performing |
32:FrameMgr.c **** both medium and high level processing on image data. |
33:FrameMgr.c **** This is performed at both the line level as well as |
34:FrameMgr.c **** the frame level. It controls the main flow of the |
35:FrameMgr.c **** system, adhering to all the critical timing |
36:FrameMgr.c **** requirements (such as when serial data can be transferred, |
37:FrameMgr.c **** etc). |
38:FrameMgr.c **** |
39:FrameMgr.c **** Revision History: |
40:FrameMgr.c **** Date Rel Ver. Notes |
41:FrameMgr.c **** 4/10/2004 0.1 Module created |
42:FrameMgr.c **** 6/30/2004 1.0 Initial release for Circuit Cellar |
43:FrameMgr.c **** contest. |
44:FrameMgr.c **** 11/15/2004 1.2 Updated processLine() function so |
45:FrameMgr.c **** it will remove objects less than |
46:FrameMgr.c **** a specified length/width (reduces |
47:FrameMgr.c **** shot noise) |
48:FrameMgr.c **** *********************************************************/ |
49:FrameMgr.c **** |
50:FrameMgr.c **** /* Includes */ |
51:FrameMgr.c **** #include <stdlib.h> |
52:FrameMgr.c **** #include <string.h> |
53:FrameMgr.c **** #include <avr/io.h> |
54:FrameMgr.c **** #include "Executive.h" |
55:FrameMgr.c **** #include "UIMgr.h" |
56:FrameMgr.c **** #include "FrameMgr.h" |
57:FrameMgr.c **** #include "CamInterface.h" |
58:FrameMgr.c **** #include "UartInterface.h" |
59:FrameMgr.c **** #include "Utility.h" |
60:FrameMgr.c **** #include "I2CInterface.h" |
61:FrameMgr.c **** #include "CamConfig.h" |
62:FrameMgr.c **** #include "CommonDefs.h" |
63:FrameMgr.c **** |
64:FrameMgr.c **** /* Local Structures and Typedefs */ |
65:FrameMgr.c **** enum |
66:FrameMgr.c **** { |
67:FrameMgr.c **** ST_FrameMgr_idle, |
68:FrameMgr.c **** ST_FrameMgr_TrackingFrame, |
69:FrameMgr.c **** ST_FrameMgr_DumpingFrame |
70:FrameMgr.c **** }; |
71:FrameMgr.c **** |
72:FrameMgr.c **** typedef unsigned char FrameMgr_State_t; |
73:FrameMgr.c **** |
74:FrameMgr.c **** /* Definitions */ |
75:FrameMgr.c **** /* The most objects that can be tracked at any one time is 8. |
76:FrameMgr.c **** This number is determined by the number of bytes that can be |
77:FrameMgr.c **** sent out during a frame (one byte per line, 144 lines per frame) |
78:FrameMgr.c **** with the number of bytes in a tracked object (7) + some wiggle |
79:FrameMgr.c **** room :-) ... I guess this could be increased to around 20 if |
GAS LISTING /tmp/ccQRbLT3.s page 4 |
80:FrameMgr.c **** we had enough room and cycles to process objects between lines */ |
81:FrameMgr.c **** #define MAX_TRACKED_OBJECTS 8 |
82:FrameMgr.c **** |
83:FrameMgr.c **** /* This defines the number of bytes that make up a trackedObject_t |
84:FrameMgr.c **** structure... */ |
85:FrameMgr.c **** #define SIZE_OF_TRACKED_OBJECT 8 |
86:FrameMgr.c **** |
87:FrameMgr.c **** /* This define is used to turn off the timer overflow interrupt |
88:FrameMgr.c **** that is generated when the PCLK overflows TIMER1 */ |
89:FrameMgr.c **** #define DISABLE_PCLK_TIMER1_OVERFLOW_BITMASK 0xFB |
90:FrameMgr.c **** |
91:FrameMgr.c **** /* This define is used to determine if a run length is too small |
92:FrameMgr.c **** to be concerned with. This helps to reduce the number of false |
93:FrameMgr.c **** positives. */ |
94:FrameMgr.c **** #define MIN_OBJECT_TRACKING_WIDTH 3 |
95:FrameMgr.c **** |
96:FrameMgr.c **** /* This define is used to determine if an object has enough |
97:FrameMgr.c **** height to be considered worth tracking...it is used to reduce |
98:FrameMgr.c **** shot noise */ |
99:FrameMgr.c **** #define MIN_OBJECT_TRACKING_HEIGHT 3 |
100:FrameMgr.c **** |
101:FrameMgr.c **** /* This define is used to indicate how often the filter routine |
102:FrameMgr.c **** that removes objects less than MIN_OBJECT_TRACKING_HEIGHT should |
103:FrameMgr.c **** be executed. It is measured in a number of lines (7 nominally). */ |
104:FrameMgr.c **** #define RUN_OBJECT_FILTER_MASK 0x07 |
105:FrameMgr.c **** |
106:FrameMgr.c **** /* This enum describes the possible colors that can |
107:FrameMgr.c **** be tracked by the system. This can't be represented as |
108:FrameMgr.c **** simple color names (red, brown, etc) due to the fact that |
109:FrameMgr.c **** the user sets which colors will be associated with which |
110:FrameMgr.c **** bits. Remember...after the AND operation of the indexed |
111:FrameMgr.c **** color map values executes, either a single bit indicating |
112:FrameMgr.c **** the color should be set, or no bits indicating that the |
113:FrameMgr.c **** color isn't represented in the color map (notTracked). */ |
114:FrameMgr.c **** enum |
115:FrameMgr.c **** { |
116:FrameMgr.c **** notTracked, |
117:FrameMgr.c **** color1, /* bit 1 color */ |
118:FrameMgr.c **** color2, /* bit 2 color */ |
119:FrameMgr.c **** color3, /* bit 3 color */ |
120:FrameMgr.c **** color4, /* bit 4 color */ |
121:FrameMgr.c **** color5, /* bit 5 color */ |
122:FrameMgr.c **** color6, /* bit 6 color */ |
123:FrameMgr.c **** color7, /* bit 7 color */ |
124:FrameMgr.c **** color8 /* bit 8 color */ |
125:FrameMgr.c **** }; |
126:FrameMgr.c **** |
127:FrameMgr.c **** typedef unsigned char trackedColor_t; |
128:FrameMgr.c **** |
129:FrameMgr.c **** /* This structure defines the info that needs to be |
130:FrameMgr.c **** maintained for each trackedObject in the trackingTable */ |
131:FrameMgr.c **** typedef struct |
132:FrameMgr.c **** { |
133:FrameMgr.c **** trackedColor_t color; |
134:FrameMgr.c **** unsigned char lastLineXStart; |
135:FrameMgr.c **** unsigned char lastLineXFinish; |
136:FrameMgr.c **** unsigned char x_upperLeft; |
GAS LISTING /tmp/ccQRbLT3.s page 5 |
137:FrameMgr.c **** unsigned char y_upperLeft; |
138:FrameMgr.c **** unsigned char x_lowerRight; |
139:FrameMgr.c **** unsigned char y_lowerRight; |
140:FrameMgr.c **** unsigned char objectValid; /* used to be a fill byte...now it is |
141:FrameMgr.c **** used to determine if the object is valid |
142:FrameMgr.c **** or not...it gets invalidated if it is |
143:FrameMgr.c **** determined that it is too small, or |
144:FrameMgr.c **** that the object is within another object */ |
145:FrameMgr.c **** } trackedObject_t; |
146:FrameMgr.c **** |
147:FrameMgr.c **** /* These defines are used to index into each individual element in the |
148:FrameMgr.c **** trackedObject_t structure. This seems to be MUCH more efficient than |
149:FrameMgr.c **** accessing the elements in GCC. */ |
150:FrameMgr.c **** #define COLOR_OFFSET 0 |
151:FrameMgr.c **** #define LAST_LINE_X_START_OFFSET 1 |
152:FrameMgr.c **** #define LAST_LINE_X_FINISH_OFFSET 2 |
153:FrameMgr.c **** #define X_UPPER_LEFT_OFFSET 3 |
154:FrameMgr.c **** #define Y_UPPER_LEFT_OFFSET 4 |
155:FrameMgr.c **** #define X_LOWER_RIGHT_OFFSET 5 |
156:FrameMgr.c **** #define Y_LOWER_RIGHT_OFFSET 6 |
157:FrameMgr.c **** #define VALID_OBJECT_OFFSET 7 |
158:FrameMgr.c **** |
159:FrameMgr.c **** /* Local Variables */ |
160:FrameMgr.c **** /* The trackedObjectTable is used to hold up to eight tracked objects |
161:FrameMgr.c **** while they are being acquired. */ |
162:FrameMgr.c **** static trackedObject_t trackedObjectTable[MAX_TRACKED_OBJECTS]; |
163:FrameMgr.c **** static trackedObject_t *pCurrentTrackedObjectTable = trackedObjectTable; |
164:FrameMgr.c **** static unsigned char lineCount = 0; |
165:FrameMgr.c **** static FrameMgr_State_t currentState = ST_FrameMgr_idle; |
166:FrameMgr.c **** static unsigned char numCurrTrackedObjects = 0; |
167:FrameMgr.c **** static unsigned char numPrevTrackedObjects = 0; |
168:FrameMgr.c **** static unsigned char trackedLineCount = 0; |
169:FrameMgr.c **** |
170:FrameMgr.c **** /* Local Functions */ |
171:FrameMgr.c **** static void FrameMgr_findConnectedness(void); |
172:FrameMgr.c **** |
173:FrameMgr.c **** /* Extern Functions */ |
174:FrameMgr.c **** /* These functions are located in assembly files, and thus |
175:FrameMgr.c **** must be externed here so they can be referenced in the source below. */ |
176:FrameMgr.c **** extern void CamIntAsm_waitForNewTrackingFrame(unsigned char *pBuffer, unsigned char *pMemLookup); |
177:FrameMgr.c **** extern void CamIntAsm_waitForNewDumpFrame(unsigned char *pCurrBuffer, unsigned char *pPrevBuffer); |
178:FrameMgr.c **** extern void CamIntAsm_acquireTrackingLine(unsigned char *pBuffer, unsigned char *pMemLookup); |
179:FrameMgr.c **** extern void CamIntAsm_acquireDumpLine(unsigned char *pCurrBuffer, unsigned char *pPrevBuffer); |
180:FrameMgr.c **** |
181:FrameMgr.c **** /*********************************************************** |
182:FrameMgr.c **** Function Name: FrameMgr_init |
183:FrameMgr.c **** Function Description: This function is responsible |
184:FrameMgr.c **** for initializing the FrameMgr. This includes |
185:FrameMgr.c **** setting up the various buffers and data needed to |
186:FrameMgr.c **** process each frame of image data. |
187:FrameMgr.c **** Inputs: none |
188:FrameMgr.c **** Outputs: none |
189:FrameMgr.c **** ***********************************************************/ |
190:FrameMgr.c **** void FrameMgr_init(void) |
191:FrameMgr.c **** { |
192:FrameMgr.c **** memset(trackedObjectTable,0x00,sizeof(trackedObjectTable)); |
193:FrameMgr.c **** } |
GAS LISTING /tmp/ccQRbLT3.s page 6 |
194:FrameMgr.c **** |
195:FrameMgr.c **** |
196:FrameMgr.c **** /*********************************************************** |
197:FrameMgr.c **** Function Name: FrameMgr_dispatchEvent |
198:FrameMgr.c **** Function Description: This function is responsible for |
199:FrameMgr.c **** taking an incoming event and performing the needed |
200:FrameMgr.c **** actions with it as pertains to the FrameMgr. |
201:FrameMgr.c **** Inputs: event - the generated event |
202:FrameMgr.c **** Outputs: none |
203:FrameMgr.c **** ***********************************************************/ |
204:FrameMgr.c **** void FrameMgr_dispatchEvent(unsigned char event) |
205:FrameMgr.c **** { |
206:FrameMgr.c **** switch(event) |
207:FrameMgr.c **** { |
208:FrameMgr.c **** case EV_DUMP_FRAME: |
209:FrameMgr.c **** /* try re-initializing the camera before we start dumping */ |
210:FrameMgr.c **** |
211:FrameMgr.c **** CamConfig_setCamReg(0x11,0x01); /* reduce the frame rate for dumping*/ |
212:FrameMgr.c **** CamConfig_sendFifoCmds(); |
213:FrameMgr.c **** Utility_delay(1000); /* allow the new frame rate to settle */ |
214:FrameMgr.c **** lineCount = 0; |
215:FrameMgr.c **** currentState = ST_FrameMgr_DumpingFrame; |
216:FrameMgr.c **** //CamIntAsm_waitForNewDumpFrame(currentLineBuffer,previousLineBuffer); |
217:FrameMgr.c **** FrameMgr_acquireLine(); |
218:FrameMgr.c **** break; |
219:FrameMgr.c **** |
220:FrameMgr.c **** case EV_ENABLE_TRACKING: |
221:FrameMgr.c **** currentState = ST_FrameMgr_TrackingFrame; |
222:FrameMgr.c **** FrameMgr_acquireFrame(); |
223:FrameMgr.c **** break; |
224:FrameMgr.c **** |
225:FrameMgr.c **** case EV_ACQUIRE_FRAME_COMPLETE: |
226:FrameMgr.c **** FrameMgr_processFrame(); |
227:FrameMgr.c **** break; |
228:FrameMgr.c **** |
229:FrameMgr.c **** case EV_PROCESS_FRAME_COMPLETE: |
230:FrameMgr.c **** FrameMgr_acquireFrame(); |
231:FrameMgr.c **** break; |
232:FrameMgr.c **** |
233:FrameMgr.c **** case EV_SERIAL_DATA_RECEIVED: |
234:FrameMgr.c **** if (currentState != ST_FrameMgr_idle) |
235:FrameMgr.c **** { |
236:FrameMgr.c **** /* we need to go back to processing line data, since |
237:FrameMgr.c **** serial data reception interrupted us....just trash the |
238:FrameMgr.c **** frame and act like the frame has been processed, which |
239:FrameMgr.c **** will kick off the system to wait for the next line */ |
240:FrameMgr.c **** PUBLISH_EVENT(EV_PROCESS_FRAME_COMPLETE); |
241:FrameMgr.c **** } |
242:FrameMgr.c **** break; |
243:FrameMgr.c **** |
244:FrameMgr.c **** case EV_DISABLE_TRACKING: |
245:FrameMgr.c **** /* tracking needs to be turned off */ |
246:FrameMgr.c **** currentState = ST_FrameMgr_idle; |
247:FrameMgr.c **** break; |
248:FrameMgr.c **** } |
249:FrameMgr.c **** } |
250:FrameMgr.c **** |
GAS LISTING /tmp/ccQRbLT3.s page 7 |
251:FrameMgr.c **** /*********************************************************** |
252:FrameMgr.c **** Function Name: FrameMgr_acquireFrame |
253:FrameMgr.c **** Function Description: This function is responsible for |
254:FrameMgr.c **** beginning of the acquisition of a new frame of data |
255:FrameMgr.c **** from the camera interface. The acquisition of this line |
256:FrameMgr.c **** depends on the current state of the FrameMgr. |
257:FrameMgr.c **** Inputs: none |
258:FrameMgr.c **** Outputs: none |
259:FrameMgr.c **** ***********************************************************/ |
260:FrameMgr.c **** void FrameMgr_acquireFrame(void) |
261:FrameMgr.c **** { |
262:FrameMgr.c **** if (currentState == ST_FrameMgr_TrackingFrame) |
263:FrameMgr.c **** { |
264:FrameMgr.c **** trackedLineCount = 0; |
265:FrameMgr.c **** numPrevTrackedObjects = numCurrTrackedObjects; |
266:FrameMgr.c **** numCurrTrackedObjects = 0; |
267:FrameMgr.c **** |
268:FrameMgr.c **** /* clear out the tracking table, and wait for the new frame |
269:FrameMgr.c **** to start */ |
270:FrameMgr.c **** memset(trackedObjectTable,0x00,sizeof(trackedObjectTable)); |
271:FrameMgr.c **** //CamIntAsm_waitForNewTrackingFrame(currentLineBuffer,colorMap); |
272:FrameMgr.c **** WAIT_FOR_VSYNC_HIGH(); |
273:FrameMgr.c **** CamIntAsm_acquireTrackingLine(currentLineBuffer,colorMap); |
274:FrameMgr.c **** } |
275:FrameMgr.c **** } |
276:FrameMgr.c **** |
277:FrameMgr.c **** /*********************************************************** |
278:FrameMgr.c **** Function Name: FrameMgr_acquireLine |
279:FrameMgr.c **** Function Description: This function is responsible for |
280:FrameMgr.c **** acquiring a line of data from the camera interface. |
281:FrameMgr.c **** The acquisition of this line depends on the current |
282:FrameMgr.c **** state of the FrameMgr. |
283:FrameMgr.c **** Inputs: none |
284:FrameMgr.c **** Outputs: none |
285:FrameMgr.c **** ***********************************************************/ |
286:FrameMgr.c **** void FrameMgr_acquireLine(void) |
287:FrameMgr.c **** { |
288:FrameMgr.c **** unsigned char tmpLineCount; |
289:FrameMgr.c **** |
290:FrameMgr.c **** /* clearing out the buffers takes too long...we should |
291:FrameMgr.c **** just overwrite the data here without a problem when |
292:FrameMgr.c **** we start acquiring...at no point do we check for |
293:FrameMgr.c **** a 0x00 value in the current or previous lineBuffers, |
294:FrameMgr.c **** so it was a bit excessive :-) */ |
295:FrameMgr.c **** |
296:FrameMgr.c **** /* check which state we are in and proceed as needed */ |
297:FrameMgr.c **** if (currentState == ST_FrameMgr_DumpingFrame) |
298:FrameMgr.c **** { |
299:FrameMgr.c **** tmpLineCount = lineCount*2; |
300:FrameMgr.c **** |
301:FrameMgr.c **** /* clearing out the line data in dump mode is ok, and actually |
302:FrameMgr.c **** is needed, since it is possible for the first dump line in |
303:FrameMgr.c **** a frame to come back with the last line captured of the |
304:FrameMgr.c **** last capture session...*/ |
305:FrameMgr.c **** memset(currentLineBuffer,0x00,LENGTH_OF_LINE_BUFFER); |
306:FrameMgr.c **** memset(previousLineBuffer,0x00,LENGTH_OF_LINE_BUFFER); |
307:FrameMgr.c **** /* wait for another VSYNC so we know which frame to use |
GAS LISTING /tmp/ccQRbLT3.s page 8 |
308:FrameMgr.c **** to start looking for a line to receive */ |
309:FrameMgr.c **** WAIT_FOR_VSYNC_HIGH(); |
310:FrameMgr.c **** WAIT_FOR_VSYNC_LOW(); |
311:FrameMgr.c **** |
312:FrameMgr.c **** /* look at lineCount to determine how many HREFs we should |
313:FrameMgr.c **** wait before we start sampling */ |
314:FrameMgr.c **** while(tmpLineCount != 0) |
315:FrameMgr.c **** { |
316:FrameMgr.c **** WAIT_FOR_HREF_HIGH(); |
317:FrameMgr.c **** tmpLineCount--; |
318:FrameMgr.c **** WAIT_FOR_HREF_LOW(); |
319:FrameMgr.c **** } |
320:FrameMgr.c **** |
321:FrameMgr.c **** /* we should now be ready to sample our line...*/ |
322:FrameMgr.c **** CamIntAsm_acquireDumpLine(currentLineBuffer,previousLineBuffer); |
323:FrameMgr.c **** } |
324:FrameMgr.c **** else if (currentState == ST_FrameMgr_TrackingFrame) |
325:FrameMgr.c **** { |
326:FrameMgr.c **** WAIT_FOR_HREF_LOW(); |
327:FrameMgr.c **** CamIntAsm_acquireTrackingLine(currentLineBuffer,colorMap); |
328:FrameMgr.c **** } |
329:FrameMgr.c **** } |
330:FrameMgr.c **** |
331:FrameMgr.c **** /*********************************************************** |
332:FrameMgr.c **** Function Name: FrameMgr_processLine |
333:FrameMgr.c **** Function Description: This function is responsible for |
334:FrameMgr.c **** parsing the received image line and performing either |
335:FrameMgr.c **** connected region mapping (if in the Tracking state) or |
336:FrameMgr.c **** sending out the raw sampled data (if in the Dumping |
337:FrameMgr.c **** state). |
338:FrameMgr.c **** Inputs: none |
339:FrameMgr.c **** Outputs: none |
340:FrameMgr.c **** ***********************************************************/ |
341:FrameMgr.c **** void FrameMgr_processLine(void) |
342:FrameMgr.c **** { |
343:FrameMgr.c **** unsigned char i; |
344:FrameMgr.c **** volatile unsigned char dataToSend; |
345:FrameMgr.c **** unsigned char *pTrackedObjectData = (unsigned char *)pCurrentTrackedObjectTable; |
346:FrameMgr.c **** #ifdef DEBUG_TRACKED_LINE |
347:FrameMgr.c **** unsigned char *pSendData; |
348:FrameMgr.c **** unsigned char asciiBuffer[5]; |
349:FrameMgr.c **** unsigned char pixelCount = 0; |
350:FrameMgr.c **** #endif |
351:FrameMgr.c **** |
352:FrameMgr.c **** if (currentState == ST_FrameMgr_DumpingFrame) |
353:FrameMgr.c **** { |
354:FrameMgr.c **** /* we want to sit in a tight loop and send the acquired data |
355:FrameMgr.c **** sitting in current and previous line buffers out the serial |
356:FrameMgr.c **** port...it is sent out the serial port immediately instead |
357:FrameMgr.c **** of going into the UIMgr tx fifo because we can't do anything |
358:FrameMgr.c **** until its sent out anyway...may as well just get it out now */ |
359:FrameMgr.c **** |
360:FrameMgr.c **** /* currentLineBuffer is getting "g" previousLineBuffer is getting "b-r" */ |
361:FrameMgr.c **** UartInt_txByte(0x0B); /* send the header byte */ |
362:FrameMgr.c **** UartInt_txByte(lineCount); /* send the line count */ |
363:FrameMgr.c **** for (i=0; i<NUM_PIXELS_IN_A_DUMP_LINE; i+=2) |
364:FrameMgr.c **** { |
GAS LISTING /tmp/ccQRbLT3.s page 9 |
365:FrameMgr.c **** /* when a dump line is sampled, the upper byte can potentially |
366:FrameMgr.c **** have garbage in it...we don't have time to mask it off as we're |
367:FrameMgr.c **** sampling, so it is done here before we send it out...we also |
368:FrameMgr.c **** combine the samples together so we really are sending up a |
369:FrameMgr.c **** sample for line N as well as line N+1 */ |
370:FrameMgr.c **** dataToSend = currentLineBuffer[i]; |
371:FrameMgr.c **** dataToSend &= 0x0F; |
372:FrameMgr.c **** dataToSend <<= 4; |
373:FrameMgr.c **** dataToSend |= (previousLineBuffer[i] & 0x0F); |
374:FrameMgr.c **** |
375:FrameMgr.c **** /* dataToSend should be packed now */ |
376:FrameMgr.c **** UartInt_txByte(dataToSend); |
377:FrameMgr.c **** |
378:FrameMgr.c **** /* flip the colors around since we are doing all G on Y and BR on UV */ |
379:FrameMgr.c **** dataToSend = previousLineBuffer[i+1]; |
380:FrameMgr.c **** dataToSend &= 0x0F; |
381:FrameMgr.c **** dataToSend <<= 4; |
382:FrameMgr.c **** dataToSend |= (currentLineBuffer[i+1] & 0x0F); |
383:FrameMgr.c **** |
384:FrameMgr.c **** /* dataToSend should be packed now */ |
385:FrameMgr.c **** UartInt_txByte(dataToSend); |
386:FrameMgr.c **** } |
387:FrameMgr.c **** UartInt_txByte(0x0F); /* send line end */ |
388:FrameMgr.c **** /* once all the data is sent, increment out line count by 2 since |
389:FrameMgr.c **** we really get 2 lines worth of pixels on each pass */ |
390:FrameMgr.c **** /* Update...increment only by 1, but only send 72 double-lines */ |
391:FrameMgr.c **** lineCount++; |
392:FrameMgr.c **** |
393:FrameMgr.c **** /* check to see if we have retrieved all of the needed lines */ |
394:FrameMgr.c **** if (lineCount >= 72) /* half 144, since we send two lines at a time */ |
395:FrameMgr.c **** { |
396:FrameMgr.c **** /* we're done, so send the dump complete?...nope, just change |
397:FrameMgr.c **** states and we should be fine */ |
398:FrameMgr.c **** lineCount = 0; |
399:FrameMgr.c **** currentState = ST_FrameMgr_idle; |
400:FrameMgr.c **** |
401:FrameMgr.c **** /* disable the PCLK counting overflow interrupt */ |
402:FrameMgr.c **** TIMSK &= DISABLE_PCLK_TIMER1_OVERFLOW_BITMASK; |
403:FrameMgr.c **** |
404:FrameMgr.c **** CamConfig_setCamReg(0x11,0x00); /* reset the frame rate to normal*/ |
405:FrameMgr.c **** CamConfig_sendFifoCmds(); |
406:FrameMgr.c **** } |
407:FrameMgr.c **** else |
408:FrameMgr.c **** { |
409:FrameMgr.c **** /* we have more lines to acquire in this frame, so keep on truckin...*/ |
410:FrameMgr.c **** PUBLISH_FAST_EVENT(FEV_PROCESS_LINE_COMPLETE); |
411:FrameMgr.c **** } |
412:FrameMgr.c **** } |
413:FrameMgr.c **** else if (currentState == ST_FrameMgr_TrackingFrame) |
414:FrameMgr.c **** { |
415:FrameMgr.c **** #ifdef DEBUG_TRACKED_LINE |
416:FrameMgr.c **** /* send the received line over serial...this should only send |
417:FrameMgr.c **** until a pixelCount == 176 */ |
418:FrameMgr.c **** pSendData = currentLineBuffer; |
419:FrameMgr.c **** itoa(trackedLineCount,asciiBuffer,10); |
420:FrameMgr.c **** UIMgr_txBuffer(asciiBuffer,3); |
421:FrameMgr.c **** UIMgr_txBuffer(" ",1); |
GAS LISTING /tmp/ccQRbLT3.s page 10 |
422:FrameMgr.c **** while(pixelCount < ACTUAL_NUM_PIXELS_IN_A_LINE) |
423:FrameMgr.c **** { |
424:FrameMgr.c **** memset(asciiBuffer,0x00,5); |
425:FrameMgr.c **** itoa(*pSendData++,asciiBuffer,10); /* color is first byte */ |
426:FrameMgr.c **** UIMgr_txBuffer(asciiBuffer,3); /* 3 ascii bytes for data */ |
427:FrameMgr.c **** UIMgr_txBuffer(" ",1); |
428:FrameMgr.c **** |
429:FrameMgr.c **** pixelCount += *pSendData; /* run-length is second byte */ |
430:FrameMgr.c **** memset(asciiBuffer,0x00,5); |
431:FrameMgr.c **** itoa(*pSendData++,asciiBuffer,10); |
432:FrameMgr.c **** UIMgr_txBuffer(asciiBuffer,3); |
433:FrameMgr.c **** UIMgr_txBuffer(" ",1); |
434:FrameMgr.c **** } |
435:FrameMgr.c **** UIMgr_txBuffer("\n\r",2); |
436:FrameMgr.c **** |
437:FrameMgr.c **** trackedLineCount++; |
438:FrameMgr.c **** if (trackedLineCount == 144) |
439:FrameMgr.c **** { |
440:FrameMgr.c **** UIMgr_txBuffer(" FC \n\r",8); |
441:FrameMgr.c **** trackedLineCount = 0; |
442:FrameMgr.c **** PUBLISH_EVENT(EV_PROCESS_FRAME_COMPLETE); |
443:FrameMgr.c **** } |
444:FrameMgr.c **** else |
445:FrameMgr.c **** { |
446:FrameMgr.c **** PUBLISH_EVENT(EV_PROCESS_LINE_COMPLETE); |
447:FrameMgr.c **** } |
448:FrameMgr.c **** #else |
449:FrameMgr.c **** /* determine if any of the RLE blocks overlap */ |
450:FrameMgr.c **** FrameMgr_findConnectedness(); |
451:FrameMgr.c **** |
452:FrameMgr.c **** /* we also want to remove any objects that are less than |
453:FrameMgr.c **** a minimum height...we already removed portions of the |
454:FrameMgr.c **** run-length that are less than MIN_PIXEL_WIDTH in the |
455:FrameMgr.c **** findConnectedness() routine...doing it here instead of |
456:FrameMgr.c **** a function to speed things up...this may end up slowing down the |
457:FrameMgr.c **** frame rate slightly, and can be removed if this isn't needed */ |
458:FrameMgr.c **** |
459:FrameMgr.c **** /* run this routine once every 8 lines */ |
460:FrameMgr.c **** if ( (trackedLineCount & RUN_OBJECT_FILTER_MASK) == RUN_OBJECT_FILTER_MASK) |
461:FrameMgr.c **** { |
462:FrameMgr.c **** for (i=0; i<MAX_TRACKED_OBJECTS; i++) |
463:FrameMgr.c **** { |
464:FrameMgr.c **** if ( *(pTrackedObjectData + VALID_OBJECT_OFFSET) == TRUE) |
465:FrameMgr.c **** { |
466:FrameMgr.c **** /* check to see if the object is already in |
467:FrameMgr.c **** our past...i.e., its last */ |
468:FrameMgr.c **** if ( (*(pTrackedObjectData + Y_LOWER_RIGHT_OFFSET) - |
469:FrameMgr.c **** *(pTrackedObjectData + Y_UPPER_LEFT_OFFSET)) < MIN_OBJECT_TRACKING_HEIGHT |
470:FrameMgr.c **** { |
471:FrameMgr.c **** /* the object is less than the minimum height...see if it is adjacent |
472:FrameMgr.c **** to the current line we just processed...if so, leave it here...otherwise, |
473:FrameMgr.c **** it needs to be invalidated since its too small */ |
474:FrameMgr.c **** if ( trackedLineCount - *(pTrackedObjectData + Y_LOWER_RIGHT_OFFSET) > 2) |
475:FrameMgr.c **** { |
476:FrameMgr.c **** /* invalidate the object */ |
477:FrameMgr.c **** *(pTrackedObjectData + VALID_OBJECT_OFFSET) = FALSE; |
478:FrameMgr.c **** numCurrTrackedObjects--; |
GAS LISTING /tmp/ccQRbLT3.s page 11 |
479:FrameMgr.c **** } |
480:FrameMgr.c **** } |
481:FrameMgr.c **** } |
482:FrameMgr.c **** pTrackedObjectData += SIZE_OF_TRACKED_OBJECT; |
483:FrameMgr.c **** } |
484:FrameMgr.c **** } |
485:FrameMgr.c **** |
486:FrameMgr.c **** trackedLineCount++; |
487:FrameMgr.c **** if (trackedLineCount == ACTUAL_NUM_LINES_IN_A_FRAME) |
488:FrameMgr.c **** { |
489:FrameMgr.c **** /* an entire frame of tracking data has been acquired, so |
490:FrameMgr.c **** publish an event letting the system know this fact */ |
491:FrameMgr.c **** PUBLISH_EVENT(EV_ACQUIRE_FRAME_COMPLETE); |
492:FrameMgr.c **** /* disable the PCLK counting overflow interrupt */ |
493:FrameMgr.c **** TIMSK &= DISABLE_PCLK_TIMER1_OVERFLOW_BITMASK; |
494:FrameMgr.c **** trackedLineCount = 0; |
495:FrameMgr.c **** } |
496:FrameMgr.c **** else |
497:FrameMgr.c **** { |
498:FrameMgr.c **** PUBLISH_FAST_EVENT(FEV_PROCESS_LINE_COMPLETE); |
499:FrameMgr.c **** } |
500:FrameMgr.c **** #endif |
501:FrameMgr.c **** } |
502:FrameMgr.c **** else |
503:FrameMgr.c **** { |
504:FrameMgr.c **** /* ...and here? */ |
505:FrameMgr.c **** } |
506:FrameMgr.c **** } |
507:FrameMgr.c **** |
508:FrameMgr.c **** /*********************************************************** |
509:FrameMgr.c **** Function Name: FrameMgr_processFrame |
510:FrameMgr.c **** Function Description: This function is responsible for |
511:FrameMgr.c **** parsing the completed frame and performing all actions |
512:FrameMgr.c **** needed at this level. |
513:FrameMgr.c **** Inputs: none |
514:FrameMgr.c **** Outputs: none |
515:FrameMgr.c **** ***********************************************************/ |
516:FrameMgr.c **** void FrameMgr_processFrame(void) |
517:FrameMgr.c **** { |
93 .stabn 68,0,517,.LM0-FrameMgr_processFrame |
94 .LM0: |
95 /* prologue: frame size=0 */ |
96 0000 DF92 push r13 |
97 0002 EF92 push r14 |
98 0004 FF92 push r15 |
99 0006 0F93 push r16 |
100 0008 1F93 push r17 |
101 000a CF93 push r28 |
102 000c DF93 push r29 |
103 /* prologue end (size=7) */ |
518:FrameMgr.c **** unsigned char i,k,color; |
519:FrameMgr.c **** #if DEBUG_FRAME_DATA |
520:FrameMgr.c **** unsigned char asciiBuffer[5]; |
521:FrameMgr.c **** unsigned char j; |
522:FrameMgr.c **** #endif |
523:FrameMgr.c **** unsigned char *pTableData = (unsigned char *)pCurrentTrackedObjectTable; |
104 .stabn 68,0,523,.LM1-FrameMgr_processFrame |
GAS LISTING /tmp/ccQRbLT3.s page 12 |
105 .LM1: |
106 000e 2091 0000 lds r18,pCurrentTrackedObjectTable |
107 0012 3091 0000 lds r19,(pCurrentTrackedObjectTable)+1 |
524:FrameMgr.c **** unsigned char tmpUpperLeftX,tmpUpperLeftY,tmpLowerRightX,tmpLowerRightY; |
525:FrameMgr.c **** |
526:FrameMgr.c **** #if DEBUG_FRAME_DATA |
527:FrameMgr.c **** /* we want to send all of the currently tracked table out |
528:FrameMgr.c **** the serial port for debugging */ |
529:FrameMgr.c **** for (i=0; i<numCurrTrackedObjects; i++) |
530:FrameMgr.c **** { |
531:FrameMgr.c **** UIMgr_txBuffer("----------\r\n",12); |
532:FrameMgr.c **** for (j=0; j<SIZE_OF_TRACKED_OBJECT; j++) |
533:FrameMgr.c **** { |
534:FrameMgr.c **** memset(asciiBuffer,0x00,5); |
535:FrameMgr.c **** itoa(*pTableData++,asciiBuffer,10); |
536:FrameMgr.c **** UIMgr_txBuffer(asciiBuffer,3); /* 3 ascii bytes for data |
537:FrameMgr.c **** + 1 space */ |
538:FrameMgr.c **** UIMgr_txBuffer("\r\n",2); |
539:FrameMgr.c **** } |
540:FrameMgr.c **** } |
541:FrameMgr.c **** |
542:FrameMgr.c **** /* finally, send a new line */ |
543:FrameMgr.c **** UIMgr_txBuffer("\r\n",2); |
544:FrameMgr.c **** |
545:FrameMgr.c **** memset(asciiBuffer,0x00,5); |
546:FrameMgr.c **** itoa(numCurrTrackedObjects,asciiBuffer,10); |
547:FrameMgr.c **** UIMgr_txBuffer(asciiBuffer,3); |
548:FrameMgr.c **** UIMgr_txBuffer(" PFC\r\n",5); |
549:FrameMgr.c **** |
550:FrameMgr.c **** #else |
551:FrameMgr.c **** /* we only send tracking packets if there are tracked objects */ |
552:FrameMgr.c **** |
553:FrameMgr.c **** if (numCurrTrackedObjects > 0) |
108 .stabn 68,0,553,.LM2-FrameMgr_processFrame |
109 .LM2: |
110 0016 8091 0000 lds r24,numCurrTrackedObjects |
111 001a 8823 tst r24 |
112 001c 09F4 brne .+2 |
113 001e 3FC0 rjmp .L2 |
114 .stabn 68,0,523,.LM3-FrameMgr_processFrame |
115 .LM3: |
116 0020 E901 movw r28,r18 |
554:FrameMgr.c **** { |
555:FrameMgr.c **** UIMgr_writeTxFifo(0x0A); /* header byte for a tracking packet */ |
117 .stabn 68,0,555,.LM4-FrameMgr_processFrame |
118 .LM4: |
119 0022 8AE0 ldi r24,lo8(10) |
120 0024 00D0 rcall UIMgr_writeTxFifo |
556:FrameMgr.c **** /* reset the pointer */ |
557:FrameMgr.c **** pTableData = (unsigned char *)pCurrentTrackedObjectTable; |
558:FrameMgr.c **** |
559:FrameMgr.c **** UIMgr_writeTxFifo(numCurrTrackedObjects); /* num of objects tracked */ |
121 .stabn 68,0,559,.LM5-FrameMgr_processFrame |
122 .LM5: |
123 0026 8091 0000 lds r24,numCurrTrackedObjects |
124 002a 00D0 rcall UIMgr_writeTxFifo |
125 002c DD24 clr r13 |
GAS LISTING /tmp/ccQRbLT3.s page 13 |
126 .L4: |
560:FrameMgr.c **** for (i=0; i<MAX_TRACKED_OBJECTS; i++) |
561:FrameMgr.c **** { |
562:FrameMgr.c **** /* we only want to process objects that have their objectValid flag |
563:FrameMgr.c **** set to TRUE */ |
564:FrameMgr.c **** if ( *(pTableData + VALID_OBJECT_OFFSET) == TRUE) |
127 .stabn 68,0,564,.LM6-FrameMgr_processFrame |
128 .LM6: |
129 002e 8F81 ldd r24,Y+7 |
130 0030 8130 cpi r24,lo8(1) |
131 0032 69F5 brne .L5 |
565:FrameMgr.c **** { |
566:FrameMgr.c **** /* the object is valid...convert the color from bit position to value...remember, |
567:FrameMgr.c **** each bit in the "color" byte corresponds to a color */ |
568:FrameMgr.c **** k=0; |
569:FrameMgr.c **** color = *(pTableData + COLOR_OFFSET); |
132 .stabn 68,0,569,.LM7-FrameMgr_processFrame |
133 .LM7: |
134 0034 8881 ld r24,Y |
570:FrameMgr.c **** if (color == 128) k=0; |
135 .stabn 68,0,570,.LM8-FrameMgr_processFrame |
136 .LM8: |
137 0036 8038 cpi r24,lo8(-128) |
138 0038 E1F0 breq .L7 |
571:FrameMgr.c **** else if (color == 64) k=1; |
139 .stabn 68,0,571,.LM9-FrameMgr_processFrame |
140 .LM9: |
141 003a 8034 cpi r24,lo8(64) |
142 003c 11F4 brne .L9 |
143 003e 81E0 ldi r24,lo8(1) |
144 0040 19C0 rjmp .L11 |
145 .L9: |
572:FrameMgr.c **** else if (color == 32) k=2; |
146 .stabn 68,0,572,.LM10-FrameMgr_processFrame |
147 .LM10: |
148 0042 8032 cpi r24,lo8(32) |
149 0044 11F4 brne .L12 |
150 0046 82E0 ldi r24,lo8(2) |
151 0048 15C0 rjmp .L11 |
152 .L12: |
573:FrameMgr.c **** else if (color == 16) k=3; |
153 .stabn 68,0,573,.LM11-FrameMgr_processFrame |
154 .LM11: |
155 004a 8031 cpi r24,lo8(16) |
156 004c 11F4 brne .L14 |
157 004e 83E0 ldi r24,lo8(3) |
158 0050 11C0 rjmp .L11 |
159 .L14: |
574:FrameMgr.c **** else if (color == 8) k=4; |
160 .stabn 68,0,574,.LM12-FrameMgr_processFrame |
161 .LM12: |
162 0052 8830 cpi r24,lo8(8) |
163 0054 11F4 brne .L16 |
164 0056 84E0 ldi r24,lo8(4) |
165 0058 0DC0 rjmp .L11 |
166 .L16: |
575:FrameMgr.c **** else if (color == 4) k=5; |
GAS LISTING /tmp/ccQRbLT3.s page 14 |
167 .stabn 68,0,575,.LM13-FrameMgr_processFrame |
168 .LM13: |
169 005a 8430 cpi r24,lo8(4) |
170 005c 11F4 brne .L18 |
171 005e 85E0 ldi r24,lo8(5) |
172 0060 09C0 rjmp .L11 |
173 .L18: |
576:FrameMgr.c **** else if (color == 2) k=6; |
174 .stabn 68,0,576,.LM14-FrameMgr_processFrame |
175 .LM14: |
176 0062 8230 cpi r24,lo8(2) |
177 0064 11F4 brne .L20 |
178 0066 86E0 ldi r24,lo8(6) |
179 0068 05C0 rjmp .L11 |
180 .L20: |
577:FrameMgr.c **** else if (color == 1) k=7; |
181 .stabn 68,0,577,.LM15-FrameMgr_processFrame |
182 .LM15: |
183 006a 8130 cpi r24,lo8(1) |
184 006c 11F4 brne .L7 |
185 006e 87E0 ldi r24,lo8(7) |
186 0070 01C0 rjmp .L11 |
187 .L7: |
188 0072 80E0 ldi r24,lo8(0) |
189 .L11: |
578:FrameMgr.c **** |
579:FrameMgr.c **** tmpUpperLeftX = *(pTableData + X_UPPER_LEFT_OFFSET); /* get the upper left X */ |
190 .stabn 68,0,579,.LM16-FrameMgr_processFrame |
191 .LM16: |
192 0074 1B81 ldd r17,Y+3 |
580:FrameMgr.c **** tmpUpperLeftY = *(pTableData + Y_UPPER_LEFT_OFFSET); /* get the upper left Y */ |
193 .stabn 68,0,580,.LM17-FrameMgr_processFrame |
194 .LM17: |
195 0076 0C81 ldd r16,Y+4 |
581:FrameMgr.c **** tmpLowerRightX = *(pTableData + X_LOWER_RIGHT_OFFSET); /* get the lower right X */ |
196 .stabn 68,0,581,.LM18-FrameMgr_processFrame |
197 .LM18: |
198 0078 FD80 ldd r15,Y+5 |
582:FrameMgr.c **** tmpLowerRightY = *(pTableData + Y_LOWER_RIGHT_OFFSET); /* get the lower right Y */ |
199 .stabn 68,0,582,.LM19-FrameMgr_processFrame |
200 .LM19: |
201 007a EE80 ldd r14,Y+6 |
583:FrameMgr.c **** |
584:FrameMgr.c **** UIMgr_writeTxFifo(k); /* send the color first */ |
202 .stabn 68,0,584,.LM20-FrameMgr_processFrame |
203 .LM20: |
204 007c 00D0 rcall UIMgr_writeTxFifo |
585:FrameMgr.c **** UIMgr_writeTxFifo(tmpUpperLeftX); |
205 .stabn 68,0,585,.LM21-FrameMgr_processFrame |
206 .LM21: |
207 007e 812F mov r24,r17 |
208 0080 00D0 rcall UIMgr_writeTxFifo |
586:FrameMgr.c **** UIMgr_writeTxFifo(tmpUpperLeftY); |
209 .stabn 68,0,586,.LM22-FrameMgr_processFrame |
210 .LM22: |
211 0082 802F mov r24,r16 |
212 0084 00D0 rcall UIMgr_writeTxFifo |
GAS LISTING /tmp/ccQRbLT3.s page 15 |
587:FrameMgr.c **** UIMgr_writeTxFifo(tmpLowerRightX); |
213 .stabn 68,0,587,.LM23-FrameMgr_processFrame |
214 .LM23: |
215 0086 8F2D mov r24,r15 |
216 0088 00D0 rcall UIMgr_writeTxFifo |
588:FrameMgr.c **** UIMgr_writeTxFifo(tmpLowerRightY); |
217 .stabn 68,0,588,.LM24-FrameMgr_processFrame |
218 .LM24: |
219 008a 8E2D mov r24,r14 |
220 008c 00D0 rcall UIMgr_writeTxFifo |
221 .L5: |
222 .stabn 68,0,560,.LM25-FrameMgr_processFrame |
223 .LM25: |
224 008e D394 inc r13 |
225 0090 88E0 ldi r24,lo8(8) |
226 0092 D816 cp r13,r24 |
227 0094 11F0 breq .L23 |
589:FrameMgr.c **** } |
590:FrameMgr.c **** |
591:FrameMgr.c **** /* move our pointer up to the beginning of the next object */ |
592:FrameMgr.c **** pTableData += SIZE_OF_TRACKED_OBJECT; |
228 .stabn 68,0,592,.LM26-FrameMgr_processFrame |
229 .LM26: |
230 0096 2896 adiw r28,8 |
231 0098 CACF rjmp .L4 |
232 .L23: |
593:FrameMgr.c **** } |
594:FrameMgr.c **** |
595:FrameMgr.c **** /* all done...send the end of tracking packets char */ |
596:FrameMgr.c **** UIMgr_writeTxFifo(0xFF); |
233 .stabn 68,0,596,.LM27-FrameMgr_processFrame |
234 .LM27: |
235 009a 8FEF ldi r24,lo8(-1) |
236 009c 00D0 rcall UIMgr_writeTxFifo |
237 .L2: |
597:FrameMgr.c **** } |
598:FrameMgr.c **** #endif |
599:FrameMgr.c **** |
600:FrameMgr.c **** /* the tracked object table will be cleared out right before we start |
601:FrameMgr.c **** to wait for VSYNC to indicate a new frame...so it doesn't need to be |
602:FrameMgr.c **** done now */ |
603:FrameMgr.c **** |
604:FrameMgr.c **** /* schedule the next action to acquire a new frame */ |
605:FrameMgr.c **** PUBLISH_EVENT(EV_PROCESS_FRAME_COMPLETE); |
238 .stabn 68,0,605,.LM28-FrameMgr_processFrame |
239 .LM28: |
240 009e 84E0 ldi r24,lo8(4) |
241 00a0 00D0 rcall Exec_writeEventFifo |
242 /* epilogue: frame size=0 */ |
243 00a2 DF91 pop r29 |
244 00a4 CF91 pop r28 |
245 00a6 1F91 pop r17 |
246 00a8 0F91 pop r16 |
247 00aa FF90 pop r15 |
248 00ac EF90 pop r14 |
249 00ae DF90 pop r13 |
250 00b0 0895 ret |
GAS LISTING /tmp/ccQRbLT3.s page 16 |
251 /* epilogue end (size=8) */ |
252 /* function FrameMgr_processFrame size 88 (73) */ |
253 .size FrameMgr_processFrame, .-FrameMgr_processFrame |
254 .stabs "i:r(0,11)",64,0,518,13 |
255 .stabs "k:r(0,11)",64,0,518,24 |
256 .stabs "color:r(0,11)",64,0,518,24 |
257 .stabs "pTableData:r(0,22)=*(0,11)",64,0,523,28 |
258 .stabs "tmpUpperLeftX:r(0,11)",64,0,524,17 |
259 .stabs "tmpUpperLeftY:r(0,11)",64,0,524,16 |
260 .stabs "tmpLowerRightX:r(0,11)",64,0,524,15 |
261 .stabs "tmpLowerRightY:r(0,11)",64,0,524,14 |
262 .stabn 192,0,0,FrameMgr_processFrame-FrameMgr_processFrame |
263 .stabn 224,0,0,.Lscope0-FrameMgr_processFrame |
264 .Lscope0: |
265 .stabs "",36,0,0,.Lscope0-FrameMgr_processFrame |
266 .stabd 78,0,0 |
267 .stabs "FrameMgr_processLine:F(0,15)",36,0,342,FrameMgr_processLine |
268 .global FrameMgr_processLine |
269 .type FrameMgr_processLine, @function |
270 FrameMgr_processLine: |
271 .stabd 46,0,0 |
272 .stabn 68,0,342,.LM29-FrameMgr_processLine |
273 .LM29: |
274 /* prologue: frame size=1 */ |
275 00b2 2F92 push r2 |
276 00b4 3F92 push r3 |
277 00b6 4F92 push r4 |
278 00b8 5F92 push r5 |
279 00ba 6F92 push r6 |
280 00bc 7F92 push r7 |
281 00be 8F92 push r8 |
282 00c0 9F92 push r9 |
283 00c2 AF92 push r10 |
284 00c4 BF92 push r11 |
285 00c6 CF92 push r12 |
286 00c8 DF92 push r13 |
287 00ca EF92 push r14 |
288 00cc FF92 push r15 |
289 00ce 0F93 push r16 |
290 00d0 1F93 push r17 |
291 00d2 CF93 push r28 |
292 00d4 DF93 push r29 |
293 00d6 CDB7 in r28,__SP_L__ |
294 00d8 DEB7 in r29,__SP_H__ |
295 00da 2197 sbiw r28,1 |
296 00dc 0FB6 in __tmp_reg__,__SREG__ |
297 00de F894 cli |
298 00e0 DEBF out __SP_H__,r29 |
299 00e2 0FBE out __SREG__,__tmp_reg__ |
300 00e4 CDBF out __SP_L__,r28 |
301 /* prologue end (size=26) */ |
302 .stabn 68,0,345,.LM30-FrameMgr_processLine |
303 .LM30: |
304 00e6 0091 0000 lds r16,pCurrentTrackedObjectTable |
305 00ea 1091 0000 lds r17,(pCurrentTrackedObjectTable)+1 |
306 .stabn 68,0,352,.LM31-FrameMgr_processLine |
307 .LM31: |
GAS LISTING /tmp/ccQRbLT3.s page 17 |
308 00ee 8091 0000 lds r24,currentState |
309 00f2 8230 cpi r24,lo8(2) |
310 00f4 09F0 breq .+2 |
311 00f6 6AC0 rjmp .L27 |
312 .stabn 68,0,361,.LM32-FrameMgr_processLine |
313 .LM32: |
314 00f8 8BE0 ldi r24,lo8(11) |
315 00fa 00D0 rcall UartInt_txByte |
316 .stabn 68,0,362,.LM33-FrameMgr_processLine |
317 .LM33: |
318 00fc 8091 0000 lds r24,lineCount |
319 0100 00D0 rcall UartInt_txByte |
320 0102 0F2E mov __tmp_reg__,r31 |
321 0104 F0E0 ldi r31,lo8(currentLineBuffer) |
322 0106 CF2E mov r12,r31 |
323 0108 F0E0 ldi r31,hi8(currentLineBuffer) |
324 010a DF2E mov r13,r31 |
325 010c F02D mov r31,__tmp_reg__ |
326 010e 00E0 ldi r16,lo8(0) |
327 0110 10E0 ldi r17,hi8(0) |
328 0112 0F2E mov __tmp_reg__,r31 |
329 0114 F0E0 ldi r31,lo8(previousLineBuffer) |
330 0116 EF2E mov r14,r31 |
331 0118 F0E0 ldi r31,hi8(previousLineBuffer) |
332 011a FF2E mov r15,r31 |
333 011c F02D mov r31,__tmp_reg__ |
334 .L29: |
335 .stabn 68,0,370,.LM34-FrameMgr_processLine |
336 .LM34: |
337 011e F601 movw r30,r12 |
338 0120 8081 ld r24,Z |
339 0122 8983 std Y+1,r24 |
340 .stabn 68,0,371,.LM35-FrameMgr_processLine |
341 .LM35: |
342 0124 8981 ldd r24,Y+1 |
343 0126 8F70 andi r24,lo8(15) |
344 0128 8983 std Y+1,r24 |
345 .stabn 68,0,372,.LM36-FrameMgr_processLine |
346 .LM36: |
347 012a 8981 ldd r24,Y+1 |
348 012c 8295 swap r24 |
349 012e 807F andi r24,0xf0 |
350 0130 8983 std Y+1,r24 |
351 .stabn 68,0,373,.LM37-FrameMgr_processLine |
352 .LM37: |
353 0132 9981 ldd r25,Y+1 |
354 0134 F701 movw r30,r14 |
355 0136 8081 ld r24,Z |
356 0138 8F70 andi r24,lo8(15) |
357 013a 892B or r24,r25 |
358 013c 8983 std Y+1,r24 |
359 .stabn 68,0,376,.LM38-FrameMgr_processLine |
360 .LM38: |
361 013e 8981 ldd r24,Y+1 |
362 0140 00D0 rcall UartInt_txByte |
363 .stabn 68,0,379,.LM39-FrameMgr_processLine |
364 .LM39: |
GAS LISTING /tmp/ccQRbLT3.s page 18 |
365 0142 D801 movw r26,r16 |
366 0144 1196 adiw r26,1 |
367 0146 FD01 movw r30,r26 |
368 0148 E050 subi r30,lo8(-(previousLineBuffer)) |
369 014a F040 sbci r31,hi8(-(previousLineBuffer)) |
370 014c 8081 ld r24,Z |
371 014e 8983 std Y+1,r24 |
372 .stabn 68,0,380,.LM40-FrameMgr_processLine |
373 .LM40: |
374 0150 8981 ldd r24,Y+1 |
375 0152 8F70 andi r24,lo8(15) |
376 0154 8983 std Y+1,r24 |
377 .stabn 68,0,381,.LM41-FrameMgr_processLine |
378 .LM41: |
379 0156 8981 ldd r24,Y+1 |
380 0158 8295 swap r24 |
381 015a 807F andi r24,0xf0 |
382 015c 8983 std Y+1,r24 |
383 .stabn 68,0,382,.LM42-FrameMgr_processLine |
384 .LM42: |
385 015e 9981 ldd r25,Y+1 |
386 0160 A050 subi r26,lo8(-(currentLineBuffer)) |
387 0162 B040 sbci r27,hi8(-(currentLineBuffer)) |
388 0164 8C91 ld r24,X |
389 0166 8F70 andi r24,lo8(15) |
390 0168 892B or r24,r25 |
391 016a 8983 std Y+1,r24 |
392 .stabn 68,0,385,.LM43-FrameMgr_processLine |
393 .LM43: |
394 016c 8981 ldd r24,Y+1 |
395 016e 00D0 rcall UartInt_txByte |
396 0170 82E0 ldi r24,lo8(2) |
397 0172 90E0 ldi r25,hi8(2) |
398 0174 C80E add r12,r24 |
399 0176 D91E adc r13,r25 |
400 0178 0E5F subi r16,lo8(-(2)) |
401 017a 1F4F sbci r17,hi8(-(2)) |
402 017c E80E add r14,r24 |
403 017e F91E adc r15,r25 |
404 .stabn 68,0,363,.LM44-FrameMgr_processLine |
405 .LM44: |
406 0180 003B cpi r16,176 |
407 0182 1105 cpc r17,__zero_reg__ |
408 0184 61F6 brne .L29 |
409 .stabn 68,0,387,.LM45-FrameMgr_processLine |
410 .LM45: |
411 0186 8FE0 ldi r24,lo8(15) |
412 0188 00D0 rcall UartInt_txByte |
413 .stabn 68,0,391,.LM46-FrameMgr_processLine |
414 .LM46: |
415 018a 8091 0000 lds r24,lineCount |
416 018e 8F5F subi r24,lo8(-(1)) |
417 0190 8093 0000 sts lineCount,r24 |
418 .stabn 68,0,394,.LM47-FrameMgr_processLine |
419 .LM47: |
420 0194 8834 cpi r24,lo8(72) |
421 0196 60F0 brlo .L31 |
GAS LISTING /tmp/ccQRbLT3.s page 19 |
422 .stabn 68,0,398,.LM48-FrameMgr_processLine |
423 .LM48: |
424 0198 1092 0000 sts lineCount,__zero_reg__ |
425 .stabn 68,0,399,.LM49-FrameMgr_processLine |
426 .LM49: |
427 019c 1092 0000 sts currentState,__zero_reg__ |
428 .stabn 68,0,402,.LM50-FrameMgr_processLine |
429 .LM50: |
430 01a0 89B7 in r24,89-0x20 |
431 01a2 8B7F andi r24,lo8(-5) |
432 01a4 89BF out 89-0x20,r24 |
433 .stabn 68,0,404,.LM51-FrameMgr_processLine |
434 .LM51: |
435 01a6 60E0 ldi r22,lo8(0) |
436 01a8 81E1 ldi r24,lo8(17) |
437 01aa 00D0 rcall CamConfig_setCamReg |
438 .stabn 68,0,405,.LM52-FrameMgr_processLine |
439 .LM52: |
440 01ac 00D0 rcall CamConfig_sendFifoCmds |
441 01ae C8C0 rjmp .L71 |
442 .L31: |
443 .stabn 68,0,410,.LM53-FrameMgr_processLine |
444 .LM53: |
445 01b0 8091 0000 lds r24,fastEventBitmask |
446 01b4 8260 ori r24,lo8(2) |
447 01b6 8093 0000 sts fastEventBitmask,r24 |
448 01ba C2C0 rjmp .L71 |
449 .L72: |
450 .stabn 68,0,491,.LM54-FrameMgr_processLine |
451 .LM54: |
452 01bc 80E2 ldi r24,lo8(32) |
453 01be 00D0 rcall Exec_writeEventFifo |
454 .stabn 68,0,493,.LM55-FrameMgr_processLine |
455 .LM55: |
456 01c0 89B7 in r24,89-0x20 |
457 01c2 8B7F andi r24,lo8(-5) |
458 01c4 89BF out 89-0x20,r24 |
459 .stabn 68,0,494,.LM56-FrameMgr_processLine |
460 .LM56: |
461 01c6 1092 0000 sts trackedLineCount,__zero_reg__ |
462 01ca BAC0 rjmp .L71 |
463 .L27: |
464 .stabn 68,0,413,.LM57-FrameMgr_processLine |
465 .LM57: |
466 01cc 8130 cpi r24,lo8(1) |
467 01ce 09F0 breq .+2 |
468 01d0 B7C0 rjmp .L71 |
469 .LBB4: |
470 .LBB5: |
606:FrameMgr.c **** } |
607:FrameMgr.c **** |
608:FrameMgr.c **** /*********************************************************** |
609:FrameMgr.c **** Function Name: FrameMgr_findConnectedness |
610:FrameMgr.c **** Function Description: This function is responsible for |
611:FrameMgr.c **** finding the connectedness between two particular run- |
612:FrameMgr.c **** length encoded lines of pixel data. It updates the |
613:FrameMgr.c **** trackingTable as needed. |
GAS LISTING /tmp/ccQRbLT3.s page 20 |
614:FrameMgr.c **** Inputs: none |
615:FrameMgr.c **** Outputs: none |
616:FrameMgr.c **** ***********************************************************/ |
617:FrameMgr.c **** static void FrameMgr_findConnectedness(void) |
618:FrameMgr.c **** { |
619:FrameMgr.c **** trackedColor_t currColor; |
620:FrameMgr.c **** unsigned char *pCurrLineColorInfo = currentLineBuffer; |
621:FrameMgr.c **** unsigned char *pTrackedObjectData; |
622:FrameMgr.c **** register unsigned char currPixelRunStart=0; |
623:FrameMgr.c **** register unsigned char currPixelRunFinish=0; |
624:FrameMgr.c **** register unsigned char lastLineXStart=0; |
625:FrameMgr.c **** register unsigned char lastLineXFinish=0; |
626:FrameMgr.c **** register unsigned char runLength=1; |
627:FrameMgr.c **** unsigned char i; |
628:FrameMgr.c **** bool_t colorConnected; |
629:FrameMgr.c **** |
630:FrameMgr.c **** do |
631:FrameMgr.c **** { |
632:FrameMgr.c **** /* grab both the current color and the number of pixels |
633:FrameMgr.c **** in the run...remember, pixels start at 1, not 0! */ |
634:FrameMgr.c **** colorConnected = FALSE; |
635:FrameMgr.c **** currColor = *pCurrLineColorInfo++; |
636:FrameMgr.c **** currPixelRunStart += runLength; |
637:FrameMgr.c **** runLength = *pCurrLineColorInfo++; |
638:FrameMgr.c **** currPixelRunFinish += runLength; |
639:FrameMgr.c **** |
640:FrameMgr.c **** /* make sure that the run-length is at least as wide as |
641:FrameMgr.c **** the minimum horizontal tracking width, and we care about the color */ |
642:FrameMgr.c **** |
643:FrameMgr.c **** if ( (currColor != notTracked) && (runLength > MIN_OBJECT_TRACKING_WIDTH) ) |
644:FrameMgr.c **** { |
645:FrameMgr.c **** /* this run contains a color we care about, so |
646:FrameMgr.c **** either it will begin a new tracked object, or it |
647:FrameMgr.c **** is connected to a currently tracked object... |
648:FrameMgr.c **** compare it with each object in the tracking |
649:FrameMgr.c **** table...we can't just look at the numTrackedObjects because |
650:FrameMgr.c **** it is entirely possible that the first couple of objects could |
651:FrameMgr.c **** be invalid... |
652:FrameMgr.c **** |
653:FrameMgr.c **** NOTE: Instead of accessing each element in the trackedObjectTable |
654:FrameMgr.c **** through the 'i' index, and then accessing the fields in each structure, |
655:FrameMgr.c **** a pointer to each entry is established each time through the loop, followed |
656:FrameMgr.c **** by accessing the elements through specified offsets. GCC seems to be |
657:FrameMgr.c **** able to optimize this code much better than simply accessing the elements |
658:FrameMgr.c **** of each structure in the array the more normal way...*/ |
659:FrameMgr.c **** |
660:FrameMgr.c **** pTrackedObjectData = (unsigned char *)pCurrentTrackedObjectTable; |
661:FrameMgr.c **** for (i=0; i<MAX_TRACKED_OBJECTS; i++) |
662:FrameMgr.c **** { |
663:FrameMgr.c **** if ( (currColor == *(pTrackedObjectData + COLOR_OFFSET)) && |
664:FrameMgr.c **** (*(pTrackedObjectData + VALID_OBJECT_OFFSET) == TRUE) && |
665:FrameMgr.c **** (*(pTrackedObjectData + Y_LOWER_RIGHT_OFFSET) == trackedLineCount - 1) ) |
666:FrameMgr.c **** { |
667:FrameMgr.c **** /* found a color match and the object is valid...check to see if there is |
668:FrameMgr.c **** connectedness */ |
669:FrameMgr.c **** lastLineXStart = *(pTrackedObjectData + LAST_LINE_X_START_OFFSET); |
670:FrameMgr.c **** lastLineXFinish = *(pTrackedObjectData + LAST_LINE_X_FINISH_OFFSET); |
GAS LISTING /tmp/ccQRbLT3.s page 21 |
671:FrameMgr.c **** |
672:FrameMgr.c **** /* Check for the 5 following types of line connectedness: |
673:FrameMgr.c **** --------------------- |
674:FrameMgr.c **** | | |
675:FrameMgr.c **** --------------------- |
676:FrameMgr.c **** ------------------------- |
677:FrameMgr.c **** | | |
678:FrameMgr.c **** ------------------------- */ |
679:FrameMgr.c **** if ( ( (currPixelRunStart >= lastLineXStart) && |
680:FrameMgr.c **** (currPixelRunStart <= lastLineXFinish) ) || |
681:FrameMgr.c **** |
682:FrameMgr.c **** /* --------------------- |
683:FrameMgr.c **** | | |
684:FrameMgr.c **** --------------------- |
685:FrameMgr.c **** ------------------- |
686:FrameMgr.c **** | | |
687:FrameMgr.c **** ------------------- |
688:FrameMgr.c **** OR |
689:FrameMgr.c **** ------------------------------ |
690:FrameMgr.c **** | | |
691:FrameMgr.c **** ------------------------------ |
692:FrameMgr.c **** --------- |
693:FrameMgr.c **** | | |
694:FrameMgr.c **** --------- */ |
695:FrameMgr.c **** ( (currPixelRunFinish >= lastLineXStart) && |
696:FrameMgr.c **** (currPixelRunFinish <= lastLineXFinish) ) || |
697:FrameMgr.c **** |
698:FrameMgr.c **** |
699:FrameMgr.c **** /* ------------------------------- |
700:FrameMgr.c **** | | |
701:FrameMgr.c **** ------------------------------- |
702:FrameMgr.c **** ------------------------------- |
703:FrameMgr.c **** | | |
704:FrameMgr.c **** ------------------------------- |
705:FrameMgr.c **** OR |
706:FrameMgr.c **** ------------- |
707:FrameMgr.c **** | | |
708:FrameMgr.c **** ------------- |
709:FrameMgr.c **** ------------------------------- |
710:FrameMgr.c **** | | |
711:FrameMgr.c **** ------------------------------- */ |
712:FrameMgr.c **** ( (currPixelRunStart <= lastLineXStart) && |
713:FrameMgr.c **** (currPixelRunFinish >= lastLineXFinish) ) ) |
714:FrameMgr.c **** { |
715:FrameMgr.c **** /* THERE IS CONNECTEDNESS...update the lastLineXStart and lastLineXFinish |
716:FrameMgr.c **** data pointed to by pTrackedObjectData */ |
717:FrameMgr.c **** *(pTrackedObjectData + LAST_LINE_X_START_OFFSET) = currPixelRunStart; |
718:FrameMgr.c **** *(pTrackedObjectData + LAST_LINE_X_FINISH_OFFSET) = currPixelRunFinish; |
719:FrameMgr.c **** |
720:FrameMgr.c **** /* check if the bounding box needs to be updated */ |
721:FrameMgr.c **** if (*(pTrackedObjectData + X_UPPER_LEFT_OFFSET) > currPixelRunStart) |
722:FrameMgr.c **** { |
723:FrameMgr.c **** /* need to update the bounding box for the upper left point to |
724:FrameMgr.c **** enclose this new left-most point...we never have to update the |
725:FrameMgr.c **** upper left Y point, since each scan line we process moves from |
726:FrameMgr.c **** top to bottom */ |
727:FrameMgr.c **** *(pTrackedObjectData + X_UPPER_LEFT_OFFSET) = currPixelRunStart; |
GAS LISTING /tmp/ccQRbLT3.s page 22 |
728:FrameMgr.c **** } |
729:FrameMgr.c **** |
730:FrameMgr.c **** if ( *(pTrackedObjectData + X_LOWER_RIGHT_OFFSET) < currPixelRunFinish) |
731:FrameMgr.c **** { |
732:FrameMgr.c **** /* need to update the bounding box for the lower right X point to |
733:FrameMgr.c **** enclose this new right-most point */ |
734:FrameMgr.c **** *(pTrackedObjectData + X_LOWER_RIGHT_OFFSET) = currPixelRunFinish; |
735:FrameMgr.c **** } |
736:FrameMgr.c **** |
737:FrameMgr.c **** /* the lower right 'y' point always gets updated when connectedness is found */ |
738:FrameMgr.c **** *(pTrackedObjectData + Y_LOWER_RIGHT_OFFSET) = trackedLineCount; |
739:FrameMgr.c **** |
740:FrameMgr.c **** /* set a flag indicating that that color run is part of another |
741:FrameMgr.c **** object and thus doesn't need to be added as a new entry into the |
742:FrameMgr.c **** tracking table */ |
743:FrameMgr.c **** colorConnected = TRUE; |
744:FrameMgr.c **** break; |
745:FrameMgr.c **** } |
746:FrameMgr.c **** } |
747:FrameMgr.c **** |
748:FrameMgr.c **** /* go to the next object */ |
749:FrameMgr.c **** pTrackedObjectData += SIZE_OF_TRACKED_OBJECT; |
750:FrameMgr.c **** } |
751:FrameMgr.c **** |
752:FrameMgr.c **** if (colorConnected == FALSE) |
753:FrameMgr.c **** { |
754:FrameMgr.c **** /* a new entry needs to be made to the tracking table, since we have |
755:FrameMgr.c **** a run-length with a color, and it isn't connected to anything...but we |
756:FrameMgr.c **** can only do this if there is space left in the trackedObject table */ |
757:FrameMgr.c **** if (numCurrTrackedObjects < MAX_TRACKED_OBJECTS) |
758:FrameMgr.c **** { |
759:FrameMgr.c **** /* space is available...add the object...but first we need to find an |
760:FrameMgr.c **** invalid object in the object tracking table */ |
761:FrameMgr.c **** pTrackedObjectData = (unsigned char *)pCurrentTrackedObjectTable; |
762:FrameMgr.c **** for (i=0; i<MAX_TRACKED_OBJECTS; i++) |
763:FrameMgr.c **** { |
764:FrameMgr.c **** if ( *(pTrackedObjectData + VALID_OBJECT_OFFSET) == FALSE) break; |
765:FrameMgr.c **** |
766:FrameMgr.c **** /* if we haven't broken above, then the object must have been valid... |
767:FrameMgr.c **** go ahead and move the pointer to the next object to check it */ |
768:FrameMgr.c **** pTrackedObjectData += SIZE_OF_TRACKED_OBJECT; |
769:FrameMgr.c **** } |
770:FrameMgr.c **** |
771:FrameMgr.c **** |
772:FrameMgr.c **** /* now that we have a pointer to the tracked object to be updated, update all |
773:FrameMgr.c **** the fields */ |
774:FrameMgr.c **** *(pTrackedObjectData + COLOR_OFFSET) = currColor; /* color */ |
775:FrameMgr.c **** *(pTrackedObjectData + LAST_LINE_X_START_OFFSET) = currPixelRunStart; /* lastLineXStart */ |
776:FrameMgr.c **** *(pTrackedObjectData + LAST_LINE_X_FINISH_OFFSET) = currPixelRunFinish; /* lastLineXFinish * |
777:FrameMgr.c **** *(pTrackedObjectData + X_UPPER_LEFT_OFFSET) = currPixelRunStart; /* x_upperLeft */ |
778:FrameMgr.c **** *(pTrackedObjectData + Y_UPPER_LEFT_OFFSET) = trackedLineCount; /* y_upperLeft */ |
471 .stabn 68,0,778,.LM58-FrameMgr_processLine |
472 .LM58: |
473 01d2 F090 0000 lds r15,trackedLineCount |
474 .stabn 68,0,663,.LM59-FrameMgr_processLine |
475 .LM59: |
476 01d6 CF2C mov r12,r15 |
GAS LISTING /tmp/ccQRbLT3.s page 23 |
477 01d8 DD24 clr r13 |
478 01da 3601 movw r6,r12 |
479 01dc 0894 sec |
480 01de 6108 sbc r6,__zero_reg__ |
481 01e0 7108 sbc r7,__zero_reg__ |
482 01e2 7091 0000 lds r23,numCurrTrackedObjects |
483 01e6 0F2E mov __tmp_reg__,r31 |
484 01e8 F0E0 ldi r31,lo8(currentLineBuffer) |
485 01ea 2F2E mov r2,r31 |
486 01ec F0E0 ldi r31,hi8(currentLineBuffer) |
487 01ee 3F2E mov r3,r31 |
488 01f0 F02D mov r31,__tmp_reg__ |
489 01f2 50E0 ldi r21,lo8(0) |
490 01f4 40E0 ldi r20,lo8(0) |
491 01f6 61E0 ldi r22,lo8(1) |
492 01f8 EF2C mov r14,r15 |
493 01fa E394 inc r14 |
494 .L35: |
495 .stabn 68,0,635,.LM60-FrameMgr_processLine |
496 .LM60: |
497 01fc F101 movw r30,r2 |
498 01fe 3081 ld r19,Z |
499 .stabn 68,0,636,.LM61-FrameMgr_processLine |
500 .LM61: |
501 0200 560F add r21,r22 |
502 .stabn 68,0,637,.LM62-FrameMgr_processLine |
503 .LM62: |
504 0202 6181 ldd r22,Z+1 |
505 0204 82E0 ldi r24,lo8(2) |
506 0206 90E0 ldi r25,hi8(2) |
507 0208 280E add r2,r24 |
508 020a 391E adc r3,r25 |
509 .stabn 68,0,638,.LM63-FrameMgr_processLine |
510 .LM63: |
511 020c 460F add r20,r22 |
512 .stabn 68,0,643,.LM64-FrameMgr_processLine |
513 .LM64: |
514 020e 3323 tst r19 |
515 0210 09F4 brne .+2 |
516 0212 5CC0 rjmp .L36 |
517 0214 6430 cpi r22,lo8(4) |
518 0216 08F4 brsh .+2 |
519 0218 59C0 rjmp .L36 |
520 021a D801 movw r26,r16 |
521 021c 20E0 ldi r18,lo8(0) |
522 .L39: |
523 .stabn 68,0,663,.LM65-FrameMgr_processLine |
524 .LM65: |
525 021e 8C91 ld r24,X |
526 0220 3817 cp r19,r24 |
527 0222 C9F5 brne .L40 |
528 0224 FD01 movw r30,r26 |
529 0226 8781 ldd r24,Z+7 |
530 0228 8130 cpi r24,lo8(1) |
531 022a A9F5 brne .L40 |
532 022c 0F2E mov __tmp_reg__,r31 |
533 022e F6E0 ldi r31,lo8(6) |
GAS LISTING /tmp/ccQRbLT3.s page 24 |
534 0230 AF2E mov r10,r31 |
535 0232 BB24 clr r11 |
536 0234 F02D mov r31,__tmp_reg__ |
537 0236 AA0E add r10,r26 |
538 0238 BB1E adc r11,r27 |
539 023a 8681 ldd r24,Z+6 |
540 023c 9927 clr r25 |
541 023e 8615 cp r24,r6 |
542 0240 9705 cpc r25,r7 |
543 0242 49F5 brne .L40 |
544 0244 2D01 movw r4,r26 |
545 0246 0894 sec |
546 0248 411C adc r4,__zero_reg__ |
547 024a 511C adc r5,__zero_reg__ |
548 .stabn 68,0,669,.LM66-FrameMgr_processLine |
549 .LM66: |
550 024c 8181 ldd r24,Z+1 |
551 024e 8824 clr r8 |
552 0250 9924 clr r9 |
553 0252 6894 set |
554 0254 81F8 bld r8,1 |
555 0256 8A0E add r8,r26 |
556 0258 9B1E adc r9,r27 |
557 .stabn 68,0,670,.LM67-FrameMgr_processLine |
558 .LM67: |
559 025a 9281 ldd r25,Z+2 |
560 .stabn 68,0,679,.LM68-FrameMgr_processLine |
561 .LM68: |
562 025c 5817 cp r21,r24 |
563 025e 10F0 brlo .L44 |
564 0260 9517 cp r25,r21 |
565 0262 40F4 brsh .L46 |
566 .L44: |
567 0264 4817 cp r20,r24 |
568 0266 10F0 brlo .L47 |
569 0268 9417 cp r25,r20 |
570 026a 20F4 brsh .L46 |
571 .L47: |
572 026c 8517 cp r24,r21 |
573 026e 98F0 brlo .L40 |
574 0270 4917 cp r20,r25 |
575 0272 88F0 brlo .L40 |
576 .L46: |
577 .stabn 68,0,717,.LM69-FrameMgr_processLine |
578 .LM69: |
579 0274 F201 movw r30,r4 |
580 0276 5083 st Z,r21 |
581 .stabn 68,0,718,.LM70-FrameMgr_processLine |
582 .LM70: |
583 0278 F401 movw r30,r8 |
584 027a 4083 st Z,r20 |
585 .stabn 68,0,721,.LM71-FrameMgr_processLine |
586 .LM71: |
587 027c FD01 movw r30,r26 |
588 027e 8381 ldd r24,Z+3 |
589 0280 5817 cp r21,r24 |
590 0282 08F4 brsh .L50 |
GAS LISTING /tmp/ccQRbLT3.s page 25 |
591 .stabn 68,0,727,.LM72-FrameMgr_processLine |
592 .LM72: |
593 0284 5383 std Z+3,r21 |
594 .L50: |
595 .stabn 68,0,730,.LM73-FrameMgr_processLine |
596 .LM73: |
597 0286 FD01 movw r30,r26 |
598 0288 8581 ldd r24,Z+5 |
599 028a 8417 cp r24,r20 |
600 028c 08F4 brsh .L52 |
601 .stabn 68,0,734,.LM74-FrameMgr_processLine |
602 .LM74: |
603 028e 4583 std Z+5,r20 |
604 .L52: |
605 .stabn 68,0,738,.LM75-FrameMgr_processLine |
606 .LM75: |
607 0290 F501 movw r30,r10 |
608 0292 F082 st Z,r15 |
609 0294 1BC0 rjmp .L36 |
610 .L40: |
611 .stabn 68,0,661,.LM76-FrameMgr_processLine |
612 .LM76: |
613 0296 2F5F subi r18,lo8(-(1)) |
614 0298 2830 cpi r18,lo8(8) |
615 029a 09F4 brne .+2 |
616 029c 4DC0 rjmp .L54 |
617 .stabn 68,0,749,.LM77-FrameMgr_processLine |
618 .LM77: |
619 029e 1896 adiw r26,8 |
620 02a0 BECF rjmp .L39 |
621 .L56: |
622 02a2 D801 movw r26,r16 |
623 02a4 90E0 ldi r25,lo8(0) |
624 .L57: |
625 .stabn 68,0,764,.LM78-FrameMgr_processLine |
626 .LM78: |
627 02a6 FD01 movw r30,r26 |
628 02a8 8781 ldd r24,Z+7 |
629 02aa 8823 tst r24 |
630 02ac 21F0 breq .L58 |
631 .stabn 68,0,768,.LM79-FrameMgr_processLine |
632 .LM79: |
633 02ae 1896 adiw r26,8 |
634 .stabn 68,0,762,.LM80-FrameMgr_processLine |
635 .LM80: |
636 02b0 9F5F subi r25,lo8(-(1)) |
637 02b2 9830 cpi r25,lo8(8) |
638 02b4 C1F7 brne .L57 |
639 .L58: |
640 .stabn 68,0,774,.LM81-FrameMgr_processLine |
641 .LM81: |
642 02b6 3C93 st X,r19 |
643 .stabn 68,0,775,.LM82-FrameMgr_processLine |
644 .LM82: |
645 02b8 FD01 movw r30,r26 |
646 02ba 5183 std Z+1,r21 |
647 .stabn 68,0,776,.LM83-FrameMgr_processLine |
GAS LISTING /tmp/ccQRbLT3.s page 26 |
648 .LM83: |
649 02bc 4283 std Z+2,r20 |
650 .stabn 68,0,777,.LM84-FrameMgr_processLine |
651 .LM84: |
652 02be 5383 std Z+3,r21 |
653 .stabn 68,0,778,.LM85-FrameMgr_processLine |
654 .LM85: |
655 02c0 F482 std Z+4,r15 |
779:FrameMgr.c **** *(pTrackedObjectData + X_LOWER_RIGHT_OFFSET) = currPixelRunFinish; /* x_lowerRight */ |
656 .stabn 68,0,779,.LM86-FrameMgr_processLine |
657 .LM86: |
658 02c2 4583 std Z+5,r20 |
780:FrameMgr.c **** *(pTrackedObjectData + Y_LOWER_RIGHT_OFFSET) = trackedLineCount; /* y_lowerRight */ |
659 .stabn 68,0,780,.LM87-FrameMgr_processLine |
660 .LM87: |
661 02c4 F682 std Z+6,r15 |
781:FrameMgr.c **** *(pTrackedObjectData + VALID_OBJECT_OFFSET) = TRUE; /* o |
662 .stabn 68,0,781,.LM88-FrameMgr_processLine |
663 .LM88: |
664 02c6 81E0 ldi r24,lo8(1) |
665 02c8 8783 std Z+7,r24 |
782:FrameMgr.c **** |
783:FrameMgr.c **** numCurrTrackedObjects++; |
666 .stabn 68,0,783,.LM89-FrameMgr_processLine |
667 .LM89: |
668 02ca 7F5F subi r23,lo8(-(1)) |
669 .L36: |
784:FrameMgr.c **** } |
785:FrameMgr.c **** } |
786:FrameMgr.c **** |
787:FrameMgr.c **** /* move the pointer to the beginning of the next tracked object */ |
788:FrameMgr.c **** pTrackedObjectData += SIZE_OF_TRACKED_OBJECT; |
789:FrameMgr.c **** } |
790:FrameMgr.c **** } while(currPixelRunFinish < ACTUAL_NUM_PIXELS_IN_A_LINE); |
670 .stabn 68,0,790,.LM90-FrameMgr_processLine |
671 .LM90: |
672 02cc 403B cpi r20,lo8(-80) |
673 02ce 08F4 brsh .+2 |
674 02d0 95CF rjmp .L35 |
675 02d2 7093 0000 sts numCurrTrackedObjects,r23 |
676 .LBE5: |
677 .LBE4: |
678 .stabn 68,0,460,.LM91-FrameMgr_processLine |
679 .LM91: |
680 02d6 C601 movw r24,r12 |
681 02d8 8770 andi r24,lo8(7) |
682 02da 9070 andi r25,hi8(7) |
683 02dc 0797 sbiw r24,7 |
684 02de 01F5 brne .L61 |
685 02e0 D801 movw r26,r16 |
686 02e2 1796 adiw r26,7 |
687 02e4 40E0 ldi r20,lo8(0) |
688 .L63: |
689 .stabn 68,0,464,.LM92-FrameMgr_processLine |
690 .LM92: |
691 02e6 8C91 ld r24,X |
692 02e8 8130 cpi r24,lo8(1) |
GAS LISTING /tmp/ccQRbLT3.s page 27 |
693 02ea A1F4 brne .L64 |
694 02ec FD01 movw r30,r26 |
695 02ee 3197 sbiw r30,1 |
696 .stabn 68,0,468,.LM93-FrameMgr_processLine |
697 .LM93: |
698 02f0 9081 ld r25,Z |
699 02f2 FD01 movw r30,r26 |
700 02f4 3397 sbiw r30,3 |
701 02f6 8081 ld r24,Z |
702 02f8 292F mov r18,r25 |
703 02fa 3327 clr r19 |
704 02fc F901 movw r30,r18 |
705 02fe E81B sub r30,r24 |
706 0300 F109 sbc r31,__zero_reg__ |
707 0302 3397 sbiw r30,3 |
708 0304 3CF4 brge .L64 |
709 .stabn 68,0,474,.LM94-FrameMgr_processLine |
710 .LM94: |
711 0306 C601 movw r24,r12 |
712 0308 821B sub r24,r18 |
713 030a 930B sbc r25,r19 |
714 030c 0397 sbiw r24,3 |
715 030e 14F0 brlt .L64 |
716 .stabn 68,0,477,.LM95-FrameMgr_processLine |
717 .LM95: |
718 0310 1C92 st X,__zero_reg__ |
719 .stabn 68,0,478,.LM96-FrameMgr_processLine |
720 .LM96: |
721 0312 7150 subi r23,lo8(-(-1)) |
722 .L64: |
723 .stabn 68,0,462,.LM97-FrameMgr_processLine |
724 .LM97: |
725 0314 4F5F subi r20,lo8(-(1)) |
726 0316 1896 adiw r26,8 |
727 0318 4830 cpi r20,lo8(8) |
728 031a 29F7 brne .L63 |
729 031c 7093 0000 sts numCurrTrackedObjects,r23 |
730 .L61: |
731 .stabn 68,0,486,.LM98-FrameMgr_processLine |
732 .LM98: |
733 0320 E092 0000 sts trackedLineCount,r14 |
734 .stabn 68,0,487,.LM99-FrameMgr_processLine |
735 .LM99: |
736 0324 F0E9 ldi r31,lo8(-112) |
737 0326 EF16 cp r14,r31 |
738 0328 09F4 brne .+2 |
739 032a 48CF rjmp .L72 |
740 .stabn 68,0,498,.LM100-FrameMgr_processLine |
741 .LM100: |
742 032c 8091 0000 lds r24,fastEventBitmask |
743 0330 8260 ori r24,lo8(2) |
744 0332 8093 0000 sts fastEventBitmask,r24 |
745 0336 04C0 rjmp .L71 |
746 .L54: |
747 .LBB6: |
748 .LBB7: |
749 .stabn 68,0,757,.LM101-FrameMgr_processLine |
GAS LISTING /tmp/ccQRbLT3.s page 28 |
750 .LM101: |
751 0338 7830 cpi r23,lo8(8) |
752 033a 08F4 brsh .+2 |
753 033c B2CF rjmp .L56 |
754 033e C6CF rjmp .L36 |
755 .L71: |
756 .LBE7: |
757 .LBE6: |
758 /* epilogue: frame size=1 */ |
759 0340 2196 adiw r28,1 |
760 0342 0FB6 in __tmp_reg__,__SREG__ |
761 0344 F894 cli |
762 0346 DEBF out __SP_H__,r29 |
763 0348 0FBE out __SREG__,__tmp_reg__ |
764 034a CDBF out __SP_L__,r28 |
765 034c DF91 pop r29 |
766 034e CF91 pop r28 |
767 0350 1F91 pop r17 |
768 0352 0F91 pop r16 |
769 0354 FF90 pop r15 |
770 0356 EF90 pop r14 |
771 0358 DF90 pop r13 |
772 035a CF90 pop r12 |
773 035c BF90 pop r11 |
774 035e AF90 pop r10 |
775 0360 9F90 pop r9 |
776 0362 8F90 pop r8 |
777 0364 7F90 pop r7 |
778 0366 6F90 pop r6 |
779 0368 5F90 pop r5 |
780 036a 4F90 pop r4 |
781 036c 3F90 pop r3 |
782 036e 2F90 pop r2 |
783 0370 0895 ret |
784 /* epilogue end (size=25) */ |
785 /* function FrameMgr_processLine size 355 (304) */ |
786 .size FrameMgr_processLine, .-FrameMgr_processLine |
787 .stabs "i:r(0,11)",64,0,343,20 |
788 .stabs "dataToSend:(0,23)=B(0,11)",128,0,344,1 |
789 .stabs "pTrackedObjectData:r(0,22)",64,0,345,26 |
790 .stabn 192,0,0,FrameMgr_processLine-FrameMgr_processLine |
791 .stabn 224,0,0,.Lscope1-FrameMgr_processLine |
792 .Lscope1: |
793 .stabs "",36,0,0,.Lscope1-FrameMgr_processLine |
794 .stabd 78,0,0 |
795 .stabs "FrameMgr_init:F(0,15)",36,0,191,FrameMgr_init |
796 .global FrameMgr_init |
797 .type FrameMgr_init, @function |
798 FrameMgr_init: |
799 .stabd 46,0,0 |
800 .stabn 68,0,191,.LM102-FrameMgr_init |
801 .LM102: |
802 /* prologue: frame size=0 */ |
803 /* prologue end (size=0) */ |
804 .stabn 68,0,192,.LM103-FrameMgr_init |
805 .LM103: |
806 0372 80E4 ldi r24,lo8(64) |
GAS LISTING /tmp/ccQRbLT3.s page 29 |
807 0374 E0E0 ldi r30,lo8(trackedObjectTable) |
808 0376 F0E0 ldi r31,hi8(trackedObjectTable) |
809 0378 1192 st Z+,__zero_reg__ |
810 037a 8A95 dec r24 |
811 037c E9F7 brne .-6 |
812 /* epilogue: frame size=0 */ |
813 037e 0895 ret |
814 /* epilogue end (size=1) */ |
815 /* function FrameMgr_init size 7 (6) */ |
816 .size FrameMgr_init, .-FrameMgr_init |
817 .Lscope2: |
818 .stabs "",36,0,0,.Lscope2-FrameMgr_init |
819 .stabd 78,0,0 |
820 .stabs "FrameMgr_acquireLine:F(0,15)",36,0,287,FrameMgr_acquireLine |
821 .global FrameMgr_acquireLine |
822 .type FrameMgr_acquireLine, @function |
823 FrameMgr_acquireLine: |
824 .stabd 46,0,0 |
825 .stabn 68,0,287,.LM104-FrameMgr_acquireLine |
826 .LM104: |
827 /* prologue: frame size=0 */ |
828 /* prologue end (size=0) */ |
829 .stabn 68,0,297,.LM105-FrameMgr_acquireLine |
830 .LM105: |
831 0380 8091 0000 lds r24,currentState |
832 0384 8230 cpi r24,lo8(2) |
833 0386 49F5 brne .L83 |
834 .stabn 68,0,299,.LM106-FrameMgr_acquireLine |
835 .LM106: |
836 0388 8091 0000 lds r24,lineCount |
837 038c 282F mov r18,r24 |
838 038e 220F lsl r18 |
839 .stabn 68,0,305,.LM107-FrameMgr_acquireLine |
840 .LM107: |
841 0390 80EB ldi r24,lo8(-80) |
842 0392 E0E0 ldi r30,lo8(currentLineBuffer) |
843 0394 F0E0 ldi r31,hi8(currentLineBuffer) |
844 0396 982F mov r25,r24 |
845 0398 1192 st Z+,__zero_reg__ |
846 039a 9A95 dec r25 |
847 039c E9F7 brne .-6 |
848 .stabn 68,0,306,.LM108-FrameMgr_acquireLine |
849 .LM108: |
850 039e E0E0 ldi r30,lo8(previousLineBuffer) |
851 03a0 F0E0 ldi r31,hi8(previousLineBuffer) |
852 03a2 1192 st Z+,__zero_reg__ |
853 03a4 8A95 dec r24 |
854 03a6 E9F7 brne .-6 |
855 .L85: |
856 .stabn 68,0,309,.LM109-FrameMgr_acquireLine |
857 .LM109: |
858 03a8 829B sbis 48-0x20,2 |
859 03aa FECF rjmp .L85 |
860 .L101: |
861 .stabn 68,0,310,.LM110-FrameMgr_acquireLine |
862 .LM110: |
863 03ac 829B sbis 48-0x20,2 |
GAS LISTING /tmp/ccQRbLT3.s page 30 |
864 03ae 07C0 rjmp .L110 |
865 03b0 FDCF rjmp .L101 |
866 .L88: |
867 03b2 90E0 ldi r25,lo8(0) |
868 .L114: |
869 .stabn 68,0,316,.LM111-FrameMgr_acquireLine |
870 .LM111: |
871 03b4 849B sbis 48-0x20,4 |
872 03b6 FECF rjmp .L114 |
873 .L102: |
874 .stabn 68,0,318,.LM112-FrameMgr_acquireLine |
875 .LM112: |
876 03b8 849B sbis 48-0x20,4 |
877 03ba 04C0 rjmp .L111 |
878 03bc FDCF rjmp .L102 |
879 .L110: |
880 .stabn 68,0,314,.LM113-FrameMgr_acquireLine |
881 .LM113: |
882 03be 2223 tst r18 |
883 03c0 C1F7 brne .L88 |
884 03c2 05C0 rjmp .L92 |
885 .L111: |
886 03c4 9150 subi r25,lo8(-(-1)) |
887 03c6 822F mov r24,r18 |
888 03c8 8195 neg r24 |
889 03ca 9817 cp r25,r24 |
890 03cc 99F7 brne .L114 |
891 .L92: |
892 .stabn 68,0,322,.LM114-FrameMgr_acquireLine |
893 .LM114: |
894 03ce 60E0 ldi r22,lo8(previousLineBuffer) |
895 03d0 70E0 ldi r23,hi8(previousLineBuffer) |
896 03d2 80E0 ldi r24,lo8(currentLineBuffer) |
897 03d4 90E0 ldi r25,hi8(currentLineBuffer) |
898 03d6 00D0 rcall CamIntAsm_acquireDumpLine |
899 03d8 0895 ret |
900 .L83: |
901 .stabn 68,0,324,.LM115-FrameMgr_acquireLine |
902 .LM115: |
903 03da 8130 cpi r24,lo8(1) |
904 03dc 39F4 brne .L96 |
905 .L103: |
906 .stabn 68,0,326,.LM116-FrameMgr_acquireLine |
907 .LM116: |
908 03de 8499 sbic 48-0x20,4 |
909 03e0 FECF rjmp .L103 |
910 .stabn 68,0,327,.LM117-FrameMgr_acquireLine |
911 .LM117: |
912 03e2 60E0 ldi r22,lo8(colorMap) |
913 03e4 70E0 ldi r23,hi8(colorMap) |
914 03e6 80E0 ldi r24,lo8(currentLineBuffer) |
915 03e8 90E0 ldi r25,hi8(currentLineBuffer) |
916 03ea 00D0 rcall CamIntAsm_acquireTrackingLine |
917 .L96: |
918 03ec 0895 ret |
919 /* epilogue: frame size=0 */ |
920 /* epilogue: noreturn */ |
GAS LISTING /tmp/ccQRbLT3.s page 31 |
921 /* epilogue end (size=0) */ |
922 /* function FrameMgr_acquireLine size 55 (55) */ |
923 .size FrameMgr_acquireLine, .-FrameMgr_acquireLine |
924 .stabs "tmpLineCount:r(0,11)",64,0,288,18 |
925 .stabn 192,0,0,FrameMgr_acquireLine-FrameMgr_acquireLine |
926 .stabn 224,0,0,.Lscope3-FrameMgr_acquireLine |
927 .Lscope3: |
928 .stabs "",36,0,0,.Lscope3-FrameMgr_acquireLine |
929 .stabd 78,0,0 |
930 .stabs "FrameMgr_acquireFrame:F(0,15)",36,0,261,FrameMgr_acquireFrame |
931 .global FrameMgr_acquireFrame |
932 .type FrameMgr_acquireFrame, @function |
933 FrameMgr_acquireFrame: |
934 .stabd 46,0,0 |
935 .stabn 68,0,261,.LM118-FrameMgr_acquireFrame |
936 .LM118: |
937 /* prologue: frame size=0 */ |
938 /* prologue end (size=0) */ |
939 .stabn 68,0,262,.LM119-FrameMgr_acquireFrame |
940 .LM119: |
941 03ee 8091 0000 lds r24,currentState |
942 03f2 8130 cpi r24,lo8(1) |
943 03f4 A9F4 brne .L120 |
944 .stabn 68,0,264,.LM120-FrameMgr_acquireFrame |
945 .LM120: |
946 03f6 1092 0000 sts trackedLineCount,__zero_reg__ |
947 .stabn 68,0,265,.LM121-FrameMgr_acquireFrame |
948 .LM121: |
949 03fa 8091 0000 lds r24,numCurrTrackedObjects |
950 03fe 8093 0000 sts numPrevTrackedObjects,r24 |
951 .stabn 68,0,266,.LM122-FrameMgr_acquireFrame |
952 .LM122: |
953 0402 1092 0000 sts numCurrTrackedObjects,__zero_reg__ |
954 .stabn 68,0,270,.LM123-FrameMgr_acquireFrame |
955 .LM123: |
956 0406 80E4 ldi r24,lo8(64) |
957 0408 E0E0 ldi r30,lo8(trackedObjectTable) |
958 040a F0E0 ldi r31,hi8(trackedObjectTable) |
959 040c 1192 st Z+,__zero_reg__ |
960 040e 8A95 dec r24 |
961 0410 E9F7 brne .-6 |
962 .L118: |
963 .stabn 68,0,272,.LM124-FrameMgr_acquireFrame |
964 .LM124: |
965 0412 829B sbis 48-0x20,2 |
966 0414 FECF rjmp .L118 |
967 .stabn 68,0,273,.LM125-FrameMgr_acquireFrame |
968 .LM125: |
969 0416 60E0 ldi r22,lo8(colorMap) |
970 0418 70E0 ldi r23,hi8(colorMap) |
971 041a 80E0 ldi r24,lo8(currentLineBuffer) |
972 041c 90E0 ldi r25,hi8(currentLineBuffer) |
973 041e 00D0 rcall CamIntAsm_acquireTrackingLine |
974 .L120: |
975 0420 0895 ret |
976 /* epilogue: frame size=0 */ |
977 /* epilogue: noreturn */ |
GAS LISTING /tmp/ccQRbLT3.s page 32 |
978 /* epilogue end (size=0) */ |
979 /* function FrameMgr_acquireFrame size 26 (26) */ |
980 .size FrameMgr_acquireFrame, .-FrameMgr_acquireFrame |
981 .Lscope4: |
982 .stabs "",36,0,0,.Lscope4-FrameMgr_acquireFrame |
983 .stabd 78,0,0 |
984 .stabs "FrameMgr_dispatchEvent:F(0,15)",36,0,205,FrameMgr_dispatchEvent |
985 .stabs "event:P(0,11)",64,0,204,24 |
986 .global FrameMgr_dispatchEvent |
987 .type FrameMgr_dispatchEvent, @function |
988 FrameMgr_dispatchEvent: |
989 .stabd 46,0,0 |
990 .stabn 68,0,205,.LM126-FrameMgr_dispatchEvent |
991 .LM126: |
992 /* prologue: frame size=0 */ |
993 /* prologue end (size=0) */ |
994 .stabn 68,0,206,.LM127-FrameMgr_dispatchEvent |
995 .LM127: |
996 0422 8430 cpi r24,lo8(4) |
997 0424 19F1 breq .L127 |
998 .stabn 68,0,206,.LM128-FrameMgr_dispatchEvent |
999 .LM128: |
1000 0426 8530 cpi r24,lo8(5) |
1001 0428 28F4 brsh .L131 |
1002 042a 8130 cpi r24,lo8(1) |
1003 042c 09F1 breq .L125 |
1004 042e 8230 cpi r24,lo8(2) |
1005 0430 41F5 brne .L133 |
1006 0432 07C0 rjmp .L126 |
1007 .L131: |
1008 0434 8038 cpi r24,lo8(-128) |
1009 0436 99F0 breq .L129 |
1010 0438 8138 cpi r24,lo8(-127) |
1011 043a 09F1 breq .L130 |
1012 043c 8032 cpi r24,lo8(32) |
1013 043e 09F5 brne .L133 |
1014 0440 13C0 rjmp .L128 |
1015 .L126: |
1016 .stabn 68,0,211,.LM129-FrameMgr_dispatchEvent |
1017 .LM129: |
1018 0442 61E0 ldi r22,lo8(1) |
1019 0444 81E1 ldi r24,lo8(17) |
1020 0446 00D0 rcall CamConfig_setCamReg |
1021 .stabn 68,0,212,.LM130-FrameMgr_dispatchEvent |
1022 .LM130: |
1023 0448 00D0 rcall CamConfig_sendFifoCmds |
1024 .stabn 68,0,213,.LM131-FrameMgr_dispatchEvent |
1025 .LM131: |
1026 044a 88EE ldi r24,lo8(1000) |
1027 044c 93E0 ldi r25,hi8(1000) |
1028 044e 00D0 rcall Utility_delay |
1029 .stabn 68,0,214,.LM132-FrameMgr_dispatchEvent |
1030 .LM132: |
1031 0450 1092 0000 sts lineCount,__zero_reg__ |
1032 .stabn 68,0,215,.LM133-FrameMgr_dispatchEvent |
1033 .LM133: |
1034 0454 82E0 ldi r24,lo8(2) |
GAS LISTING /tmp/ccQRbLT3.s page 33 |
1035 0456 8093 0000 sts currentState,r24 |
1036 .stabn 68,0,217,.LM134-FrameMgr_dispatchEvent |
1037 .LM134: |
1038 045a 92DF rcall FrameMgr_acquireLine |
1039 045c 0895 ret |
1040 .L129: |
1041 .stabn 68,0,221,.LM135-FrameMgr_dispatchEvent |
1042 .LM135: |
1043 045e 81E0 ldi r24,lo8(1) |
1044 0460 8093 0000 sts currentState,r24 |
1045 .stabn 68,0,222,.LM136-FrameMgr_dispatchEvent |
1046 .LM136: |
1047 0464 C4DF rcall FrameMgr_acquireFrame |
1048 0466 0895 ret |
1049 .L128: |
1050 .stabn 68,0,226,.LM137-FrameMgr_dispatchEvent |
1051 .LM137: |
1052 0468 CBDD rcall FrameMgr_processFrame |
1053 046a 0895 ret |
1054 .L127: |
1055 .stabn 68,0,230,.LM138-FrameMgr_dispatchEvent |
1056 .LM138: |
1057 046c C0DF rcall FrameMgr_acquireFrame |
1058 046e 0895 ret |
1059 .L125: |
1060 .stabn 68,0,234,.LM139-FrameMgr_dispatchEvent |
1061 .LM139: |
1062 0470 8091 0000 lds r24,currentState |
1063 0474 8823 tst r24 |
1064 0476 29F0 breq .L133 |
1065 .stabn 68,0,240,.LM140-FrameMgr_dispatchEvent |
1066 .LM140: |
1067 0478 84E0 ldi r24,lo8(4) |
1068 047a 00D0 rcall Exec_writeEventFifo |
1069 047c 0895 ret |
1070 .L130: |
1071 .stabn 68,0,246,.LM141-FrameMgr_dispatchEvent |
1072 .LM141: |
1073 047e 1092 0000 sts currentState,__zero_reg__ |
1074 .L133: |
1075 0482 0895 ret |
1076 /* epilogue: frame size=0 */ |
1077 /* epilogue: noreturn */ |
1078 /* epilogue end (size=0) */ |
1079 /* function FrameMgr_dispatchEvent size 49 (49) */ |
1080 .size FrameMgr_dispatchEvent, .-FrameMgr_dispatchEvent |
1081 .Lscope5: |
1082 .stabs "",36,0,0,.Lscope5-FrameMgr_dispatchEvent |
1083 .stabd 78,0,0 |
1084 .data |
1085 .type pCurrentTrackedObjectTable, @object |
1086 .size pCurrentTrackedObjectTable, 2 |
1087 pCurrentTrackedObjectTable: |
1088 0000 0000 .word trackedObjectTable |
1089 .lcomm numCurrTrackedObjects,1 |
1090 .lcomm currentState,1 |
1091 .lcomm lineCount,1 |
GAS LISTING /tmp/ccQRbLT3.s page 34 |
1092 .lcomm trackedLineCount,1 |
1093 .lcomm numPrevTrackedObjects,1 |
1094 .lcomm trackedObjectTable,64 |
1095 .stabs "trackedObjectTable:S(0,24)=ar(0,25)=r(0,25);0;0177777;;0;7;(0,20)",40,0,162,trackedObjectT |
1096 .stabs "pCurrentTrackedObjectTable:S(0,26)=*(0,20)",38,0,163,pCurrentTrackedObjectTable |
1097 .stabs "lineCount:S(0,11)",38,0,164,lineCount |
1098 .stabs "currentState:S(0,17)",38,0,165,currentState |
1099 .stabs "numCurrTrackedObjects:S(0,11)",38,0,166,numCurrTrackedObjects |
1100 .stabs "numPrevTrackedObjects:S(0,11)",38,0,167,numPrevTrackedObjects |
1101 .stabs "trackedLineCount:S(0,11)",38,0,168,trackedLineCount |
1102 .text |
1103 .stabs "",100,0,0,.Letext0 |
1104 .Letext0: |
1105 /* File "FrameMgr.c": code 580 = 0x0244 ( 513), prologues 33, epilogues 34 */ |
GAS LISTING /tmp/ccQRbLT3.s page 35 |
DEFINED SYMBOLS |
*ABS*:00000000 FrameMgr.c |
/tmp/ccQRbLT3.s:3 *ABS*:0000003f __SREG__ |
/tmp/ccQRbLT3.s:4 *ABS*:0000003e __SP_H__ |
/tmp/ccQRbLT3.s:5 *ABS*:0000003d __SP_L__ |
/tmp/ccQRbLT3.s:6 *ABS*:00000000 __tmp_reg__ |
/tmp/ccQRbLT3.s:7 *ABS*:00000001 __zero_reg__ |
/tmp/ccQRbLT3.s:91 .text:00000000 FrameMgr_processFrame |
/tmp/ccQRbLT3.s:1087 .data:00000000 pCurrentTrackedObjectTable |
.bss:00000000 numCurrTrackedObjects |
/tmp/ccQRbLT3.s:270 .text:000000b2 FrameMgr_processLine |
/tmp/ccQRbLT3.s:1089 .bss:00000001 currentState |
/tmp/ccQRbLT3.s:1090 .bss:00000002 lineCount |
/tmp/ccQRbLT3.s:1091 .bss:00000003 trackedLineCount |
/tmp/ccQRbLT3.s:798 .text:00000372 FrameMgr_init |
/tmp/ccQRbLT3.s:1093 .bss:00000005 trackedObjectTable |
/tmp/ccQRbLT3.s:823 .text:00000380 FrameMgr_acquireLine |
/tmp/ccQRbLT3.s:933 .text:000003ee FrameMgr_acquireFrame |
/tmp/ccQRbLT3.s:1092 .bss:00000004 numPrevTrackedObjects |
/tmp/ccQRbLT3.s:988 .text:00000422 FrameMgr_dispatchEvent |
UNDEFINED SYMBOLS |
__do_copy_data |
__do_clear_bss |
UIMgr_writeTxFifo |
Exec_writeEventFifo |
UartInt_txByte |
currentLineBuffer |
previousLineBuffer |
CamConfig_setCamReg |
CamConfig_sendFifoCmds |
fastEventBitmask |
CamIntAsm_acquireDumpLine |
colorMap |
CamIntAsm_acquireTrackingLine |
Utility_delay |
/programy/C/avr/AVRcam/I2CInterface.lst |
---|
0,0 → 1,942 |
GAS LISTING /tmp/ccZHfAgR.s page 1 |
1 .file "I2CInterface.c" |
2 .arch atmega8 |
3 __SREG__ = 0x3f |
4 __SP_H__ = 0x3e |
5 __SP_L__ = 0x3d |
6 __tmp_reg__ = 0 |
7 __zero_reg__ = 1 |
8 .global __do_copy_data |
9 .global __do_clear_bss |
10 .stabs "/home/kaklik/projects/programy/Atmel_C/AVRcam/",100,0,2,.Ltext0 |
11 .stabs "I2CInterface.c",100,0,2,.Ltext0 |
12 .text |
13 .Ltext0: |
14 .stabs "gcc2_compiled.",60,0,0,0 |
15 .stabs "int:t(0,1)=r(0,1);-32768;32767;",128,0,0,0 |
16 .stabs "char:t(0,2)=@s8;r(0,2);0;255;",128,0,0,0 |
17 .stabs "long int:t(0,3)=@s32;r(0,3);020000000000;017777777777;",128,0,0,0 |
18 .stabs "unsigned int:t(0,4)=r(0,4);0;0177777;",128,0,0,0 |
19 .stabs "long unsigned int:t(0,5)=@s32;r(0,5);0;037777777777;",128,0,0,0 |
20 .stabs "long long int:t(0,6)=@s64;r(0,6);01000000000000000000000;0777777777777777777777;",128,0,0, |
21 .stabs "long long unsigned int:t(0,7)=@s64;r(0,7);0;01777777777777777777777;",128,0,0,0 |
22 .stabs "short int:t(0,8)=r(0,8);-32768;32767;",128,0,0,0 |
23 .stabs "short unsigned int:t(0,9)=r(0,9);0;0177777;",128,0,0,0 |
24 .stabs "signed char:t(0,10)=@s8;r(0,10);-128;127;",128,0,0,0 |
25 .stabs "unsigned char:t(0,11)=@s8;r(0,11);0;255;",128,0,0,0 |
26 .stabs "float:t(0,12)=r(0,1);4;0;",128,0,0,0 |
27 .stabs "double:t(0,13)=r(0,1);4;0;",128,0,0,0 |
28 .stabs "long double:t(0,14)=r(0,1);4;0;",128,0,0,0 |
29 .stabs "void:t(0,15)=(0,15)",128,0,0,0 |
30 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/io.h",130,0,0,0 |
31 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/sfr_defs.h",130,0,0,0 |
32 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/inttypes.h",130,0,0,0 |
33 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/stdint.h",130,0,0,0 |
34 .stabs "int8_t:t(4,1)=(0,10)",128,0,116,0 |
35 .stabs "uint8_t:t(4,2)=(0,11)",128,0,117,0 |
36 .stabs "int16_t:t(4,3)=(0,1)",128,0,118,0 |
37 .stabs "uint16_t:t(4,4)=(0,4)",128,0,119,0 |
38 .stabs "int32_t:t(4,5)=(0,3)",128,0,120,0 |
39 .stabs "uint32_t:t(4,6)=(0,5)",128,0,121,0 |
40 .stabs "int64_t:t(4,7)=(0,6)",128,0,122,0 |
41 .stabs "uint64_t:t(4,8)=(0,7)",128,0,123,0 |
42 .stabs "intptr_t:t(4,9)=(4,3)",128,0,135,0 |
43 .stabs "uintptr_t:t(4,10)=(4,4)",128,0,140,0 |
44 .stabs "int_least8_t:t(4,11)=(4,1)",128,0,152,0 |
45 .stabs "uint_least8_t:t(4,12)=(4,2)",128,0,157,0 |
46 .stabs "int_least16_t:t(4,13)=(4,3)",128,0,162,0 |
47 .stabs "uint_least16_t:t(4,14)=(4,4)",128,0,167,0 |
48 .stabs "int_least32_t:t(4,15)=(4,5)",128,0,172,0 |
49 .stabs "uint_least32_t:t(4,16)=(4,6)",128,0,177,0 |
50 .stabs "int_least64_t:t(4,17)=(4,7)",128,0,182,0 |
51 .stabs "uint_least64_t:t(4,18)=(4,8)",128,0,187,0 |
52 .stabs "int_fast8_t:t(4,19)=(4,1)",128,0,200,0 |
53 .stabs "uint_fast8_t:t(4,20)=(4,2)",128,0,205,0 |
54 .stabs "int_fast16_t:t(4,21)=(4,3)",128,0,210,0 |
55 .stabs "uint_fast16_t:t(4,22)=(4,4)",128,0,215,0 |
56 .stabs "int_fast32_t:t(4,23)=(4,5)",128,0,220,0 |
57 .stabs "uint_fast32_t:t(4,24)=(4,6)",128,0,225,0 |
GAS LISTING /tmp/ccZHfAgR.s page 2 |
58 .stabs "int_fast64_t:t(4,25)=(4,7)",128,0,230,0 |
59 .stabs "uint_fast64_t:t(4,26)=(4,8)",128,0,235,0 |
60 .stabs "intmax_t:t(4,27)=(4,7)",128,0,249,0 |
61 .stabs "uintmax_t:t(4,28)=(4,8)",128,0,254,0 |
62 .stabn 162,0,0,0 |
63 .stabs "int_farptr_t:t(3,1)=(4,5)",128,0,76,0 |
64 .stabs "uint_farptr_t:t(3,2)=(4,6)",128,0,80,0 |
65 .stabn 162,0,0,0 |
66 .stabn 162,0,0,0 |
67 .stabn 162,0,0,0 |
68 .stabs "CamConfig.h",130,0,0,0 |
69 .stabs "I2CInterface.h",130,0,0,0 |
70 .stabs "CommonDefs.h",130,0,0,0 |
71 .stabs "bool_t:t(7,1)=(0,11)",128,0,56,0 |
72 .stabn 162,0,0,0 |
73 .stabs "i2cCmd_t:t(6,1)=(6,2)=s2configReg:(0,11),0,8;data:(0,11),8,8;;",128,0,53,0 |
74 .stabn 162,0,0,0 |
75 .stabn 162,0,0,0 |
76 .stabs "I2CInt_init:F(0,15)",36,0,85,I2CInt_init |
77 .global I2CInt_init |
78 .type I2CInt_init, @function |
79 I2CInt_init: |
80 .stabd 46,0,0 |
1:I2CInterface.c **** /* |
2:I2CInterface.c **** Copyright (C) 2004 John Orlando |
3:I2CInterface.c **** |
4:I2CInterface.c **** AVRcam: a small real-time image processing engine. |
5:I2CInterface.c **** |
6:I2CInterface.c **** This program is free software; you can redistribute it and/or |
7:I2CInterface.c **** modify it under the terms of the GNU General Public |
8:I2CInterface.c **** License as published by the Free Software Foundation; either |
9:I2CInterface.c **** version 2 of the License, or (at your option) any later version. |
10:I2CInterface.c **** |
11:I2CInterface.c **** This program is distributed in the hope that it will be useful, |
12:I2CInterface.c **** but WITHOUT ANY WARRANTY; without even the implied warranty of |
13:I2CInterface.c **** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14:I2CInterface.c **** General Public License for more details. |
15:I2CInterface.c **** |
16:I2CInterface.c **** You should have received a copy of the GNU General Public |
17:I2CInterface.c **** License along with this program; if not, write to the Free Software |
18:I2CInterface.c **** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19:I2CInterface.c **** |
20:I2CInterface.c **** For more information on the AVRcam, please contact: |
21:I2CInterface.c **** |
22:I2CInterface.c **** john@jrobot.net |
23:I2CInterface.c **** |
24:I2CInterface.c **** or go to www.jrobot.net for more details regarding the system. |
25:I2CInterface.c **** */ |
26:I2CInterface.c **** /*********************************************************** |
27:I2CInterface.c **** Module Name: I2CInterface.c |
28:I2CInterface.c **** Module Date: 4/10/2004 |
29:I2CInterface.c **** Module Auth: John Orlando |
30:I2CInterface.c **** |
31:I2CInterface.c **** Description: This module is responsible for providing a |
32:I2CInterface.c **** low-level interface to the I2C hardware resident on the |
33:I2CInterface.c **** mega8 processor (also known as the Two-Wire Interface, |
34:I2CInterface.c **** or TWI). The interface is needed to configure the |
GAS LISTING /tmp/ccZHfAgR.s page 3 |
35:I2CInterface.c **** needed registers in the OV6620 camera. This interface |
36:I2CInterface.c **** is interrupt-driven based on the events that should |
37:I2CInterface.c **** occur upon successful writing of an I2C register. |
38:I2CInterface.c **** |
39:I2CInterface.c **** Revision History: |
40:I2CInterface.c **** Date Rel Ver. Notes |
41:I2CInterface.c **** 4/10/2004 0.1 Module created |
42:I2CInterface.c **** 6/30/2004 1.0 Initial release for Circuit Cellar |
43:I2CInterface.c **** contest. |
44:I2CInterface.c **** |
45:I2CInterface.c **** ***********************************************************/ |
46:I2CInterface.c **** |
47:I2CInterface.c **** /* Includes */ |
48:I2CInterface.c **** #include <avr/io.h> |
49:I2CInterface.c **** #include <util/twi.h> |
50:I2CInterface.c **** #include <avr/interrupt.h> |
51:I2CInterface.c **** #include "CamConfig.h" |
52:I2CInterface.c **** #include "CommonDefs.h" |
53:I2CInterface.c **** |
54:I2CInterface.c **** /* Local Variables */ |
55:I2CInterface.c **** |
56:I2CInterface.c **** /* These variables are used as storage space for the current |
57:I2CInterface.c **** I2C command being sent over the interface. They need to |
58:I2CInterface.c **** be volatile since they are dealt with an the TWI ISR */ |
59:I2CInterface.c **** volatile static unsigned char twi_address; |
60:I2CInterface.c **** volatile static unsigned char *twi_data; |
61:I2CInterface.c **** volatile static unsigned char twi_ddr; |
62:I2CInterface.c **** volatile static unsigned char twi_bytes; |
63:I2CInterface.c **** volatile static unsigned char status; |
64:I2CInterface.c **** volatile static unsigned char retry_cnt; |
65:I2CInterface.c **** |
66:I2CInterface.c **** /* Local Structures and Typedefs */ |
67:I2CInterface.c **** |
68:I2CInterface.c **** /* Extern Variables */ |
69:I2CInterface.c **** |
70:I2CInterface.c **** /* Definitions */ |
71:I2CInterface.c **** /* Bit definitions for the tw_status register */ |
72:I2CInterface.c **** #define MAX_TWI_RETRIES 2 |
73:I2CInterface.c **** #define BUSY 7 |
74:I2CInterface.c **** |
75:I2CInterface.c **** /*********************************************************** |
76:I2CInterface.c **** Function Name: I2CInt_init |
77:I2CInterface.c **** Function Description: This function is responsible |
78:I2CInterface.c **** for setting up the registers needed for the TWI |
79:I2CInterface.c **** interface |
80:I2CInterface.c **** |
81:I2CInterface.c **** Inputs: none |
82:I2CInterface.c **** Outputs: none |
83:I2CInterface.c **** ***********************************************************/ |
84:I2CInterface.c **** void I2CInt_init(void) |
85:I2CInterface.c **** { |
81 .stabn 68,0,85,.LM0-I2CInt_init |
82 .LM0: |
83 /* prologue: frame size=0 */ |
84 /* prologue end (size=0) */ |
86:I2CInterface.c **** TWSR = 0; |
85 .stabn 68,0,86,.LM1-I2CInt_init |
GAS LISTING /tmp/ccZHfAgR.s page 4 |
86 .LM1: |
87 0000 11B8 out 33-0x20,__zero_reg__ |
87:I2CInterface.c **** |
88:I2CInterface.c **** /* init the speed of the I2C interface, running at |
89:I2CInterface.c **** 100 Kbps */ |
90:I2CInterface.c **** TWBR = (FOSC / I2C_SPEED - 16)/2; |
88 .stabn 68,0,90,.LM2-I2CInt_init |
89 .LM2: |
90 0002 88E4 ldi r24,lo8(72) |
91 0004 80B9 out 32-0x20,r24 |
92 /* epilogue: frame size=0 */ |
93 0006 0895 ret |
94 /* epilogue end (size=1) */ |
95 /* function I2CInt_init size 4 (3) */ |
96 .size I2CInt_init, .-I2CInt_init |
97 .Lscope0: |
98 .stabs "",36,0,0,.Lscope0-I2CInt_init |
99 .stabd 78,0,0 |
100 .stabs "I2CInt_writeData:F(0,15)",36,0,108,I2CInt_writeData |
101 .stabs "address:P(0,11)",64,0,107,25 |
102 .stabs "data:P(0,16)=*(0,11)",64,0,107,22 |
103 .stabs "bytes:P(0,11)",64,0,107,20 |
104 .global I2CInt_writeData |
105 .type I2CInt_writeData, @function |
106 I2CInt_writeData: |
107 .stabd 46,0,0 |
91:I2CInterface.c **** } |
92:I2CInterface.c **** |
93:I2CInterface.c **** /*********************************************************** |
94:I2CInterface.c **** Function Name: I2CInt_writeData |
95:I2CInterface.c **** Function Description: This function is responsible for |
96:I2CInterface.c **** initiating the process of writing a sequence of bytes |
97:I2CInterface.c **** an I2C slave address. This function will try to write |
98:I2CInterface.c **** the data three times before giving up. |
99:I2CInterface.c **** Inputs: address: the address of the I2C slave device |
100:I2CInterface.c **** data: a pointer to the data to be written |
101:I2CInterface.c **** to the slave...for camera interfacing, |
102:I2CInterface.c **** the data follows a <register #><data> |
103:I2CInterface.c **** format |
104:I2CInterface.c **** bytes: the number of bytes to write |
105:I2CInterface.c **** Outputs: none |
106:I2CInterface.c **** ***********************************************************/ |
107:I2CInterface.c **** void I2CInt_writeData(unsigned char address, unsigned char *data, unsigned char bytes) |
108:I2CInterface.c **** { |
108 .stabn 68,0,108,.LM3-I2CInt_writeData |
109 .LM3: |
110 /* prologue: frame size=0 */ |
111 /* prologue end (size=0) */ |
112 0008 982F mov r25,r24 |
113 .L5: |
109:I2CInterface.c **** while(status & (1<<BUSY)); /* Bus is busy wait (or exit with error code) */ |
114 .stabn 68,0,109,.LM4-I2CInt_writeData |
115 .LM4: |
116 000a 8091 0000 lds r24,status |
117 000e 8823 tst r24 |
118 0010 E4F3 brlt .L5 |
119 .L9: |
GAS LISTING /tmp/ccZHfAgR.s page 5 |
110:I2CInterface.c **** while(TWCR & (1<<TWSTO)); |
120 .stabn 68,0,110,.LM5-I2CInt_writeData |
121 .LM5: |
122 0012 06B6 in __tmp_reg__,86-0x20 |
123 0014 04FC sbrc __tmp_reg__,4 |
124 0016 FDCF rjmp .L9 |
111:I2CInterface.c **** |
112:I2CInterface.c **** /* copy the needed data and state info to our local I2C command structure */ |
113:I2CInterface.c **** twi_address = address; |
125 .stabn 68,0,113,.LM6-I2CInt_writeData |
126 .LM6: |
127 0018 9093 0000 sts twi_address,r25 |
114:I2CInterface.c **** twi_data = data; |
128 .stabn 68,0,114,.LM7-I2CInt_writeData |
129 .LM7: |
130 001c 7093 0000 sts (twi_data)+1,r23 |
131 0020 6093 0000 sts twi_data,r22 |
115:I2CInterface.c **** twi_bytes = bytes; |
132 .stabn 68,0,115,.LM8-I2CInt_writeData |
133 .LM8: |
134 0024 4093 0000 sts twi_bytes,r20 |
116:I2CInterface.c **** twi_ddr = TW_WRITE; |
135 .stabn 68,0,116,.LM9-I2CInt_writeData |
136 .LM9: |
137 0028 1092 0000 sts twi_ddr,__zero_reg__ |
117:I2CInterface.c **** |
118:I2CInterface.c **** retry_cnt = 0; |
138 .stabn 68,0,118,.LM10-I2CInt_writeData |
139 .LM10: |
140 002c 1092 0000 sts retry_cnt,__zero_reg__ |
119:I2CInterface.c **** |
120:I2CInterface.c **** /* Generate start condition, the remainder of the transfer is interrupt driven and |
121:I2CInterface.c **** will be performed in the background */ |
122:I2CInterface.c **** TWCR = (1<<TWINT)|(1<<TWSTA)|(1<<TWEN)|(1<<TWIE); |
141 .stabn 68,0,122,.LM11-I2CInt_writeData |
142 .LM11: |
143 0030 85EA ldi r24,lo8(-91) |
144 0032 86BF out 86-0x20,r24 |
123:I2CInterface.c **** |
124:I2CInterface.c **** status |= (1<<BUSY); |
145 .stabn 68,0,124,.LM12-I2CInt_writeData |
146 .LM12: |
147 0034 8091 0000 lds r24,status |
148 0038 8068 ori r24,lo8(-128) |
149 003a 8093 0000 sts status,r24 |
150 /* epilogue: frame size=0 */ |
151 003e 0895 ret |
152 /* epilogue end (size=1) */ |
153 /* function I2CInt_writeData size 28 (27) */ |
154 .size I2CInt_writeData, .-I2CInt_writeData |
155 .Lscope1: |
156 .stabs "",36,0,0,.Lscope1-I2CInt_writeData |
157 .stabd 78,0,0 |
158 .stabs "I2CInt_readData:F(0,15)",36,0,138,I2CInt_readData |
159 .stabs "address:P(0,11)",64,0,137,25 |
160 .stabs "data:P(0,16)",64,0,137,22 |
161 .stabs "bytes:P(0,11)",64,0,137,20 |
GAS LISTING /tmp/ccZHfAgR.s page 6 |
162 .global I2CInt_readData |
163 .type I2CInt_readData, @function |
164 I2CInt_readData: |
165 .stabd 46,0,0 |
125:I2CInterface.c **** } |
126:I2CInterface.c **** |
127:I2CInterface.c **** /*********************************************************** |
128:I2CInterface.c **** Function Name: I2CInt_readData |
129:I2CInterface.c **** Function Description: This funcion is responsible for |
130:I2CInterface.c **** reading the specified number of bytes from a slave |
131:I2CInterface.c **** device. |
132:I2CInterface.c **** Inputs: address: the slave address to read from |
133:I2CInterface.c **** data: a pointer to where the data will be stored |
134:I2CInterface.c **** bytes: the number of bytes to read |
135:I2CInterface.c **** Outputs: none |
136:I2CInterface.c **** ***********************************************************/ |
137:I2CInterface.c **** void I2CInt_readData(unsigned char address, unsigned char *data, unsigned char bytes) |
138:I2CInterface.c **** { |
166 .stabn 68,0,138,.LM13-I2CInt_readData |
167 .LM13: |
168 /* prologue: frame size=0 */ |
169 /* prologue end (size=0) */ |
170 0040 982F mov r25,r24 |
171 .L15: |
139:I2CInterface.c **** /* Bus is busy wait (or exit with error code) */ |
140:I2CInterface.c **** while(status & (1<<BUSY)); |
172 .stabn 68,0,140,.LM14-I2CInt_readData |
173 .LM14: |
174 0042 8091 0000 lds r24,status |
175 0046 8823 tst r24 |
176 0048 E4F3 brlt .L15 |
141:I2CInterface.c **** |
142:I2CInterface.c **** twi_address = address; |
177 .stabn 68,0,142,.LM15-I2CInt_readData |
178 .LM15: |
179 004a 9093 0000 sts twi_address,r25 |
143:I2CInterface.c **** twi_data = data; |
180 .stabn 68,0,143,.LM16-I2CInt_readData |
181 .LM16: |
182 004e 7093 0000 sts (twi_data)+1,r23 |
183 0052 6093 0000 sts twi_data,r22 |
144:I2CInterface.c **** twi_bytes = bytes; |
184 .stabn 68,0,144,.LM17-I2CInt_readData |
185 .LM17: |
186 0056 4093 0000 sts twi_bytes,r20 |
145:I2CInterface.c **** twi_ddr = TW_READ; |
187 .stabn 68,0,145,.LM18-I2CInt_readData |
188 .LM18: |
189 005a 81E0 ldi r24,lo8(1) |
190 005c 8093 0000 sts twi_ddr,r24 |
146:I2CInterface.c **** |
147:I2CInterface.c **** retry_cnt = 0; |
191 .stabn 68,0,147,.LM19-I2CInt_readData |
192 .LM19: |
193 0060 1092 0000 sts retry_cnt,__zero_reg__ |
148:I2CInterface.c **** |
149:I2CInterface.c **** /* Generate start condition, the remainder of the transfer is interrupt driven and |
GAS LISTING /tmp/ccZHfAgR.s page 7 |
150:I2CInterface.c **** will be performed in the background */ |
151:I2CInterface.c **** TWCR = (1<<TWINT)|(1<<TWSTA)|(1<<TWEN)|(1<<TWIE); |
194 .stabn 68,0,151,.LM20-I2CInt_readData |
195 .LM20: |
196 0064 85EA ldi r24,lo8(-91) |
197 0066 86BF out 86-0x20,r24 |
152:I2CInterface.c **** |
153:I2CInterface.c **** status |= (1<<BUSY); |
198 .stabn 68,0,153,.LM21-I2CInt_readData |
199 .LM21: |
200 0068 8091 0000 lds r24,status |
201 006c 8068 ori r24,lo8(-128) |
202 006e 8093 0000 sts status,r24 |
203 /* epilogue: frame size=0 */ |
204 0072 0895 ret |
205 /* epilogue end (size=1) */ |
206 /* function I2CInt_readData size 26 (25) */ |
207 .size I2CInt_readData, .-I2CInt_readData |
208 .Lscope2: |
209 .stabs "",36,0,0,.Lscope2-I2CInt_readData |
210 .stabd 78,0,0 |
211 .stabs "I2CInt_isI2cBusy:F(7,1)",36,0,166,I2CInt_isI2cBusy |
212 .global I2CInt_isI2cBusy |
213 .type I2CInt_isI2cBusy, @function |
214 I2CInt_isI2cBusy: |
215 .stabd 46,0,0 |
154:I2CInterface.c **** } |
155:I2CInterface.c **** |
156:I2CInterface.c **** /*********************************************************** |
157:I2CInterface.c **** Function Name: I2CInt_isI2cBusy |
158:I2CInterface.c **** Function Description: This funcion is responsible for |
159:I2CInterface.c **** indicating if the I2C bus is currently busy to external |
160:I2CInterface.c **** modules. |
161:I2CInterface.c **** device. |
162:I2CInterface.c **** Inputs: none |
163:I2CInterface.c **** Outputs: bool_t - indicating if bus is busy |
164:I2CInterface.c **** ***********************************************************/ |
165:I2CInterface.c **** bool_t I2CInt_isI2cBusy(void) |
166:I2CInterface.c **** { |
216 .stabn 68,0,166,.LM22-I2CInt_isI2cBusy |
217 .LM22: |
218 /* prologue: frame size=0 */ |
219 /* prologue end (size=0) */ |
167:I2CInterface.c **** bool_t retVal = FALSE; |
168:I2CInterface.c **** if ( (status & (1<<BUSY)) != 0) |
220 .stabn 68,0,168,.LM23-I2CInt_isI2cBusy |
221 .LM23: |
222 0074 8091 0000 lds r24,status |
223 0078 881F rol r24 |
224 007a 8827 clr r24 |
225 007c 881F rol r24 |
169:I2CInterface.c **** { |
170:I2CInterface.c **** retVal = TRUE; |
171:I2CInterface.c **** } |
172:I2CInterface.c **** |
173:I2CInterface.c **** return(retVal); |
174:I2CInterface.c **** } |
GAS LISTING /tmp/ccZHfAgR.s page 8 |
226 .stabn 68,0,174,.LM24-I2CInt_isI2cBusy |
227 .LM24: |
228 007e 9927 clr r25 |
229 /* epilogue: frame size=0 */ |
230 0080 0895 ret |
231 /* epilogue end (size=1) */ |
232 /* function I2CInt_isI2cBusy size 7 (6) */ |
233 .size I2CInt_isI2cBusy, .-I2CInt_isI2cBusy |
234 .Lscope3: |
235 .stabs "",36,0,0,.Lscope3-I2CInt_isI2cBusy |
236 .stabd 78,0,0 |
237 .stabs "__vector_17:F(0,15)",36,0,185,__vector_17 |
238 .global __vector_17 |
239 .type __vector_17, @function |
240 __vector_17: |
241 .stabd 46,0,0 |
175:I2CInterface.c **** |
176:I2CInterface.c **** /*********************************************************** |
177:I2CInterface.c **** Function Name: <interrupt handler for I2C> |
178:I2CInterface.c **** Function Description: This function is responsible for |
179:I2CInterface.c **** implementing the control logic needed to perform a |
180:I2CInterface.c **** read or write operation with an I2C slave. |
181:I2CInterface.c **** Inputs: none |
182:I2CInterface.c **** Outputs: none |
183:I2CInterface.c **** ***********************************************************/ |
184:I2CInterface.c **** SIGNAL(SIG_2WIRE_SERIAL) |
185:I2CInterface.c **** { |
242 .stabn 68,0,185,.LM25-__vector_17 |
243 .LM25: |
244 /* prologue: frame size=0 */ |
245 0082 1F92 push __zero_reg__ |
246 0084 0F92 push __tmp_reg__ |
247 0086 0FB6 in __tmp_reg__,__SREG__ |
248 0088 0F92 push __tmp_reg__ |
249 008a 1124 clr __zero_reg__ |
250 008c 8F93 push r24 |
251 008e 9F93 push r25 |
252 0090 AF93 push r26 |
253 0092 BF93 push r27 |
254 0094 EF93 push r30 |
255 0096 FF93 push r31 |
256 /* prologue end (size=11) */ |
186:I2CInterface.c **** unsigned char TWI_status = TWSR & TW_STATUS_MASK; /* grab just the status bits */ |
257 .stabn 68,0,186,.LM26-__vector_17 |
258 .LM26: |
259 0098 81B1 in r24,33-0x20 |
187:I2CInterface.c **** |
188:I2CInterface.c **** /* the entire I2C handler is state-based...determine |
189:I2CInterface.c **** what needs to be done based on TWI_status */ |
190:I2CInterface.c **** switch(TWI_status) |
260 .stabn 68,0,190,.LM27-__vector_17 |
261 .LM27: |
262 009a 9927 clr r25 |
263 009c AA27 clr r26 |
264 009e BB27 clr r27 |
265 00a0 887F andi r24,lo8(248) |
266 00a2 9070 andi r25,hi8(248) |
GAS LISTING /tmp/ccZHfAgR.s page 9 |
267 00a4 A070 andi r26,hlo8(248) |
268 00a6 B070 andi r27,hhi8(248) |
269 00a8 FC01 movw r30,r24 |
270 00aa 3897 sbiw r30,8 |
271 00ac E135 cpi r30,81 |
272 00ae F105 cpc r31,__zero_reg__ |
273 00b0 08F0 brlo .+2 |
274 00b2 9AC0 rjmp .L42 |
275 .stabn 68,0,190,.LM28-__vector_17 |
276 .LM28: |
277 00b4 E050 subi r30,lo8(-(pm(.L33))) |
278 00b6 F040 sbci r31,hi8(-(pm(.L33))) |
279 00b8 0994 ijmp |
280 .data |
281 .section .progmem.gcc_sw_table, "ax", @progbits |
282 .p2align 1 |
283 .L33: |
284 .data |
285 .section .progmem.gcc_sw_table, "ax", @progbits |
286 .p2align 1 |
287 0000 00C0 rjmp .L25 |
288 0002 00C0 rjmp .L42 |
289 0004 00C0 rjmp .L42 |
290 0006 00C0 rjmp .L42 |
291 0008 00C0 rjmp .L42 |
292 000a 00C0 rjmp .L42 |
293 000c 00C0 rjmp .L42 |
294 000e 00C0 rjmp .L42 |
295 0010 00C0 rjmp .L25 |
296 0012 00C0 rjmp .L42 |
297 0014 00C0 rjmp .L42 |
298 0016 00C0 rjmp .L42 |
299 0018 00C0 rjmp .L42 |
300 001a 00C0 rjmp .L42 |
301 001c 00C0 rjmp .L42 |
302 001e 00C0 rjmp .L42 |
303 0020 00C0 rjmp .L26 |
304 0022 00C0 rjmp .L42 |
305 0024 00C0 rjmp .L42 |
306 0026 00C0 rjmp .L42 |
307 0028 00C0 rjmp .L42 |
308 002a 00C0 rjmp .L42 |
309 002c 00C0 rjmp .L42 |
310 002e 00C0 rjmp .L42 |
311 0030 00C0 rjmp .L27 |
312 0032 00C0 rjmp .L42 |
313 0034 00C0 rjmp .L42 |
314 0036 00C0 rjmp .L42 |
315 0038 00C0 rjmp .L42 |
316 003a 00C0 rjmp .L42 |
317 003c 00C0 rjmp .L42 |
318 003e 00C0 rjmp .L42 |
319 0040 00C0 rjmp .L28 |
320 0042 00C0 rjmp .L42 |
321 0044 00C0 rjmp .L42 |
322 0046 00C0 rjmp .L42 |
323 0048 00C0 rjmp .L42 |
GAS LISTING /tmp/ccZHfAgR.s page 10 |
324 004a 00C0 rjmp .L42 |
325 004c 00C0 rjmp .L42 |
326 004e 00C0 rjmp .L42 |
327 0050 00C0 rjmp .L29 |
328 0052 00C0 rjmp .L42 |
329 0054 00C0 rjmp .L42 |
330 0056 00C0 rjmp .L42 |
331 0058 00C0 rjmp .L42 |
332 005a 00C0 rjmp .L42 |
333 005c 00C0 rjmp .L42 |
334 005e 00C0 rjmp .L42 |
335 0060 00C0 rjmp .L42 |
336 0062 00C0 rjmp .L42 |
337 0064 00C0 rjmp .L42 |
338 0066 00C0 rjmp .L42 |
339 0068 00C0 rjmp .L42 |
340 006a 00C0 rjmp .L42 |
341 006c 00C0 rjmp .L42 |
342 006e 00C0 rjmp .L42 |
343 0070 00C0 rjmp .L30 |
344 0072 00C0 rjmp .L42 |
345 0074 00C0 rjmp .L42 |
346 0076 00C0 rjmp .L42 |
347 0078 00C0 rjmp .L42 |
348 007a 00C0 rjmp .L42 |
349 007c 00C0 rjmp .L42 |
350 007e 00C0 rjmp .L42 |
351 0080 00C0 rjmp .L27 |
352 0082 00C0 rjmp .L42 |
353 0084 00C0 rjmp .L42 |
354 0086 00C0 rjmp .L42 |
355 0088 00C0 rjmp .L42 |
356 008a 00C0 rjmp .L42 |
357 008c 00C0 rjmp .L42 |
358 008e 00C0 rjmp .L42 |
359 0090 00C0 rjmp .L31 |
360 0092 00C0 rjmp .L42 |
361 0094 00C0 rjmp .L42 |
362 0096 00C0 rjmp .L42 |
363 0098 00C0 rjmp .L42 |
364 009a 00C0 rjmp .L42 |
365 009c 00C0 rjmp .L42 |
366 009e 00C0 rjmp .L42 |
367 00a0 00C0 rjmp .L32 |
368 .text |
369 .L25: |
191:I2CInterface.c **** { |
192:I2CInterface.c **** case TW_START: /* Start condition */ |
193:I2CInterface.c **** case TW_REP_START: /* Repeated start condition */ |
194:I2CInterface.c **** if(retry_cnt > MAX_TWI_RETRIES) |
370 .stabn 68,0,194,.LM29-__vector_17 |
371 .LM29: |
372 00ba 8091 0000 lds r24,retry_cnt |
373 00be 8330 cpi r24,lo8(3) |
374 00c0 48F0 brlo .L34 |
195:I2CInterface.c **** { |
196:I2CInterface.c **** /* generate stop condition if we've reached our retry limit */ |
GAS LISTING /tmp/ccZHfAgR.s page 11 |
197:I2CInterface.c **** TWCR |= (1<<TWINT)|(1<<TWSTO); |
375 .stabn 68,0,197,.LM30-__vector_17 |
376 .LM30: |
377 00c2 86B7 in r24,86-0x20 |
378 00c4 8069 ori r24,lo8(-112) |
379 00c6 86BF out 86-0x20,r24 |
198:I2CInterface.c **** status &= ~(1<<BUSY); |
380 .stabn 68,0,198,.LM31-__vector_17 |
381 .LM31: |
382 00c8 8091 0000 lds r24,status |
383 00cc 8F77 andi r24,lo8(127) |
384 00ce 8093 0000 sts status,r24 |
385 00d2 8AC0 rjmp .L42 |
386 .L34: |
199:I2CInterface.c **** return; |
200:I2CInterface.c **** } |
201:I2CInterface.c **** /* indicate read or write */ |
202:I2CInterface.c **** TWDR = (twi_address<<1) + twi_ddr; |
387 .stabn 68,0,202,.LM32-__vector_17 |
388 .LM32: |
389 00d4 8091 0000 lds r24,twi_address |
390 00d8 9091 0000 lds r25,twi_ddr |
391 00dc 880F lsl r24 |
392 00de 890F add r24,r25 |
393 00e0 83B9 out 35-0x20,r24 |
203:I2CInterface.c **** /* TWSTA must be cleared...also clears TWINT */ |
204:I2CInterface.c **** TWCR &= ~(1<<TWSTA); |
394 .stabn 68,0,204,.LM33-__vector_17 |
395 .LM33: |
396 00e2 86B7 in r24,86-0x20 |
397 00e4 8F7D andi r24,lo8(-33) |
398 00e6 86BF out 86-0x20,r24 |
399 00e8 7FC0 rjmp .L42 |
400 .L26: |
205:I2CInterface.c **** break; |
206:I2CInterface.c **** |
207:I2CInterface.c **** case TW_MT_SLA_ACK: /* Slave acknowledged address, */ |
208:I2CInterface.c **** retry_cnt = 0; |
401 .stabn 68,0,208,.LM34-__vector_17 |
402 .LM34: |
403 00ea 1092 0000 sts retry_cnt,__zero_reg__ |
209:I2CInterface.c **** /* tx the data, and increment the data pointer */ |
210:I2CInterface.c **** TWDR = *twi_data; |
404 .stabn 68,0,210,.LM35-__vector_17 |
405 .LM35: |
406 00ee E091 0000 lds r30,twi_data |
407 00f2 F091 0000 lds r31,(twi_data)+1 |
408 00f6 8081 ld r24,Z |
409 00f8 83B9 out 35-0x20,r24 |
211:I2CInterface.c **** twi_data++; |
410 .stabn 68,0,211,.LM36-__vector_17 |
411 .LM36: |
412 00fa 3196 adiw r30,1 |
413 00fc F093 0000 sts (twi_data)+1,r31 |
414 0100 E093 0000 sts twi_data,r30 |
212:I2CInterface.c **** |
213:I2CInterface.c **** /* clear the int to continue */ |
GAS LISTING /tmp/ccZHfAgR.s page 12 |
214:I2CInterface.c **** TWCR |= (1<<TWINT); |
415 .stabn 68,0,214,.LM37-__vector_17 |
416 .LM37: |
417 0104 86B7 in r24,86-0x20 |
418 0106 8068 ori r24,lo8(-128) |
419 0108 86BF out 86-0x20,r24 |
420 010a 6EC0 rjmp .L42 |
421 .L27: |
215:I2CInterface.c **** break; |
216:I2CInterface.c **** |
217:I2CInterface.c **** case TW_MT_SLA_NACK: /* Slave didn't acknowledge address, */ |
218:I2CInterface.c **** case TW_MR_SLA_NACK: |
219:I2CInterface.c **** retry_cnt++; |
422 .stabn 68,0,219,.LM38-__vector_17 |
423 .LM38: |
424 010c 8091 0000 lds r24,retry_cnt |
425 0110 8F5F subi r24,lo8(-(1)) |
426 0112 8093 0000 sts retry_cnt,r24 |
220:I2CInterface.c **** |
221:I2CInterface.c **** /* retry...*/ |
222:I2CInterface.c **** TWCR |= (1<<TWINT)|(1<<TWSTA)|(1<<TWSTO); |
427 .stabn 68,0,222,.LM39-__vector_17 |
428 .LM39: |
429 0116 86B7 in r24,86-0x20 |
430 0118 806B ori r24,lo8(-80) |
431 011a 86BF out 86-0x20,r24 |
432 011c 65C0 rjmp .L42 |
433 .L28: |
223:I2CInterface.c **** break; |
224:I2CInterface.c **** |
225:I2CInterface.c **** case TW_MT_DATA_ACK: /* Slave Acknowledged data, */ |
226:I2CInterface.c **** if(--twi_bytes > 0) |
434 .stabn 68,0,226,.LM40-__vector_17 |
435 .LM40: |
436 011e 8091 0000 lds r24,twi_bytes |
437 0122 8150 subi r24,lo8(-(-1)) |
438 0124 8093 0000 sts twi_bytes,r24 |
439 0128 8091 0000 lds r24,twi_bytes |
440 012c 8823 tst r24 |
441 012e 79F0 breq .L36 |
227:I2CInterface.c **** { |
228:I2CInterface.c **** /* more data to send, so send it */ |
229:I2CInterface.c **** TWDR = *twi_data; |
442 .stabn 68,0,229,.LM41-__vector_17 |
443 .LM41: |
444 0130 E091 0000 lds r30,twi_data |
445 0134 F091 0000 lds r31,(twi_data)+1 |
446 0138 8081 ld r24,Z |
447 013a 83B9 out 35-0x20,r24 |
230:I2CInterface.c **** twi_data++; |
448 .stabn 68,0,230,.LM42-__vector_17 |
449 .LM42: |
450 013c 3196 adiw r30,1 |
451 013e F093 0000 sts (twi_data)+1,r31 |
452 0142 E093 0000 sts twi_data,r30 |
231:I2CInterface.c **** TWCR |= (1<<TWINT); |
453 .stabn 68,0,231,.LM43-__vector_17 |
GAS LISTING /tmp/ccZHfAgR.s page 13 |
454 .LM43: |
455 0146 86B7 in r24,86-0x20 |
456 0148 8068 ori r24,lo8(-128) |
457 014a 86BF out 86-0x20,r24 |
458 014c 4DC0 rjmp .L42 |
459 .L36: |
232:I2CInterface.c **** } |
233:I2CInterface.c **** else |
234:I2CInterface.c **** { |
235:I2CInterface.c **** /* generate the stop condition if needed */ |
236:I2CInterface.c **** TWCR |= (1<<TWSTO)|(1<<TWINT); |
460 .stabn 68,0,236,.LM44-__vector_17 |
461 .LM44: |
462 014e 86B7 in r24,86-0x20 |
463 0150 8069 ori r24,lo8(-112) |
464 0152 86BF out 86-0x20,r24 |
237:I2CInterface.c **** status &= ~(1<<BUSY); |
465 .stabn 68,0,237,.LM45-__vector_17 |
466 .LM45: |
467 0154 8091 0000 lds r24,status |
468 0158 8F77 andi r24,lo8(127) |
469 015a 8093 0000 sts status,r24 |
470 015e 44C0 rjmp .L42 |
471 .L29: |
238:I2CInterface.c **** } |
239:I2CInterface.c **** break; |
240:I2CInterface.c **** |
241:I2CInterface.c **** case TW_MT_DATA_NACK: /* Slave didn't acknowledge data */ |
242:I2CInterface.c **** /* send the stop condition */ |
243:I2CInterface.c **** TWCR |= (1<<TWINT)|(1<<TWSTO); |
472 .stabn 68,0,243,.LM46-__vector_17 |
473 .LM46: |
474 0160 86B7 in r24,86-0x20 |
475 0162 8069 ori r24,lo8(-112) |
476 0164 86BF out 86-0x20,r24 |
244:I2CInterface.c **** status &= ~(1<<BUSY); |
477 .stabn 68,0,244,.LM47-__vector_17 |
478 .LM47: |
479 0166 8091 0000 lds r24,status |
480 016a 8F77 andi r24,lo8(127) |
481 016c 8093 0000 sts status,r24 |
482 0170 3BC0 rjmp .L42 |
483 .L30: |
245:I2CInterface.c **** break; |
246:I2CInterface.c **** |
247:I2CInterface.c **** case TW_MR_SLA_ACK: /* Slave acknowledged address */ |
248:I2CInterface.c **** if(--twi_bytes > 0) |
484 .stabn 68,0,248,.LM48-__vector_17 |
485 .LM48: |
486 0172 8091 0000 lds r24,twi_bytes |
487 0176 8150 subi r24,lo8(-(-1)) |
488 0178 8093 0000 sts twi_bytes,r24 |
489 017c 8091 0000 lds r24,twi_bytes |
490 0180 8823 tst r24 |
491 0182 21F0 breq .L38 |
249:I2CInterface.c **** { |
250:I2CInterface.c **** /* if there is more than one byte to read, acknowledge */ |
GAS LISTING /tmp/ccZHfAgR.s page 14 |
251:I2CInterface.c **** TWCR |= (1<<TWEA)|(1<<TWINT); |
492 .stabn 68,0,251,.LM49-__vector_17 |
493 .LM49: |
494 0184 86B7 in r24,86-0x20 |
495 0186 806C ori r24,lo8(-64) |
496 0188 86BF out 86-0x20,r24 |
497 018a 2EC0 rjmp .L42 |
498 .L38: |
252:I2CInterface.c **** } |
253:I2CInterface.c **** else |
254:I2CInterface.c **** { |
255:I2CInterface.c **** /* no acknowledge */ |
256:I2CInterface.c **** TWCR |= (1<<TWINT); |
499 .stabn 68,0,256,.LM50-__vector_17 |
500 .LM50: |
501 018c 86B7 in r24,86-0x20 |
502 018e 8068 ori r24,lo8(-128) |
503 0190 86BF out 86-0x20,r24 |
504 0192 2AC0 rjmp .L42 |
505 .L31: |
257:I2CInterface.c **** } |
258:I2CInterface.c **** break; |
259:I2CInterface.c **** |
260:I2CInterface.c **** case TW_MR_DATA_ACK: /* Master acknowledged data */ |
261:I2CInterface.c **** |
262:I2CInterface.c **** /* grab the received data */ |
263:I2CInterface.c **** *twi_data = TWDR; |
506 .stabn 68,0,263,.LM51-__vector_17 |
507 .LM51: |
508 0194 E091 0000 lds r30,twi_data |
509 0198 F091 0000 lds r31,(twi_data)+1 |
510 019c 83B1 in r24,35-0x20 |
511 019e 8083 st Z,r24 |
264:I2CInterface.c **** twi_data++; |
512 .stabn 68,0,264,.LM52-__vector_17 |
513 .LM52: |
514 01a0 3196 adiw r30,1 |
515 01a2 F093 0000 sts (twi_data)+1,r31 |
516 01a6 E093 0000 sts twi_data,r30 |
265:I2CInterface.c **** if(--twi_bytes > 0) |
517 .stabn 68,0,265,.LM53-__vector_17 |
518 .LM53: |
519 01aa 8091 0000 lds r24,twi_bytes |
520 01ae 8150 subi r24,lo8(-(-1)) |
521 01b0 8093 0000 sts twi_bytes,r24 |
522 01b4 8091 0000 lds r24,twi_bytes |
523 01b8 8823 tst r24 |
524 01ba 21F0 breq .L40 |
266:I2CInterface.c **** { |
267:I2CInterface.c **** /* get the next data byte and ack */ |
268:I2CInterface.c **** TWCR |= (1<<TWEA)|(1<<TWINT); |
525 .stabn 68,0,268,.LM54-__vector_17 |
526 .LM54: |
527 01bc 86B7 in r24,86-0x20 |
528 01be 806C ori r24,lo8(-64) |
529 01c0 86BF out 86-0x20,r24 |
530 01c2 12C0 rjmp .L42 |
GAS LISTING /tmp/ccZHfAgR.s page 15 |
531 .L40: |
269:I2CInterface.c **** } |
270:I2CInterface.c **** else |
271:I2CInterface.c **** { |
272:I2CInterface.c **** /* clear out the enable acknowledge bit */ |
273:I2CInterface.c **** TWCR &= ~(1<<TWEA); |
532 .stabn 68,0,273,.LM55-__vector_17 |
533 .LM55: |
534 01c4 86B7 in r24,86-0x20 |
535 01c6 8F7B andi r24,lo8(-65) |
536 01c8 86BF out 86-0x20,r24 |
537 01ca 0EC0 rjmp .L42 |
538 .L32: |
274:I2CInterface.c **** } |
275:I2CInterface.c **** break; |
276:I2CInterface.c **** |
277:I2CInterface.c **** case TW_MR_DATA_NACK: /* Master didn't acknowledge data -> end of read process */ |
278:I2CInterface.c **** /* read data, and generate the stop condition */ |
279:I2CInterface.c **** *twi_data = TWDR; |
539 .stabn 68,0,279,.LM56-__vector_17 |
540 .LM56: |
541 01cc E091 0000 lds r30,twi_data |
542 01d0 F091 0000 lds r31,(twi_data)+1 |
543 01d4 83B1 in r24,35-0x20 |
544 01d6 8083 st Z,r24 |
280:I2CInterface.c **** TWCR |= (1<<TWSTO)|(1<<TWINT); |
545 .stabn 68,0,280,.LM57-__vector_17 |
546 .LM57: |
547 01d8 86B7 in r24,86-0x20 |
548 01da 8069 ori r24,lo8(-112) |
549 01dc 86BF out 86-0x20,r24 |
281:I2CInterface.c **** status &= ~(1<<BUSY); |
550 .stabn 68,0,281,.LM58-__vector_17 |
551 .LM58: |
552 01de 8091 0000 lds r24,status |
553 01e2 8F77 andi r24,lo8(127) |
554 01e4 8093 0000 sts status,r24 |
555 .L42: |
556 /* epilogue: frame size=0 */ |
557 01e8 FF91 pop r31 |
558 01ea EF91 pop r30 |
559 01ec BF91 pop r27 |
560 01ee AF91 pop r26 |
561 01f0 9F91 pop r25 |
562 01f2 8F91 pop r24 |
563 01f4 0F90 pop __tmp_reg__ |
564 01f6 0FBE out __SREG__,__tmp_reg__ |
565 01f8 0F90 pop __tmp_reg__ |
566 01fa 1F90 pop __zero_reg__ |
567 01fc 1895 reti |
568 /* epilogue end (size=11) */ |
569 /* function __vector_17 size 271 (249) */ |
570 .size __vector_17, .-__vector_17 |
571 .Lscope4: |
572 .stabs "",36,0,0,.Lscope4-__vector_17 |
573 .stabd 78,0,0 |
574 .lcomm twi_address,1 |
GAS LISTING /tmp/ccZHfAgR.s page 16 |
575 .lcomm twi_data,2 |
576 .lcomm twi_ddr,1 |
577 .lcomm twi_bytes,1 |
578 .lcomm status,1 |
579 .lcomm retry_cnt,1 |
580 .stabs "twi_address:S(0,17)=B(0,11)",40,0,59,twi_address |
581 .stabs "twi_data:S(0,18)=*(0,17)",40,0,60,twi_data |
582 .stabs "twi_ddr:S(0,17)",40,0,61,twi_ddr |
583 .stabs "twi_bytes:S(0,17)",40,0,62,twi_bytes |
584 .stabs "status:S(0,17)",40,0,63,status |
585 .stabs "retry_cnt:S(0,17)",40,0,64,retry_cnt |
586 .stabs "",100,0,0,.Letext0 |
587 .Letext0: |
588 /* File "I2CInterface.c": code 336 = 0x0150 ( 310), prologues 11, epilogues 15 */ |
GAS LISTING /tmp/ccZHfAgR.s page 17 |
DEFINED SYMBOLS |
*ABS*:00000000 I2CInterface.c |
/tmp/ccZHfAgR.s:3 *ABS*:0000003f __SREG__ |
/tmp/ccZHfAgR.s:4 *ABS*:0000003e __SP_H__ |
/tmp/ccZHfAgR.s:5 *ABS*:0000003d __SP_L__ |
/tmp/ccZHfAgR.s:6 *ABS*:00000000 __tmp_reg__ |
/tmp/ccZHfAgR.s:7 *ABS*:00000001 __zero_reg__ |
/tmp/ccZHfAgR.s:79 .text:00000000 I2CInt_init |
/tmp/ccZHfAgR.s:106 .text:00000008 I2CInt_writeData |
/tmp/ccZHfAgR.s:577 .bss:00000005 status |
.bss:00000000 twi_address |
/tmp/ccZHfAgR.s:574 .bss:00000001 twi_data |
/tmp/ccZHfAgR.s:576 .bss:00000004 twi_bytes |
/tmp/ccZHfAgR.s:575 .bss:00000003 twi_ddr |
/tmp/ccZHfAgR.s:578 .bss:00000006 retry_cnt |
/tmp/ccZHfAgR.s:164 .text:00000040 I2CInt_readData |
/tmp/ccZHfAgR.s:214 .text:00000074 I2CInt_isI2cBusy |
/tmp/ccZHfAgR.s:240 .text:00000082 __vector_17 |
UNDEFINED SYMBOLS |
__do_copy_data |
__do_clear_bss |
/programy/C/avr/AVRcam/Main.lst |
---|
0,0 → 1,279 |
GAS LISTING /tmp/ccgNUTZJ.s page 1 |
1 .file "Main.c" |
2 .arch atmega8 |
3 __SREG__ = 0x3f |
4 __SP_H__ = 0x3e |
5 __SP_L__ = 0x3d |
6 __tmp_reg__ = 0 |
7 __zero_reg__ = 1 |
8 .global __do_copy_data |
9 .global __do_clear_bss |
10 .stabs "/home/kaklik/projects/programy/Atmel_C/AVRcam/",100,0,2,.Ltext0 |
11 .stabs "Main.c",100,0,2,.Ltext0 |
12 .text |
13 .Ltext0: |
14 .stabs "gcc2_compiled.",60,0,0,0 |
15 .stabs "int:t(0,1)=r(0,1);-32768;32767;",128,0,0,0 |
16 .stabs "char:t(0,2)=@s8;r(0,2);0;255;",128,0,0,0 |
17 .stabs "long int:t(0,3)=@s32;r(0,3);020000000000;017777777777;",128,0,0,0 |
18 .stabs "unsigned int:t(0,4)=r(0,4);0;0177777;",128,0,0,0 |
19 .stabs "long unsigned int:t(0,5)=@s32;r(0,5);0;037777777777;",128,0,0,0 |
20 .stabs "long long int:t(0,6)=@s64;r(0,6);01000000000000000000000;0777777777777777777777;",128,0,0, |
21 .stabs "long long unsigned int:t(0,7)=@s64;r(0,7);0;01777777777777777777777;",128,0,0,0 |
22 .stabs "short int:t(0,8)=r(0,8);-32768;32767;",128,0,0,0 |
23 .stabs "short unsigned int:t(0,9)=r(0,9);0;0177777;",128,0,0,0 |
24 .stabs "signed char:t(0,10)=@s8;r(0,10);-128;127;",128,0,0,0 |
25 .stabs "unsigned char:t(0,11)=@s8;r(0,11);0;255;",128,0,0,0 |
26 .stabs "float:t(0,12)=r(0,1);4;0;",128,0,0,0 |
27 .stabs "double:t(0,13)=r(0,1);4;0;",128,0,0,0 |
28 .stabs "long double:t(0,14)=r(0,1);4;0;",128,0,0,0 |
29 .stabs "void:t(0,15)=(0,15)",128,0,0,0 |
30 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/io.h",130,0,0,0 |
31 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/sfr_defs.h",130,0,0,0 |
32 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/inttypes.h",130,0,0,0 |
33 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/stdint.h",130,0,0,0 |
34 .stabs "int8_t:t(4,1)=(0,10)",128,0,116,0 |
35 .stabs "uint8_t:t(4,2)=(0,11)",128,0,117,0 |
36 .stabs "int16_t:t(4,3)=(0,1)",128,0,118,0 |
37 .stabs "uint16_t:t(4,4)=(0,4)",128,0,119,0 |
38 .stabs "int32_t:t(4,5)=(0,3)",128,0,120,0 |
39 .stabs "uint32_t:t(4,6)=(0,5)",128,0,121,0 |
40 .stabs "int64_t:t(4,7)=(0,6)",128,0,122,0 |
41 .stabs "uint64_t:t(4,8)=(0,7)",128,0,123,0 |
42 .stabs "intptr_t:t(4,9)=(4,3)",128,0,135,0 |
43 .stabs "uintptr_t:t(4,10)=(4,4)",128,0,140,0 |
44 .stabs "int_least8_t:t(4,11)=(4,1)",128,0,152,0 |
45 .stabs "uint_least8_t:t(4,12)=(4,2)",128,0,157,0 |
46 .stabs "int_least16_t:t(4,13)=(4,3)",128,0,162,0 |
47 .stabs "uint_least16_t:t(4,14)=(4,4)",128,0,167,0 |
48 .stabs "int_least32_t:t(4,15)=(4,5)",128,0,172,0 |
49 .stabs "uint_least32_t:t(4,16)=(4,6)",128,0,177,0 |
50 .stabs "int_least64_t:t(4,17)=(4,7)",128,0,182,0 |
51 .stabs "uint_least64_t:t(4,18)=(4,8)",128,0,187,0 |
52 .stabs "int_fast8_t:t(4,19)=(4,1)",128,0,200,0 |
53 .stabs "uint_fast8_t:t(4,20)=(4,2)",128,0,205,0 |
54 .stabs "int_fast16_t:t(4,21)=(4,3)",128,0,210,0 |
55 .stabs "uint_fast16_t:t(4,22)=(4,4)",128,0,215,0 |
56 .stabs "int_fast32_t:t(4,23)=(4,5)",128,0,220,0 |
57 .stabs "uint_fast32_t:t(4,24)=(4,6)",128,0,225,0 |
GAS LISTING /tmp/ccgNUTZJ.s page 2 |
58 .stabs "int_fast64_t:t(4,25)=(4,7)",128,0,230,0 |
59 .stabs "uint_fast64_t:t(4,26)=(4,8)",128,0,235,0 |
60 .stabs "intmax_t:t(4,27)=(4,7)",128,0,249,0 |
61 .stabs "uintmax_t:t(4,28)=(4,8)",128,0,254,0 |
62 .stabn 162,0,0,0 |
63 .stabs "int_farptr_t:t(3,1)=(4,5)",128,0,76,0 |
64 .stabs "uint_farptr_t:t(3,2)=(4,6)",128,0,80,0 |
65 .stabn 162,0,0,0 |
66 .stabn 162,0,0,0 |
67 .stabn 162,0,0,0 |
68 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/stdlib.h",130,0,0,0 |
69 .stabs "/usr/lib/gcc/avr/4.1.0/include/stddef.h",130,0,0,0 |
70 .stabs "size_t:t(6,1)=(0,4)",128,0,214,0 |
71 .stabs "wchar_t:t(6,2)=(0,1)",128,0,326,0 |
72 .stabn 162,0,0,0 |
73 .stabs "div_t:t(5,1)=(5,2)=s4quot:(0,1),0,16;rem:(0,1),16,16;;",128,0,69,0 |
74 .stabs "ldiv_t:t(5,3)=(5,4)=s8quot:(0,3),0,32;rem:(0,3),32,32;;",128,0,75,0 |
75 .stabs "__compar_fn_t:t(5,5)=(5,6)=*(5,7)=f(0,1)",128,0,78,0 |
76 .stabn 162,0,0,0 |
77 .stabs "I2CInterface.h",130,0,0,0 |
78 .stabs "CommonDefs.h",130,0,0,0 |
79 .stabs "bool_t:t(8,1)=(0,11)",128,0,56,0 |
80 .stabn 162,0,0,0 |
81 .stabs "i2cCmd_t:t(7,1)=(7,2)=s2configReg:(0,11),0,8;data:(0,11),8,8;;",128,0,53,0 |
82 .stabn 162,0,0,0 |
83 .stabs "main:F(0,1)",36,0,70,main |
84 .global main |
85 .type main, @function |
86 main: |
87 .stabd 46,0,0 |
1:Main.c **** /* |
2:Main.c **** Copyright (C) 2004 John Orlando |
3:Main.c **** |
4:Main.c **** AVRcam: a small real-time image processing engine. |
5:Main.c **** |
6:Main.c **** This program is free software; you can redistribute it and/or |
7:Main.c **** modify it under the terms of the GNU General Public |
8:Main.c **** License as published by the Free Software Foundation; either |
9:Main.c **** version 2 of the License, or (at your option) any later version. |
10:Main.c **** |
11:Main.c **** This program is distributed in the hope that it will be useful, |
12:Main.c **** but WITHOUT ANY WARRANTY; without even the implied warranty of |
13:Main.c **** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14:Main.c **** General Public License for more details. |
15:Main.c **** |
16:Main.c **** You should have received a copy of the GNU General Public |
17:Main.c **** License along with this program; if not, write to the Free Software |
18:Main.c **** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19:Main.c **** |
20:Main.c **** For more information on the AVRcam, please contact: |
21:Main.c **** |
22:Main.c **** john@jrobot.net |
23:Main.c **** |
24:Main.c **** or go to www.jrobot.net for more details regarding the system. |
25:Main.c **** */ |
26:Main.c **** /*********************************************************** |
27:Main.c **** Module Name: Main.c |
GAS LISTING /tmp/ccgNUTZJ.s page 3 |
28:Main.c **** Module Date: 04/10/2004 |
29:Main.c **** Module Auth: John Orlando |
30:Main.c **** |
31:Main.c **** Description: This module is responsible for providing |
32:Main.c **** the entry point to the code through the "main" function. |
33:Main.c **** |
34:Main.c **** Revision History: |
35:Main.c **** Date Rel Ver. Notes |
36:Main.c **** 4/10/2004 0.1 Module created |
37:Main.c **** 6/30/2004 1.0 Initial release for Circuit Cellar |
38:Main.c **** contest. |
39:Main.c **** ***********************************************************/ |
40:Main.c **** |
41:Main.c **** /* Includes */ |
42:Main.c **** #include <avr/io.h> |
43:Main.c **** #include <stdlib.h> |
44:Main.c **** #include <string.h> |
45:Main.c **** #include "UIMgr.h" |
46:Main.c **** #include "UartInterface.h" |
47:Main.c **** #include "I2CInterface.h" |
48:Main.c **** #include "CamInterface.h" |
49:Main.c **** #include "DebugInterface.h" |
50:Main.c **** #include "FrameMgr.h" |
51:Main.c **** #include "CommonDefs.h" |
52:Main.c **** #include "CamConfig.h" |
53:Main.c **** #include "Executive.h" |
54:Main.c **** #include "Utility.h" |
55:Main.c **** |
56:Main.c **** /* Local Structures and Typedefs */ |
57:Main.c **** |
58:Main.c **** /* Extern Variables */ |
59:Main.c **** |
60:Main.c **** /* Definitions */ |
61:Main.c **** |
62:Main.c **** /*********************************************************** |
63:Main.c **** Function Name: main |
64:Main.c **** Function Description: This function provides the entry |
65:Main.c **** point into AVRcam application. |
66:Main.c **** Inputs: none |
67:Main.c **** Outputs: int |
68:Main.c **** ***********************************************************/ |
69:Main.c **** int main(void) |
70:Main.c **** { |
88 .stabn 68,0,70,.LM0-main |
89 .LM0: |
90 /* prologue: frame size=0 */ |
91 0000 C0E0 ldi r28,lo8(__stack - 0) |
92 0002 D0E0 ldi r29,hi8(__stack - 0) |
93 0004 DEBF out __SP_H__,r29 |
94 0006 CDBF out __SP_L__,r28 |
95 /* prologue end (size=4) */ |
71:Main.c **** /* initialize all of the interface modules */ |
72:Main.c **** DebugInt_init(); |
96 .stabn 68,0,72,.LM1-main |
97 .LM1: |
98 0008 00D0 rcall DebugInt_init |
73:Main.c **** UartInt_init(); |
GAS LISTING /tmp/ccgNUTZJ.s page 4 |
99 .stabn 68,0,73,.LM2-main |
100 .LM2: |
101 000a 00D0 rcall UartInt_init |
74:Main.c **** I2CInt_init(); |
102 .stabn 68,0,74,.LM3-main |
103 .LM3: |
104 000c 00D0 rcall I2CInt_init |
75:Main.c **** CamInt_init(); |
105 .stabn 68,0,75,.LM4-main |
106 .LM4: |
107 000e 00D0 rcall CamInt_init |
76:Main.c **** |
77:Main.c **** /* initialize the remaining modules that will process |
78:Main.c **** data...interrupts need to be on for these */ |
79:Main.c **** ENABLE_INTS(); |
108 .stabn 68,0,79,.LM5-main |
109 .LM5: |
110 /* #APP */ |
111 0010 7894 sei |
80:Main.c **** CamConfig_init(); |
112 .stabn 68,0,80,.LM6-main |
113 .LM6: |
114 /* #NOAPP */ |
115 0012 00D0 rcall CamConfig_init |
81:Main.c **** UIMgr_init(); |
116 .stabn 68,0,81,.LM7-main |
117 .LM7: |
118 0014 00D0 rcall UIMgr_init |
82:Main.c **** FrameMgr_init(); |
119 .stabn 68,0,82,.LM8-main |
120 .LM8: |
121 0016 00D0 rcall FrameMgr_init |
83:Main.c **** |
84:Main.c **** /* provide a short delay for the camera to stabilize before |
85:Main.c **** we let the executive start up */ |
86:Main.c **** Utility_delay(1000); |
122 .stabn 68,0,86,.LM9-main |
123 .LM9: |
124 0018 88EE ldi r24,lo8(1000) |
125 001a 93E0 ldi r25,hi8(1000) |
126 001c 00D0 rcall Utility_delay |
87:Main.c **** |
88:Main.c **** /* the rest of the application will be under the |
89:Main.c **** control of the Executive. */ |
90:Main.c **** Exec_run(); |
127 .stabn 68,0,90,.LM10-main |
128 .LM10: |
129 001e 00D0 rcall Exec_run |
91:Main.c **** |
92:Main.c **** /* this should never be reached */ |
93:Main.c **** return(0); |
94:Main.c **** } |
130 .stabn 68,0,94,.LM11-main |
131 .LM11: |
132 0020 80E0 ldi r24,lo8(0) |
133 0022 90E0 ldi r25,hi8(0) |
134 /* epilogue: frame size=0 */ |
GAS LISTING /tmp/ccgNUTZJ.s page 5 |
135 0024 00C0 rjmp exit |
136 /* epilogue end (size=1) */ |
137 /* function main size 20 (15) */ |
138 .size main, .-main |
139 .Lscope0: |
140 .stabs "",36,0,0,.Lscope0-main |
141 .stabd 78,0,0 |
142 .stabs "",100,0,0,.Letext0 |
143 .Letext0: |
144 /* File "Main.c": code 20 = 0x0014 ( 15), prologues 4, epilogues 1 */ |
GAS LISTING /tmp/ccgNUTZJ.s page 6 |
DEFINED SYMBOLS |
*ABS*:00000000 Main.c |
/tmp/ccgNUTZJ.s:3 *ABS*:0000003f __SREG__ |
/tmp/ccgNUTZJ.s:4 *ABS*:0000003e __SP_H__ |
/tmp/ccgNUTZJ.s:5 *ABS*:0000003d __SP_L__ |
/tmp/ccgNUTZJ.s:6 *ABS*:00000000 __tmp_reg__ |
/tmp/ccgNUTZJ.s:7 *ABS*:00000001 __zero_reg__ |
/tmp/ccgNUTZJ.s:86 .text:00000000 main |
UNDEFINED SYMBOLS |
__do_copy_data |
__do_clear_bss |
__stack |
DebugInt_init |
UartInt_init |
I2CInt_init |
CamInt_init |
CamConfig_init |
UIMgr_init |
FrameMgr_init |
Utility_delay |
Exec_run |
exit |
/programy/C/avr/AVRcam/UIMgr.lst |
---|
0,0 → 1,2363 |
GAS LISTING /tmp/ccRvT1Qm.s page 1 |
1 .file "UIMgr.c" |
2 .arch atmega8 |
3 __SREG__ = 0x3f |
4 __SP_H__ = 0x3e |
5 __SP_L__ = 0x3d |
6 __tmp_reg__ = 0 |
7 __zero_reg__ = 1 |
8 .global __do_copy_data |
9 .global __do_clear_bss |
10 .stabs "/home/kaklik/projects/programy/Atmel_C/AVRcam/",100,0,2,.Ltext0 |
11 .stabs "UIMgr.c",100,0,2,.Ltext0 |
12 .text |
13 .Ltext0: |
14 .stabs "gcc2_compiled.",60,0,0,0 |
15 .stabs "int:t(0,1)=r(0,1);-32768;32767;",128,0,0,0 |
16 .stabs "char:t(0,2)=@s8;r(0,2);0;255;",128,0,0,0 |
17 .stabs "long int:t(0,3)=@s32;r(0,3);020000000000;017777777777;",128,0,0,0 |
18 .stabs "unsigned int:t(0,4)=r(0,4);0;0177777;",128,0,0,0 |
19 .stabs "long unsigned int:t(0,5)=@s32;r(0,5);0;037777777777;",128,0,0,0 |
20 .stabs "long long int:t(0,6)=@s64;r(0,6);01000000000000000000000;0777777777777777777777;",128,0,0, |
21 .stabs "long long unsigned int:t(0,7)=@s64;r(0,7);0;01777777777777777777777;",128,0,0,0 |
22 .stabs "short int:t(0,8)=r(0,8);-32768;32767;",128,0,0,0 |
23 .stabs "short unsigned int:t(0,9)=r(0,9);0;0177777;",128,0,0,0 |
24 .stabs "signed char:t(0,10)=@s8;r(0,10);-128;127;",128,0,0,0 |
25 .stabs "unsigned char:t(0,11)=@s8;r(0,11);0;255;",128,0,0,0 |
26 .stabs "float:t(0,12)=r(0,1);4;0;",128,0,0,0 |
27 .stabs "double:t(0,13)=r(0,1);4;0;",128,0,0,0 |
28 .stabs "long double:t(0,14)=r(0,1);4;0;",128,0,0,0 |
29 .stabs "void:t(0,15)=(0,15)",128,0,0,0 |
30 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/io.h",130,0,0,0 |
31 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/sfr_defs.h",130,0,0,0 |
32 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/inttypes.h",130,0,0,0 |
33 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/stdint.h",130,0,0,0 |
34 .stabs "int8_t:t(4,1)=(0,10)",128,0,116,0 |
35 .stabs "uint8_t:t(4,2)=(0,11)",128,0,117,0 |
36 .stabs "int16_t:t(4,3)=(0,1)",128,0,118,0 |
37 .stabs "uint16_t:t(4,4)=(0,4)",128,0,119,0 |
38 .stabs "int32_t:t(4,5)=(0,3)",128,0,120,0 |
39 .stabs "uint32_t:t(4,6)=(0,5)",128,0,121,0 |
40 .stabs "int64_t:t(4,7)=(0,6)",128,0,122,0 |
41 .stabs "uint64_t:t(4,8)=(0,7)",128,0,123,0 |
42 .stabs "intptr_t:t(4,9)=(4,3)",128,0,135,0 |
43 .stabs "uintptr_t:t(4,10)=(4,4)",128,0,140,0 |
44 .stabs "int_least8_t:t(4,11)=(4,1)",128,0,152,0 |
45 .stabs "uint_least8_t:t(4,12)=(4,2)",128,0,157,0 |
46 .stabs "int_least16_t:t(4,13)=(4,3)",128,0,162,0 |
47 .stabs "uint_least16_t:t(4,14)=(4,4)",128,0,167,0 |
48 .stabs "int_least32_t:t(4,15)=(4,5)",128,0,172,0 |
49 .stabs "uint_least32_t:t(4,16)=(4,6)",128,0,177,0 |
50 .stabs "int_least64_t:t(4,17)=(4,7)",128,0,182,0 |
51 .stabs "uint_least64_t:t(4,18)=(4,8)",128,0,187,0 |
52 .stabs "int_fast8_t:t(4,19)=(4,1)",128,0,200,0 |
53 .stabs "uint_fast8_t:t(4,20)=(4,2)",128,0,205,0 |
54 .stabs "int_fast16_t:t(4,21)=(4,3)",128,0,210,0 |
55 .stabs "uint_fast16_t:t(4,22)=(4,4)",128,0,215,0 |
56 .stabs "int_fast32_t:t(4,23)=(4,5)",128,0,220,0 |
57 .stabs "uint_fast32_t:t(4,24)=(4,6)",128,0,225,0 |
GAS LISTING /tmp/ccRvT1Qm.s page 2 |
58 .stabs "int_fast64_t:t(4,25)=(4,7)",128,0,230,0 |
59 .stabs "uint_fast64_t:t(4,26)=(4,8)",128,0,235,0 |
60 .stabs "intmax_t:t(4,27)=(4,7)",128,0,249,0 |
61 .stabs "uintmax_t:t(4,28)=(4,8)",128,0,254,0 |
62 .stabn 162,0,0,0 |
63 .stabs "int_farptr_t:t(3,1)=(4,5)",128,0,76,0 |
64 .stabs "uint_farptr_t:t(3,2)=(4,6)",128,0,80,0 |
65 .stabn 162,0,0,0 |
66 .stabn 162,0,0,0 |
67 .stabn 162,0,0,0 |
68 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/stdlib.h",130,0,0,0 |
69 .stabs "/usr/lib/gcc/avr/4.1.0/include/stddef.h",130,0,0,0 |
70 .stabs "size_t:t(6,1)=(0,4)",128,0,214,0 |
71 .stabs "wchar_t:t(6,2)=(0,1)",128,0,326,0 |
72 .stabn 162,0,0,0 |
73 .stabs "div_t:t(5,1)=(5,2)=s4quot:(0,1),0,16;rem:(0,1),16,16;;",128,0,69,0 |
74 .stabs "ldiv_t:t(5,3)=(5,4)=s8quot:(0,3),0,32;rem:(0,3),32,32;;",128,0,75,0 |
75 .stabs "__compar_fn_t:t(5,5)=(5,6)=*(5,7)=f(0,1)",128,0,78,0 |
76 .stabn 162,0,0,0 |
77 .stabs "CommonDefs.h",130,0,0,0 |
78 .stabs "bool_t:t(7,1)=(0,11)",128,0,56,0 |
79 .stabn 162,0,0,0 |
80 .stabs "CamConfig.h",130,0,0,0 |
81 .stabs "I2CInterface.h",130,0,0,0 |
82 .stabs "i2cCmd_t:t(9,1)=(9,2)=s2configReg:(0,11),0,8;data:(0,11),8,8;;",128,0,53,0 |
83 .stabn 162,0,0,0 |
84 .stabn 162,0,0,0 |
85 .stabs " :T(0,16)=@s8;egetVersionCmd:0,pingCmd:1,setCameraRegsCmd:2,dumpFrameCmd:3,enableTrackingC |
86 .stabs "UIMgr_Cmd_t:t(0,17)=(0,16)",128,0,81,0 |
87 .stabs " :T(0,18)=@s8;esetRed:0,setGreen:1,setBlue:2,;",128,0,0,0 |
88 .stabs "setColorState_t:t(0,19)=(0,18)",128,0,88,0 |
89 .stabs "UIMgr_writeBufferToTxFifo:F(0,15)",36,0,547,UIMgr_writeBufferToTxFifo |
90 .stabs "pData:P(0,20)=*(0,11)",64,0,546,26 |
91 .stabs "length:P(0,11)",64,0,546,24 |
92 .global UIMgr_writeBufferToTxFifo |
93 .type UIMgr_writeBufferToTxFifo, @function |
94 UIMgr_writeBufferToTxFifo: |
95 .stabd 46,0,0 |
1:UIMgr.c **** /* |
2:UIMgr.c **** Copyright (C) 2004 John Orlando |
3:UIMgr.c **** |
4:UIMgr.c **** AVRcam: a small real-time image processing engine. |
5:UIMgr.c **** |
6:UIMgr.c **** This program is free software; you can redistribute it and/or |
7:UIMgr.c **** modify it under the terms of the GNU General Public |
8:UIMgr.c **** License as published by the Free Software Foundation; either |
9:UIMgr.c **** version 2 of the License, or (at your option) any later version. |
10:UIMgr.c **** |
11:UIMgr.c **** This program is distributed in the hope that it will be useful, |
12:UIMgr.c **** but WITHOUT ANY WARRANTY; without even the implied warranty of |
13:UIMgr.c **** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14:UIMgr.c **** General Public License for more details. |
15:UIMgr.c **** |
16:UIMgr.c **** You should have received a copy of the GNU General Public |
17:UIMgr.c **** License along with this program; if not, write to the Free Software |
18:UIMgr.c **** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19:UIMgr.c **** |
GAS LISTING /tmp/ccRvT1Qm.s page 3 |
20:UIMgr.c **** For more information on the AVRcam, please contact: |
21:UIMgr.c **** |
22:UIMgr.c **** john@jrobot.net |
23:UIMgr.c **** |
24:UIMgr.c **** or go to www.jrobot.net for more details regarding the system. |
25:UIMgr.c **** */ |
26:UIMgr.c **** /*********************************************************** |
27:UIMgr.c **** Module Name: UIMgr.c |
28:UIMgr.c **** Module Date: 04/10/2004 |
29:UIMgr.c **** Module Auth: John Orlando |
30:UIMgr.c **** |
31:UIMgr.c **** Description: This module is responsible for providing |
32:UIMgr.c **** the processing to manage the user interface of the |
33:UIMgr.c **** system. This user interface is provided via the UART. |
34:UIMgr.c **** This module handles the incoming serial commands, and |
35:UIMgr.c **** performs the needed functionality. It is then |
36:UIMgr.c **** responsible for generating any needed response to |
37:UIMgr.c **** the external entity. |
38:UIMgr.c **** |
39:UIMgr.c **** Revision History: |
40:UIMgr.c **** Date Rel Ver. Notes |
41:UIMgr.c **** 4/10/2004 0.1 Module created |
42:UIMgr.c **** 6/30/2004 1.0 Initial release for Circuit Cellar |
43:UIMgr.c **** contest. |
44:UIMgr.c **** 11/15/2004 1.2 Updated version string to 1.2. |
45:UIMgr.c **** 1/16/2005 1.4 Added code to write the colorMap |
46:UIMgr.c **** to EEPROM one byte at a time, |
47:UIMgr.c **** ensuring that the EEPROM is only |
48:UIMgr.c **** written when the data is different |
49:UIMgr.c **** than the current value (thus saving |
50:UIMgr.c **** EEPROM writes). Updated version |
51:UIMgr.c **** string to 1.4. |
52:UIMgr.c **** ***********************************************************/ |
53:UIMgr.c **** |
54:UIMgr.c **** /* Includes */ |
55:UIMgr.c **** #include <avr/io.h> |
56:UIMgr.c **** #include <stdlib.h> |
57:UIMgr.c **** #include <string.h> |
58:UIMgr.c **** #include <avr/eeprom.h> |
59:UIMgr.c **** #include "CommonDefs.h" |
60:UIMgr.c **** #include "UIMgr.h" |
61:UIMgr.c **** #include "UartInterface.h" |
62:UIMgr.c **** #include "CamConfig.h" |
63:UIMgr.c **** #include "Utility.h" |
64:UIMgr.c **** #include "Executive.h" |
65:UIMgr.c **** #include "CamInterface.h" |
66:UIMgr.c **** |
67:UIMgr.c **** /* Local Structures and Typedefs */ |
68:UIMgr.c **** |
69:UIMgr.c **** typedef enum |
70:UIMgr.c **** { |
71:UIMgr.c **** getVersionCmd, |
72:UIMgr.c **** pingCmd, |
73:UIMgr.c **** setCameraRegsCmd, |
74:UIMgr.c **** dumpFrameCmd, |
75:UIMgr.c **** enableTrackingCmd, |
76:UIMgr.c **** disableTrackingCmd, |
GAS LISTING /tmp/ccRvT1Qm.s page 4 |
77:UIMgr.c **** setColorMapCmd, |
78:UIMgr.c **** resetCameraCmd, |
79:UIMgr.c **** noCmd, |
80:UIMgr.c **** invalidCmd |
81:UIMgr.c **** } UIMgr_Cmd_t; |
82:UIMgr.c **** |
83:UIMgr.c **** typedef enum |
84:UIMgr.c **** { |
85:UIMgr.c **** setRed, |
86:UIMgr.c **** setGreen, |
87:UIMgr.c **** setBlue |
88:UIMgr.c **** } setColorState_t; |
89:UIMgr.c **** |
90:UIMgr.c **** |
91:UIMgr.c **** /* Local Variables */ |
92:UIMgr.c **** static unsigned char charCount = 0; |
93:UIMgr.c **** static unsigned char charIndex = 0; |
94:UIMgr.c **** static unsigned char asciiTokenBuffer[MAX_TOKEN_LENGTH+1]; /* +1 to ensure NULL at end */ |
95:UIMgr.c **** static unsigned char tokenCount = 0; |
96:UIMgr.c **** static unsigned char tokenBuffer[MAX_TOKEN_COUNT]; |
97:UIMgr.c **** static UIMgr_Cmd_t receivedCmd = noCmd; |
98:UIMgr.c **** static unsigned char AVRcamVersion[] = "AVRcam v1.4\r"; |
99:UIMgr.c **** |
100:UIMgr.c **** /* Local Function Declaration */ |
101:UIMgr.c **** static unsigned char UIMgr_readRxFifo(void); |
102:UIMgr.c **** static unsigned char UIMgr_readTxFifo(void); |
103:UIMgr.c **** static unsigned char UIMgr_readRxFifo(void); |
104:UIMgr.c **** static void UIMgr_sendNck(void); |
105:UIMgr.c **** static void UIMgr_sendAck(void); |
106:UIMgr.c **** static void UIMgr_convertTokenToCmd(void); |
107:UIMgr.c **** static void UIMgr_convertTokenToValue(void); |
108:UIMgr.c **** static void UIMgr_executeCmd(void); |
109:UIMgr.c **** |
110:UIMgr.c **** /* Extern Variables */ |
111:UIMgr.c **** unsigned char UIMgr_rxFifo[UI_MGR_RX_FIFO_SIZE]; |
112:UIMgr.c **** unsigned char UIMgr_rxFifoHead=0; |
113:UIMgr.c **** unsigned char UIMgr_rxFifoTail=0; |
114:UIMgr.c **** |
115:UIMgr.c **** unsigned char UIMgr_txFifo[UI_MGR_TX_FIFO_SIZE]; |
116:UIMgr.c **** unsigned char UIMgr_txFifoHead=0; |
117:UIMgr.c **** unsigned char UIMgr_txFifoTail=0; |
118:UIMgr.c **** |
119:UIMgr.c **** /* Definitions */ |
120:UIMgr.c **** #define IS_DATA_IN_TX_FIFO() (!(UIMgr_txFifoHead == UIMgr_txFifoTail)) |
121:UIMgr.c **** #define IS_DATA_IN_RX_FIFO() (!(UIMgr_rxFifoHead == UIMgr_rxFifoTail)) |
122:UIMgr.c **** |
123:UIMgr.c **** /* MAX_EEPROM_WRITE_ATTEMPTS limits the number of writes that can be |
124:UIMgr.c **** done to a particular EEPROM cell, so that it can't possible just |
125:UIMgr.c **** write to the same cell over and over */ |
126:UIMgr.c **** #define MAX_EEPROM_WRITE_ATTEMPTS 3 |
127:UIMgr.c **** |
128:UIMgr.c **** /*********************************************************** |
129:UIMgr.c **** Function Name: UIMgr_init |
130:UIMgr.c **** Function Description: This function is responsible for |
131:UIMgr.c **** initializing the UIMgr module. It sets up the fifo |
132:UIMgr.c **** used to hold incoming data, etc. |
133:UIMgr.c **** Inputs: none |
GAS LISTING /tmp/ccRvT1Qm.s page 5 |
134:UIMgr.c **** Outputs: none |
135:UIMgr.c **** ***********************************************************/ |
136:UIMgr.c **** void UIMgr_init(void) |
137:UIMgr.c **** { |
138:UIMgr.c **** memset(asciiTokenBuffer,0x00,MAX_TOKEN_LENGTH+1); |
139:UIMgr.c **** memset(tokenBuffer,0x00,MAX_TOKEN_COUNT); |
140:UIMgr.c **** memset(UIMgr_txFifo,0x00,UI_MGR_TX_FIFO_SIZE); |
141:UIMgr.c **** memset(UIMgr_rxFifo,0x00,UI_MGR_RX_FIFO_SIZE); |
142:UIMgr.c **** } |
143:UIMgr.c **** |
144:UIMgr.c **** /*********************************************************** |
145:UIMgr.c **** Function Name: UIMgr_dispatchEvent |
146:UIMgr.c **** Function Description: This function is responsible for |
147:UIMgr.c **** processing events that pertain to the UIMgr. |
148:UIMgr.c **** Inputs: event - the generated event |
149:UIMgr.c **** Outputs: none |
150:UIMgr.c **** ***********************************************************/ |
151:UIMgr.c **** void UIMgr_dispatchEvent(unsigned char event) |
152:UIMgr.c **** { |
153:UIMgr.c **** switch(event) |
154:UIMgr.c **** { |
155:UIMgr.c **** case EV_ACQUIRE_LINE_COMPLETE: |
156:UIMgr.c **** UIMgr_transmitPendingData(); |
157:UIMgr.c **** break; |
158:UIMgr.c **** |
159:UIMgr.c **** case EV_SERIAL_DATA_RECEIVED: |
160:UIMgr.c **** UIMgr_processReceivedData(); |
161:UIMgr.c **** break; |
162:UIMgr.c **** |
163:UIMgr.c **** case EV_SERIAL_DATA_PENDING_TX: |
164:UIMgr.c **** UIMgr_flushTxBuffer(); |
165:UIMgr.c **** break; |
166:UIMgr.c **** } |
167:UIMgr.c **** } |
168:UIMgr.c **** /*********************************************************** |
169:UIMgr.c **** Function Name: UIMgr_transmitPendingData |
170:UIMgr.c **** Function Description: This function is responsible for |
171:UIMgr.c **** transmitting a single byte of data if data is waiting |
172:UIMgr.c **** to be sent. Otherwise, if nothing is waiting, the |
173:UIMgr.c **** function just returns. |
174:UIMgr.c **** Inputs: none |
175:UIMgr.c **** Outputs: none |
176:UIMgr.c **** ***********************************************************/ |
177:UIMgr.c **** void UIMgr_transmitPendingData(void) |
178:UIMgr.c **** { |
179:UIMgr.c **** if (IS_DATA_IN_TX_FIFO() == TRUE) |
180:UIMgr.c **** { |
181:UIMgr.c **** /* data is waiting...send a single byte */ |
182:UIMgr.c **** UartInt_txByte( UIMgr_readTxFifo() ); |
183:UIMgr.c **** } |
184:UIMgr.c **** } |
185:UIMgr.c **** /*********************************************************** |
186:UIMgr.c **** Function Name: UIMgr_processReceivedData |
187:UIMgr.c **** Function Description: This function is responsible for |
188:UIMgr.c **** parsing any serial data waiting in the rx fifo |
189:UIMgr.c **** Inputs: none |
190:UIMgr.c **** Outputs: none |
GAS LISTING /tmp/ccRvT1Qm.s page 6 |
191:UIMgr.c **** ***********************************************************/ |
192:UIMgr.c **** void UIMgr_processReceivedData(void) |
193:UIMgr.c **** { |
194:UIMgr.c **** unsigned char tmpData = 0; |
195:UIMgr.c **** |
196:UIMgr.c **** /* still need to add a mechanism to handle token counts |
197:UIMgr.c **** that are excessive!!! FIX ME!!! */ |
198:UIMgr.c **** |
199:UIMgr.c **** while(IS_DATA_IN_RX_FIFO() == TRUE) |
200:UIMgr.c **** { |
201:UIMgr.c **** tmpData = UIMgr_readRxFifo(); |
202:UIMgr.c **** if (tmpData == '\r') |
203:UIMgr.c **** { |
204:UIMgr.c **** /* we have reached a token separator */ |
205:UIMgr.c **** if (tokenCount == 0) |
206:UIMgr.c **** { |
207:UIMgr.c **** /* convert the command */ |
208:UIMgr.c **** UIMgr_convertTokenToCmd(); |
209:UIMgr.c **** } |
210:UIMgr.c **** else |
211:UIMgr.c **** { |
212:UIMgr.c **** /* convert a value */ |
213:UIMgr.c **** UIMgr_convertTokenToValue(); |
214:UIMgr.c **** tokenCount++; |
215:UIMgr.c **** } |
216:UIMgr.c **** /* either way, it is time to try to process the received |
217:UIMgr.c **** token list since we have reached the end of the cmd. */ |
218:UIMgr.c **** Utility_delay(100); |
219:UIMgr.c **** if (receivedCmd == invalidCmd || |
220:UIMgr.c **** receivedCmd == noCmd ) |
221:UIMgr.c **** { |
222:UIMgr.c **** UIMgr_sendNck(); |
223:UIMgr.c **** PUBLISH_EVENT(EV_SERIAL_DATA_PENDING_TX); |
224:UIMgr.c **** } |
225:UIMgr.c **** else |
226:UIMgr.c **** { |
227:UIMgr.c **** UIMgr_sendAck(); |
228:UIMgr.c **** /* publish the serial data pending event, so it |
229:UIMgr.c **** will push the ACK out before we execute the cmd */ |
230:UIMgr.c **** PUBLISH_EVENT(EV_SERIAL_DATA_PENDING_TX); |
231:UIMgr.c **** UIMgr_executeCmd(); |
232:UIMgr.c **** } |
233:UIMgr.c **** |
234:UIMgr.c **** /* reset any necessary data */ |
235:UIMgr.c **** tokenCount = 0; |
236:UIMgr.c **** memset(tokenBuffer,0x00,MAX_TOKEN_COUNT); |
237:UIMgr.c **** } |
238:UIMgr.c **** else if (tmpData == ' ') /* space char */ |
239:UIMgr.c **** { |
240:UIMgr.c **** /* the end of a token has been reached */ |
241:UIMgr.c **** if (tokenCount == 0) |
242:UIMgr.c **** { |
243:UIMgr.c **** UIMgr_convertTokenToCmd(); |
244:UIMgr.c **** tokenCount++; /* check this...why is this being incremented here??? This |
245:UIMgr.c **** means we have received a token, with tokenCount == 0, which means it is a |
246:UIMgr.c **** command...why is this contributing to tokenCount? |
247:UIMgr.c **** This might cause the set color map command to include too much data, since |
GAS LISTING /tmp/ccRvT1Qm.s page 7 |
248:UIMgr.c **** it sets the color map based on tokenCount...CHECK*/ |
249:UIMgr.c **** } |
250:UIMgr.c **** else |
251:UIMgr.c **** { |
252:UIMgr.c **** /* check to see if this token is going to push |
253:UIMgr.c **** us over the limit...if so, abort the transaction */ |
254:UIMgr.c **** if (tokenCount+1 >= MAX_TOKEN_COUNT) |
255:UIMgr.c **** { |
256:UIMgr.c **** /* we received too many tokens, and |
257:UIMgr.c **** need to NCK this request, since its too |
258:UIMgr.c **** large...reset everything...*/ |
259:UIMgr.c **** charCount=0; |
260:UIMgr.c **** charIndex=0; |
261:UIMgr.c **** tokenCount=0; |
262:UIMgr.c **** receivedCmd = invalidCmd; |
263:UIMgr.c **** } |
264:UIMgr.c **** else |
265:UIMgr.c **** { |
266:UIMgr.c **** /* tokenCount is still in range...*/ |
267:UIMgr.c **** UIMgr_convertTokenToValue(); |
268:UIMgr.c **** tokenCount++; |
269:UIMgr.c **** } |
270:UIMgr.c **** } |
271:UIMgr.c **** } |
272:UIMgr.c **** else if ( (tmpData >= 'A' && tmpData <= 'Z') || |
273:UIMgr.c **** (tmpData >= '0' && tmpData <= '9') ) |
274:UIMgr.c **** { |
275:UIMgr.c **** /* a valid range of token was received */ |
276:UIMgr.c **** asciiTokenBuffer[charIndex] = tmpData; |
277:UIMgr.c **** charCount++; |
278:UIMgr.c **** charIndex++; |
279:UIMgr.c **** if (charCount > MAX_TOKEN_LENGTH) |
280:UIMgr.c **** { |
281:UIMgr.c **** /* we have received a token that cannot be handled... |
282:UIMgr.c **** set the received cmd to an invalid cmd, and wait |
283:UIMgr.c **** for the \r to process it */ |
284:UIMgr.c **** receivedCmd = invalidCmd; |
285:UIMgr.c **** charIndex = 0; /* ...so we won't overwrite memory */ |
286:UIMgr.c **** } |
287:UIMgr.c **** } |
288:UIMgr.c **** else |
289:UIMgr.c **** { |
290:UIMgr.c **** /* an invalid character was received */ |
291:UIMgr.c **** receivedCmd = invalidCmd; |
292:UIMgr.c **** } |
293:UIMgr.c **** } /* end while */ |
294:UIMgr.c **** |
295:UIMgr.c **** asm volatile("clt"::); /* clear out the T flag in case it wasn't |
296:UIMgr.c **** cleared already */ |
297:UIMgr.c **** } |
298:UIMgr.c **** |
299:UIMgr.c **** /*********************************************************** |
300:UIMgr.c **** Function Name: UIMgr_executeCmd |
301:UIMgr.c **** Function Description: This function is responsible for |
302:UIMgr.c **** executing whatever cmd is stored in the receivedCmd |
303:UIMgr.c **** object. |
304:UIMgr.c **** Inputs: none |
GAS LISTING /tmp/ccRvT1Qm.s page 8 |
305:UIMgr.c **** Outputs: none |
306:UIMgr.c **** ***********************************************************/ |
307:UIMgr.c **** static void UIMgr_executeCmd(void) |
308:UIMgr.c **** { |
309:UIMgr.c **** unsigned char i,eepromData, num_writes=0; |
310:UIMgr.c **** unsigned char *pData; |
311:UIMgr.c **** unsigned char eeprom_write_succeeded = FALSE; |
312:UIMgr.c **** #if DEBUG_COLOR_MAP |
313:UIMgr.c **** unsigned char asciiBuffer[5]; |
314:UIMgr.c **** #endif |
315:UIMgr.c **** |
316:UIMgr.c **** if (receivedCmd == pingCmd) |
317:UIMgr.c **** { |
318:UIMgr.c **** } |
319:UIMgr.c **** else if (receivedCmd == getVersionCmd) |
320:UIMgr.c **** { |
321:UIMgr.c **** pData = AVRcamVersion; |
322:UIMgr.c **** while(*pData != 0) |
323:UIMgr.c **** { |
324:UIMgr.c **** UIMgr_writeTxFifo(*pData++); |
325:UIMgr.c **** } |
326:UIMgr.c **** } |
327:UIMgr.c **** else if (receivedCmd == resetCameraCmd) |
328:UIMgr.c **** { |
329:UIMgr.c **** CamInt_resetCam(); |
330:UIMgr.c **** } |
331:UIMgr.c **** else if (receivedCmd == dumpFrameCmd) |
332:UIMgr.c **** { |
333:UIMgr.c **** /* publish the event that will indicate that |
334:UIMgr.c **** a request has come to dump a frame...this will |
335:UIMgr.c **** be received by the FrameMgr, which will begin |
336:UIMgr.c **** dumping the frame...a short delay is needed |
337:UIMgr.c **** here to keep the Java demo app happy (sometimes |
338:UIMgr.c **** it wouldn't be able to receive the serial data |
339:UIMgr.c **** as quickly as AVRcam can provide it). */ |
340:UIMgr.c **** Utility_delay(100); |
341:UIMgr.c **** PUBLISH_EVENT(EV_DUMP_FRAME); |
342:UIMgr.c **** } |
343:UIMgr.c **** else if (receivedCmd == setCameraRegsCmd) |
344:UIMgr.c **** { |
345:UIMgr.c **** /* we need to gather the tokens and |
346:UIMgr.c **** build config cmds to be sent to the camera */ |
347:UIMgr.c **** for (i=1; i<tokenCount; i+=2) /* starts at 1 since first token |
348:UIMgr.c **** is the CR cmd */ |
349:UIMgr.c **** { |
350:UIMgr.c **** CamConfig_setCamReg(tokenBuffer[i],tokenBuffer[i+1]); |
351:UIMgr.c **** } |
352:UIMgr.c **** CamConfig_sendFifoCmds(); |
353:UIMgr.c **** } |
354:UIMgr.c **** else if (receivedCmd == enableTrackingCmd) |
355:UIMgr.c **** { |
356:UIMgr.c **** /* publish the event...again with a short delay */ |
357:UIMgr.c **** Utility_delay(100); |
358:UIMgr.c **** PUBLISH_EVENT(EV_ENABLE_TRACKING); |
359:UIMgr.c **** } |
360:UIMgr.c **** else if (receivedCmd == disableTrackingCmd) |
361:UIMgr.c **** { |
GAS LISTING /tmp/ccRvT1Qm.s page 9 |
362:UIMgr.c **** PUBLISH_EVENT(EV_DISABLE_TRACKING); |
363:UIMgr.c **** } |
364:UIMgr.c **** else if (receivedCmd == setColorMapCmd) |
365:UIMgr.c **** { |
366:UIMgr.c **** /* copy the received tokens into the color map */ |
367:UIMgr.c **** for (i=0; i<tokenCount; i++) |
368:UIMgr.c **** { |
369:UIMgr.c **** colorMap[i] = tokenBuffer[i+1]; |
370:UIMgr.c **** |
371:UIMgr.c **** /* write each colorMap byte to EEPROM, but only those |
372:UIMgr.c **** that changed...this will help reduce wear on the EEPROM */ |
373:UIMgr.c **** eepromData = eeprom_read_byte( (unsigned char*)(i+1)); |
374:UIMgr.c **** if (eepromData != colorMap[i]) |
375:UIMgr.c **** { |
376:UIMgr.c **** /* need to actually perform the write because the |
377:UIMgr.c **** data in eeprom is different than the current colorMap */ |
378:UIMgr.c **** eeprom_write_succeeded = FALSE; |
379:UIMgr.c **** while(eeprom_write_succeeded == FALSE && num_writes < MAX_EEPROM_WRITE_ATTEMPTS) |
380:UIMgr.c **** { |
381:UIMgr.c **** eeprom_write_byte((unsigned char*)(i+1),colorMap[i]); |
382:UIMgr.c **** num_writes++; |
383:UIMgr.c **** eepromData = eeprom_read_byte( (unsigned char*)(i+1)); |
384:UIMgr.c **** if (eepromData == colorMap[i]) |
385:UIMgr.c **** { |
386:UIMgr.c **** eeprom_write_succeeded = TRUE; |
387:UIMgr.c **** } |
388:UIMgr.c **** } |
389:UIMgr.c **** num_writes = 0; |
390:UIMgr.c **** } |
391:UIMgr.c **** } |
392:UIMgr.c **** |
393:UIMgr.c **** #if DEBUG_COLOR_MAP |
394:UIMgr.c **** /* for debugging...send out the entire color map */ |
395:UIMgr.c **** UIMgr_txBuffer("\r\n",2); |
396:UIMgr.c **** for (i=0; i<NUM_ELEMENTS_IN_COLOR_MAP; i++) |
397:UIMgr.c **** { |
398:UIMgr.c **** memset(asciiBuffer,0x00,5); |
399:UIMgr.c **** itoa(colorMap[i],asciiBuffer,10); |
400:UIMgr.c **** UIMgr_txBuffer(asciiBuffer,3); |
401:UIMgr.c **** UIMgr_txBuffer(" ",1); |
402:UIMgr.c **** if (i==15 || i == 31) |
403:UIMgr.c **** { |
404:UIMgr.c **** /* break up the output */ |
405:UIMgr.c **** UIMgr_txBuffer("\r\n",2); |
406:UIMgr.c **** } |
407:UIMgr.c **** } |
408:UIMgr.c **** #endif |
409:UIMgr.c **** } |
410:UIMgr.c **** } |
411:UIMgr.c **** |
412:UIMgr.c **** /*********************************************************** |
413:UIMgr.c **** Function Name: UIMgr_convertTokenToValue |
414:UIMgr.c **** Function Description: This function is responsible for |
415:UIMgr.c **** converting a received token to a hex value It will |
416:UIMgr.c **** access the asciiTokenBuffer directly, and store the |
417:UIMgr.c **** result in the appropriate token buffer. |
418:UIMgr.c **** Inputs: none |
GAS LISTING /tmp/ccRvT1Qm.s page 10 |
419:UIMgr.c **** Outputs: none |
420:UIMgr.c **** ***********************************************************/ |
421:UIMgr.c **** static void UIMgr_convertTokenToValue(void) |
422:UIMgr.c **** { |
423:UIMgr.c **** unsigned int newValue; |
424:UIMgr.c **** |
425:UIMgr.c **** newValue = atoi(asciiTokenBuffer); |
426:UIMgr.c **** if (newValue > 255) |
427:UIMgr.c **** { |
428:UIMgr.c **** /* the value is too large */ |
429:UIMgr.c **** receivedCmd = invalidCmd; |
430:UIMgr.c **** tokenBuffer[tokenCount] = 0xFF; /* to indicate an error */ |
431:UIMgr.c **** } |
432:UIMgr.c **** else |
433:UIMgr.c **** { |
434:UIMgr.c **** /* copy the value into the tokenBuffer */ |
435:UIMgr.c **** tokenBuffer[tokenCount] = newValue; |
436:UIMgr.c **** } |
437:UIMgr.c **** memset(asciiTokenBuffer,0x00,MAX_TOKEN_LENGTH); |
438:UIMgr.c **** charIndex = 0; |
439:UIMgr.c **** charCount = 0; |
440:UIMgr.c **** } |
441:UIMgr.c **** /*********************************************************** |
442:UIMgr.c **** Function Name: UIMgr_convertTokenToCmd |
443:UIMgr.c **** Function Description: This function is responsible for |
444:UIMgr.c **** parsing a received 2-character command. It will |
445:UIMgr.c **** access the asciiTokenBuffer directly. |
446:UIMgr.c **** Inputs: none |
447:UIMgr.c **** Outputs: none |
448:UIMgr.c **** ***********************************************************/ |
449:UIMgr.c **** static void UIMgr_convertTokenToCmd(void) |
450:UIMgr.c **** { |
451:UIMgr.c **** if ( (asciiTokenBuffer[0] == 'P') && |
452:UIMgr.c **** (asciiTokenBuffer[1] == 'G') ) |
453:UIMgr.c **** { |
454:UIMgr.c **** /* we got a "ping" command...but we still need to see |
455:UIMgr.c **** if we are going to get the \r */ |
456:UIMgr.c **** receivedCmd = pingCmd; |
457:UIMgr.c **** } |
458:UIMgr.c **** else if ( (asciiTokenBuffer[0] == 'G') && |
459:UIMgr.c **** (asciiTokenBuffer[1] == 'V') ) |
460:UIMgr.c **** { |
461:UIMgr.c **** /* we got the "get version" command */ |
462:UIMgr.c **** receivedCmd = getVersionCmd; |
463:UIMgr.c **** } |
464:UIMgr.c **** else if ( (asciiTokenBuffer[0] == 'D') && |
465:UIMgr.c **** (asciiTokenBuffer[1] == 'F') ) |
466:UIMgr.c **** { |
467:UIMgr.c **** /* we should go into frame dump mode */ |
468:UIMgr.c **** receivedCmd = dumpFrameCmd; |
469:UIMgr.c **** } |
470:UIMgr.c **** else if ( (asciiTokenBuffer[0] == 'C') && |
471:UIMgr.c **** (asciiTokenBuffer[1] == 'R') ) |
472:UIMgr.c **** { |
473:UIMgr.c **** /* the user wants to set registers in the OV6620 */ |
474:UIMgr.c **** receivedCmd = setCameraRegsCmd; |
475:UIMgr.c **** } |
GAS LISTING /tmp/ccRvT1Qm.s page 11 |
476:UIMgr.c **** else if ( (asciiTokenBuffer[0] == 'E') && |
477:UIMgr.c **** (asciiTokenBuffer[1] == 'T') ) |
478:UIMgr.c **** { |
479:UIMgr.c **** /* the user wants to enable tracking */ |
480:UIMgr.c **** receivedCmd = enableTrackingCmd; |
481:UIMgr.c **** } |
482:UIMgr.c **** else if ( (asciiTokenBuffer[0] == 'S') && |
483:UIMgr.c **** (asciiTokenBuffer[1] == 'M') ) |
484:UIMgr.c **** { |
485:UIMgr.c **** /* the user wants to set the color map */ |
486:UIMgr.c **** receivedCmd = setColorMapCmd; |
487:UIMgr.c **** } |
488:UIMgr.c **** else if ( (asciiTokenBuffer[0] == 'D') && |
489:UIMgr.c **** (asciiTokenBuffer[1] == 'T') ) |
490:UIMgr.c **** { |
491:UIMgr.c **** receivedCmd = disableTrackingCmd; |
492:UIMgr.c **** } |
493:UIMgr.c **** else if ( (asciiTokenBuffer[0] == 'R') && |
494:UIMgr.c **** (asciiTokenBuffer[1] == 'S') ) |
495:UIMgr.c **** { |
496:UIMgr.c **** receivedCmd = resetCameraCmd; |
497:UIMgr.c **** } |
498:UIMgr.c **** else |
499:UIMgr.c **** { |
500:UIMgr.c **** /* don't recognize the cmd */ |
501:UIMgr.c **** receivedCmd = invalidCmd; |
502:UIMgr.c **** } |
503:UIMgr.c **** memset(asciiTokenBuffer,0x00,MAX_TOKEN_LENGTH); |
504:UIMgr.c **** charIndex = 0; |
505:UIMgr.c **** charCount = 0; |
506:UIMgr.c **** } |
507:UIMgr.c **** /*********************************************************** |
508:UIMgr.c **** Function Name: UIMgr_sendAck |
509:UIMgr.c **** Function Description: This function is responsible for |
510:UIMgr.c **** queuing up an ACK to be sent to the user. |
511:UIMgr.c **** Inputs: none |
512:UIMgr.c **** Outputs: none |
513:UIMgr.c **** ***********************************************************/ |
514:UIMgr.c **** static void UIMgr_sendAck(void) |
515:UIMgr.c **** { |
516:UIMgr.c **** UIMgr_writeTxFifo('A'); |
517:UIMgr.c **** UIMgr_writeTxFifo('C'); |
518:UIMgr.c **** UIMgr_writeTxFifo('K'); |
519:UIMgr.c **** UIMgr_writeTxFifo('\r'); |
520:UIMgr.c **** } |
521:UIMgr.c **** |
522:UIMgr.c **** /*********************************************************** |
523:UIMgr.c **** Function Name: UIMgr_sendNck |
524:UIMgr.c **** Function Description: This function is responsible for |
525:UIMgr.c **** queueing up an NCK to be sent to the user. |
526:UIMgr.c **** Inputs: none |
527:UIMgr.c **** Outputs: none |
528:UIMgr.c **** ***********************************************************/ |
529:UIMgr.c **** static void UIMgr_sendNck(void) |
530:UIMgr.c **** { |
531:UIMgr.c **** UIMgr_writeTxFifo('N'); |
532:UIMgr.c **** UIMgr_writeTxFifo('C'); |
GAS LISTING /tmp/ccRvT1Qm.s page 12 |
533:UIMgr.c **** UIMgr_writeTxFifo('K'); |
534:UIMgr.c **** UIMgr_writeTxFifo('\r'); |
535:UIMgr.c **** } |
536:UIMgr.c **** |
537:UIMgr.c **** |
538:UIMgr.c **** /*********************************************************** |
539:UIMgr.c **** Function Name: UIMgr_writeBufferToTxFifo |
540:UIMgr.c **** Function Description: This function is responsible for |
541:UIMgr.c **** placing "length" bytes into the tx FIFO. |
542:UIMgr.c **** Inputs: pData - a pointer to the data to send |
543:UIMgr.c **** length - the number of bytes to send |
544:UIMgr.c **** Outputs: none |
545:UIMgr.c **** ***********************************************************/ |
546:UIMgr.c **** void UIMgr_writeBufferToTxFifo(unsigned char *pData, unsigned char length) |
547:UIMgr.c **** { |
96 .stabn 68,0,547,.LM0-UIMgr_writeBufferToTxFifo |
97 .LM0: |
98 /* prologue: frame size=0 */ |
99 /* prologue end (size=0) */ |
100 0000 DC01 movw r26,r24 |
101 0002 862F mov r24,r22 |
548:UIMgr.c **** unsigned char tmpHead; |
549:UIMgr.c **** if (length == 0) |
102 .stabn 68,0,549,.LM1-UIMgr_writeBufferToTxFifo |
103 .LM1: |
104 0004 6623 tst r22 |
105 0006 C9F0 breq .L7 |
550:UIMgr.c **** { |
551:UIMgr.c **** return; |
552:UIMgr.c **** } |
553:UIMgr.c **** |
554:UIMgr.c **** DISABLE_INTS(); |
106 .stabn 68,0,554,.LM2-UIMgr_writeBufferToTxFifo |
107 .LM2: |
108 /* #APP */ |
109 0008 F894 cli |
555:UIMgr.c **** while(length-- != 0) |
110 .stabn 68,0,555,.LM3-UIMgr_writeBufferToTxFifo |
111 .LM3: |
112 /* #NOAPP */ |
113 000a 6150 subi r22,lo8(-(-1)) |
114 000c 6F3F cpi r22,lo8(-1) |
115 000e A1F0 breq .L4 |
116 0010 262F mov r18,r22 |
117 0012 40E0 ldi r20,lo8(UIMgr_txFifo) |
118 0014 50E0 ldi r21,hi8(UIMgr_txFifo) |
119 0016 861B sub r24,r22 |
120 0018 682F mov r22,r24 |
121 001a 6250 subi r22,lo8(-(-2)) |
122 .L6: |
556:UIMgr.c **** { |
557:UIMgr.c **** UIMgr_txFifo[UIMgr_txFifoHead] = *pData++; |
123 .stabn 68,0,557,.LM4-UIMgr_writeBufferToTxFifo |
124 .LM4: |
125 001c 8091 0000 lds r24,UIMgr_txFifoHead |
126 0020 FA01 movw r30,r20 |
127 0022 E80F add r30,r24 |
GAS LISTING /tmp/ccRvT1Qm.s page 13 |
128 0024 F11D adc r31,__zero_reg__ |
129 0026 9D91 ld r25,X+ |
130 0028 9083 st Z,r25 |
558:UIMgr.c **** |
559:UIMgr.c **** /* now move the head up */ |
560:UIMgr.c **** tmpHead = (UIMgr_txFifoHead + 1) & (UI_MGR_TX_FIFO_MASK); |
561:UIMgr.c **** UIMgr_txFifoHead = tmpHead; |
131 .stabn 68,0,561,.LM5-UIMgr_writeBufferToTxFifo |
132 .LM5: |
133 002a 8F5F subi r24,lo8(-(1)) |
134 002c 8F73 andi r24,lo8(63) |
135 002e 8093 0000 sts UIMgr_txFifoHead,r24 |
136 .stabn 68,0,555,.LM6-UIMgr_writeBufferToTxFifo |
137 .LM6: |
138 0032 2150 subi r18,lo8(-(-1)) |
139 0034 6217 cp r22,r18 |
140 0036 91F7 brne .L6 |
141 .L4: |
562:UIMgr.c **** } |
563:UIMgr.c **** ENABLE_INTS(); |
142 .stabn 68,0,563,.LM7-UIMgr_writeBufferToTxFifo |
143 .LM7: |
144 /* #APP */ |
145 0038 7894 sei |
146 /* #NOAPP */ |
147 .L7: |
148 003a 0895 ret |
149 /* epilogue: frame size=0 */ |
150 /* epilogue: noreturn */ |
151 /* epilogue end (size=0) */ |
152 /* function UIMgr_writeBufferToTxFifo size 32 (32) */ |
153 .size UIMgr_writeBufferToTxFifo, .-UIMgr_writeBufferToTxFifo |
154 .Lscope0: |
155 .stabs "",36,0,0,.Lscope0-UIMgr_writeBufferToTxFifo |
156 .stabd 78,0,0 |
157 .stabs "UIMgr_readTxFifo:f(0,11)",36,0,630,UIMgr_readTxFifo |
158 .type UIMgr_readTxFifo, @function |
159 UIMgr_readTxFifo: |
160 .stabd 46,0,0 |
564:UIMgr.c **** } |
565:UIMgr.c **** |
566:UIMgr.c **** /*********************************************************** |
567:UIMgr.c **** Function Name: UIMgr_txBuffer |
568:UIMgr.c **** Function Description: This function is responsible for |
569:UIMgr.c **** sending 'length' bytes out using the UartInterface |
570:UIMgr.c **** module. |
571:UIMgr.c **** Inputs: pData - a pointer to the data to send |
572:UIMgr.c **** length - the number of bytes to send |
573:UIMgr.c **** Outputs: none |
574:UIMgr.c **** ***********************************************************/ |
575:UIMgr.c **** void UIMgr_txBuffer(unsigned char *pData, unsigned char length) |
576:UIMgr.c **** { |
577:UIMgr.c **** while(length-- != 0) |
578:UIMgr.c **** { |
579:UIMgr.c **** UartInt_txByte(*pData++); |
580:UIMgr.c **** } |
581:UIMgr.c **** } |
GAS LISTING /tmp/ccRvT1Qm.s page 14 |
582:UIMgr.c **** |
583:UIMgr.c **** /*********************************************************** |
584:UIMgr.c **** Function Name: UIMgr_flushTxBuffer |
585:UIMgr.c **** Function Description: This function is responsible for |
586:UIMgr.c **** sending all data currently in the serial tx buffer |
587:UIMgr.c **** to the user. |
588:UIMgr.c **** Inputs: none |
589:UIMgr.c **** Outputs: none |
590:UIMgr.c **** ***********************************************************/ |
591:UIMgr.c **** void UIMgr_flushTxBuffer(void) |
592:UIMgr.c **** { |
593:UIMgr.c **** while(IS_DATA_IN_TX_FIFO() == TRUE) |
594:UIMgr.c **** { |
595:UIMgr.c **** UartInt_txByte(UIMgr_readTxFifo() ); |
596:UIMgr.c **** } |
597:UIMgr.c **** } |
598:UIMgr.c **** |
599:UIMgr.c **** /*********************************************************** |
600:UIMgr.c **** Function Name: UIMgr_readRxFifo |
601:UIMgr.c **** Function Description: This function is responsible for |
602:UIMgr.c **** reading a single byte of data from the rx fifo, and |
603:UIMgr.c **** updating the appropriate pointers. |
604:UIMgr.c **** Inputs: none |
605:UIMgr.c **** Outputs: unsigned char-the data read |
606:UIMgr.c **** ***********************************************************/ |
607:UIMgr.c **** static unsigned char UIMgr_readRxFifo(void) |
608:UIMgr.c **** { |
609:UIMgr.c **** unsigned char dataByte, tmpTail; |
610:UIMgr.c **** |
611:UIMgr.c **** /* just return the current tail from the rx fifo */ |
612:UIMgr.c **** DISABLE_INTS(); |
613:UIMgr.c **** dataByte = UIMgr_rxFifo[UIMgr_rxFifoTail]; |
614:UIMgr.c **** tmpTail = (UIMgr_rxFifoTail+1) & (UI_MGR_RX_FIFO_MASK); |
615:UIMgr.c **** UIMgr_rxFifoTail = tmpTail; |
616:UIMgr.c **** ENABLE_INTS(); |
617:UIMgr.c **** |
618:UIMgr.c **** return(dataByte); |
619:UIMgr.c **** } |
620:UIMgr.c **** |
621:UIMgr.c **** /*********************************************************** |
622:UIMgr.c **** Function Name: UIMgr_readTxFifo |
623:UIMgr.c **** Function Description: This function is responsible for |
624:UIMgr.c **** reading a single byte of data from the tx fifo, and |
625:UIMgr.c **** updating the appropriate pointers. |
626:UIMgr.c **** Inputs: none |
627:UIMgr.c **** Outputs: unsigned char-the data read |
628:UIMgr.c **** ***********************************************************/ |
629:UIMgr.c **** static unsigned char UIMgr_readTxFifo(void) |
630:UIMgr.c **** { |
161 .stabn 68,0,630,.LM8-UIMgr_readTxFifo |
162 .LM8: |
163 /* prologue: frame size=0 */ |
164 /* prologue end (size=0) */ |
631:UIMgr.c **** unsigned char dataByte, tmpTail; |
632:UIMgr.c **** |
633:UIMgr.c **** /* just return the current tail from the tx fifo */ |
634:UIMgr.c **** DISABLE_INTS(); |
GAS LISTING /tmp/ccRvT1Qm.s page 15 |
165 .stabn 68,0,634,.LM9-UIMgr_readTxFifo |
166 .LM9: |
167 /* #APP */ |
168 003c F894 cli |
635:UIMgr.c **** dataByte = UIMgr_txFifo[UIMgr_txFifoTail]; |
169 .stabn 68,0,635,.LM10-UIMgr_readTxFifo |
170 .LM10: |
171 /* #NOAPP */ |
172 003e 9091 0000 lds r25,UIMgr_txFifoTail |
173 0042 E0E0 ldi r30,lo8(UIMgr_txFifo) |
174 0044 F0E0 ldi r31,hi8(UIMgr_txFifo) |
175 0046 E90F add r30,r25 |
176 0048 F11D adc r31,__zero_reg__ |
177 004a 8081 ld r24,Z |
636:UIMgr.c **** tmpTail = (UIMgr_txFifoTail+1) & (UI_MGR_TX_FIFO_MASK); |
637:UIMgr.c **** UIMgr_txFifoTail = tmpTail; |
178 .stabn 68,0,637,.LM11-UIMgr_readTxFifo |
179 .LM11: |
180 004c 9F5F subi r25,lo8(-(1)) |
181 004e 9F73 andi r25,lo8(63) |
182 0050 9093 0000 sts UIMgr_txFifoTail,r25 |
638:UIMgr.c **** ENABLE_INTS(); |
183 .stabn 68,0,638,.LM12-UIMgr_readTxFifo |
184 .LM12: |
185 /* #APP */ |
186 0054 7894 sei |
639:UIMgr.c **** |
640:UIMgr.c **** return(dataByte); |
641:UIMgr.c **** } |
187 .stabn 68,0,641,.LM13-UIMgr_readTxFifo |
188 .LM13: |
189 /* #NOAPP */ |
190 0056 9927 clr r25 |
191 /* epilogue: frame size=0 */ |
192 0058 0895 ret |
193 /* epilogue end (size=1) */ |
194 /* function UIMgr_readTxFifo size 17 (16) */ |
195 .size UIMgr_readTxFifo, .-UIMgr_readTxFifo |
196 .stabs "dataByte:r(0,11)",64,0,631,24 |
197 .stabn 192,0,0,UIMgr_readTxFifo-UIMgr_readTxFifo |
198 .stabn 224,0,0,.Lscope1-UIMgr_readTxFifo |
199 .Lscope1: |
200 .stabs "",36,0,0,.Lscope1-UIMgr_readTxFifo |
201 .stabd 78,0,0 |
202 .stabs "UIMgr_writeTxFifo:F(0,15)",36,0,652,UIMgr_writeTxFifo |
203 .stabs "data:P(0,11)",64,0,651,24 |
204 .global UIMgr_writeTxFifo |
205 .type UIMgr_writeTxFifo, @function |
206 UIMgr_writeTxFifo: |
207 .stabd 46,0,0 |
642:UIMgr.c **** |
643:UIMgr.c **** /*********************************************************** |
644:UIMgr.c **** Function Name: UIMgr_writeTxFifo |
645:UIMgr.c **** Function Description: This function is responsible for |
646:UIMgr.c **** writing a single byte to the TxFifo and |
647:UIMgr.c **** updating the appropriate pointers. |
648:UIMgr.c **** Inputs: data - the byte to write to the Fifo |
GAS LISTING /tmp/ccRvT1Qm.s page 16 |
649:UIMgr.c **** Outputs: none |
650:UIMgr.c **** ***********************************************************/ |
651:UIMgr.c **** void UIMgr_writeTxFifo(unsigned char data) |
652:UIMgr.c **** { |
208 .stabn 68,0,652,.LM14-UIMgr_writeTxFifo |
209 .LM14: |
210 /* prologue: frame size=0 */ |
211 /* prologue end (size=0) */ |
653:UIMgr.c **** unsigned char tmpHead; |
654:UIMgr.c **** |
655:UIMgr.c **** DISABLE_INTS(); |
212 .stabn 68,0,655,.LM15-UIMgr_writeTxFifo |
213 .LM15: |
214 /* #APP */ |
215 005a F894 cli |
656:UIMgr.c **** UIMgr_txFifo[UIMgr_txFifoHead] = data; |
216 .stabn 68,0,656,.LM16-UIMgr_writeTxFifo |
217 .LM16: |
218 /* #NOAPP */ |
219 005c 9091 0000 lds r25,UIMgr_txFifoHead |
220 0060 E0E0 ldi r30,lo8(UIMgr_txFifo) |
221 0062 F0E0 ldi r31,hi8(UIMgr_txFifo) |
222 0064 E90F add r30,r25 |
223 0066 F11D adc r31,__zero_reg__ |
224 0068 8083 st Z,r24 |
657:UIMgr.c **** |
658:UIMgr.c **** /* now move the head up */ |
659:UIMgr.c **** tmpHead = (UIMgr_txFifoHead + 1) & (UI_MGR_TX_FIFO_MASK); |
660:UIMgr.c **** UIMgr_txFifoHead = tmpHead; |
225 .stabn 68,0,660,.LM17-UIMgr_writeTxFifo |
226 .LM17: |
227 006a 9F5F subi r25,lo8(-(1)) |
228 006c 9F73 andi r25,lo8(63) |
229 006e 9093 0000 sts UIMgr_txFifoHead,r25 |
661:UIMgr.c **** ENABLE_INTS(); |
230 .stabn 68,0,661,.LM18-UIMgr_writeTxFifo |
231 .LM18: |
232 /* #APP */ |
233 0072 7894 sei |
234 /* #NOAPP */ |
235 /* epilogue: frame size=0 */ |
236 0074 0895 ret |
237 /* epilogue end (size=1) */ |
238 /* function UIMgr_writeTxFifo size 16 (15) */ |
239 .size UIMgr_writeTxFifo, .-UIMgr_writeTxFifo |
240 .Lscope2: |
241 .stabs "",36,0,0,.Lscope2-UIMgr_writeTxFifo |
242 .stabd 78,0,0 |
243 .stabs "UIMgr_flushTxBuffer:F(0,15)",36,0,592,UIMgr_flushTxBuffer |
244 .global UIMgr_flushTxBuffer |
245 .type UIMgr_flushTxBuffer, @function |
246 UIMgr_flushTxBuffer: |
247 .stabd 46,0,0 |
248 .stabn 68,0,592,.LM19-UIMgr_flushTxBuffer |
249 .LM19: |
250 /* prologue: frame size=0 */ |
251 /* prologue end (size=0) */ |
GAS LISTING /tmp/ccRvT1Qm.s page 17 |
252 .stabn 68,0,593,.LM20-UIMgr_flushTxBuffer |
253 .LM20: |
254 0076 9091 0000 lds r25,UIMgr_txFifoHead |
255 007a 8091 0000 lds r24,UIMgr_txFifoTail |
256 007e 9817 cp r25,r24 |
257 0080 41F0 breq .L16 |
258 .L17: |
259 .stabn 68,0,595,.LM21-UIMgr_flushTxBuffer |
260 .LM21: |
261 0082 DCDF rcall UIMgr_readTxFifo |
262 0084 00D0 rcall UartInt_txByte |
263 .stabn 68,0,593,.LM22-UIMgr_flushTxBuffer |
264 .LM22: |
265 0086 9091 0000 lds r25,UIMgr_txFifoHead |
266 008a 8091 0000 lds r24,UIMgr_txFifoTail |
267 008e 9817 cp r25,r24 |
268 0090 C1F7 brne .L17 |
269 .L16: |
270 0092 0895 ret |
271 /* epilogue: frame size=0 */ |
272 /* epilogue: noreturn */ |
273 /* epilogue end (size=0) */ |
274 /* function UIMgr_flushTxBuffer size 15 (15) */ |
275 .size UIMgr_flushTxBuffer, .-UIMgr_flushTxBuffer |
276 .Lscope3: |
277 .stabs "",36,0,0,.Lscope3-UIMgr_flushTxBuffer |
278 .stabd 78,0,0 |
279 .stabs "UIMgr_txBuffer:F(0,15)",36,0,576,UIMgr_txBuffer |
280 .stabs "pData:P(0,20)",64,0,575,28 |
281 .stabs "length:P(0,11)",64,0,575,24 |
282 .global UIMgr_txBuffer |
283 .type UIMgr_txBuffer, @function |
284 UIMgr_txBuffer: |
285 .stabd 46,0,0 |
286 .stabn 68,0,576,.LM23-UIMgr_txBuffer |
287 .LM23: |
288 /* prologue: frame size=0 */ |
289 0094 0F93 push r16 |
290 0096 1F93 push r17 |
291 0098 CF93 push r28 |
292 009a DF93 push r29 |
293 /* prologue end (size=4) */ |
294 009c EC01 movw r28,r24 |
295 009e 862F mov r24,r22 |
296 .stabn 68,0,577,.LM24-UIMgr_txBuffer |
297 .LM24: |
298 00a0 6150 subi r22,lo8(-(-1)) |
299 00a2 6F3F cpi r22,lo8(-1) |
300 00a4 49F0 breq .L23 |
301 .stabn 68,0,577,.LM25-UIMgr_txBuffer |
302 .LM25: |
303 00a6 162F mov r17,r22 |
304 00a8 861B sub r24,r22 |
305 00aa 082F mov r16,r24 |
306 00ac 0250 subi r16,lo8(-(-2)) |
307 .L22: |
308 .stabn 68,0,579,.LM26-UIMgr_txBuffer |
GAS LISTING /tmp/ccRvT1Qm.s page 18 |
309 .LM26: |
310 00ae 8991 ld r24,Y+ |
311 00b0 00D0 rcall UartInt_txByte |
312 .stabn 68,0,577,.LM27-UIMgr_txBuffer |
313 .LM27: |
314 00b2 1150 subi r17,lo8(-(-1)) |
315 00b4 0117 cp r16,r17 |
316 00b6 D9F7 brne .L22 |
317 .L23: |
318 /* epilogue: frame size=0 */ |
319 00b8 DF91 pop r29 |
320 00ba CF91 pop r28 |
321 00bc 1F91 pop r17 |
322 00be 0F91 pop r16 |
323 00c0 0895 ret |
324 /* epilogue end (size=5) */ |
325 /* function UIMgr_txBuffer size 23 (14) */ |
326 .size UIMgr_txBuffer, .-UIMgr_txBuffer |
327 .Lscope4: |
328 .stabs "",36,0,0,.Lscope4-UIMgr_txBuffer |
329 .stabd 78,0,0 |
330 .stabs "UIMgr_transmitPendingData:F(0,15)",36,0,178,UIMgr_transmitPendingData |
331 .global UIMgr_transmitPendingData |
332 .type UIMgr_transmitPendingData, @function |
333 UIMgr_transmitPendingData: |
334 .stabd 46,0,0 |
335 .stabn 68,0,178,.LM28-UIMgr_transmitPendingData |
336 .LM28: |
337 /* prologue: frame size=0 */ |
338 /* prologue end (size=0) */ |
339 .stabn 68,0,179,.LM29-UIMgr_transmitPendingData |
340 .LM29: |
341 00c2 9091 0000 lds r25,UIMgr_txFifoHead |
342 00c6 8091 0000 lds r24,UIMgr_txFifoTail |
343 00ca 9817 cp r25,r24 |
344 00cc 11F0 breq .L28 |
345 .stabn 68,0,182,.LM30-UIMgr_transmitPendingData |
346 .LM30: |
347 00ce B6DF rcall UIMgr_readTxFifo |
348 00d0 00D0 rcall UartInt_txByte |
349 .L28: |
350 00d2 0895 ret |
351 /* epilogue: frame size=0 */ |
352 /* epilogue: noreturn */ |
353 /* epilogue end (size=0) */ |
354 /* function UIMgr_transmitPendingData size 9 (9) */ |
355 .size UIMgr_transmitPendingData, .-UIMgr_transmitPendingData |
356 .Lscope5: |
357 .stabs "",36,0,0,.Lscope5-UIMgr_transmitPendingData |
358 .stabd 78,0,0 |
359 .stabs "UIMgr_convertTokenToCmd:f(0,15)",36,0,450,UIMgr_convertTokenToCmd |
360 .type UIMgr_convertTokenToCmd, @function |
361 UIMgr_convertTokenToCmd: |
362 .stabd 46,0,0 |
363 .stabn 68,0,450,.LM31-UIMgr_convertTokenToCmd |
364 .LM31: |
365 /* prologue: frame size=0 */ |
GAS LISTING /tmp/ccRvT1Qm.s page 19 |
366 /* prologue end (size=0) */ |
367 .stabn 68,0,451,.LM32-UIMgr_convertTokenToCmd |
368 .LM32: |
369 00d4 9091 0000 lds r25,asciiTokenBuffer |
370 00d8 9035 cpi r25,lo8(80) |
371 00da 41F4 brne .L30 |
372 .stabn 68,0,451,.LM33-UIMgr_convertTokenToCmd |
373 .LM33: |
374 00dc 8091 0000 lds r24,asciiTokenBuffer+1 |
375 00e0 8734 cpi r24,lo8(71) |
376 00e2 09F5 brne .L32 |
377 .stabn 68,0,456,.LM34-UIMgr_convertTokenToCmd |
378 .LM34: |
379 00e4 81E0 ldi r24,lo8(1) |
380 00e6 8093 0000 sts receivedCmd,r24 |
381 00ea 48C0 rjmp .L34 |
382 .L30: |
383 .stabn 68,0,458,.LM35-UIMgr_convertTokenToCmd |
384 .LM35: |
385 00ec 9734 cpi r25,lo8(71) |
386 00ee 39F4 brne .L35 |
387 00f0 8091 0000 lds r24,asciiTokenBuffer+1 |
388 00f4 8635 cpi r24,lo8(86) |
389 00f6 09F5 brne .L37 |
390 .stabn 68,0,462,.LM36-UIMgr_convertTokenToCmd |
391 .LM36: |
392 00f8 1092 0000 sts receivedCmd,__zero_reg__ |
393 00fc 3FC0 rjmp .L34 |
394 .L35: |
395 .stabn 68,0,464,.LM37-UIMgr_convertTokenToCmd |
396 .LM37: |
397 00fe 9434 cpi r25,lo8(68) |
398 0100 41F4 brne .L39 |
399 0102 8091 0000 lds r24,asciiTokenBuffer+1 |
400 0106 8634 cpi r24,lo8(70) |
401 0108 11F5 brne .L41 |
402 .stabn 68,0,468,.LM38-UIMgr_convertTokenToCmd |
403 .LM38: |
404 010a 83E0 ldi r24,lo8(3) |
405 010c 8093 0000 sts receivedCmd,r24 |
406 0110 35C0 rjmp .L34 |
407 .L39: |
408 .stabn 68,0,470,.LM39-UIMgr_convertTokenToCmd |
409 .LM39: |
410 0112 9334 cpi r25,lo8(67) |
411 0114 41F4 brne .L32 |
412 0116 8091 0000 lds r24,asciiTokenBuffer+1 |
413 011a 8235 cpi r24,lo8(82) |
414 011c 11F5 brne .L44 |
415 .stabn 68,0,474,.LM40-UIMgr_convertTokenToCmd |
416 .LM40: |
417 011e 82E0 ldi r24,lo8(2) |
418 0120 8093 0000 sts receivedCmd,r24 |
419 0124 2BC0 rjmp .L34 |
420 .L32: |
421 .stabn 68,0,476,.LM41-UIMgr_convertTokenToCmd |
422 .LM41: |
GAS LISTING /tmp/ccRvT1Qm.s page 20 |
423 0126 9534 cpi r25,lo8(69) |
424 0128 41F4 brne .L37 |
425 012a 8091 0000 lds r24,asciiTokenBuffer+1 |
426 012e 8435 cpi r24,lo8(84) |
427 0130 11F5 brne .L47 |
428 .stabn 68,0,480,.LM42-UIMgr_convertTokenToCmd |
429 .LM42: |
430 0132 84E0 ldi r24,lo8(4) |
431 0134 8093 0000 sts receivedCmd,r24 |
432 0138 21C0 rjmp .L34 |
433 .L37: |
434 .stabn 68,0,482,.LM43-UIMgr_convertTokenToCmd |
435 .LM43: |
436 013a 9335 cpi r25,lo8(83) |
437 013c 41F4 brne .L41 |
438 013e 8091 0000 lds r24,asciiTokenBuffer+1 |
439 0142 8D34 cpi r24,lo8(77) |
440 0144 C1F4 brne .L47 |
441 .stabn 68,0,486,.LM44-UIMgr_convertTokenToCmd |
442 .LM44: |
443 0146 86E0 ldi r24,lo8(6) |
444 0148 8093 0000 sts receivedCmd,r24 |
445 014c 17C0 rjmp .L34 |
446 .L41: |
447 .stabn 68,0,488,.LM45-UIMgr_convertTokenToCmd |
448 .LM45: |
449 014e 9434 cpi r25,lo8(68) |
450 0150 41F4 brne .L44 |
451 0152 8091 0000 lds r24,asciiTokenBuffer+1 |
452 0156 8435 cpi r24,lo8(84) |
453 0158 71F4 brne .L47 |
454 .stabn 68,0,491,.LM46-UIMgr_convertTokenToCmd |
455 .LM46: |
456 015a 85E0 ldi r24,lo8(5) |
457 015c 8093 0000 sts receivedCmd,r24 |
458 0160 0DC0 rjmp .L34 |
459 .L44: |
460 .stabn 68,0,493,.LM47-UIMgr_convertTokenToCmd |
461 .LM47: |
462 0162 9235 cpi r25,lo8(82) |
463 0164 41F4 brne .L47 |
464 0166 8091 0000 lds r24,asciiTokenBuffer+1 |
465 016a 8335 cpi r24,lo8(83) |
466 016c 21F4 brne .L47 |
467 .stabn 68,0,496,.LM48-UIMgr_convertTokenToCmd |
468 .LM48: |
469 016e 87E0 ldi r24,lo8(7) |
470 0170 8093 0000 sts receivedCmd,r24 |
471 0174 03C0 rjmp .L34 |
472 .L47: |
473 .stabn 68,0,501,.LM49-UIMgr_convertTokenToCmd |
474 .LM49: |
475 0176 89E0 ldi r24,lo8(9) |
476 0178 8093 0000 sts receivedCmd,r24 |
477 .L34: |
478 .stabn 68,0,503,.LM50-UIMgr_convertTokenToCmd |
479 .LM50: |
GAS LISTING /tmp/ccRvT1Qm.s page 21 |
480 017c 83E0 ldi r24,lo8(3) |
481 017e E0E0 ldi r30,lo8(asciiTokenBuffer) |
482 0180 F0E0 ldi r31,hi8(asciiTokenBuffer) |
483 0182 1192 st Z+,__zero_reg__ |
484 0184 8A95 dec r24 |
485 0186 E9F7 brne .-6 |
486 .stabn 68,0,504,.LM51-UIMgr_convertTokenToCmd |
487 .LM51: |
488 0188 1092 0000 sts charIndex,__zero_reg__ |
489 .stabn 68,0,505,.LM52-UIMgr_convertTokenToCmd |
490 .LM52: |
491 018c 1092 0000 sts charCount,__zero_reg__ |
492 /* epilogue: frame size=0 */ |
493 0190 0895 ret |
494 /* epilogue end (size=1) */ |
495 /* function UIMgr_convertTokenToCmd size 95 (94) */ |
496 .size UIMgr_convertTokenToCmd, .-UIMgr_convertTokenToCmd |
497 .Lscope6: |
498 .stabs "",36,0,0,.Lscope6-UIMgr_convertTokenToCmd |
499 .stabd 78,0,0 |
500 .stabs "UIMgr_init:F(0,15)",36,0,137,UIMgr_init |
501 .global UIMgr_init |
502 .type UIMgr_init, @function |
503 UIMgr_init: |
504 .stabd 46,0,0 |
505 .stabn 68,0,137,.LM53-UIMgr_init |
506 .LM53: |
507 /* prologue: frame size=0 */ |
508 /* prologue end (size=0) */ |
509 .stabn 68,0,138,.LM54-UIMgr_init |
510 .LM54: |
511 0192 1092 0000 sts asciiTokenBuffer,__zero_reg__ |
512 0196 1092 0000 sts (asciiTokenBuffer)+1,__zero_reg__ |
513 019a 1092 0000 sts (asciiTokenBuffer)+2,__zero_reg__ |
514 019e 1092 0000 sts (asciiTokenBuffer)+3,__zero_reg__ |
515 .stabn 68,0,139,.LM55-UIMgr_init |
516 .LM55: |
517 01a2 80E4 ldi r24,lo8(64) |
518 01a4 E0E0 ldi r30,lo8(tokenBuffer) |
519 01a6 F0E0 ldi r31,hi8(tokenBuffer) |
520 01a8 982F mov r25,r24 |
521 01aa 1192 st Z+,__zero_reg__ |
522 01ac 9A95 dec r25 |
523 01ae E9F7 brne .-6 |
524 .stabn 68,0,140,.LM56-UIMgr_init |
525 .LM56: |
526 01b0 E0E0 ldi r30,lo8(UIMgr_txFifo) |
527 01b2 F0E0 ldi r31,hi8(UIMgr_txFifo) |
528 01b4 1192 st Z+,__zero_reg__ |
529 01b6 8A95 dec r24 |
530 01b8 E9F7 brne .-6 |
531 .stabn 68,0,141,.LM57-UIMgr_init |
532 .LM57: |
533 01ba 80E2 ldi r24,lo8(32) |
534 01bc E0E0 ldi r30,lo8(UIMgr_rxFifo) |
535 01be F0E0 ldi r31,hi8(UIMgr_rxFifo) |
536 01c0 1192 st Z+,__zero_reg__ |
GAS LISTING /tmp/ccRvT1Qm.s page 22 |
537 01c2 8A95 dec r24 |
538 01c4 E9F7 brne .-6 |
539 /* epilogue: frame size=0 */ |
540 01c6 0895 ret |
541 /* epilogue end (size=1) */ |
542 /* function UIMgr_init size 27 (26) */ |
543 .size UIMgr_init, .-UIMgr_init |
544 .Lscope7: |
545 .stabs "",36,0,0,.Lscope7-UIMgr_init |
546 .stabd 78,0,0 |
547 .stabs "UIMgr_convertTokenToValue:f(0,15)",36,0,422,UIMgr_convertTokenToValue |
548 .type UIMgr_convertTokenToValue, @function |
549 UIMgr_convertTokenToValue: |
550 .stabd 46,0,0 |
551 .stabn 68,0,422,.LM58-UIMgr_convertTokenToValue |
552 .LM58: |
553 /* prologue: frame size=0 */ |
554 /* prologue end (size=0) */ |
555 .stabn 68,0,425,.LM59-UIMgr_convertTokenToValue |
556 .LM59: |
557 01c8 80E0 ldi r24,lo8(asciiTokenBuffer) |
558 01ca 90E0 ldi r25,hi8(asciiTokenBuffer) |
559 01cc 00D0 rcall atoi |
560 01ce 9C01 movw r18,r24 |
561 .stabn 68,0,426,.LM60-UIMgr_convertTokenToValue |
562 .LM60: |
563 01d0 8F3F cpi r24,255 |
564 01d2 9105 cpc r25,__zero_reg__ |
565 01d4 69F0 breq .L59 |
566 01d6 60F0 brlo .L59 |
567 .stabn 68,0,429,.LM61-UIMgr_convertTokenToValue |
568 .LM61: |
569 01d8 89E0 ldi r24,lo8(9) |
570 01da 8093 0000 sts receivedCmd,r24 |
571 .stabn 68,0,430,.LM62-UIMgr_convertTokenToValue |
572 .LM62: |
573 01de 8091 0000 lds r24,tokenCount |
574 01e2 E0E0 ldi r30,lo8(tokenBuffer) |
575 01e4 F0E0 ldi r31,hi8(tokenBuffer) |
576 01e6 E80F add r30,r24 |
577 01e8 F11D adc r31,__zero_reg__ |
578 01ea 8FEF ldi r24,lo8(-1) |
579 01ec 8083 st Z,r24 |
580 01ee 07C0 rjmp .L61 |
581 .L59: |
582 .stabn 68,0,435,.LM63-UIMgr_convertTokenToValue |
583 .LM63: |
584 01f0 8091 0000 lds r24,tokenCount |
585 01f4 E0E0 ldi r30,lo8(tokenBuffer) |
586 01f6 F0E0 ldi r31,hi8(tokenBuffer) |
587 01f8 E80F add r30,r24 |
588 01fa F11D adc r31,__zero_reg__ |
589 01fc 2083 st Z,r18 |
590 .L61: |
591 .stabn 68,0,437,.LM64-UIMgr_convertTokenToValue |
592 .LM64: |
593 01fe 83E0 ldi r24,lo8(3) |
GAS LISTING /tmp/ccRvT1Qm.s page 23 |
594 0200 E0E0 ldi r30,lo8(asciiTokenBuffer) |
595 0202 F0E0 ldi r31,hi8(asciiTokenBuffer) |
596 0204 1192 st Z+,__zero_reg__ |
597 0206 8A95 dec r24 |
598 0208 E9F7 brne .-6 |
599 .stabn 68,0,438,.LM65-UIMgr_convertTokenToValue |
600 .LM65: |
601 020a 1092 0000 sts charIndex,__zero_reg__ |
602 .stabn 68,0,439,.LM66-UIMgr_convertTokenToValue |
603 .LM66: |
604 020e 1092 0000 sts charCount,__zero_reg__ |
605 /* epilogue: frame size=0 */ |
606 0212 0895 ret |
607 /* epilogue end (size=1) */ |
608 /* function UIMgr_convertTokenToValue size 38 (37) */ |
609 .size UIMgr_convertTokenToValue, .-UIMgr_convertTokenToValue |
610 .stabs "newValue:r(0,4)",64,0,423,18 |
611 .stabn 192,0,0,UIMgr_convertTokenToValue-UIMgr_convertTokenToValue |
612 .stabn 224,0,0,.Lscope8-UIMgr_convertTokenToValue |
613 .Lscope8: |
614 .stabs "",36,0,0,.Lscope8-UIMgr_convertTokenToValue |
615 .stabd 78,0,0 |
616 .stabs "UIMgr_processReceivedData:F(0,15)",36,0,193,UIMgr_processReceivedData |
617 .global UIMgr_processReceivedData |
618 .type UIMgr_processReceivedData, @function |
619 UIMgr_processReceivedData: |
620 .stabd 46,0,0 |
621 .stabn 68,0,193,.LM67-UIMgr_processReceivedData |
622 .LM67: |
623 /* prologue: frame size=0 */ |
624 0214 FF92 push r15 |
625 0216 0F93 push r16 |
626 0218 1F93 push r17 |
627 021a CF93 push r28 |
628 021c DF93 push r29 |
629 /* prologue end (size=5) */ |
630 021e 0F2E mov __tmp_reg__,r31 |
631 0220 F9E0 ldi r31,lo8(9) |
632 0222 FF2E mov r15,r31 |
633 0224 F02D mov r31,__tmp_reg__ |
634 0226 FFC0 rjmp .L119 |
635 .L65: |
636 .LBB22: |
637 .LBB23: |
638 .stabn 68,0,612,.LM68-UIMgr_processReceivedData |
639 .LM68: |
640 /* #APP */ |
641 0228 F894 cli |
642 .stabn 68,0,613,.LM69-UIMgr_processReceivedData |
643 .LM69: |
644 /* #NOAPP */ |
645 022a E22F mov r30,r18 |
646 022c FF27 clr r31 |
647 022e E050 subi r30,lo8(-(UIMgr_rxFifo)) |
648 0230 F040 sbci r31,hi8(-(UIMgr_rxFifo)) |
649 0232 9081 ld r25,Z |
650 .stabn 68,0,615,.LM70-UIMgr_processReceivedData |
GAS LISTING /tmp/ccRvT1Qm.s page 24 |
651 .LM70: |
652 0234 822F mov r24,r18 |
653 0236 8F5F subi r24,lo8(-(1)) |
654 0238 8F71 andi r24,lo8(31) |
655 023a 8093 0000 sts UIMgr_rxFifoTail,r24 |
656 .stabn 68,0,616,.LM71-UIMgr_processReceivedData |
657 .LM71: |
658 /* #APP */ |
659 023e 7894 sei |
660 /* #NOAPP */ |
661 .LBE23: |
662 .LBE22: |
663 .stabn 68,0,202,.LM72-UIMgr_processReceivedData |
664 .LM72: |
665 0240 9D30 cpi r25,lo8(13) |
666 0242 09F0 breq .+2 |
667 0244 B1C0 rjmp .L66 |
668 .stabn 68,0,205,.LM73-UIMgr_processReceivedData |
669 .LM73: |
670 0246 8091 0000 lds r24,tokenCount |
671 024a 8823 tst r24 |
672 024c 11F4 brne .L68 |
673 .stabn 68,0,208,.LM74-UIMgr_processReceivedData |
674 .LM74: |
675 024e 42DF rcall UIMgr_convertTokenToCmd |
676 0250 06C0 rjmp .L70 |
677 .L68: |
678 .stabn 68,0,213,.LM75-UIMgr_processReceivedData |
679 .LM75: |
680 0252 BADF rcall UIMgr_convertTokenToValue |
681 .stabn 68,0,214,.LM76-UIMgr_processReceivedData |
682 .LM76: |
683 0254 8091 0000 lds r24,tokenCount |
684 0258 8F5F subi r24,lo8(-(1)) |
685 025a 8093 0000 sts tokenCount,r24 |
686 .L70: |
687 .stabn 68,0,218,.LM77-UIMgr_processReceivedData |
688 .LM77: |
689 025e 84E6 ldi r24,lo8(100) |
690 0260 90E0 ldi r25,hi8(100) |
691 0262 00D0 rcall Utility_delay |
692 .stabn 68,0,219,.LM78-UIMgr_processReceivedData |
693 .LM78: |
694 0264 8091 0000 lds r24,receivedCmd |
695 0268 8850 subi r24,lo8(-(-8)) |
696 026a 8230 cpi r24,lo8(2) |
697 026c 58F4 brsh .L71 |
698 .LBB24: |
699 .LBB25: |
700 .stabn 68,0,531,.LM79-UIMgr_processReceivedData |
701 .LM79: |
702 026e 8EE4 ldi r24,lo8(78) |
703 0270 F4DE rcall UIMgr_writeTxFifo |
704 .stabn 68,0,532,.LM80-UIMgr_processReceivedData |
705 .LM80: |
706 0272 83E4 ldi r24,lo8(67) |
707 0274 F2DE rcall UIMgr_writeTxFifo |
GAS LISTING /tmp/ccRvT1Qm.s page 25 |
708 .stabn 68,0,533,.LM81-UIMgr_processReceivedData |
709 .LM81: |
710 0276 8BE4 ldi r24,lo8(75) |
711 0278 F0DE rcall UIMgr_writeTxFifo |
712 .stabn 68,0,534,.LM82-UIMgr_processReceivedData |
713 .LM82: |
714 027a 8DE0 ldi r24,lo8(13) |
715 027c EEDE rcall UIMgr_writeTxFifo |
716 .LBE25: |
717 .LBE24: |
718 .stabn 68,0,223,.LM83-UIMgr_processReceivedData |
719 .LM83: |
720 027e 80E9 ldi r24,lo8(-112) |
721 0280 00D0 rcall Exec_writeEventFifo |
722 0282 89C0 rjmp .L73 |
723 .L71: |
724 .LBB26: |
725 .LBB27: |
726 .stabn 68,0,516,.LM84-UIMgr_processReceivedData |
727 .LM84: |
728 0284 81E4 ldi r24,lo8(65) |
729 0286 E9DE rcall UIMgr_writeTxFifo |
730 .stabn 68,0,517,.LM85-UIMgr_processReceivedData |
731 .LM85: |
732 0288 83E4 ldi r24,lo8(67) |
733 028a E7DE rcall UIMgr_writeTxFifo |
734 .stabn 68,0,518,.LM86-UIMgr_processReceivedData |
735 .LM86: |
736 028c 8BE4 ldi r24,lo8(75) |
737 028e E5DE rcall UIMgr_writeTxFifo |
738 .stabn 68,0,519,.LM87-UIMgr_processReceivedData |
739 .LM87: |
740 0290 8DE0 ldi r24,lo8(13) |
741 0292 E3DE rcall UIMgr_writeTxFifo |
742 .LBE27: |
743 .LBE26: |
744 .stabn 68,0,230,.LM88-UIMgr_processReceivedData |
745 .LM88: |
746 0294 80E9 ldi r24,lo8(-112) |
747 0296 00D0 rcall Exec_writeEventFifo |
748 .LBB28: |
749 .LBB29: |
750 .stabn 68,0,316,.LM89-UIMgr_processReceivedData |
751 .LM89: |
752 0298 8091 0000 lds r24,receivedCmd |
753 029c 8130 cpi r24,lo8(1) |
754 029e 09F4 brne .+2 |
755 02a0 7AC0 rjmp .L73 |
756 .stabn 68,0,319,.LM90-UIMgr_processReceivedData |
757 .LM90: |
758 02a2 8823 tst r24 |
759 02a4 71F4 brne .L75 |
760 .stabn 68,0,322,.LM91-UIMgr_processReceivedData |
761 .LM91: |
762 02a6 8091 0000 lds r24,AVRcamVersion |
763 02aa 8823 tst r24 |
764 02ac 09F4 brne .+2 |
GAS LISTING /tmp/ccRvT1Qm.s page 26 |
765 02ae 73C0 rjmp .L73 |
766 02b0 C0E0 ldi r28,lo8(AVRcamVersion) |
767 02b2 D0E0 ldi r29,hi8(AVRcamVersion) |
768 .L78: |
769 .stabn 68,0,324,.LM92-UIMgr_processReceivedData |
770 .LM92: |
771 02b4 2196 adiw r28,1 |
772 02b6 D1DE rcall UIMgr_writeTxFifo |
773 .stabn 68,0,322,.LM93-UIMgr_processReceivedData |
774 .LM93: |
775 02b8 8881 ld r24,Y |
776 02ba 8823 tst r24 |
777 02bc 09F4 brne .+2 |
778 02be 6BC0 rjmp .L73 |
779 02c0 F9CF rjmp .L78 |
780 .L75: |
781 .stabn 68,0,327,.LM94-UIMgr_processReceivedData |
782 .LM94: |
783 02c2 8730 cpi r24,lo8(7) |
784 02c4 11F4 brne .L79 |
785 .stabn 68,0,329,.LM95-UIMgr_processReceivedData |
786 .LM95: |
787 02c6 00D0 rcall CamInt_resetCam |
788 02c8 66C0 rjmp .L73 |
789 .L79: |
790 .stabn 68,0,331,.LM96-UIMgr_processReceivedData |
791 .LM96: |
792 02ca 8330 cpi r24,lo8(3) |
793 02cc 31F4 brne .L81 |
794 .stabn 68,0,340,.LM97-UIMgr_processReceivedData |
795 .LM97: |
796 02ce 84E6 ldi r24,lo8(100) |
797 02d0 90E0 ldi r25,hi8(100) |
798 02d2 00D0 rcall Utility_delay |
799 .stabn 68,0,341,.LM98-UIMgr_processReceivedData |
800 .LM98: |
801 02d4 82E0 ldi r24,lo8(2) |
802 02d6 00D0 rcall Exec_writeEventFifo |
803 02d8 5EC0 rjmp .L73 |
804 .L81: |
805 .stabn 68,0,343,.LM99-UIMgr_processReceivedData |
806 .LM99: |
807 02da 8230 cpi r24,lo8(2) |
808 02dc 99F4 brne .L83 |
809 .stabn 68,0,347,.LM100-UIMgr_processReceivedData |
810 .LM100: |
811 02de 8091 0000 lds r24,tokenCount |
812 02e2 8230 cpi r24,lo8(2) |
813 02e4 68F0 brlo .L85 |
814 02e6 11E0 ldi r17,lo8(1) |
815 .L87: |
816 .stabn 68,0,350,.LM101-UIMgr_processReceivedData |
817 .LM101: |
818 02e8 E12F mov r30,r17 |
819 02ea FF27 clr r31 |
820 02ec E050 subi r30,lo8(-(tokenBuffer)) |
821 02ee F040 sbci r31,hi8(-(tokenBuffer)) |
GAS LISTING /tmp/ccRvT1Qm.s page 27 |
822 02f0 6181 ldd r22,Z+1 |
823 02f2 8081 ld r24,Z |
824 02f4 00D0 rcall CamConfig_setCamReg |
825 .stabn 68,0,347,.LM102-UIMgr_processReceivedData |
826 .LM102: |
827 02f6 1E5F subi r17,lo8(-(2)) |
828 02f8 8091 0000 lds r24,tokenCount |
829 02fc 1817 cp r17,r24 |
830 02fe A0F3 brlo .L87 |
831 .L85: |
832 .stabn 68,0,352,.LM103-UIMgr_processReceivedData |
833 .LM103: |
834 0300 00D0 rcall CamConfig_sendFifoCmds |
835 0302 49C0 rjmp .L73 |
836 .L83: |
837 .stabn 68,0,354,.LM104-UIMgr_processReceivedData |
838 .LM104: |
839 0304 8430 cpi r24,lo8(4) |
840 0306 31F4 brne .L88 |
841 .stabn 68,0,357,.LM105-UIMgr_processReceivedData |
842 .LM105: |
843 0308 84E6 ldi r24,lo8(100) |
844 030a 90E0 ldi r25,hi8(100) |
845 030c 00D0 rcall Utility_delay |
846 .stabn 68,0,358,.LM106-UIMgr_processReceivedData |
847 .LM106: |
848 030e 80E8 ldi r24,lo8(-128) |
849 0310 00D0 rcall Exec_writeEventFifo |
850 0312 41C0 rjmp .L73 |
851 .L88: |
852 .stabn 68,0,360,.LM107-UIMgr_processReceivedData |
853 .LM107: |
854 0314 8530 cpi r24,lo8(5) |
855 0316 19F4 brne .L90 |
856 .stabn 68,0,362,.LM108-UIMgr_processReceivedData |
857 .LM108: |
858 0318 81E8 ldi r24,lo8(-127) |
859 031a 00D0 rcall Exec_writeEventFifo |
860 031c 3CC0 rjmp .L73 |
861 .L90: |
862 .stabn 68,0,364,.LM109-UIMgr_processReceivedData |
863 .LM109: |
864 031e 8630 cpi r24,lo8(6) |
865 0320 09F0 breq .+2 |
866 0322 39C0 rjmp .L73 |
867 .stabn 68,0,367,.LM110-UIMgr_processReceivedData |
868 .LM110: |
869 0324 8091 0000 lds r24,tokenCount |
870 0328 8823 tst r24 |
871 032a 09F4 brne .+2 |
872 032c 34C0 rjmp .L73 |
873 032e 40E0 ldi r20,lo8(0) |
874 0330 00E0 ldi r16,lo8(tokenBuffer) |
875 0332 10E0 ldi r17,hi8(tokenBuffer) |
876 0334 60E0 ldi r22,lo8(colorMap) |
877 0336 70E0 ldi r23,hi8(colorMap) |
878 .L94: |
GAS LISTING /tmp/ccRvT1Qm.s page 28 |
879 .stabn 68,0,369,.LM111-UIMgr_processReceivedData |
880 .LM111: |
881 0338 842F mov r24,r20 |
882 033a 9927 clr r25 |
883 033c 9C01 movw r18,r24 |
884 033e 2F5F subi r18,lo8(-(1)) |
885 0340 3F4F sbci r19,hi8(-(1)) |
886 0342 F901 movw r30,r18 |
887 0344 E00F add r30,r16 |
888 0346 F11F adc r31,r17 |
889 0348 E081 ld r30,Z |
890 034a EC01 movw r28,r24 |
891 034c C60F add r28,r22 |
892 034e D71F adc r29,r23 |
893 0350 E883 st Y,r30 |
894 .LBB30: |
895 .LBB31: |
896 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h",132,0,0,.Ltext1 |
897 .Ltext1: |
1:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** /* Copyright (c) 2002, 2003, 2004 Marek Michalkiewicz |
2:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** Copyright (c) 2005, 2006 Bjoern Haase |
3:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** All rights reserved. |
4:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
5:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** Redistribution and use in source and binary forms, with or without |
6:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** modification, are permitted provided that the following conditions are met: |
7:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
8:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** * Redistributions of source code must retain the above copyright |
9:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** notice, this list of conditions and the following disclaimer. |
10:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
11:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** * Redistributions in binary form must reproduce the above copyright |
12:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** notice, this list of conditions and the following disclaimer in |
13:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** the documentation and/or other materials provided with the |
14:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** distribution. |
15:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
16:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** * Neither the name of the copyright holders nor the names of |
17:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** contributors may be used to endorse or promote products derived |
18:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** from this software without specific prior written permission. |
19:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
20:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
21:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
22:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
23:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
24:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
25:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
26:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
27:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
28:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
29:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
30:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** POSSIBILITY OF SUCH DAMAGE. */ |
31:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
32:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** /* $Id: eeprom.h,v 1.17.2.1 2006/02/26 21:51:04 aesok Exp $ */ |
33:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
34:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** /* |
35:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** eeprom.h |
36:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
37:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** Contributors: |
38:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** Created by Marek Michalkiewicz <marekm@linux.org.pl> |
GAS LISTING /tmp/ccRvT1Qm.s page 29 |
39:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** eeprom_write_word and eeprom_write_block added by Artur Lipowski |
40:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** <LAL@pro.onet.pl> |
41:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** Complete rewrite using the original interface by Bjoern Haase |
42:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** <bjoern.haase@de.bosch.com>. |
43:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** */ |
44:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
45:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #ifndef _EEPROM_H_ |
46:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #define _EEPROM_H_ 1 |
47:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
48:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #define __need_size_t |
49:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #include <stddef.h> |
50:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #include <inttypes.h> |
51:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
52:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
53:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #ifdef __AVR_MEGA__ |
54:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #define XCALL "call" |
55:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #else |
56:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #define XCALL "rcall" |
57:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #endif |
58:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
59:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #include <avr/io.h> |
60:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #ifndef __EEPROM_REG_LOCATIONS__ |
61:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** /** \def __EEPROM_REG_LOCATIONS__ |
62:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** \ingroup avr_eeprom |
63:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** In order to be able to work without a requiring a multilib |
64:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** approach for dealing with controllers having the EEPROM registers |
65:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** at different positions in memory space, the eeprom functions evaluate |
66:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** __EEPROM_REG_LOCATIONS__: It is assumed to be defined by |
67:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** the device io header and contains 6 uppercase hex digits encoding the |
68:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** addresses of EECR,EEDR and EEAR. |
69:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** First two letters: EECR address. |
70:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** Second two letters: EEDR address. |
71:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** Last two letters: EEAR address. |
72:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** The default 1C1D1E corresponds to the |
73:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** register location that is valid for most controllers. The value |
74:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** of this define symbol is used for appending it to the base name of the |
75:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** assembler functions. */ |
76:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #define __EEPROM_REG_LOCATIONS__ 1C1D1E |
77:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #endif |
78:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #define _STR2(EXP) _STR1(EXP) |
79:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #define _STR1(EXP) #EXP |
80:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #define _REG_LOCATION_SUFFIX _STR2(__EEPROM_REG_LOCATIONS__) |
81:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
82:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #ifndef CR_TAB |
83:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #define CR_TAB "\n\t" |
84:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #endif |
85:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
86:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
87:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** /** \defgroup avr_eeprom <avr/eeprom.h>: EEPROM handling |
88:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** \code #include <avr/eeprom.h> \endcode |
89:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
90:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** This header file declares the interface to some simple library |
91:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** routines suitable for handling the data EEPROM contained in the |
92:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** AVR microcontrollers. The implementation uses a simple polled |
93:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** mode interface. Applications that require interrupt-controlled |
94:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** EEPROM access to ensure that no time will be wasted in spinloops |
95:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** will have to deploy their own implementation. |
GAS LISTING /tmp/ccRvT1Qm.s page 30 |
96:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
97:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** \note All of the read/write functions first make sure the EEPROM |
98:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** is ready to be accessed. Since this may cause long delays if a |
99:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** write operation is still pending, time-critical applications |
100:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** should first poll the EEPROM e. g. using eeprom_is_ready() before |
101:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** attempting any actual I/O. |
102:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
103:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** \note This header file declares inline functions that call the |
104:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** assembler subroutines directly. This prevents that the compiler |
105:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** generates push/pops for the call-clobbered registers. This way |
106:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** also a specific calling convention could be used for the eeprom |
107:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** routines e.g. by passing values in __tmp_reg__, eeprom addresses in |
108:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** X and memory addresses in Z registers. Method is optimized for code |
109:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** size. |
110:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
111:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** \note Presently supported are two locations of the EEPROM register |
112:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** set: 0x1F,0x20,0x21 and 0x1C,0x1D,0x1E |
113:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** (see ::__EEPROM_REG_LOCATIONS__). |
114:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
115:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** \note As these functions modify IO registers, they are known to be |
116:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** non-reentrant. If any of these functions are used from both, |
117:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** standard and interrupt context, the applications must ensure |
118:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** proper protection (e.g. by disabling interrupts before accessing |
119:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** them). |
120:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
121:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** */ |
122:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
123:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
124:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** /* forward declarations of the inline functions so that doxygen does |
125:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** not get confused by the attribute expression. */ |
126:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
127:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** static inline uint8_t __attribute__ ((always_inline)) |
128:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** eeprom_read_byte (const uint8_t *addr); |
129:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
130:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** static inline uint16_t __attribute__ ((always_inline)) |
131:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** eeprom_read_word (const uint16_t *addr); |
132:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
133:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** static inline void __attribute__ ((always_inline)) |
134:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** eeprom_read_block (void *pointer_ram, |
135:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** const void *pointer_eeprom, |
136:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** size_t size); |
137:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
138:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** static inline void __attribute__ ((always_inline)) |
139:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** eeprom_write_byte (uint8_t *addr,uint8_t value); |
140:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
141:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** static inline void __attribute__ ((always_inline)) |
142:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** eeprom_write_word (uint16_t *addr,uint16_t value); |
143:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
144:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** static inline void __attribute__ ((always_inline)) |
145:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** eeprom_write_block (const void *pointer_ram, |
146:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** void *pointer_eeprom, |
147:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** size_t size); |
148:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
149:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** /** \name avr-libc declarations */ |
150:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
151:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** /*@{*/ |
152:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
GAS LISTING /tmp/ccRvT1Qm.s page 31 |
153:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** /** \def EEMEM |
154:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** \ingroup avr_eeprom |
155:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** Attribute expression causing a variable to be allocated within the .eeprom |
156:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** section. */ |
157:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #define EEMEM __attribute__((section(".eeprom"))) |
158:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
159:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** /** \def eeprom_is_ready |
160:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** \ingroup avr_eeprom |
161:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** \returns 1 if EEPROM is ready for a new read/write operation, 0 if not. */ |
162:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
163:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #if defined(__DOXYGEN__) |
164:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** # define eeprom_is_ready() |
165:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #elif defined(EEWE) |
166:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** # define eeprom_is_ready() bit_is_clear(EECR, EEWE) |
167:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #elif defined(EEPE) |
168:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** # define eeprom_is_ready() bit_is_clear(EECR, EEPE) |
169:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #elif defined(DEECR) && defined(EEL) |
170:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** # define eeprom_is_ready() bit_is_clear(DEECR, EEL) |
171:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #else |
172:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** # error "No write enable bit known for this device's EEPROM." |
173:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #endif |
174:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
175:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** /** \def eeprom_busy_wait |
176:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** \ingroup avr_eeprom |
177:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
178:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** Loops until the eeprom is no longer busy. |
179:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
180:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** \returns Nothing. */ |
181:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
182:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** #define eeprom_busy_wait() do {} while (!eeprom_is_ready()) |
183:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
184:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
185:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** /** \ingroup avr_eeprom |
186:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** Read one byte from EEPROM address \c addr. */ |
187:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
188:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** uint8_t |
189:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** eeprom_read_byte (const uint8_t *addr) |
190:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** { |
191:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** uint8_t result; |
192:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** asm volatile |
898 .stabn 68,0,192,.LM112-UIMgr_processReceivedData |
899 .LM112: |
900 0352 D901 movw r26,r18 |
901 /* #APP */ |
902 0354 00D0 rcall __eeprom_read_byte_1C1D1E |
903 0356 802D mov r24,__tmp_reg__ |
904 /* #NOAPP */ |
905 .LBE31: |
906 .LBE30: |
907 .stabs "UIMgr.c",132,0,0,.Ltext2 |
908 .Ltext2: |
909 .stabn 68,0,374,.LM113-UIMgr_processReceivedData |
910 .LM113: |
911 0358 E817 cp r30,r24 |
912 035a C1F0 breq .L95 |
913 .LBB32: |
914 .LBB33: |
GAS LISTING /tmp/ccRvT1Qm.s page 32 |
915 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h",132,0,0,.Ltext3 |
916 .Ltext3: |
193:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** ( XCALL " __eeprom_read_byte_" _REG_LOCATION_SUFFIX CR_TAB |
194:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** "mov %1,__tmp_reg__" |
195:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** : "+x" (addr), |
196:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** "=r" (result) |
197:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** : ); |
198:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** return result; |
199:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** } |
200:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
201:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** /** \ingroup avr_eeprom |
202:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** Read one 16-bit word (little endian) from EEPROM address \c addr. */ |
203:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** uint16_t |
204:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** eeprom_read_word (const uint16_t *addr) |
205:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** { |
206:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** uint16_t result; |
207:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
208:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** asm ( |
209:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** XCALL " __eeprom_read_word_" _REG_LOCATION_SUFFIX CR_TAB |
210:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** : "+x" (addr), |
211:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** "=z" (result) |
212:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** : ); |
213:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** return result; |
214:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** } |
215:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
216:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** /** \ingroup avr_eeprom |
217:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** Read a block of \c n bytes from EEPROM address \c pointer_eeprom to |
218:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** \c pointer_ram. For constant n <= 256 bytes a library function is used. |
219:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** For block sizes unknown at compile time or block sizes > 256 an inline |
220:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** loop is expanded. */ |
221:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
222:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** void |
223:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** eeprom_read_block (void *pointer_ram, |
224:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** const void *pointer_eeprom, |
225:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** size_t n) |
226:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** { |
227:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** if (!__builtin_constant_p (n) |
228:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** || n > 256) |
229:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** { |
230:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** /* make sure size is a 16 bit variable. */ |
231:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** uint16_t size = n; |
232:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
233:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** asm volatile ( |
234:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** ".%=_start:" CR_TAB |
235:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** "sbiw %2,1" CR_TAB |
236:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** "brlt .%=_finished" CR_TAB |
237:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** XCALL " __eeprom_read_byte_" _REG_LOCATION_SUFFIX CR_TAB |
238:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** "st z+,__tmp_reg__" CR_TAB |
239:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** "rjmp .%=_start" CR_TAB |
240:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** ".%=_finished:" |
241:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** : "=x" (pointer_eeprom), |
242:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** "=z" (pointer_ram), |
243:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** "+w" (size) |
244:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** : "x" (pointer_eeprom), |
245:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** "z" (pointer_ram) |
246:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** : "memory"); |
247:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** } |
GAS LISTING /tmp/ccRvT1Qm.s page 33 |
248:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** else |
249:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** { |
250:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** if (n != 0) |
251:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** { |
252:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** if (n == 256) |
253:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** { |
254:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** asm volatile ( |
255:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** XCALL " __eeprom_read_block_" _REG_LOCATION_SUFFIX |
256:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** : "+x" (pointer_eeprom), |
257:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** "=z" (pointer_ram) |
258:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** : "z" (pointer_ram) |
259:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** : "memory"); |
260:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** } |
261:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** else |
262:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** { |
263:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** /* Needed in order to truncate to 8 bit. */ |
264:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** uint8_t len; |
265:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** len = (uint8_t) n; |
266:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
267:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** asm volatile ( |
268:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** "mov __zero_reg__,%2" CR_TAB |
269:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** XCALL " __eeprom_read_block_" _REG_LOCATION_SUFFIX |
270:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** : "+x" (pointer_eeprom), |
271:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** "=z" (pointer_ram) |
272:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** : "r" (len), |
273:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** "z" (pointer_ram) |
274:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** : "memory"); |
275:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** } |
276:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** } |
277:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** } |
278:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** } |
279:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
280:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** /** \ingroup avr_eeprom |
281:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** Write a byte \c value to EEPROM address \c addr. */ |
282:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** |
283:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** void |
284:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** eeprom_write_byte (uint8_t *addr,uint8_t value) |
285:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** { |
286:/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h **** asm volatile ( |
917 .stabn 68,0,286,.LM114-UIMgr_processReceivedData |
918 .LM114: |
919 035c D901 movw r26,r18 |
920 /* #APP */ |
921 035e 0E2E mov __tmp_reg__,r30 |
922 0360 00D0 rcall __eeprom_write_byte_1C1D1E |
923 /* #NOAPP */ |
924 .LBE33: |
925 .LBE32: |
926 .LBB34: |
927 .LBB35: |
928 .stabn 68,0,192,.LM115-UIMgr_processReceivedData |
929 .LM115: |
930 0362 D901 movw r26,r18 |
931 /* #APP */ |
932 0364 00D0 rcall __eeprom_read_byte_1C1D1E |
933 0366 802D mov r24,__tmp_reg__ |
934 /* #NOAPP */ |
GAS LISTING /tmp/ccRvT1Qm.s page 34 |
935 .LBE35: |
936 .LBE34: |
937 .stabs "UIMgr.c",132,0,0,.Ltext4 |
938 .Ltext4: |
939 .stabn 68,0,384,.LM116-UIMgr_processReceivedData |
940 .LM116: |
941 0368 9881 ld r25,Y |
942 036a 9817 cp r25,r24 |
943 036c 79F0 breq .L95 |
944 .LBB36: |
945 .LBB37: |
946 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h",132,0,0,.Ltext5 |
947 .Ltext5: |
948 .stabn 68,0,286,.LM117-UIMgr_processReceivedData |
949 .LM117: |
950 036e D901 movw r26,r18 |
951 /* #APP */ |
952 0370 092E mov __tmp_reg__,r25 |
953 0372 00D0 rcall __eeprom_write_byte_1C1D1E |
954 /* #NOAPP */ |
955 .LBE37: |
956 .LBE36: |
957 .LBB38: |
958 .LBB39: |
959 .stabn 68,0,192,.LM118-UIMgr_processReceivedData |
960 .LM118: |
961 0374 D901 movw r26,r18 |
962 /* #APP */ |
963 0376 00D0 rcall __eeprom_read_byte_1C1D1E |
964 0378 802D mov r24,__tmp_reg__ |
965 /* #NOAPP */ |
966 .LBE39: |
967 .LBE38: |
968 .stabs "UIMgr.c",132,0,0,.Ltext6 |
969 .Ltext6: |
970 .stabn 68,0,384,.LM119-UIMgr_processReceivedData |
971 .LM119: |
972 037a 9881 ld r25,Y |
973 037c 9817 cp r25,r24 |
974 037e 31F0 breq .L95 |
975 .LBB40: |
976 .LBB41: |
977 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/eeprom.h",132,0,0,.Ltext7 |
978 .Ltext7: |
979 .stabn 68,0,286,.LM120-UIMgr_processReceivedData |
980 .LM120: |
981 0380 D901 movw r26,r18 |
982 /* #APP */ |
983 0382 092E mov __tmp_reg__,r25 |
984 0384 00D0 rcall __eeprom_write_byte_1C1D1E |
985 /* #NOAPP */ |
986 .LBE41: |
987 .LBE40: |
988 .LBB42: |
989 .LBB43: |
990 .stabn 68,0,192,.LM121-UIMgr_processReceivedData |
991 .LM121: |
GAS LISTING /tmp/ccRvT1Qm.s page 35 |
992 0386 D901 movw r26,r18 |
993 /* #APP */ |
994 0388 00D0 rcall __eeprom_read_byte_1C1D1E |
995 038a 802D mov r24,__tmp_reg__ |
996 /* #NOAPP */ |
997 .L95: |
998 .LBE43: |
999 .LBE42: |
1000 .stabs "UIMgr.c",132,0,0,.Ltext8 |
1001 .Ltext8: |
1002 .stabn 68,0,367,.LM122-UIMgr_processReceivedData |
1003 .LM122: |
1004 038c 4F5F subi r20,lo8(-(1)) |
1005 038e 8091 0000 lds r24,tokenCount |
1006 0392 4817 cp r20,r24 |
1007 0394 88F2 brlo .L94 |
1008 .L73: |
1009 .LBE29: |
1010 .LBE28: |
1011 .stabn 68,0,235,.LM123-UIMgr_processReceivedData |
1012 .LM123: |
1013 0396 1092 0000 sts tokenCount,__zero_reg__ |
1014 .stabn 68,0,236,.LM124-UIMgr_processReceivedData |
1015 .LM124: |
1016 039a 80E4 ldi r24,lo8(64) |
1017 039c E0E0 ldi r30,lo8(tokenBuffer) |
1018 039e F0E0 ldi r31,hi8(tokenBuffer) |
1019 03a0 1192 st Z+,__zero_reg__ |
1020 03a2 8A95 dec r24 |
1021 03a4 E9F7 brne .-6 |
1022 03a6 3FC0 rjmp .L119 |
1023 .L66: |
1024 .stabn 68,0,238,.LM125-UIMgr_processReceivedData |
1025 .LM125: |
1026 03a8 9032 cpi r25,lo8(32) |
1027 03aa F1F4 brne .L99 |
1028 .stabn 68,0,241,.LM126-UIMgr_processReceivedData |
1029 .LM126: |
1030 03ac 8091 0000 lds r24,tokenCount |
1031 03b0 8823 tst r24 |
1032 03b2 39F4 brne .L101 |
1033 .stabn 68,0,243,.LM127-UIMgr_processReceivedData |
1034 .LM127: |
1035 03b4 8FDE rcall UIMgr_convertTokenToCmd |
1036 .stabn 68,0,244,.LM128-UIMgr_processReceivedData |
1037 .LM128: |
1038 03b6 8091 0000 lds r24,tokenCount |
1039 03ba 8F5F subi r24,lo8(-(1)) |
1040 03bc 8093 0000 sts tokenCount,r24 |
1041 03c0 32C0 rjmp .L119 |
1042 .L101: |
1043 .stabn 68,0,254,.LM129-UIMgr_processReceivedData |
1044 .LM129: |
1045 03c2 9927 clr r25 |
1046 03c4 CF97 sbiw r24,63 |
1047 03c6 4CF0 brlt .L103 |
1048 .stabn 68,0,259,.LM130-UIMgr_processReceivedData |
GAS LISTING /tmp/ccRvT1Qm.s page 36 |
1049 .LM130: |
1050 03c8 1092 0000 sts charCount,__zero_reg__ |
1051 .stabn 68,0,260,.LM131-UIMgr_processReceivedData |
1052 .LM131: |
1053 03cc 1092 0000 sts charIndex,__zero_reg__ |
1054 .stabn 68,0,261,.LM132-UIMgr_processReceivedData |
1055 .LM132: |
1056 03d0 1092 0000 sts tokenCount,__zero_reg__ |
1057 .stabn 68,0,262,.LM133-UIMgr_processReceivedData |
1058 .LM133: |
1059 03d4 F092 0000 sts receivedCmd,r15 |
1060 03d8 26C0 rjmp .L119 |
1061 .L103: |
1062 .stabn 68,0,267,.LM134-UIMgr_processReceivedData |
1063 .LM134: |
1064 03da F6DE rcall UIMgr_convertTokenToValue |
1065 .stabn 68,0,268,.LM135-UIMgr_processReceivedData |
1066 .LM135: |
1067 03dc 8091 0000 lds r24,tokenCount |
1068 03e0 8F5F subi r24,lo8(-(1)) |
1069 03e2 8093 0000 sts tokenCount,r24 |
1070 03e6 1FC0 rjmp .L119 |
1071 .L99: |
1072 .stabn 68,0,272,.LM136-UIMgr_processReceivedData |
1073 .LM136: |
1074 03e8 892F mov r24,r25 |
1075 03ea 8154 subi r24,lo8(-(-65)) |
1076 03ec 8A31 cpi r24,lo8(26) |
1077 03ee 18F0 brlo .L105 |
1078 03f0 8F5E subi r24,lo8(-(17)) |
1079 03f2 8A30 cpi r24,lo8(10) |
1080 03f4 B0F4 brsh .L107 |
1081 .L105: |
1082 .stabn 68,0,276,.LM137-UIMgr_processReceivedData |
1083 .LM137: |
1084 03f6 8091 0000 lds r24,charIndex |
1085 03fa E82F mov r30,r24 |
1086 03fc FF27 clr r31 |
1087 03fe E050 subi r30,lo8(-(asciiTokenBuffer)) |
1088 0400 F040 sbci r31,hi8(-(asciiTokenBuffer)) |
1089 0402 9083 st Z,r25 |
1090 .stabn 68,0,277,.LM138-UIMgr_processReceivedData |
1091 .LM138: |
1092 0404 9091 0000 lds r25,charCount |
1093 0408 9F5F subi r25,lo8(-(1)) |
1094 040a 9093 0000 sts charCount,r25 |
1095 .stabn 68,0,278,.LM139-UIMgr_processReceivedData |
1096 .LM139: |
1097 040e 8F5F subi r24,lo8(-(1)) |
1098 0410 8093 0000 sts charIndex,r24 |
1099 .stabn 68,0,279,.LM140-UIMgr_processReceivedData |
1100 .LM140: |
1101 0414 9430 cpi r25,lo8(4) |
1102 0416 38F0 brlo .L119 |
1103 .stabn 68,0,284,.LM141-UIMgr_processReceivedData |
1104 .LM141: |
1105 0418 F092 0000 sts receivedCmd,r15 |
GAS LISTING /tmp/ccRvT1Qm.s page 37 |
1106 .stabn 68,0,285,.LM142-UIMgr_processReceivedData |
1107 .LM142: |
1108 041c 1092 0000 sts charIndex,__zero_reg__ |
1109 0420 02C0 rjmp .L119 |
1110 .L107: |
1111 .stabn 68,0,291,.LM143-UIMgr_processReceivedData |
1112 .LM143: |
1113 0422 F092 0000 sts receivedCmd,r15 |
1114 .L119: |
1115 .stabn 68,0,199,.LM144-UIMgr_processReceivedData |
1116 .LM144: |
1117 0426 2091 0000 lds r18,UIMgr_rxFifoTail |
1118 042a 8091 0000 lds r24,UIMgr_rxFifoHead |
1119 042e 8217 cp r24,r18 |
1120 0430 09F0 breq .+2 |
1121 0432 FACE rjmp .L65 |
1122 .stabn 68,0,295,.LM145-UIMgr_processReceivedData |
1123 .LM145: |
1124 /* #APP */ |
1125 0434 E894 clt |
1126 /* #NOAPP */ |
1127 /* epilogue: frame size=0 */ |
1128 0436 DF91 pop r29 |
1129 0438 CF91 pop r28 |
1130 043a 1F91 pop r17 |
1131 043c 0F91 pop r16 |
1132 043e FF90 pop r15 |
1133 0440 0895 ret |
1134 /* epilogue end (size=6) */ |
1135 /* function UIMgr_processReceivedData size 297 (286) */ |
1136 .size UIMgr_processReceivedData, .-UIMgr_processReceivedData |
1137 .stabs "tmpData:r(0,11)",64,0,194,25 |
1138 .stabn 192,0,0,UIMgr_processReceivedData-UIMgr_processReceivedData |
1139 .stabs "dataByte:r(0,11)",64,0,609,25 |
1140 .stabn 192,0,0,.LBB23-UIMgr_processReceivedData |
1141 .stabn 224,0,0,.LBE23-UIMgr_processReceivedData |
1142 .stabn 224,0,0,.Lscope9-UIMgr_processReceivedData |
1143 .Lscope9: |
1144 .stabs "",36,0,0,.Lscope9-UIMgr_processReceivedData |
1145 .stabd 78,0,0 |
1146 .stabs "UIMgr_dispatchEvent:F(0,15)",36,0,152,UIMgr_dispatchEvent |
1147 .stabs "event:P(0,11)",64,0,151,24 |
1148 .global UIMgr_dispatchEvent |
1149 .type UIMgr_dispatchEvent, @function |
1150 UIMgr_dispatchEvent: |
1151 .stabd 46,0,0 |
1152 .stabn 68,0,152,.LM146-UIMgr_dispatchEvent |
1153 .LM146: |
1154 /* prologue: frame size=0 */ |
1155 /* prologue end (size=0) */ |
1156 .stabn 68,0,153,.LM147-UIMgr_dispatchEvent |
1157 .LM147: |
1158 0442 8031 cpi r24,lo8(16) |
1159 0444 29F0 breq .L123 |
1160 .stabn 68,0,153,.LM148-UIMgr_dispatchEvent |
1161 .LM148: |
1162 0446 8039 cpi r24,lo8(-112) |
GAS LISTING /tmp/ccRvT1Qm.s page 38 |
1163 0448 39F0 breq .L124 |
1164 044a 8130 cpi r24,lo8(1) |
1165 044c 31F4 brne .L125 |
1166 044e 02C0 rjmp .L122 |
1167 .L123: |
1168 .stabn 68,0,156,.LM149-UIMgr_dispatchEvent |
1169 .LM149: |
1170 0450 38DE rcall UIMgr_transmitPendingData |
1171 0452 0895 ret |
1172 .L122: |
1173 .stabn 68,0,160,.LM150-UIMgr_dispatchEvent |
1174 .LM150: |
1175 0454 DFDE rcall UIMgr_processReceivedData |
1176 0456 0895 ret |
1177 .L124: |
1178 .stabn 68,0,164,.LM151-UIMgr_dispatchEvent |
1179 .LM151: |
1180 0458 0EDE rcall UIMgr_flushTxBuffer |
1181 .L125: |
1182 045a 0895 ret |
1183 /* epilogue: frame size=0 */ |
1184 /* epilogue: noreturn */ |
1185 /* epilogue end (size=0) */ |
1186 /* function UIMgr_dispatchEvent size 13 (13) */ |
1187 .size UIMgr_dispatchEvent, .-UIMgr_dispatchEvent |
1188 .Lscope10: |
1189 .stabs "",36,0,0,.Lscope10-UIMgr_dispatchEvent |
1190 .stabd 78,0,0 |
1191 .global UIMgr_rxFifoHead |
1192 .global UIMgr_rxFifoHead |
1193 .section .bss |
1194 .type UIMgr_rxFifoHead, @object |
1195 .size UIMgr_rxFifoHead, 1 |
1196 UIMgr_rxFifoHead: |
1197 0000 00 .skip 1,0 |
1198 .global UIMgr_rxFifoTail |
1199 .global UIMgr_rxFifoTail |
1200 .type UIMgr_rxFifoTail, @object |
1201 .size UIMgr_rxFifoTail, 1 |
1202 UIMgr_rxFifoTail: |
1203 0001 00 .skip 1,0 |
1204 .global UIMgr_txFifoHead |
1205 .global UIMgr_txFifoHead |
1206 .type UIMgr_txFifoHead, @object |
1207 .size UIMgr_txFifoHead, 1 |
1208 UIMgr_txFifoHead: |
1209 0002 00 .skip 1,0 |
1210 .global UIMgr_txFifoTail |
1211 .global UIMgr_txFifoTail |
1212 .type UIMgr_txFifoTail, @object |
1213 .size UIMgr_txFifoTail, 1 |
1214 UIMgr_txFifoTail: |
1215 0003 00 .skip 1,0 |
1216 .lcomm tokenCount,1 |
1217 .data |
1218 .type receivedCmd, @object |
1219 .size receivedCmd, 1 |
GAS LISTING /tmp/ccRvT1Qm.s page 39 |
1220 receivedCmd: |
1221 0000 08 .byte 8 |
1222 .lcomm charCount,1 |
1223 .lcomm charIndex,1 |
1224 .type AVRcamVersion, @object |
1225 .size AVRcamVersion, 13 |
1226 AVRcamVersion: |
1227 0001 4156 5263 .string "AVRcam v1.4\r" |
1227 616D 2076 |
1227 312E 340D |
1227 00 |
1228 .lcomm asciiTokenBuffer,4 |
1229 .lcomm tokenBuffer,64 |
1230 .comm UIMgr_rxFifo,32,1 |
1231 .comm UIMgr_txFifo,64,1 |
1232 .stabs "charCount:S(0,11)",38,0,92,charCount |
1233 .stabs "charIndex:S(0,11)",38,0,93,charIndex |
1234 .stabs "asciiTokenBuffer:S(0,21)=ar(0,22)=r(0,22);0;0177777;;0;3;(0,11)",40,0,94,asciiTokenBuffer |
1235 .stabs "tokenCount:S(0,11)",38,0,95,tokenCount |
1236 .stabs "tokenBuffer:S(0,23)=ar(0,22);0;63;(0,11)",40,0,96,tokenBuffer |
1237 .stabs "receivedCmd:S(0,17)",38,0,97,receivedCmd |
1238 .stabs "AVRcamVersion:S(0,24)=ar(0,22);0;12;(0,11)",38,0,98,AVRcamVersion |
1239 .stabs "UIMgr_rxFifo:G(0,25)=ar(0,22);0;31;(0,11)",32,0,111,0 |
1240 .stabs "UIMgr_rxFifoHead:G(0,11)",32,0,112,0 |
1241 .stabs "UIMgr_rxFifoTail:G(0,11)",32,0,113,0 |
1242 .stabs "UIMgr_txFifo:G(0,23)",32,0,115,0 |
1243 .stabs "UIMgr_txFifoHead:G(0,11)",32,0,116,0 |
1244 .stabs "UIMgr_txFifoTail:G(0,11)",32,0,117,0 |
1245 .text |
1246 .stabs "",100,0,0,.Letext0 |
1247 .Letext0: |
1248 /* File "UIMgr.c": code 582 = 0x0246 ( 557), prologues 9, epilogues 16 */ |
GAS LISTING /tmp/ccRvT1Qm.s page 40 |
DEFINED SYMBOLS |
*ABS*:00000000 UIMgr.c |
/tmp/ccRvT1Qm.s:3 *ABS*:0000003f __SREG__ |
/tmp/ccRvT1Qm.s:4 *ABS*:0000003e __SP_H__ |
/tmp/ccRvT1Qm.s:5 *ABS*:0000003d __SP_L__ |
/tmp/ccRvT1Qm.s:6 *ABS*:00000000 __tmp_reg__ |
/tmp/ccRvT1Qm.s:7 *ABS*:00000001 __zero_reg__ |
/tmp/ccRvT1Qm.s:94 .text:00000000 UIMgr_writeBufferToTxFifo |
*COM*:00000040 UIMgr_txFifo |
/tmp/ccRvT1Qm.s:1208 .bss:00000002 UIMgr_txFifoHead |
/tmp/ccRvT1Qm.s:159 .text:0000003c UIMgr_readTxFifo |
/tmp/ccRvT1Qm.s:1214 .bss:00000003 UIMgr_txFifoTail |
/tmp/ccRvT1Qm.s:206 .text:0000005a UIMgr_writeTxFifo |
/tmp/ccRvT1Qm.s:246 .text:00000076 UIMgr_flushTxBuffer |
/tmp/ccRvT1Qm.s:284 .text:00000094 UIMgr_txBuffer |
/tmp/ccRvT1Qm.s:333 .text:000000c2 UIMgr_transmitPendingData |
/tmp/ccRvT1Qm.s:361 .text:000000d4 UIMgr_convertTokenToCmd |
/tmp/ccRvT1Qm.s:1223 .bss:00000007 asciiTokenBuffer |
/tmp/ccRvT1Qm.s:1220 .data:00000000 receivedCmd |
/tmp/ccRvT1Qm.s:1222 .bss:00000006 charIndex |
/tmp/ccRvT1Qm.s:1216 .bss:00000005 charCount |
/tmp/ccRvT1Qm.s:503 .text:00000192 UIMgr_init |
/tmp/ccRvT1Qm.s:1228 .bss:0000000b tokenBuffer |
*COM*:00000020 UIMgr_rxFifo |
/tmp/ccRvT1Qm.s:549 .text:000001c8 UIMgr_convertTokenToValue |
.bss:00000004 tokenCount |
/tmp/ccRvT1Qm.s:619 .text:00000214 UIMgr_processReceivedData |
/tmp/ccRvT1Qm.s:1202 .bss:00000001 UIMgr_rxFifoTail |
/tmp/ccRvT1Qm.s:1226 .data:00000001 AVRcamVersion |
/tmp/ccRvT1Qm.s:1196 .bss:00000000 UIMgr_rxFifoHead |
/tmp/ccRvT1Qm.s:1150 .text:00000442 UIMgr_dispatchEvent |
UNDEFINED SYMBOLS |
__do_copy_data |
__do_clear_bss |
UartInt_txByte |
atoi |
Utility_delay |
Exec_writeEventFifo |
CamInt_resetCam |
CamConfig_setCamReg |
CamConfig_sendFifoCmds |
colorMap |
__eeprom_read_byte_1C1D1E |
__eeprom_write_byte_1C1D1E |
/programy/C/avr/AVRcam/UartInterface.lst |
---|
0,0 → 1,393 |
GAS LISTING /tmp/ccZtX2VJ.s page 1 |
1 .file "UartInterface.c" |
2 .arch atmega8 |
3 __SREG__ = 0x3f |
4 __SP_H__ = 0x3e |
5 __SP_L__ = 0x3d |
6 __tmp_reg__ = 0 |
7 __zero_reg__ = 1 |
8 .global __do_copy_data |
9 .global __do_clear_bss |
10 .stabs "/home/kaklik/projects/programy/Atmel_C/AVRcam/",100,0,2,.Ltext0 |
11 .stabs "UartInterface.c",100,0,2,.Ltext0 |
12 .text |
13 .Ltext0: |
14 .stabs "gcc2_compiled.",60,0,0,0 |
15 .stabs "int:t(0,1)=r(0,1);-32768;32767;",128,0,0,0 |
16 .stabs "char:t(0,2)=@s8;r(0,2);0;255;",128,0,0,0 |
17 .stabs "long int:t(0,3)=@s32;r(0,3);020000000000;017777777777;",128,0,0,0 |
18 .stabs "unsigned int:t(0,4)=r(0,4);0;0177777;",128,0,0,0 |
19 .stabs "long unsigned int:t(0,5)=@s32;r(0,5);0;037777777777;",128,0,0,0 |
20 .stabs "long long int:t(0,6)=@s64;r(0,6);01000000000000000000000;0777777777777777777777;",128,0,0, |
21 .stabs "long long unsigned int:t(0,7)=@s64;r(0,7);0;01777777777777777777777;",128,0,0,0 |
22 .stabs "short int:t(0,8)=r(0,8);-32768;32767;",128,0,0,0 |
23 .stabs "short unsigned int:t(0,9)=r(0,9);0;0177777;",128,0,0,0 |
24 .stabs "signed char:t(0,10)=@s8;r(0,10);-128;127;",128,0,0,0 |
25 .stabs "unsigned char:t(0,11)=@s8;r(0,11);0;255;",128,0,0,0 |
26 .stabs "float:t(0,12)=r(0,1);4;0;",128,0,0,0 |
27 .stabs "double:t(0,13)=r(0,1);4;0;",128,0,0,0 |
28 .stabs "long double:t(0,14)=r(0,1);4;0;",128,0,0,0 |
29 .stabs "void:t(0,15)=(0,15)",128,0,0,0 |
30 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/io.h",130,0,0,0 |
31 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/sfr_defs.h",130,0,0,0 |
32 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/inttypes.h",130,0,0,0 |
33 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/stdint.h",130,0,0,0 |
34 .stabs "int8_t:t(4,1)=(0,10)",128,0,116,0 |
35 .stabs "uint8_t:t(4,2)=(0,11)",128,0,117,0 |
36 .stabs "int16_t:t(4,3)=(0,1)",128,0,118,0 |
37 .stabs "uint16_t:t(4,4)=(0,4)",128,0,119,0 |
38 .stabs "int32_t:t(4,5)=(0,3)",128,0,120,0 |
39 .stabs "uint32_t:t(4,6)=(0,5)",128,0,121,0 |
40 .stabs "int64_t:t(4,7)=(0,6)",128,0,122,0 |
41 .stabs "uint64_t:t(4,8)=(0,7)",128,0,123,0 |
42 .stabs "intptr_t:t(4,9)=(4,3)",128,0,135,0 |
43 .stabs "uintptr_t:t(4,10)=(4,4)",128,0,140,0 |
44 .stabs "int_least8_t:t(4,11)=(4,1)",128,0,152,0 |
45 .stabs "uint_least8_t:t(4,12)=(4,2)",128,0,157,0 |
46 .stabs "int_least16_t:t(4,13)=(4,3)",128,0,162,0 |
47 .stabs "uint_least16_t:t(4,14)=(4,4)",128,0,167,0 |
48 .stabs "int_least32_t:t(4,15)=(4,5)",128,0,172,0 |
49 .stabs "uint_least32_t:t(4,16)=(4,6)",128,0,177,0 |
50 .stabs "int_least64_t:t(4,17)=(4,7)",128,0,182,0 |
51 .stabs "uint_least64_t:t(4,18)=(4,8)",128,0,187,0 |
52 .stabs "int_fast8_t:t(4,19)=(4,1)",128,0,200,0 |
53 .stabs "uint_fast8_t:t(4,20)=(4,2)",128,0,205,0 |
54 .stabs "int_fast16_t:t(4,21)=(4,3)",128,0,210,0 |
55 .stabs "uint_fast16_t:t(4,22)=(4,4)",128,0,215,0 |
56 .stabs "int_fast32_t:t(4,23)=(4,5)",128,0,220,0 |
57 .stabs "uint_fast32_t:t(4,24)=(4,6)",128,0,225,0 |
GAS LISTING /tmp/ccZtX2VJ.s page 2 |
58 .stabs "int_fast64_t:t(4,25)=(4,7)",128,0,230,0 |
59 .stabs "uint_fast64_t:t(4,26)=(4,8)",128,0,235,0 |
60 .stabs "intmax_t:t(4,27)=(4,7)",128,0,249,0 |
61 .stabs "uintmax_t:t(4,28)=(4,8)",128,0,254,0 |
62 .stabn 162,0,0,0 |
63 .stabs "int_farptr_t:t(3,1)=(4,5)",128,0,76,0 |
64 .stabs "uint_farptr_t:t(3,2)=(4,6)",128,0,80,0 |
65 .stabn 162,0,0,0 |
66 .stabn 162,0,0,0 |
67 .stabn 162,0,0,0 |
68 .stabs "CommonDefs.h",130,0,0,0 |
69 .stabs "bool_t:t(5,1)=(0,11)",128,0,56,0 |
70 .stabn 162,0,0,0 |
71 .stabs "UartInt_init:F(0,15)",36,0,76,UartInt_init |
72 .global UartInt_init |
73 .type UartInt_init, @function |
74 UartInt_init: |
75 .stabd 46,0,0 |
1:UartInterface.c **** /* |
2:UartInterface.c **** Copyright (C) 2004 John Orlando |
3:UartInterface.c **** |
4:UartInterface.c **** AVRcam: a small real-time image processing engine. |
5:UartInterface.c **** |
6:UartInterface.c **** This program is free software; you can redistribute it and/or |
7:UartInterface.c **** modify it under the terms of the GNU General Public |
8:UartInterface.c **** License as published by the Free Software Foundation; either |
9:UartInterface.c **** version 2 of the License, or (at your option) any later version. |
10:UartInterface.c **** |
11:UartInterface.c **** This program is distributed in the hope that it will be useful, |
12:UartInterface.c **** but WITHOUT ANY WARRANTY; without even the implied warranty of |
13:UartInterface.c **** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14:UartInterface.c **** General Public License for more details. |
15:UartInterface.c **** |
16:UartInterface.c **** You should have received a copy of the GNU General Public |
17:UartInterface.c **** License along with this program; if not, write to the Free Software |
18:UartInterface.c **** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19:UartInterface.c **** |
20:UartInterface.c **** For more information on the AVRcam, please contact: |
21:UartInterface.c **** |
22:UartInterface.c **** john@jrobot.net |
23:UartInterface.c **** |
24:UartInterface.c **** or go to www.jrobot.net for more details regarding the system. |
25:UartInterface.c **** */ |
26:UartInterface.c **** /*********************************************************** |
27:UartInterface.c **** Module Name: UartInterface.c |
28:UartInterface.c **** Module Date: 04/10/2004 |
29:UartInterface.c **** Module Auth: John Orlando |
30:UartInterface.c **** |
31:UartInterface.c **** Description: This module is responsible for providing an |
32:UartInterface.c **** interface to the UART hardware available on the mega8. |
33:UartInterface.c **** This interface is an interrupt-driven interface. |
34:UartInterface.c **** |
35:UartInterface.c **** Revision History: |
36:UartInterface.c **** Date Rel Ver. Notes |
37:UartInterface.c **** 4/10/2004 0.1 Module created |
38:UartInterface.c **** 6/30/2004 1.0 Initial release for Circuit Cellar |
39:UartInterface.c **** contest. |
GAS LISTING /tmp/ccZtX2VJ.s page 3 |
40:UartInterface.c **** 11/15/2004 1.2 Updated UART baud rate regs so that |
41:UartInterface.c **** it runs at 115.2 kbps when the input |
42:UartInterface.c **** crystal is at 17.7 MHz (which is the |
43:UartInterface.c **** speed of the OV6620's crystal). |
44:UartInterface.c **** 1/16/2005 1.4 Moved the serial received ISR to |
45:UartInterface.c **** this file, instead of having it |
46:UartInterface.c **** in its own UartInterfaceAsm.S file |
47:UartInterface.c **** written in assembly. |
48:UartInterface.c **** ***********************************************************/ |
49:UartInterface.c **** |
50:UartInterface.c **** /* Includes */ |
51:UartInterface.c **** #include <avr/io.h> |
52:UartInterface.c **** #include <avr/interrupt.h> |
53:UartInterface.c **** #include "CommonDefs.h" |
54:UartInterface.c **** #include "UartInterface.h" |
55:UartInterface.c **** #include "UIMgr.h" |
56:UartInterface.c **** #include "Executive.h" |
57:UartInterface.c **** |
58:UartInterface.c **** /* Local Variables */ |
59:UartInterface.c **** |
60:UartInterface.c **** /* Local Structures and Typedefs */ |
61:UartInterface.c **** |
62:UartInterface.c **** /* Extern Variables */ |
63:UartInterface.c **** |
64:UartInterface.c **** /* Definitions */ |
65:UartInterface.c **** |
66:UartInterface.c **** /*********************************************************** |
67:UartInterface.c **** Function Name: UartInt_init |
68:UartInterface.c **** Function Description: This function is responsible for |
69:UartInterface.c **** initializing the UART interface on the mega8. This |
70:UartInterface.c **** interface is set to communicate at 115.2 Kbps, with an |
71:UartInterface.c **** 8N1 protocol. |
72:UartInterface.c **** Inputs: none |
73:UartInterface.c **** Outputs: none |
74:UartInterface.c **** ***********************************************************/ |
75:UartInterface.c **** void UartInt_init(void) |
76:UartInterface.c **** { |
76 .stabn 68,0,76,.LM0-UartInt_init |
77 .LM0: |
78 /* prologue: frame size=0 */ |
79 /* prologue end (size=0) */ |
77:UartInterface.c **** /* set up the baud rate registers so the UART will operate |
78:UartInterface.c **** at 115.2 Kbps */ |
79:UartInterface.c **** UBRRH = 0x00; |
80 .stabn 68,0,79,.LM1-UartInt_init |
81 .LM1: |
82 0000 10BC out 64-0x20,__zero_reg__ |
80:UartInterface.c **** |
81:UartInterface.c **** #ifdef NO_CRYSTAL |
82:UartInterface.c **** UBRRL = 18; /* 18 for double clocking at 115.2 kbps */ |
83 .stabn 68,0,82,.LM2-UartInt_init |
84 .LM2: |
85 0002 82E1 ldi r24,lo8(18) |
86 0004 89B9 out 41-0x20,r24 |
83:UartInterface.c **** #else |
84:UartInterface.c **** UBRRL = 0x08; /* for 16 MHz crystal at 115.2 kbps */ |
85:UartInterface.c **** #endif |
GAS LISTING /tmp/ccZtX2VJ.s page 4 |
86:UartInterface.c **** |
87:UartInterface.c **** /* enable the tx and rx capabilities of the UART...as well |
88:UartInterface.c **** as the receive complete interrupt */ |
89:UartInterface.c **** UCSRB = (1<<RXCIE)|(1<<RXEN)|(1<<TXEN); |
87 .stabn 68,0,89,.LM3-UartInt_init |
88 .LM3: |
89 0006 88E9 ldi r24,lo8(-104) |
90 0008 8AB9 out 42-0x20,r24 |
90:UartInterface.c **** |
91:UartInterface.c **** /* set up the control registers so the UART works at 8N1 */ |
92:UartInterface.c **** UCSRC = (1<<URSEL)|(1<<UCSZ1)|(1<<UCSZ0); |
91 .stabn 68,0,92,.LM4-UartInt_init |
92 .LM4: |
93 000a 86E8 ldi r24,lo8(-122) |
94 000c 80BD out 64-0x20,r24 |
93:UartInterface.c **** |
94:UartInterface.c **** #ifdef NO_CRYSTAL |
95:UartInterface.c **** /* set the baud rate to use the double-speed */ |
96:UartInterface.c **** UCSRA = (1<<U2X); |
95 .stabn 68,0,96,.LM5-UartInt_init |
96 .LM5: |
97 000e 82E0 ldi r24,lo8(2) |
98 0010 8BB9 out 43-0x20,r24 |
99 /* epilogue: frame size=0 */ |
100 0012 0895 ret |
101 /* epilogue end (size=1) */ |
102 /* function UartInt_init size 10 (9) */ |
103 .size UartInt_init, .-UartInt_init |
104 .Lscope0: |
105 .stabs "",36,0,0,.Lscope0-UartInt_init |
106 .stabd 78,0,0 |
107 .stabs "UartInt_txByte:F(0,15)",36,0,115,UartInt_txByte |
108 .stabs "txByte:P(0,11)",64,0,114,24 |
109 .global UartInt_txByte |
110 .type UartInt_txByte, @function |
111 UartInt_txByte: |
112 .stabd 46,0,0 |
97:UartInterface.c **** #endif |
98:UartInterface.c **** |
99:UartInterface.c **** } |
100:UartInterface.c **** |
101:UartInterface.c **** /*********************************************************** |
102:UartInterface.c **** Function Name: UartInt_txByte |
103:UartInterface.c **** Function Description: This function is responsible for |
104:UartInterface.c **** transmitting a single byte on the uart. |
105:UartInterface.c **** Inputs: txByte - the byte to send |
106:UartInterface.c **** Outputs: none |
107:UartInterface.c **** NOTES: When the TX UDRE (data register empty) is set, there |
108:UartInterface.c **** is puposefully no interrupt...thus, to send a string of |
109:UartInterface.c **** data out, the calling routine needs to hold up the entire |
110:UartInterface.c **** application while this takes place (or just send one |
111:UartInterface.c **** byte at a time at strtegically timed intervals, like |
112:UartInterface.c **** the stats data is sent out :-) |
113:UartInterface.c **** ***********************************************************/ |
114:UartInterface.c **** void UartInt_txByte(unsigned char txByte) |
115:UartInterface.c **** { |
113 .stabn 68,0,115,.LM6-UartInt_txByte |
GAS LISTING /tmp/ccZtX2VJ.s page 5 |
114 .LM6: |
115 /* prologue: frame size=0 */ |
116 /* prologue end (size=0) */ |
117 .L5: |
116:UartInterface.c **** /* Wait for empty transmit buffer */ |
117:UartInterface.c **** while ( !( UCSRA & (1<<UDRE)) ); |
118 .stabn 68,0,117,.LM7-UartInt_txByte |
119 .LM7: |
120 0014 5D9B sbis 43-0x20,5 |
121 0016 FECF rjmp .L5 |
118:UartInterface.c **** /* Put data into buffer, sends the data */ |
119:UartInterface.c **** UDR = txByte; |
122 .stabn 68,0,119,.LM8-UartInt_txByte |
123 .LM8: |
124 0018 8CB9 out 44-0x20,r24 |
125 /* epilogue: frame size=0 */ |
126 001a 0895 ret |
127 /* epilogue end (size=1) */ |
128 /* function UartInt_txByte size 4 (3) */ |
129 .size UartInt_txByte, .-UartInt_txByte |
130 .Lscope1: |
131 .stabs "",36,0,0,.Lscope1-UartInt_txByte |
132 .stabd 78,0,0 |
133 .stabs "__vector_11:F(0,15)",36,0,138,__vector_11 |
134 .global __vector_11 |
135 .type __vector_11, @function |
136 __vector_11: |
137 .stabd 46,0,0 |
120:UartInterface.c **** } |
121:UartInterface.c **** |
122:UartInterface.c **** /*********************************************************** |
123:UartInterface.c **** Function Name: SIG_UART_RECV ISR |
124:UartInterface.c **** Function Description: This function is responsible for |
125:UartInterface.c **** handling the interrupt caused when a data byte is |
126:UartInterface.c **** received by the UART. |
127:UartInterface.c **** Inputs: none |
128:UartInterface.c **** Outputs: none |
129:UartInterface.c **** NOTES: This function was originally written in assembly, |
130:UartInterface.c **** but moved over to C when the setting of the "T" bit at |
131:UartInterface.c **** the end of the routine was no longer necessary (this |
132:UartInterface.c **** theoretically allowed the AVRcam to respond to serial |
133:UartInterface.c **** bytes in the middle of tracking or dumping a frame. |
134:UartInterface.c **** But it wasn't really needed, and understanding the C |
135:UartInterface.c **** is easier :-) |
136:UartInterface.c **** ***********************************************************/ |
137:UartInterface.c **** SIGNAL(SIG_UART_RECV) |
138:UartInterface.c **** { |
138 .stabn 68,0,138,.LM9-__vector_11 |
139 .LM9: |
140 /* prologue: frame size=0 */ |
141 001c 1F92 push __zero_reg__ |
142 001e 0F92 push __tmp_reg__ |
143 0020 0FB6 in __tmp_reg__,__SREG__ |
144 0022 0F92 push __tmp_reg__ |
145 0024 1124 clr __zero_reg__ |
146 0026 8F93 push r24 |
147 0028 9F93 push r25 |
GAS LISTING /tmp/ccZtX2VJ.s page 6 |
148 002a EF93 push r30 |
149 002c FF93 push r31 |
150 /* prologue end (size=9) */ |
139:UartInterface.c **** unsigned char tmpHead; |
140:UartInterface.c **** /* read the data byte, put it in the serial queue, and |
141:UartInterface.c **** post the event */ |
142:UartInterface.c **** |
143:UartInterface.c **** UIMgr_rxFifo[UIMgr_rxFifoHead] = UDR; |
151 .stabn 68,0,143,.LM10-__vector_11 |
152 .LM10: |
153 002e 8091 0000 lds r24,UIMgr_rxFifoHead |
154 0032 9CB1 in r25,44-0x20 |
155 0034 E0E0 ldi r30,lo8(UIMgr_rxFifo) |
156 0036 F0E0 ldi r31,hi8(UIMgr_rxFifo) |
157 0038 E80F add r30,r24 |
158 003a F11D adc r31,__zero_reg__ |
159 003c 9083 st Z,r25 |
144:UartInterface.c **** |
145:UartInterface.c **** /* now move the head up */ |
146:UartInterface.c **** tmpHead = (UIMgr_rxFifoHead + 1) & (UI_MGR_RX_FIFO_MASK); |
147:UartInterface.c **** UIMgr_rxFifoHead = tmpHead; |
160 .stabn 68,0,147,.LM11-__vector_11 |
161 .LM11: |
162 003e 8F5F subi r24,lo8(-(1)) |
163 0040 8F71 andi r24,lo8(31) |
164 0042 8093 0000 sts UIMgr_rxFifoHead,r24 |
148:UartInterface.c **** |
149:UartInterface.c **** /* write the serial received event to the event fifo */ |
150:UartInterface.c **** Exec_eventFifo[Exec_eventFifoHead] = EV_SERIAL_DATA_RECEIVED; |
165 .stabn 68,0,150,.LM12-__vector_11 |
166 .LM12: |
167 0046 8091 0000 lds r24,Exec_eventFifoHead |
168 004a E0E0 ldi r30,lo8(Exec_eventFifo) |
169 004c F0E0 ldi r31,hi8(Exec_eventFifo) |
170 004e E80F add r30,r24 |
171 0050 F11D adc r31,__zero_reg__ |
172 0052 91E0 ldi r25,lo8(1) |
173 0054 9083 st Z,r25 |
151:UartInterface.c **** |
152:UartInterface.c **** /* now move the head up */ |
153:UartInterface.c **** tmpHead = (Exec_eventFifoHead + 1) & (EXEC_EVENT_FIFO_MASK); |
154:UartInterface.c **** Exec_eventFifoHead = tmpHead; |
174 .stabn 68,0,154,.LM13-__vector_11 |
175 .LM13: |
176 0056 8F5F subi r24,lo8(-(1)) |
177 0058 8770 andi r24,lo8(7) |
178 005a 8093 0000 sts Exec_eventFifoHead,r24 |
179 /* epilogue: frame size=0 */ |
180 005e FF91 pop r31 |
181 0060 EF91 pop r30 |
182 0062 9F91 pop r25 |
183 0064 8F91 pop r24 |
184 0066 0F90 pop __tmp_reg__ |
185 0068 0FBE out __SREG__,__tmp_reg__ |
186 006a 0F90 pop __tmp_reg__ |
187 006c 1F90 pop __zero_reg__ |
188 006e 1895 reti |
GAS LISTING /tmp/ccZtX2VJ.s page 7 |
189 /* epilogue end (size=9) */ |
190 /* function __vector_11 size 42 (24) */ |
191 .size __vector_11, .-__vector_11 |
192 .Lscope2: |
193 .stabs "",36,0,0,.Lscope2-__vector_11 |
194 .stabd 78,0,0 |
195 .stabs "",100,0,0,.Letext0 |
196 .Letext0: |
197 /* File "UartInterface.c": code 56 = 0x0038 ( 36), prologues 9, epilogues 11 */ |
GAS LISTING /tmp/ccZtX2VJ.s page 8 |
DEFINED SYMBOLS |
*ABS*:00000000 UartInterface.c |
/tmp/ccZtX2VJ.s:3 *ABS*:0000003f __SREG__ |
/tmp/ccZtX2VJ.s:4 *ABS*:0000003e __SP_H__ |
/tmp/ccZtX2VJ.s:5 *ABS*:0000003d __SP_L__ |
/tmp/ccZtX2VJ.s:6 *ABS*:00000000 __tmp_reg__ |
/tmp/ccZtX2VJ.s:7 *ABS*:00000001 __zero_reg__ |
/tmp/ccZtX2VJ.s:74 .text:00000000 UartInt_init |
/tmp/ccZtX2VJ.s:111 .text:00000014 UartInt_txByte |
/tmp/ccZtX2VJ.s:136 .text:0000001c __vector_11 |
UNDEFINED SYMBOLS |
__do_copy_data |
__do_clear_bss |
UIMgr_rxFifoHead |
UIMgr_rxFifo |
Exec_eventFifoHead |
Exec_eventFifo |
/programy/C/avr/AVRcam/Utility.lst |
---|
0,0 → 1,275 |
GAS LISTING /tmp/cc5q3bJ9.s page 1 |
1 .file "Utility.c" |
2 .arch atmega8 |
3 __SREG__ = 0x3f |
4 __SP_H__ = 0x3e |
5 __SP_L__ = 0x3d |
6 __tmp_reg__ = 0 |
7 __zero_reg__ = 1 |
8 .global __do_copy_data |
9 .global __do_clear_bss |
10 .stabs "/home/kaklik/projects/programy/Atmel_C/AVRcam/",100,0,2,.Ltext0 |
11 .stabs "Utility.c",100,0,2,.Ltext0 |
12 .text |
13 .Ltext0: |
14 .stabs "gcc2_compiled.",60,0,0,0 |
15 .stabs "int:t(0,1)=r(0,1);-32768;32767;",128,0,0,0 |
16 .stabs "char:t(0,2)=@s8;r(0,2);0;255;",128,0,0,0 |
17 .stabs "long int:t(0,3)=@s32;r(0,3);020000000000;017777777777;",128,0,0,0 |
18 .stabs "unsigned int:t(0,4)=r(0,4);0;0177777;",128,0,0,0 |
19 .stabs "long unsigned int:t(0,5)=@s32;r(0,5);0;037777777777;",128,0,0,0 |
20 .stabs "long long int:t(0,6)=@s64;r(0,6);01000000000000000000000;0777777777777777777777;",128,0,0, |
21 .stabs "long long unsigned int:t(0,7)=@s64;r(0,7);0;01777777777777777777777;",128,0,0,0 |
22 .stabs "short int:t(0,8)=r(0,8);-32768;32767;",128,0,0,0 |
23 .stabs "short unsigned int:t(0,9)=r(0,9);0;0177777;",128,0,0,0 |
24 .stabs "signed char:t(0,10)=@s8;r(0,10);-128;127;",128,0,0,0 |
25 .stabs "unsigned char:t(0,11)=@s8;r(0,11);0;255;",128,0,0,0 |
26 .stabs "float:t(0,12)=r(0,1);4;0;",128,0,0,0 |
27 .stabs "double:t(0,13)=r(0,1);4;0;",128,0,0,0 |
28 .stabs "long double:t(0,14)=r(0,1);4;0;",128,0,0,0 |
29 .stabs "void:t(0,15)=(0,15)",128,0,0,0 |
30 .stabs "CommonDefs.h",130,0,0,0 |
31 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/interrupt.h",130,0,0,0 |
32 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/io.h",130,0,0,0 |
33 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/avr/sfr_defs.h",130,0,0,0 |
34 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/inttypes.h",130,0,0,0 |
35 .stabs "/usr/lib/gcc/avr/4.1.0/../../../../avr/include/stdint.h",130,0,0,0 |
36 .stabs "int8_t:t(6,1)=(0,10)",128,0,116,0 |
37 .stabs "uint8_t:t(6,2)=(0,11)",128,0,117,0 |
38 .stabs "int16_t:t(6,3)=(0,1)",128,0,118,0 |
39 .stabs "uint16_t:t(6,4)=(0,4)",128,0,119,0 |
40 .stabs "int32_t:t(6,5)=(0,3)",128,0,120,0 |
41 .stabs "uint32_t:t(6,6)=(0,5)",128,0,121,0 |
42 .stabs "int64_t:t(6,7)=(0,6)",128,0,122,0 |
43 .stabs "uint64_t:t(6,8)=(0,7)",128,0,123,0 |
44 .stabs "intptr_t:t(6,9)=(6,3)",128,0,135,0 |
45 .stabs "uintptr_t:t(6,10)=(6,4)",128,0,140,0 |
46 .stabs "int_least8_t:t(6,11)=(6,1)",128,0,152,0 |
47 .stabs "uint_least8_t:t(6,12)=(6,2)",128,0,157,0 |
48 .stabs "int_least16_t:t(6,13)=(6,3)",128,0,162,0 |
49 .stabs "uint_least16_t:t(6,14)=(6,4)",128,0,167,0 |
50 .stabs "int_least32_t:t(6,15)=(6,5)",128,0,172,0 |
51 .stabs "uint_least32_t:t(6,16)=(6,6)",128,0,177,0 |
52 .stabs "int_least64_t:t(6,17)=(6,7)",128,0,182,0 |
53 .stabs "uint_least64_t:t(6,18)=(6,8)",128,0,187,0 |
54 .stabs "int_fast8_t:t(6,19)=(6,1)",128,0,200,0 |
55 .stabs "uint_fast8_t:t(6,20)=(6,2)",128,0,205,0 |
56 .stabs "int_fast16_t:t(6,21)=(6,3)",128,0,210,0 |
57 .stabs "uint_fast16_t:t(6,22)=(6,4)",128,0,215,0 |
GAS LISTING /tmp/cc5q3bJ9.s page 2 |
58 .stabs "int_fast32_t:t(6,23)=(6,5)",128,0,220,0 |
59 .stabs "uint_fast32_t:t(6,24)=(6,6)",128,0,225,0 |
60 .stabs "int_fast64_t:t(6,25)=(6,7)",128,0,230,0 |
61 .stabs "uint_fast64_t:t(6,26)=(6,8)",128,0,235,0 |
62 .stabs "intmax_t:t(6,27)=(6,7)",128,0,249,0 |
63 .stabs "uintmax_t:t(6,28)=(6,8)",128,0,254,0 |
64 .stabn 162,0,0,0 |
65 .stabs "int_farptr_t:t(5,1)=(6,5)",128,0,76,0 |
66 .stabs "uint_farptr_t:t(5,2)=(6,6)",128,0,80,0 |
67 .stabn 162,0,0,0 |
68 .stabn 162,0,0,0 |
69 .stabn 162,0,0,0 |
70 .stabn 162,0,0,0 |
71 .stabs "bool_t:t(1,1)=(0,11)",128,0,56,0 |
72 .stabn 162,0,0,0 |
73 .stabs "Utility_delay:F(0,15)",36,0,65,Utility_delay |
74 .stabs "numMs:P(0,9)",64,0,64,18 |
75 .global Utility_delay |
76 .type Utility_delay, @function |
77 Utility_delay: |
78 .stabd 46,0,0 |
1:Utility.c **** /* |
2:Utility.c **** Copyright (C) 2004 John Orlando |
3:Utility.c **** |
4:Utility.c **** AVRcam: a small real-time image processing engine. |
5:Utility.c **** |
6:Utility.c **** This program is free software; you can redistribute it and/or |
7:Utility.c **** modify it under the terms of the GNU General Public |
8:Utility.c **** License as published by the Free Software Foundation; either |
9:Utility.c **** version 2 of the License, or (at your option) any later version. |
10:Utility.c **** |
11:Utility.c **** This program is distributed in the hope that it will be useful, |
12:Utility.c **** but WITHOUT ANY WARRANTY; without even the implied warranty of |
13:Utility.c **** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14:Utility.c **** General Public License for more details. |
15:Utility.c **** |
16:Utility.c **** You should have received a copy of the GNU General Public |
17:Utility.c **** License along with this program; if not, write to the Free Software |
18:Utility.c **** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19:Utility.c **** |
20:Utility.c **** For more information on the AVRcam, please contact: |
21:Utility.c **** |
22:Utility.c **** john@jrobot.net |
23:Utility.c **** |
24:Utility.c **** or go to www.jrobot.net for more details regarding the system. |
25:Utility.c **** */ |
26:Utility.c **** /*********************************************************** |
27:Utility.c **** Module Name: Utility.c |
28:Utility.c **** Module Date: 04/13/2004 |
29:Utility.c **** Module Auth: John Orlando |
30:Utility.c **** |
31:Utility.c **** Description: This module provides a basic set of |
32:Utility.c **** general purpose utilities that can be used by any |
33:Utility.c **** module needing them. |
34:Utility.c **** |
35:Utility.c **** Revision History: |
36:Utility.c **** Date Rel Ver. Notes |
GAS LISTING /tmp/cc5q3bJ9.s page 3 |
37:Utility.c **** 4/10/2004 0.1 Module created |
38:Utility.c **** 6/30/2004 1.0 Initial release for Circuit Cellar |
39:Utility.c **** contest. |
40:Utility.c **** ***********************************************************/ |
41:Utility.c **** |
42:Utility.c **** /* Includes */ |
43:Utility.c **** #include "CommonDefs.h" |
44:Utility.c **** |
45:Utility.c **** /* Local Variables */ |
46:Utility.c **** |
47:Utility.c **** /* Local Structures and Typedefs */ |
48:Utility.c **** |
49:Utility.c **** /* Extern Variables */ |
50:Utility.c **** |
51:Utility.c **** /* Definitions */ |
52:Utility.c **** |
53:Utility.c **** /*********************************************************** |
54:Utility.c **** Function Name: Utility_delay |
55:Utility.c **** Function Description: This function provides a busy-wait |
56:Utility.c **** delay for a specified number of milliseconds. |
57:Utility.c **** Inputs: numMs - the number of milliseconds to delay |
58:Utility.c **** Outputs: none |
59:Utility.c **** NOTES: The delay_loop_1 and delay_loop_2 functions found |
60:Utility.c **** in avr/delay.h provide accurate 3 and 4 cycle delay loops |
61:Utility.c **** if needed...this isn't really a millisecond, so DON'T |
62:Utility.c **** depend on it for exact timing... |
63:Utility.c **** ***********************************************************/ |
64:Utility.c **** void Utility_delay(unsigned short numMs) |
65:Utility.c **** { |
79 .stabn 68,0,65,.LM0-Utility_delay |
80 .LM0: |
81 /* prologue: frame size=4 */ |
82 0000 CF93 push r28 |
83 0002 DF93 push r29 |
84 0004 CDB7 in r28,__SP_L__ |
85 0006 DEB7 in r29,__SP_H__ |
86 0008 2497 sbiw r28,4 |
87 000a 0FB6 in __tmp_reg__,__SREG__ |
88 000c F894 cli |
89 000e DEBF out __SP_H__,r29 |
90 0010 0FBE out __SREG__,__tmp_reg__ |
91 0012 CDBF out __SP_L__,r28 |
92 /* prologue end (size=10) */ |
93 0014 9C01 movw r18,r24 |
66:Utility.c **** volatile unsigned short i=0,j=0; |
94 .stabn 68,0,66,.LM1-Utility_delay |
95 .LM1: |
96 0016 1A82 std Y+2,__zero_reg__ |
97 0018 1982 std Y+1,__zero_reg__ |
98 001a 1C82 std Y+4,__zero_reg__ |
99 001c 1B82 std Y+3,__zero_reg__ |
67:Utility.c **** #ifndef SIMULATION |
68:Utility.c **** for (i=0; i<numMs; i++) |
100 .stabn 68,0,68,.LM2-Utility_delay |
101 .LM2: |
102 001e 1A82 std Y+2,__zero_reg__ |
103 0020 1982 std Y+1,__zero_reg__ |
GAS LISTING /tmp/cc5q3bJ9.s page 4 |
104 0022 8981 ldd r24,Y+1 |
105 0024 9A81 ldd r25,Y+2 |
106 0026 8217 cp r24,r18 |
107 0028 9307 cpc r25,r19 |
108 002a E0F4 brsh .L6 |
109 .L7: |
69:Utility.c **** { |
70:Utility.c **** for (j=0; j<1000; j++) |
110 .stabn 68,0,70,.LM3-Utility_delay |
111 .LM3: |
112 002c 1C82 std Y+4,__zero_reg__ |
113 002e 1B82 std Y+3,__zero_reg__ |
114 0030 8B81 ldd r24,Y+3 |
115 0032 9C81 ldd r25,Y+4 |
116 0034 885E subi r24,lo8(1000) |
117 0036 9340 sbci r25,hi8(1000) |
118 0038 58F4 brsh .L4 |
119 .L8: |
71:Utility.c **** { |
72:Utility.c **** asm volatile("nop"::); |
120 .stabn 68,0,72,.LM4-Utility_delay |
121 .LM4: |
122 /* #APP */ |
123 003a 0000 nop |
124 .stabn 68,0,70,.LM5-Utility_delay |
125 .LM5: |
126 /* #NOAPP */ |
127 003c 8B81 ldd r24,Y+3 |
128 003e 9C81 ldd r25,Y+4 |
129 0040 0196 adiw r24,1 |
130 0042 9C83 std Y+4,r25 |
131 0044 8B83 std Y+3,r24 |
132 0046 8B81 ldd r24,Y+3 |
133 0048 9C81 ldd r25,Y+4 |
134 004a 885E subi r24,lo8(1000) |
135 004c 9340 sbci r25,hi8(1000) |
136 004e A8F3 brlo .L8 |
137 .L4: |
138 .stabn 68,0,68,.LM6-Utility_delay |
139 .LM6: |
140 0050 8981 ldd r24,Y+1 |
141 0052 9A81 ldd r25,Y+2 |
142 0054 0196 adiw r24,1 |
143 0056 9A83 std Y+2,r25 |
144 0058 8983 std Y+1,r24 |
145 005a 8981 ldd r24,Y+1 |
146 005c 9A81 ldd r25,Y+2 |
147 005e 8217 cp r24,r18 |
148 0060 9307 cpc r25,r19 |
149 0062 20F3 brlo .L7 |
150 .L6: |
151 /* epilogue: frame size=4 */ |
152 0064 2496 adiw r28,4 |
153 0066 0FB6 in __tmp_reg__,__SREG__ |
154 0068 F894 cli |
155 006a DEBF out __SP_H__,r29 |
156 006c 0FBE out __SREG__,__tmp_reg__ |
GAS LISTING /tmp/cc5q3bJ9.s page 5 |
157 006e CDBF out __SP_L__,r28 |
158 0070 DF91 pop r29 |
159 0072 CF91 pop r28 |
160 0074 0895 ret |
161 /* epilogue end (size=9) */ |
162 /* function Utility_delay size 62 (43) */ |
163 .size Utility_delay, .-Utility_delay |
164 .stabs "i:(0,16)=B(0,9)",128,0,66,1 |
165 .stabs "j:(0,16)",128,0,66,3 |
166 .stabn 192,0,0,Utility_delay-Utility_delay |
167 .stabn 224,0,0,.Lscope0-Utility_delay |
168 .Lscope0: |
169 .stabs "",36,0,0,.Lscope0-Utility_delay |
170 .stabd 78,0,0 |
171 .stabs "",100,0,0,.Letext0 |
172 .Letext0: |
173 /* File "Utility.c": code 62 = 0x003e ( 43), prologues 10, epilogues 9 */ |
GAS LISTING /tmp/cc5q3bJ9.s page 6 |
DEFINED SYMBOLS |
*ABS*:00000000 Utility.c |
/tmp/cc5q3bJ9.s:3 *ABS*:0000003f __SREG__ |
/tmp/cc5q3bJ9.s:4 *ABS*:0000003e __SP_H__ |
/tmp/cc5q3bJ9.s:5 *ABS*:0000003d __SP_L__ |
/tmp/cc5q3bJ9.s:6 *ABS*:00000000 __tmp_reg__ |
/tmp/cc5q3bJ9.s:7 *ABS*:00000001 __zero_reg__ |
/tmp/cc5q3bJ9.s:77 .text:00000000 Utility_delay |
UNDEFINED SYMBOLS |
__do_copy_data |
__do_clear_bss |
/programy/C/avr/AVRcam/makefile |
---|
0,0 → 1,361 |
# WinAVR Sample makefile written by Eric B. Weddington, Jörg Wunsch, et al. |
# Released to the Public Domain |
# Please read the make user manual! |
# |
# Retrofitted for the AVRcam project by John Orlando 6/30/2004 |
# |
# |
# On command line: |
# |
# make all = Make software. |
# |
# make clean = Clean out built project files. |
# |
# make coff = Convert ELF to AVR COFF (for use with AVR Studio 3.x or VMLAB). |
# |
# make extcoff = Convert ELF to AVR Extended COFF (for use with AVR Studio |
# 4.07 or greater). |
# |
# make program = Download the hex file to the device, using avrdude. Please |
# customize the avrdude settings below first! |
# |
# make filename.s = Just compile filename.c into the assembler code only |
# |
# To rebuild project do "make clean" then "make all". |
# |
# Revision History: |
# Date Rel Ver. Notes |
# 4/10/2004 0.1 Module created |
# 6/30/2004 1.0 Initial release for Circuit Cellar |
# contest. |
# 1/15/2005 1.4 Removed the UartInterfaceAsm file from |
# file list, since the routine in that |
# file was added to UartInterface.c. |
# MCU name |
MCU = atmega8 |
# Output format. (can be srec, ihex, binary) |
FORMAT = ihex |
# Target file name (without extension). |
TARGET = AVRcam |
# Optimization level, can be [0, 1, 2, 3, s]. 0 turns off optimization. |
# (Note 3 is not always the best optimization level. See avr-libc FAQ.) |
OPT = 1 |
# List C source files here. (C dependencies are automatically generated.) |
#SRC = $(TARGET).c |
# If there is more than one source file, append them above, or adjust and |
# uncomment the following: |
# NOTE: The order of the files here is important...CamInterface.c MUST be |
# the first file, due to the declaration of an array that needs to be |
# located at the very beginning of the .noinit section in on-board RAM. |
SRC = CamInterface.c Main.c Executive.c FrameMgr.c UIMgr.c UartInterface.c I2CInterface.c CamConfig.c Utility.c DebugInterface.c |
# List Assembler source files here. |
# Make them always end in a capital .S. Files ending in a lowercase .s |
# will not be considered source files but generated files (assembler |
# output from the compiler), and will be deleted upon "make clean"! |
# Even though the DOS/Win* filesystem matches both .s and .S the same, |
# it will preserve the spelling of the filenames, and gcc itself does |
# care about how the name is spelled on its command-line. |
ASRC = CamInterfaceAsm.S |
# Optional compiler flags. |
# -g: generate debugging information (for GDB, or for COFF conversion) |
# -O*: optimization level |
# -f...: tuning, see gcc manual and avr-libc documentation |
# -Wall...: warning level |
# -Wa,...: tell GCC to pass this to the assembler. |
# -ahlms: create assembler listing |
CFLAGS = -g -O$(OPT) \ |
-funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums \ |
-Wall -Wstrict-prototypes \ |
-Wa,-ahlms=$(<:.c=.lst) |
# Optional assembler flags. |
# -Wa,...: tell GCC to pass this to the assembler. |
# -ahlms: create listing |
# -gstabs: have the assembler create line number information; note that |
# for use in COFF files, additional information about filenames |
# and function names needs to be present in the assembler source |
# files -- see avr-libc docs [FIXME: not yet described there] |
ASFLAGS = -Wa,-ahlms=$(<:.S=.lst),-gstabs |
# Optional linker flags. |
# -Wl,...: tell GCC to pass this to linker. |
# -Map: create map file |
# --cref: add cross reference to map file |
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref,--section-start=.noinit=0x800300 |
#LDFLAGS = -Wl,-Map=$(TARGET).map,--cref,--section-start=.john=0x800200 |
# Additional libraries |
# |
# Minimalistic printf version |
#LDFLAGS += -Wl,-u,vfprintf -lprintf_min |
# |
# Floating point printf version (requires -lm below) |
#LDFLAGS += -Wl,-u,vfprintf -lprintf_flt |
# |
# -lm = math library |
LDFLAGS += -lm |
PROGRAMMER_DEVICE = dapa |
PORT = /dev/parport0 # programmer connected to parallel port |
# Programming support using avrdude. Settings and variables. |
# Programming hardware: avrisp stk500 avr910 pavr stk200 pony-stk200 |
# dt006 bascom alf |
# Type: avrdude -c ? |
# to get a full listing. |
# |
# Uncomment the following if you want avrdude's erase cycle counter. |
# Note that this counter needs to be initialized first using -Yn, |
# see avrdude manual. |
#AVRDUDE_ERASE += -y |
# |
# Uncomment the following if you do /not/ wish a verification to be |
# performed after programming the device. |
#AVRDUDE_FLAGS += -V |
# |
# Increase verbosity level. Please use this when submitting bug |
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude> |
# to submit bug reports. |
#AVRDUDE_FLAGS += -v -v |
# --------------------------------------------------------------------------- |
# Define directories, if needed. |
DIRAVR = c:/winavr |
DIRAVRBIN = $(DIRAVR)/bin |
DIRAVRUTILS = $(DIRAVR)/utils/bin |
DIRINC = . |
DIRLIB = $(DIRAVR)/avr/lib |
# Define programs and commands. |
SHELL = sh |
CC = avr-gcc |
OBJCOPY = avr-objcopy |
OBJDUMP = avr-objdump |
SIZE = avr-size |
# Programming support using avrdude. |
#PROGRAMMER = avrdude |
# Programming support using uisp. |
PROGRAMMER = uisp |
REMOVE = rm -f |
COPY = cp |
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex |
ELFSIZE = $(SIZE) -A $(TARGET).elf |
FINISH = echo Errors: none |
BEGIN = echo -------- begin -------- |
END = echo -------- end -------- |
# Define all object files. |
OBJ = $(SRC:.c=.o) $(ASRC:.S=.o) |
# Define all listing files. |
LST = $(ASRC:.S=.lst) $(SRC:.c=.lst) |
# Combine all necessary flags and optional flags. |
# Add target processor to flags. |
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) |
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS) |
# Default target. |
all: begin gccversion sizebefore $(TARGET).elf $(TARGET).hex $(TARGET).eep \ |
$(TARGET).lss coff sizeafter finished end |
# Eye candy. |
# AVR Studio 3.x does not check make's exit code but relies on |
# the following magic strings to be generated by the compile job. |
begin: |
@$(BEGIN) |
finished: |
@$(FINISH) |
end: |
@$(END) |
# Display size of file. |
sizebefore: |
@if [ -f $(TARGET).elf ]; then echo Size before:; $(ELFSIZE);fi |
sizeafter: |
@if [ -f $(TARGET).elf ]; then echo Size after:; $(ELFSIZE);fi |
# Display compiler version information. |
gccversion : |
$(CC) --version |
# Convert ELF to COFF for use in debugging / simulating in |
# AVR Studio or VMLAB. |
COFFCONVERT=$(OBJCOPY) --debugging \ |
--change-section-address .data-0x800000 \ |
--change-section-address .bss-0x800000 \ |
--change-section-address .noinit-0x800000 \ |
--change-section-address .eeprom-0x810000 |
coff: $(TARGET).elf |
$(COFFCONVERT) -O coff-avr $< $(TARGET).cof |
extcoff: $(TARGET).elf |
$(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof |
# Program the device. The magic trickery below examines the .eep hex |
# file whether the size is > 0, and if so, reprograms the EEPROM as |
# well. Just delete these lines if you don't want this feature (like |
# on the ATmegas with the EESAVE fuse bit set). |
program: $(TARGET).hex $(TARGET).eep |
# if[ "$(PROGRAMMER)" == "avrdude"]; then \ |
# avrdude -p $(MCU) -P $(PORT) -c $(PROGRAMMER_DEVICE) -e # erase AVR device |
# avrdude -p $(MCU) -P $(PORT) -c $(PROGRAMMER_DEVICE) -i $(TARGET).hex # program AVR device |
# fi; \ |
# @$(SIZE) --target=$(FORMAT) $(TARGET).eep | while read line; \ |
# do \ |
# set -- $$line; \ |
# if [ "x$$1" != "x0" ] ; then continue; fi; \ |
# if [ "$$2" -ne 0 ] ; then \ |
# echo $(AVRDUDE) $(AVRDUDE_FLAGS) -m eeprom -i $(TARGET).eep; \ |
# $(AVRDUDE) $(AVRDUDE_FLAGS) -m eeprom -i $(TARGET).eep; \ |
# break; \ |
# fi; \ |
# done |
# if[$PROGRAMMER == "uisp"]; then |
uisp -dlpt=$(PORT) -dpart=$(MCU) -dprog=$(PROGRAMMER_DEVICE) --erase |
uisp -dlpt=$(PORT) -dpart=$(MCU) -dprog=$(PROGRAMMER_DEVICE) if=$(TARGET).hex --upload |
uisp -dlpt=$(PORT) -dpart=$(MCU) -dprog=$(PROGRAMMER_DEVICE) if=$(TARGET).hex --verify |
# fi; |
# Create final output files (.hex, .eep) from ELF output file. |
%.hex: %.elf |
$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@ |
%.eep: %.elf |
-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \ |
--change-section-lma .eeprom=0 -O $(FORMAT) $< $@ |
# Create extended listing file from ELF output file. |
%.lss: %.elf |
$(OBJDUMP) -h -S $< > $@ |
# Link: create ELF output file from object files. |
.SECONDARY : $(TARGET).elf |
.PRECIOUS : $(OBJ) |
%.elf: $(OBJ) |
$(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS) |
# Compile: create object files from C source files. |
%.o : %.c |
$(CC) -c $(ALL_CFLAGS) $< -o $@ |
# Compile: create assembler files from C source files. |
%.s : %.c |
$(CC) -S $(ALL_CFLAGS) $< -o $@ |
# Assemble: create object files from assembler source files. |
%.o : %.S |
$(CC) -c $(ALL_ASFLAGS) $< -o $@ |
# Target: clean project. |
clean: begin clean_list finished end |
clean_list : |
$(REMOVE) $(TARGET).hex |
$(REMOVE) $(TARGET).eep |
$(REMOVE) $(TARGET).obj |
$(REMOVE) $(TARGET).cof |
$(REMOVE) $(TARGET).elf |
$(REMOVE) $(TARGET).map |
$(REMOVE) $(TARGET).obj |
$(REMOVE) $(TARGET).a90 |
$(REMOVE) $(TARGET).sym |
$(REMOVE) $(TARGET).lnk |
$(REMOVE) $(TARGET).lss |
$(REMOVE) $(OBJ) |
$(REMOVE) $(LST) |
$(REMOVE) $(SRC:.c=.s) |
$(REMOVE) $(SRC:.c=.d) |
# Automatically generate C source code dependencies. |
# (Code originally taken from the GNU make user manual and modified |
# (See README.txt Credits).) |
# |
# Note that this will work with sh (bash) and sed that is shipped with WinAVR |
# (see the SHELL variable defined above). |
# This may not work with other shells or other seds. |
# |
%.d: %.c |
set -e; $(CC) -MM $(ALL_CFLAGS) $< \ |
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > $@; \ |
[ -s $@ ] || rm -f $@ |
# Remove the '-' if you want to see the dependency files generated. |
-include $(SRC:.c=.d) |
# Listing of phony targets. |
.PHONY : all begin finish end sizebefore sizeafter gccversion coff extcoff \ |
clean clean_list program |
/programy/C/avr/AVRcam/AVRcam.eep |
---|
0,0 → 1,0 |
:00000001FF |
/programy/C/avr/AVRcam/AVRcam.hex |
---|
0,0 → 1,270 |
:1000000063C005C805C87AC079C078C077C076C01B |
:1000100000C874C073C0AAC571C070C06FC06EC084 |
:100020006DC00FC66BC029C6BFC6BEC6BDC6BCC6A6 |
:10003000BBC6BAC6B9C621C6B7C6B6C6B5C6B4C66B |
:10004000B3C6B2C6B1C631C6AFC6AEC6ADC6ACC683 |
:10005000ABC6AAC6A9C63AC6A7C6A6C6A5C6A4C6A2 |
:10006000A3C6A2C6A1C63BC69FC69EC69DC69CC6C9 |
:100070009BC69AC699C654C697C696C695C694C6D8 |
:1000800093C692C691C690C68FC68EC68DC68CC6C4 |
:100090008BC68AC689C64DC687C686C685C684C62F |
:1000A00083C682C681C612C67FC67EC67DC67CC692 |
:1000B0007BC67AC679C64EC677C676C675C674C67E |
:1000C00073C672C671C662C611241FBECFE5D4E0E6 |
:1000D000DEBFCDBF10E0A0E6B0E0EEEBF0E102C085 |
:1000E00005900D92A037B107D9F712E0A0E7B0E074 |
:1000F00001C01D92A43EB107E1F730C091C7089539 |
:100100008F9A8F9A8A98979887B3807F87BB87B397 |
:10011000806F87BB84B3807F84BB8EB5887F8EBDA4 |
:1001200085B78C6085BF85B7836085BF8BB78064DA |
:100130008BBF86E083BF85B78F7885BF85B7806822 |
:1001400085BFE0E0F3E080E3DF01982F1D929A95F0 |
:10015000E9F7A1E0B0E0182EA0D70895CFE5D4E0EC |
:10016000DEBFCDBFCFD6F4D42BD5CADF78947ED6F0 |
:100170008AD337D288EE93E08AD611D080E090E01F |
:100180009DC7F89490917000ECE6F2E0E90FF11D44 |
:1001900080839F5F9770909370007894089580910A |
:1001A0007200882399F080FF07C0F8948E7F8093B7 |
:1001B00072007894B6D0FFD28091720081FF06C0A1 |
:1001C000F8948D7F80937200789412D22091710000 |
:1001D00080917000821719F3F894E22FFF27E459F9 |
:1001E000FD4F9081822F8F5F87708093710078948C |
:1001F000892F9927803131F1813168F48230C9F03B |
:10020000833018F4813059F62BC0843031F18830B6 |
:1002100009F0C5CF1FC0803879F0813820F48032D2 |
:1002200009F0BDCF14C0813851F0803909F0B7CF43 |
:100230001CC082E02ED2B3CF80E82BD2B0CF81E8B1 |
:1002400028D2ADCF80E125D280E175D4A8CF80E25D |
:1002500020D2A5CF88E01DD2A2CF84E01AD29FCFB2 |
:1002600081E069D481E015D29ACF80E964D497CF38 |
:10027000DF92EF92FF920F931F93CF93DF93209122 |
:1002800060003091610080917300882309F43FC0C1 |
:10029000E9018AE05CD28091730059D2DD248F811C |
:1002A000813069F588818038E1F0803411F481E093 |
:1002B00019C0803211F482E015C0803111F483E05E |
:1002C00011C0883011F484E00DC0843011F485E051 |
:1002D00009C0823011F486E005C0813011F487E056 |
:1002E00001C080E01B810C81FD80EE8030D2812F27 |
:1002F0002ED2802F2CD28F2D2AD28E2D28D2D3947D |
:1003000088E0D81611F02896CACF8FEF20D284E06B |
:1003100038DFDF91CF911F910F91FF90EF90DF9029 |
:1003200008952F923F924F925F926F927F928F9299 |
:100330009F92AF92BF92CF92DF92EF92FF920F9374 |
:100340001F93CF93DF93CDB7DEB721970FB6F89405 |
:10035000DEBF0FBECDBF00916000109161008091A3 |
:100360007400823009F06AC08BE0FCD38091750084 |
:10037000F9D30F2EFCEBCF2EF1E0DF2EF02D00E0B5 |
:1003800010E00F2EFCE0EF2EF1E0FF2EF02DF60135 |
:100390008081898389818F70898389818295807F1B |
:1003A00089839981F70180818F70892B8983898165 |
:1003B000D9D3D8011196FD01E45FFE4F8081898376 |
:1003C00089818F70898389818295807F89839981D2 |
:1003D000A454BE4F8C918F70892B89838981C2D39D |
:1003E00082E090E0C80ED91E0E5F1F4FE80EF91E86 |
:1003F000003B110561F68FE0B5D3809175008F5FEA |
:1004000080937500883460F010927500109274002B |
:1004100089B78B7F89BF60E081E1E9D4EDD4C8C0A2 |
:1004200080917200826080937200C2C080E2A9DE77 |
:1004300089B78B7F89BF10927600BAC0813009F0EE |
:10044000B7C0F0907600CF2CDD2436010894610807 |
:100450007108709173000F2EFCEB2F2EF1E03F2EF0 |
:10046000F02D50E040E061E0EF2CE394F1013081A9 |
:10047000560F618182E090E0280E391E460F33232B |
:1004800009F45CC0643008F459C0D80120E08C91B4 |
:100490003817C9F5FD0187818130A9F50F2EF6E0E7 |
:1004A000AF2EBB24F02DAA0EBB1E86819927861580 |
:1004B000970549F52D010894411C511C8181882420 |
:1004C0009924689481F88A0E9B1E9281581710F027 |
:1004D000951740F4481710F0941720F4851798F0FA |
:1004E000491788F0F2015083F4014083FD018381B4 |
:1004F000581708F45383FD018581841708F4458358 |
:10050000F501F0821BC02F5F283009F44DC018960A |
:10051000BECFD80190E0FD018781882321F0189695 |
:100520009F5F9830C1F73C93FD0151834283538311 |
:10053000F4824583F68281E087837F5F403B08F445 |
:1005400095CF70937300C60187709070079701F57F |
:10055000D801179640E08C918130A1F4FD013197CC |
:100560009081FD0133978081292F3327F901E81B02 |
:10057000F10933973CF4C601821B930B039714F0E7 |
:100580001C9271504F5F1896483029F77093730092 |
:10059000E0927600F0E9EF1609F448CF80917200FE |
:1005A00082608093720004C0783008F4B2CFC6CF66 |
:1005B00021960FB6F894DEBF0FBECDBFDF91CF916D |
:1005C0001F910F91FF90EF90DF90CF90BF90AF9071 |
:1005D0009F908F907F906F905F904F903F902F9063 |
:1005E000089580E4E8E7F0E011928A95E9F708952C |
:1005F00080917400823049F580917500282F220F78 |
:1006000080EBECEBF1E0982F11929A95E9F7ECE092 |
:10061000F1E011928A95E9F7829BFECF829B07C099 |
:10062000FDCF90E0849BFECF849B04C0FDCF2223AE |
:10063000C1F705C09150822F8195981799F76CE00A |
:1006400071E08CEB91E0C3D40895813039F4849942 |
:10065000FECF60E073E08CEB91E072D4089580915E |
:1006600074008130A9F41092760080917300809319 |
:1006700077001092730080E4E8E7F0E011928A9529 |
:10068000E9F7829BFECF60E073E08CEB91E058D4F9 |
:100690000895843019F1853028F4813009F18230D1 |
:1006A00041F507C0803899F0813809F1803209F5A9 |
:1006B00013C061E081E19BD39FD388EE93E0E7D341 |
:1006C0001092750082E08093740092DF089581E0BB |
:1006D00080937400C4DF0895CBDD0895C0DF0895D2 |
:1006E00080917400882329F084E04BDD08951092F6 |
:1006F00074000895DC01862F6623C9F0F8946150D8 |
:100700006F3FA1F0262F44E952E0861B682F62500C |
:100710008091BA00FA01E80FF11D9D9190838F5FDF |
:100720008F738093BA002150621791F778940895DF |
:10073000F8949091BB00E4E9F2E0E90FF11D8081AB |
:100740009F5F9F739093BB00789499270895F894C6 |
:100750009091BA00E4E9F2E0E90FF11D80839F5F18 |
:100760009F739093BA00789408959091BA00809105 |
:10077000BB00981741F0DCDFF5D19091BA00809171 |
:10078000BB009817C1F708950F931F93CF93DF9382 |
:10079000EC01862F61506F3F49F0162F861B082F02 |
:1007A00002508991DFD111500117D9F7DF91CF9114 |
:1007B0001F910F9108959091BA008091BB009817F6 |
:1007C00011F0B6DFCFD108959091BF00903541F47C |
:1007D0008091C000873409F581E08093620048C0B1 |
:1007E000973439F48091C000863509F51092620083 |
:1007F0003FC0943441F48091C000863411F583E009 |
:100800008093620035C0933441F48091C0008235FA |
:1008100011F582E0809362002BC0953441F4809101 |
:10082000C000843511F584E08093620021C09335C7 |
:1008300041F48091C0008D34C1F486E08093620061 |
:1008400017C0943441F48091C000843571F485E080 |
:10085000809362000DC0923541F48091C0008335D1 |
:1008600021F487E08093620003C089E080936200F6 |
:1008700083E0EFEBF0E011928A95E9F71092BE0069 |
:100880001092BD0008951092BF001092C000109207 |
:10089000C1001092C20080E4E3ECF0E0982F1192C6 |
:1008A0009A95E9F7E4E9F2E011928A95E9F780E296 |
:1008B000E4E7F2E011928A95E9F708958FEB90E072 |
:1008C000B0D39C018F3F910569F060F089E080937F |
:1008D00062008091BC00E3ECF0E0E80FF11D8FEFC7 |
:1008E000808307C08091BC00E3ECF0E0E80FF11DCD |
:1008F000208383E0EFEBF0E011928A95E9F7109204 |
:10090000BE001092BD000895FF920F931F93CF93E6 |
:10091000DF930F2EF9E0FF2EF02DFFC0F894E22FA9 |
:10092000FF27EC58FD4F9081822F8F5F8F7180934E |
:10093000B90078949D3009F0B1C08091BC00882343 |
:1009400011F442DF06C0BADF8091BC008F5F809354 |
:10095000BC0084E690E09BD2809162008850823097 |
:1009600058F48EE4F4DE83E4F2DE8BE4F0DE8DE016 |
:10097000EEDE80E906DC89C081E4E9DE83E4E7DEBF |
:100980008BE4E5DE8DE0E3DE80E9FBDB8091620055 |
:10099000813009F47AC0882371F480916300882340 |
:1009A00009F473C0C3E6D0E02196D1DE88818823A4 |
:1009B00009F46BC0F9CF873011F4A1DB66C0833036 |
:1009C00031F484E690E063D282E0DBDB5EC082300B |
:1009D00099F48091BC00823068F011E0E12FFF278C |
:1009E000ED53FF4F6181808102D21E5F8091BC0078 |
:1009F0001817A0F301D249C0843031F484E690E0A6 |
:100A000046D280E8BEDB41C0853019F481E8B9DB0D |
:100A10003CC0863009F039C08091BC00882309F4BD |
:100A200034C040E003EC10E060E073E0842F9927CD |
:100A30009C012F5F3F4FF901E00FF11FE081EC01B6 |
:100A4000C60FD71FE883D90120D3802DE817C1F046 |
:100A5000D9010E2E27D3D90118D3802D988198174C |
:100A600079F0D901092E1ED3D9010FD3802D988199 |
:100A7000981731F0D901092E15D3D90106D3802D4D |
:100A80004F5F8091BC00481788F21092BC0080E450 |
:100A9000E3ECF0E011928A95E9F73FC09032F1F46F |
:100AA0008091BC00882339F48FDE8091BC008F5F79 |
:100AB0008093BC0032C09927CF974CF01092BD00B4 |
:100AC0001092BE001092BC00F092620026C0F6DECA |
:100AD0008091BC008F5F8093BC001FC0892F815420 |
:100AE0008A3118F08F5E8A30B0F48091BE00E82F12 |
:100AF000FF27E154FF4F90839091BD009F5F90933B |
:100B0000BD008F5F8093BE00943038F0F092620099 |
:100B10001092BE0002C0F09262002091B900809154 |
:100B2000B800821709F0FACEE894DF91CF911F91B7 |
:100B30000F91FF900895803129F0803939F081308C |
:100B400031F402C038DE0895DFDE08950EDE089528 |
:100B500010BC82E189B988E98AB986E880BD82E063 |
:100B60008BB908955D9BFECF8CB908951F920F92AB |
:100B70000FB60F9211248F939F93EF93FF93809161 |
:100B8000B8009CB1E4E7F2E0E80FF11D90838F5FBD |
:100B90008F718093B80080917000ECE6F2E0E80F6E |
:100BA000F11D91E090838F5F877080937000FF91BB |
:100BB000EF919F918F910F900FBE0F901F901895FE |
:100BC00011B888E480B90895982F8091080188238E |
:100BD000E4F306B604FCFDCF909303017093050186 |
:100BE00060930401409307011092060110920901DD |
:100BF00085EA86BF80910801806880930801089586 |
:100C0000982F809108018823E4F390930301709357 |
:100C10000501609304014093070181E08093060180 |
:100C20001092090185EA86BF80910801806880934F |
:100C30000801089580910801881F8827881F992737 |
:100C400008951F920F920FB60F9211248F939F93C6 |
:100C5000AF93BF93EF93FF9381B19927AA27BB2747 |
:100C6000887F9070A070B070FC013897E135F10575 |
:100C700008F09AC0ED5EFF4F09948091090183301E |
:100C800048F086B7806986BF809108018F7780938E |
:100C900008018AC08091030190910601880F890F95 |
:100CA00083B986B78F7D86BF7FC010920901E0911E |
:100CB0000401F0910501808183B93196F09305011B |
:100CC000E093040186B7806886BF6EC080910901F9 |
:100CD0008F5F8093090186B7806B86BF65C0809166 |
:100CE000070181508093070180910701882379F0E3 |
:100CF000E0910401F0910501808183B93196F09370 |
:100D00000501E093040186B7806886BF4DC086B7B1 |
:100D1000806986BF809108018F778093080144C065 |
:100D200086B7806986BF809108018F77809308011C |
:100D30003BC080910701815080930701809107019A |
:100D4000882321F086B7806C86BF2EC086B7806866 |
:100D500086BF2AC0E0910401F091050183B1808330 |
:100D60003196F0930501E0930401809107018150D1 |
:100D70008093070180910701882321F086B7806C5A |
:100D800086BF12C086B78F7B86BF0EC0E09104017C |
:100D9000F091050183B1808386B7806986BF809119 |
:100DA00008018F7780930801FF91EF91BF91AF9178 |
:100DB0009F918F910F900FBE0F901F9018952091CB |
:100DC0000A01E22FFF27EE0FFF1FEC52FD4F918328 |
:100DD00080832F5F277020930A0190E080910B01A0 |
:100DE000281709F491E081E0892799270895282F91 |
:100DF000362FC901E4DF08950F931F93CF93DF933C |
:100E0000CDB7DEB722970FB6F894DEBF0FBECDBFC9 |
:100E10008E010F5F1F4F19C0E32FFF27EE0FFF1F3B |
:100E2000EC52FD4F91812081832F8F5F87708093DB |
:100E30000B019A83298342E0B80180E6C5DE84E68F |
:100E400090E025D0F7DE8130E9F330910B018091FD |
:100E50000A01831709F722960FB6F894DEBF0FBE7A |
:100E6000CDBFDF91CF911F910F91089560E284E192 |
:100E7000BEDF60E489E3BBDF68E282E1B8DF65E002 |
:100E800088E2B5DF61E083E1B2DFB6DF0895CF939A |
:100E9000DF93CDB7DEB724970FB6F894DEBF0FBE51 |
:100EA000CDBF9C011A8219821C821B821A82198270 |
:100EB00089819A8182179307E0F41C821B828B81BF |
:100EC0009C81885E934058F400008B819C81019640 |
:100ED0009C838B838B819C81885E9340A8F389815E |
:100EE0009A8101969A83898389819A8182179307CF |
:100EF00020F324960FB6F894DEBF0FBECDBFDF916E |
:100F0000CF9108958E9A969A84EF91E0C0DF9698DB |
:100F100084EF91E0BCDF969A84EF91E0B8DF969879 |
:100F200084EF91E0B4DF969A84EF91E0B0DF969879 |
:100F300084EF91E0ACDF969A0895969A96988895FA |
:100F4000E6F13EB537603EBD00E010E520E0B92F88 |
:100F5000A82FF72FE62FD72F39B7346039BF30E5E8 |
:100F60004FEF4DBD3CBDC62F3BB730683BBF969A97 |
:100F7000889596983BB73F773BBF00000000E6B3EB |
:100F8000C3B3CF703081E6B3488950A134233523F1 |
:100F900076F03217A1F3969A00009698412F0CB57F |
:100FA000102F041B2D930D93232F0000E8CF0FEF7C |
:100FB000011B03953D930C9300C03EB5387F3EBDA9 |
:100FC000969A9698E8940895969A96988895AEF38E |
:100FD000B92FA82FD72FC62F30E54FEF4DBD3CBD01 |
:100FE0003EB537603EBD000039B7346039BF3BB70E |
:100FF00030683BBF969A889596983BB73F773BBF42 |
:10100000000033B346B33D934993DEF7D6CF18952E |
:101010001895309172003160309372006894189581 |
:101020001895FC0188279927E89421912223E9F05B |
:101030002032D9F32930C9F32A30B9F32C30A9F37F |
:101040002D3099F3263789F32B3219F02D3221F404 |
:1010500068942191222349F020333CF02A332CF468 |
:1010600020530BD0820F911DF4CF8115910521F0F3 |
:101070001EF480959095019608957AE0979F902DA3 |
:10108000879F802D910D11240895E199FECFBFBB5C |
:10109000AEBBE09A11960DB20895F7DF01921A9453 |
:1010A000E1F70895E199FECFBFBBAEBB0DBA119633 |
:0E10B0000FB6F894E29AE19A0FBE0895FFCFB2 |
:1010BE0078000841565263616D2076312E340D0052 |
:00000001FF |
/programy/C/avr/AVRcam/AVRcam.lss |
---|
0,0 → 1,2787 |
AVRcam.elf: file format elf32-avr |
Sections: |
Idx Name Size VMA LMA File off Algn |
0 .noinit 00000030 00800300 00800300 00001182 2**0 |
ALLOC |
1 .bss 00000274 00800070 00800070 00001182 2**0 |
ALLOC |
2 .data 00000010 00800060 000010be 00001172 2**0 |
CONTENTS, ALLOC, LOAD, DATA |
3 .text 000010be 00000000 00000000 000000b4 2**1 |
CONTENTS, ALLOC, LOAD, READONLY, CODE |
4 .eeprom 00000000 00810000 00810000 00001182 2**0 |
CONTENTS |
5 .stab 00003ed0 00000000 00000000 00001184 2**2 |
CONTENTS, READONLY, DEBUGGING |
6 .stabstr 000017c9 00000000 00000000 00005054 2**0 |
CONTENTS, READONLY, DEBUGGING |
Disassembly of section .text: |
00000000 <__vectors>: |
0: 63 c0 rjmp .+198 ; 0xc8 <__init> |
2: 05 c8 rjmp .-4086 ; 0xfffff00e <__eeprom_end+0xff7ef00e> |
4: 05 c8 rjmp .-4086 ; 0xfffff010 <__eeprom_end+0xff7ef010> |
6: 7a c0 rjmp .+244 ; 0xfc <__bad_interrupt> |
8: 79 c0 rjmp .+242 ; 0xfc <__bad_interrupt> |
a: 78 c0 rjmp .+240 ; 0xfc <__bad_interrupt> |
c: 77 c0 rjmp .+238 ; 0xfc <__bad_interrupt> |
e: 76 c0 rjmp .+236 ; 0xfc <__bad_interrupt> |
10: 00 c8 rjmp .-4096 ; 0xfffff012 <__eeprom_end+0xff7ef012> |
12: 74 c0 rjmp .+232 ; 0xfc <__bad_interrupt> |
14: 73 c0 rjmp .+230 ; 0xfc <__bad_interrupt> |
16: aa c5 rjmp .+2900 ; 0xb6c <__vector_11> |
18: 71 c0 rjmp .+226 ; 0xfc <__bad_interrupt> |
1a: 70 c0 rjmp .+224 ; 0xfc <__bad_interrupt> |
1c: 6f c0 rjmp .+222 ; 0xfc <__bad_interrupt> |
1e: 6e c0 rjmp .+220 ; 0xfc <__bad_interrupt> |
20: 6d c0 rjmp .+218 ; 0xfc <__bad_interrupt> |
22: 0f c6 rjmp .+3102 ; 0xc42 <__vector_17> |
24: 6b c0 rjmp .+214 ; 0xfc <__bad_interrupt> |
00000026 <__ctors_end>: |
26: 29 c6 rjmp .+3154 ; 0xc7a <__vector_17+0x38> |
28: bf c6 rjmp .+3454 ; 0xda8 <__vector_17+0x166> |
2a: be c6 rjmp .+3452 ; 0xda8 <__vector_17+0x166> |
2c: bd c6 rjmp .+3450 ; 0xda8 <__vector_17+0x166> |
2e: bc c6 rjmp .+3448 ; 0xda8 <__vector_17+0x166> |
30: bb c6 rjmp .+3446 ; 0xda8 <__vector_17+0x166> |
32: ba c6 rjmp .+3444 ; 0xda8 <__vector_17+0x166> |
34: b9 c6 rjmp .+3442 ; 0xda8 <__vector_17+0x166> |
36: 21 c6 rjmp .+3138 ; 0xc7a <__vector_17+0x38> |
38: b7 c6 rjmp .+3438 ; 0xda8 <__vector_17+0x166> |
3a: b6 c6 rjmp .+3436 ; 0xda8 <__vector_17+0x166> |
3c: b5 c6 rjmp .+3434 ; 0xda8 <__vector_17+0x166> |
3e: b4 c6 rjmp .+3432 ; 0xda8 <__vector_17+0x166> |
40: b3 c6 rjmp .+3430 ; 0xda8 <__vector_17+0x166> |
42: b2 c6 rjmp .+3428 ; 0xda8 <__vector_17+0x166> |
44: b1 c6 rjmp .+3426 ; 0xda8 <__vector_17+0x166> |
46: 31 c6 rjmp .+3170 ; 0xcaa <__vector_17+0x68> |
48: af c6 rjmp .+3422 ; 0xda8 <__vector_17+0x166> |
4a: ae c6 rjmp .+3420 ; 0xda8 <__vector_17+0x166> |
4c: ad c6 rjmp .+3418 ; 0xda8 <__vector_17+0x166> |
4e: ac c6 rjmp .+3416 ; 0xda8 <__vector_17+0x166> |
50: ab c6 rjmp .+3414 ; 0xda8 <__vector_17+0x166> |
52: aa c6 rjmp .+3412 ; 0xda8 <__vector_17+0x166> |
54: a9 c6 rjmp .+3410 ; 0xda8 <__vector_17+0x166> |
56: 3a c6 rjmp .+3188 ; 0xccc <__vector_17+0x8a> |
58: a7 c6 rjmp .+3406 ; 0xda8 <__vector_17+0x166> |
5a: a6 c6 rjmp .+3404 ; 0xda8 <__vector_17+0x166> |
5c: a5 c6 rjmp .+3402 ; 0xda8 <__vector_17+0x166> |
5e: a4 c6 rjmp .+3400 ; 0xda8 <__vector_17+0x166> |
60: a3 c6 rjmp .+3398 ; 0xda8 <__vector_17+0x166> |
62: a2 c6 rjmp .+3396 ; 0xda8 <__vector_17+0x166> |
64: a1 c6 rjmp .+3394 ; 0xda8 <__vector_17+0x166> |
66: 3b c6 rjmp .+3190 ; 0xcde <__vector_17+0x9c> |
68: 9f c6 rjmp .+3390 ; 0xda8 <__vector_17+0x166> |
6a: 9e c6 rjmp .+3388 ; 0xda8 <__vector_17+0x166> |
6c: 9d c6 rjmp .+3386 ; 0xda8 <__vector_17+0x166> |
6e: 9c c6 rjmp .+3384 ; 0xda8 <__vector_17+0x166> |
70: 9b c6 rjmp .+3382 ; 0xda8 <__vector_17+0x166> |
72: 9a c6 rjmp .+3380 ; 0xda8 <__vector_17+0x166> |
74: 99 c6 rjmp .+3378 ; 0xda8 <__vector_17+0x166> |
76: 54 c6 rjmp .+3240 ; 0xd20 <__vector_17+0xde> |
78: 97 c6 rjmp .+3374 ; 0xda8 <__vector_17+0x166> |
7a: 96 c6 rjmp .+3372 ; 0xda8 <__vector_17+0x166> |
7c: 95 c6 rjmp .+3370 ; 0xda8 <__vector_17+0x166> |
7e: 94 c6 rjmp .+3368 ; 0xda8 <__vector_17+0x166> |
80: 93 c6 rjmp .+3366 ; 0xda8 <__vector_17+0x166> |
82: 92 c6 rjmp .+3364 ; 0xda8 <__vector_17+0x166> |
84: 91 c6 rjmp .+3362 ; 0xda8 <__vector_17+0x166> |
86: 90 c6 rjmp .+3360 ; 0xda8 <__vector_17+0x166> |
88: 8f c6 rjmp .+3358 ; 0xda8 <__vector_17+0x166> |
8a: 8e c6 rjmp .+3356 ; 0xda8 <__vector_17+0x166> |
8c: 8d c6 rjmp .+3354 ; 0xda8 <__vector_17+0x166> |
8e: 8c c6 rjmp .+3352 ; 0xda8 <__vector_17+0x166> |
90: 8b c6 rjmp .+3350 ; 0xda8 <__vector_17+0x166> |
92: 8a c6 rjmp .+3348 ; 0xda8 <__vector_17+0x166> |
94: 89 c6 rjmp .+3346 ; 0xda8 <__vector_17+0x166> |
96: 4d c6 rjmp .+3226 ; 0xd32 <__vector_17+0xf0> |
98: 87 c6 rjmp .+3342 ; 0xda8 <__vector_17+0x166> |
9a: 86 c6 rjmp .+3340 ; 0xda8 <__vector_17+0x166> |
9c: 85 c6 rjmp .+3338 ; 0xda8 <__vector_17+0x166> |
9e: 84 c6 rjmp .+3336 ; 0xda8 <__vector_17+0x166> |
a0: 83 c6 rjmp .+3334 ; 0xda8 <__vector_17+0x166> |
a2: 82 c6 rjmp .+3332 ; 0xda8 <__vector_17+0x166> |
a4: 81 c6 rjmp .+3330 ; 0xda8 <__vector_17+0x166> |
a6: 12 c6 rjmp .+3108 ; 0xccc <__vector_17+0x8a> |
a8: 7f c6 rjmp .+3326 ; 0xda8 <__vector_17+0x166> |
aa: 7e c6 rjmp .+3324 ; 0xda8 <__vector_17+0x166> |
ac: 7d c6 rjmp .+3322 ; 0xda8 <__vector_17+0x166> |
ae: 7c c6 rjmp .+3320 ; 0xda8 <__vector_17+0x166> |
b0: 7b c6 rjmp .+3318 ; 0xda8 <__vector_17+0x166> |
b2: 7a c6 rjmp .+3316 ; 0xda8 <__vector_17+0x166> |
b4: 79 c6 rjmp .+3314 ; 0xda8 <__vector_17+0x166> |
b6: 4e c6 rjmp .+3228 ; 0xd54 <__vector_17+0x112> |
b8: 77 c6 rjmp .+3310 ; 0xda8 <__vector_17+0x166> |
ba: 76 c6 rjmp .+3308 ; 0xda8 <__vector_17+0x166> |
bc: 75 c6 rjmp .+3306 ; 0xda8 <__vector_17+0x166> |
be: 74 c6 rjmp .+3304 ; 0xda8 <__vector_17+0x166> |
c0: 73 c6 rjmp .+3302 ; 0xda8 <__vector_17+0x166> |
c2: 72 c6 rjmp .+3300 ; 0xda8 <__vector_17+0x166> |
c4: 71 c6 rjmp .+3298 ; 0xda8 <__vector_17+0x166> |
c6: 62 c6 rjmp .+3268 ; 0xd8c <__vector_17+0x14a> |
000000c8 <__init>: |
c8: 11 24 eor r1, r1 |
ca: 1f be out 0x3f, r1 ; 63 |
cc: cf e5 ldi r28, 0x5F ; 95 |
ce: d4 e0 ldi r29, 0x04 ; 4 |
d0: de bf out 0x3e, r29 ; 62 |
d2: cd bf out 0x3d, r28 ; 61 |
000000d4 <__do_copy_data>: |
d4: 10 e0 ldi r17, 0x00 ; 0 |
d6: a0 e6 ldi r26, 0x60 ; 96 |
d8: b0 e0 ldi r27, 0x00 ; 0 |
da: ee eb ldi r30, 0xBE ; 190 |
dc: f0 e1 ldi r31, 0x10 ; 16 |
de: 02 c0 rjmp .+4 ; 0xe4 <.do_copy_data_start> |
000000e0 <.do_copy_data_loop>: |
e0: 05 90 lpm r0, Z+ |
e2: 0d 92 st X+, r0 |
000000e4 <.do_copy_data_start>: |
e4: a0 37 cpi r26, 0x70 ; 112 |
e6: b1 07 cpc r27, r17 |
e8: d9 f7 brne .-10 ; 0xe0 <.do_copy_data_loop> |
000000ea <__do_clear_bss>: |
ea: 12 e0 ldi r17, 0x02 ; 2 |
ec: a0 e7 ldi r26, 0x70 ; 112 |
ee: b0 e0 ldi r27, 0x00 ; 0 |
f0: 01 c0 rjmp .+2 ; 0xf4 <.do_clear_bss_start> |
000000f2 <.do_clear_bss_loop>: |
f2: 1d 92 st X+, r1 |
000000f4 <.do_clear_bss_start>: |
f4: a4 3e cpi r26, 0xE4 ; 228 |
f6: b1 07 cpc r27, r17 |
f8: e1 f7 brne .-8 ; 0xf2 <.do_clear_bss_loop> |
fa: 30 c0 rjmp .+96 ; 0x15c <main> |
000000fc <__bad_interrupt>: |
fc: 91 c7 rjmp .+3874 ; 0x1020 <__vector_default> |
000000fe <CamInt_resetCam>: |
output the clock signal. Thus, if we reset the cam, the |
AVR has no clock, and thus doesn't run... |
***********************************************************/ |
void CamInt_resetCam(void) |
{ |
fe: 08 95 ret |
00000100 <CamInt_init>: |
100: 8f 9a sbi 0x11, 7 ; 17 |
102: 8f 9a sbi 0x11, 7 ; 17 |
104: 8a 98 cbi 0x11, 2 ; 17 |
106: 97 98 cbi 0x12, 7 ; 18 |
108: 87 b3 in r24, 0x17 ; 23 |
10a: 80 7f andi r24, 0xF0 ; 240 |
10c: 87 bb out 0x17, r24 ; 23 |
10e: 87 b3 in r24, 0x17 ; 23 |
110: 80 6f ori r24, 0xF0 ; 240 |
112: 87 bb out 0x17, r24 ; 23 |
114: 84 b3 in r24, 0x14 ; 20 |
116: 80 7f andi r24, 0xF0 ; 240 |
118: 84 bb out 0x14, r24 ; 20 |
11a: 8e b5 in r24, 0x2e ; 46 |
11c: 88 7f andi r24, 0xF8 ; 248 |
11e: 8e bd out 0x2e, r24 ; 46 |
120: 85 b7 in r24, 0x35 ; 53 |
122: 8c 60 ori r24, 0x0C ; 12 |
124: 85 bf out 0x35, r24 ; 53 |
126: 85 b7 in r24, 0x35 ; 53 |
128: 83 60 ori r24, 0x03 ; 3 |
12a: 85 bf out 0x35, r24 ; 53 |
12c: 8b b7 in r24, 0x3b ; 59 |
12e: 80 64 ori r24, 0x40 ; 64 |
130: 8b bf out 0x3b, r24 ; 59 |
132: 86 e0 ldi r24, 0x06 ; 6 |
134: 83 bf out 0x33, r24 ; 51 |
136: 85 b7 in r24, 0x35 ; 53 |
138: 8f 78 andi r24, 0x8F ; 143 |
13a: 85 bf out 0x35, r24 ; 53 |
13c: 85 b7 in r24, 0x35 ; 53 |
13e: 80 68 ori r24, 0x80 ; 128 |
140: 85 bf out 0x35, r24 ; 53 |
142: e0 e0 ldi r30, 0x00 ; 0 |
144: f3 e0 ldi r31, 0x03 ; 3 |
146: 80 e3 ldi r24, 0x30 ; 48 |
148: df 01 movw r26, r30 |
14a: 98 2f mov r25, r24 |
14c: 1d 92 st X+, r1 |
14e: 9a 95 dec r25 |
150: e9 f7 brne .-6 ; 0x14c <CamInt_init+0x4c> |
/* Needed in order to truncate to 8 bit. */ |
uint8_t len; |
len = (uint8_t) n; |
asm volatile ( |
152: a1 e0 ldi r26, 0x01 ; 1 |
154: b0 e0 ldi r27, 0x00 ; 0 |
156: 18 2e mov r1, r24 |
158: a0 d7 rcall .+3904 ; 0x109a <__eeprom_read_block_1C1D1E> |
15a: 08 95 ret |
0000015c <main>: |
Inputs: none |
Outputs: int |
***********************************************************/ |
int main(void) |
{ |
15c: cf e5 ldi r28, 0x5F ; 95 |
15e: d4 e0 ldi r29, 0x04 ; 4 |
160: de bf out 0x3e, r29 ; 62 |
162: cd bf out 0x3d, r28 ; 61 |
/* initialize all of the interface modules */ |
DebugInt_init(); |
164: cf d6 rcall .+3486 ; 0xf04 <DebugInt_init> |
UartInt_init(); |
166: f4 d4 rcall .+2536 ; 0xb50 <UartInt_init> |
I2CInt_init(); |
168: 2b d5 rcall .+2646 ; 0xbc0 <I2CInt_init> |
CamInt_init(); |
16a: ca df rcall .-108 ; 0x100 <CamInt_init> |
/* initialize the remaining modules that will process |
data...interrupts need to be on for these */ |
ENABLE_INTS(); |
16c: 78 94 sei |
CamConfig_init(); |
16e: 7e d6 rcall .+3324 ; 0xe6c <CamConfig_init> |
UIMgr_init(); |
170: 8a d3 rcall .+1812 ; 0x886 <UIMgr_init> |
FrameMgr_init(); |
172: 37 d2 rcall .+1134 ; 0x5e2 <FrameMgr_init> |
/* provide a short delay for the camera to stabilize before |
we let the executive start up */ |
Utility_delay(1000); |
174: 88 ee ldi r24, 0xE8 ; 232 |
176: 93 e0 ldi r25, 0x03 ; 3 |
178: 8a d6 rcall .+3348 ; 0xe8e <Utility_delay> |
/* the rest of the application will be under the |
control of the Executive. */ |
Exec_run(); |
17a: 11 d0 rcall .+34 ; 0x19e <Exec_run> |
/* this should never be reached */ |
return(0); |
} |
17c: 80 e0 ldi r24, 0x00 ; 0 |
17e: 90 e0 ldi r25, 0x00 ; 0 |
180: 9d c7 rjmp .+3898 ; 0x10bc <_exit> |
00000182 <Exec_writeEventFifo>: |
182: f8 94 cli |
184: 90 91 70 00 lds r25, 0x0070 |
188: ec e6 ldi r30, 0x6C ; 108 |
18a: f2 e0 ldi r31, 0x02 ; 2 |
18c: e9 0f add r30, r25 |
18e: f1 1d adc r31, r1 |
190: 80 83 st Z, r24 |
192: 9f 5f subi r25, 0xFF ; 255 |
194: 97 70 andi r25, 0x07 ; 7 |
196: 90 93 70 00 sts 0x0070, r25 |
19a: 78 94 sei |
19c: 08 95 ret |
0000019e <Exec_run>: |
19e: 80 91 72 00 lds r24, 0x0072 |
1a2: 88 23 and r24, r24 |
1a4: 99 f0 breq .+38 ; 0x1cc <Exec_run+0x2e> |
1a6: 80 ff sbrs r24, 0 |
1a8: 07 c0 rjmp .+14 ; 0x1b8 <Exec_run+0x1a> |
1aa: f8 94 cli |
1ac: 8e 7f andi r24, 0xFE ; 254 |
1ae: 80 93 72 00 sts 0x0072, r24 |
1b2: 78 94 sei |
1b4: b6 d0 rcall .+364 ; 0x322 <FrameMgr_processLine> |
1b6: ff d2 rcall .+1534 ; 0x7b6 <UIMgr_transmitPendingData> |
1b8: 80 91 72 00 lds r24, 0x0072 |
1bc: 81 ff sbrs r24, 1 |
1be: 06 c0 rjmp .+12 ; 0x1cc <Exec_run+0x2e> |
1c0: f8 94 cli |
1c2: 8d 7f andi r24, 0xFD ; 253 |
1c4: 80 93 72 00 sts 0x0072, r24 |
1c8: 78 94 sei |
1ca: 12 d2 rcall .+1060 ; 0x5f0 <FrameMgr_acquireLine> |
1cc: 20 91 71 00 lds r18, 0x0071 |
1d0: 80 91 70 00 lds r24, 0x0070 |
1d4: 82 17 cp r24, r18 |
1d6: 19 f3 breq .-58 ; 0x19e <Exec_run> |
1d8: f8 94 cli |
1da: e2 2f mov r30, r18 |
1dc: ff 27 eor r31, r31 |
1de: e4 59 subi r30, 0x94 ; 148 |
1e0: fd 4f sbci r31, 0xFD ; 253 |
1e2: 90 81 ld r25, Z |
1e4: 82 2f mov r24, r18 |
1e6: 8f 5f subi r24, 0xFF ; 255 |
1e8: 87 70 andi r24, 0x07 ; 7 |
1ea: 80 93 71 00 sts 0x0071, r24 |
1ee: 78 94 sei |
1f0: 89 2f mov r24, r25 |
1f2: 99 27 eor r25, r25 |
1f4: 80 31 cpi r24, 0x10 ; 16 |
1f6: 31 f1 breq .+76 ; 0x244 <Exec_run+0xa6> |
1f8: 81 31 cpi r24, 0x11 ; 17 |
1fa: 68 f4 brcc .+26 ; 0x216 <Exec_run+0x78> |
1fc: 82 30 cpi r24, 0x02 ; 2 |
1fe: c9 f0 breq .+50 ; 0x232 <Exec_run+0x94> |
200: 83 30 cpi r24, 0x03 ; 3 |
202: 18 f4 brcc .+6 ; 0x20a <Exec_run+0x6c> |
204: 81 30 cpi r24, 0x01 ; 1 |
206: 59 f6 brne .-106 ; 0x19e <Exec_run> |
208: 2b c0 rjmp .+86 ; 0x260 <Exec_run+0xc2> |
20a: 84 30 cpi r24, 0x04 ; 4 |
20c: 31 f1 breq .+76 ; 0x25a <Exec_run+0xbc> |
20e: 88 30 cpi r24, 0x08 ; 8 |
210: 09 f0 breq .+2 ; 0x214 <Exec_run+0x76> |
212: c5 cf rjmp .-118 ; 0x19e <Exec_run> |
214: 1f c0 rjmp .+62 ; 0x254 <Exec_run+0xb6> |
216: 80 38 cpi r24, 0x80 ; 128 |
218: 79 f0 breq .+30 ; 0x238 <Exec_run+0x9a> |
21a: 81 38 cpi r24, 0x81 ; 129 |
21c: 20 f4 brcc .+8 ; 0x226 <Exec_run+0x88> |
21e: 80 32 cpi r24, 0x20 ; 32 |
220: 09 f0 breq .+2 ; 0x224 <Exec_run+0x86> |
222: bd cf rjmp .-134 ; 0x19e <Exec_run> |
224: 14 c0 rjmp .+40 ; 0x24e <Exec_run+0xb0> |
226: 81 38 cpi r24, 0x81 ; 129 |
228: 51 f0 breq .+20 ; 0x23e <Exec_run+0xa0> |
22a: 80 39 cpi r24, 0x90 ; 144 |
22c: 09 f0 breq .+2 ; 0x230 <Exec_run+0x92> |
22e: b7 cf rjmp .-146 ; 0x19e <Exec_run> |
230: 1c c0 rjmp .+56 ; 0x26a <Exec_run+0xcc> |
232: 82 e0 ldi r24, 0x02 ; 2 |
234: 2e d2 rcall .+1116 ; 0x692 <FrameMgr_dispatchEvent> |
236: b3 cf rjmp .-154 ; 0x19e <Exec_run> |
238: 80 e8 ldi r24, 0x80 ; 128 |
23a: 2b d2 rcall .+1110 ; 0x692 <FrameMgr_dispatchEvent> |
23c: b0 cf rjmp .-160 ; 0x19e <Exec_run> |
23e: 81 e8 ldi r24, 0x81 ; 129 |
240: 28 d2 rcall .+1104 ; 0x692 <FrameMgr_dispatchEvent> |
242: ad cf rjmp .-166 ; 0x19e <Exec_run> |
244: 80 e1 ldi r24, 0x10 ; 16 |
246: 25 d2 rcall .+1098 ; 0x692 <FrameMgr_dispatchEvent> |
248: 80 e1 ldi r24, 0x10 ; 16 |
24a: 75 d4 rcall .+2282 ; 0xb36 <UIMgr_dispatchEvent> |
24c: a8 cf rjmp .-176 ; 0x19e <Exec_run> |
24e: 80 e2 ldi r24, 0x20 ; 32 |
250: 20 d2 rcall .+1088 ; 0x692 <FrameMgr_dispatchEvent> |
252: a5 cf rjmp .-182 ; 0x19e <Exec_run> |
254: 88 e0 ldi r24, 0x08 ; 8 |
256: 1d d2 rcall .+1082 ; 0x692 <FrameMgr_dispatchEvent> |
258: a2 cf rjmp .-188 ; 0x19e <Exec_run> |
25a: 84 e0 ldi r24, 0x04 ; 4 |
25c: 1a d2 rcall .+1076 ; 0x692 <FrameMgr_dispatchEvent> |
25e: 9f cf rjmp .-194 ; 0x19e <Exec_run> |
260: 81 e0 ldi r24, 0x01 ; 1 |
262: 69 d4 rcall .+2258 ; 0xb36 <UIMgr_dispatchEvent> |
264: 81 e0 ldi r24, 0x01 ; 1 |
266: 15 d2 rcall .+1066 ; 0x692 <FrameMgr_dispatchEvent> |
268: 9a cf rjmp .-204 ; 0x19e <Exec_run> |
26a: 80 e9 ldi r24, 0x90 ; 144 |
26c: 64 d4 rcall .+2248 ; 0xb36 <UIMgr_dispatchEvent> |
26e: 97 cf rjmp .-210 ; 0x19e <Exec_run> |
00000270 <FrameMgr_processFrame>: |
270: df 92 push r13 |
272: ef 92 push r14 |
274: ff 92 push r15 |
276: 0f 93 push r16 |
278: 1f 93 push r17 |
27a: cf 93 push r28 |
27c: df 93 push r29 |
27e: 20 91 60 00 lds r18, 0x0060 |
282: 30 91 61 00 lds r19, 0x0061 |
286: 80 91 73 00 lds r24, 0x0073 |
28a: 88 23 and r24, r24 |
28c: 09 f4 brne .+2 ; 0x290 <FrameMgr_processFrame+0x20> |
28e: 3f c0 rjmp .+126 ; 0x30e <FrameMgr_processFrame+0x9e> |
290: e9 01 movw r28, r18 |
292: 8a e0 ldi r24, 0x0A ; 10 |
294: 5c d2 rcall .+1208 ; 0x74e <UIMgr_writeTxFifo> |
296: 80 91 73 00 lds r24, 0x0073 |
29a: 59 d2 rcall .+1202 ; 0x74e <UIMgr_writeTxFifo> |
29c: dd 24 eor r13, r13 |
29e: 8f 81 ldd r24, Y+7 ; 0x07 |
2a0: 81 30 cpi r24, 0x01 ; 1 |
2a2: 69 f5 brne .+90 ; 0x2fe <FrameMgr_processFrame+0x8e> |
2a4: 88 81 ld r24, Y |
2a6: 80 38 cpi r24, 0x80 ; 128 |
2a8: e1 f0 breq .+56 ; 0x2e2 <FrameMgr_processFrame+0x72> |
2aa: 80 34 cpi r24, 0x40 ; 64 |
2ac: 11 f4 brne .+4 ; 0x2b2 <FrameMgr_processFrame+0x42> |
2ae: 81 e0 ldi r24, 0x01 ; 1 |
2b0: 19 c0 rjmp .+50 ; 0x2e4 <FrameMgr_processFrame+0x74> |
2b2: 80 32 cpi r24, 0x20 ; 32 |
2b4: 11 f4 brne .+4 ; 0x2ba <FrameMgr_processFrame+0x4a> |
2b6: 82 e0 ldi r24, 0x02 ; 2 |
2b8: 15 c0 rjmp .+42 ; 0x2e4 <FrameMgr_processFrame+0x74> |
2ba: 80 31 cpi r24, 0x10 ; 16 |
2bc: 11 f4 brne .+4 ; 0x2c2 <FrameMgr_processFrame+0x52> |
2be: 83 e0 ldi r24, 0x03 ; 3 |
2c0: 11 c0 rjmp .+34 ; 0x2e4 <FrameMgr_processFrame+0x74> |
2c2: 88 30 cpi r24, 0x08 ; 8 |
2c4: 11 f4 brne .+4 ; 0x2ca <FrameMgr_processFrame+0x5a> |
2c6: 84 e0 ldi r24, 0x04 ; 4 |
2c8: 0d c0 rjmp .+26 ; 0x2e4 <FrameMgr_processFrame+0x74> |
2ca: 84 30 cpi r24, 0x04 ; 4 |
2cc: 11 f4 brne .+4 ; 0x2d2 <FrameMgr_processFrame+0x62> |
2ce: 85 e0 ldi r24, 0x05 ; 5 |
2d0: 09 c0 rjmp .+18 ; 0x2e4 <FrameMgr_processFrame+0x74> |
2d2: 82 30 cpi r24, 0x02 ; 2 |
2d4: 11 f4 brne .+4 ; 0x2da <FrameMgr_processFrame+0x6a> |
2d6: 86 e0 ldi r24, 0x06 ; 6 |
2d8: 05 c0 rjmp .+10 ; 0x2e4 <FrameMgr_processFrame+0x74> |
2da: 81 30 cpi r24, 0x01 ; 1 |
2dc: 11 f4 brne .+4 ; 0x2e2 <FrameMgr_processFrame+0x72> |
2de: 87 e0 ldi r24, 0x07 ; 7 |
2e0: 01 c0 rjmp .+2 ; 0x2e4 <FrameMgr_processFrame+0x74> |
2e2: 80 e0 ldi r24, 0x00 ; 0 |
2e4: 1b 81 ldd r17, Y+3 ; 0x03 |
2e6: 0c 81 ldd r16, Y+4 ; 0x04 |
2e8: fd 80 ldd r15, Y+5 ; 0x05 |
2ea: ee 80 ldd r14, Y+6 ; 0x06 |
2ec: 30 d2 rcall .+1120 ; 0x74e <UIMgr_writeTxFifo> |
2ee: 81 2f mov r24, r17 |
2f0: 2e d2 rcall .+1116 ; 0x74e <UIMgr_writeTxFifo> |
2f2: 80 2f mov r24, r16 |
2f4: 2c d2 rcall .+1112 ; 0x74e <UIMgr_writeTxFifo> |
2f6: 8f 2d mov r24, r15 |
2f8: 2a d2 rcall .+1108 ; 0x74e <UIMgr_writeTxFifo> |
2fa: 8e 2d mov r24, r14 |
2fc: 28 d2 rcall .+1104 ; 0x74e <UIMgr_writeTxFifo> |
2fe: d3 94 inc r13 |
300: 88 e0 ldi r24, 0x08 ; 8 |
302: d8 16 cp r13, r24 |
304: 11 f0 breq .+4 ; 0x30a <FrameMgr_processFrame+0x9a> |
306: 28 96 adiw r28, 0x08 ; 8 |
308: ca cf rjmp .-108 ; 0x29e <FrameMgr_processFrame+0x2e> |
30a: 8f ef ldi r24, 0xFF ; 255 |
30c: 20 d2 rcall .+1088 ; 0x74e <UIMgr_writeTxFifo> |
30e: 84 e0 ldi r24, 0x04 ; 4 |
310: 38 df rcall .-400 ; 0x182 <Exec_writeEventFifo> |
312: df 91 pop r29 |
314: cf 91 pop r28 |
316: 1f 91 pop r17 |
318: 0f 91 pop r16 |
31a: ff 90 pop r15 |
31c: ef 90 pop r14 |
31e: df 90 pop r13 |
320: 08 95 ret |
00000322 <FrameMgr_processLine>: |
322: 2f 92 push r2 |
324: 3f 92 push r3 |
326: 4f 92 push r4 |
328: 5f 92 push r5 |
32a: 6f 92 push r6 |
32c: 7f 92 push r7 |
32e: 8f 92 push r8 |
330: 9f 92 push r9 |
332: af 92 push r10 |
334: bf 92 push r11 |
336: cf 92 push r12 |
338: df 92 push r13 |
33a: ef 92 push r14 |
33c: ff 92 push r15 |
33e: 0f 93 push r16 |
340: 1f 93 push r17 |
342: cf 93 push r28 |
344: df 93 push r29 |
346: cd b7 in r28, 0x3d ; 61 |
348: de b7 in r29, 0x3e ; 62 |
34a: 21 97 sbiw r28, 0x01 ; 1 |
34c: 0f b6 in r0, 0x3f ; 63 |
34e: f8 94 cli |
350: de bf out 0x3e, r29 ; 62 |
352: 0f be out 0x3f, r0 ; 63 |
354: cd bf out 0x3d, r28 ; 61 |
356: 00 91 60 00 lds r16, 0x0060 |
35a: 10 91 61 00 lds r17, 0x0061 |
35e: 80 91 74 00 lds r24, 0x0074 |
362: 82 30 cpi r24, 0x02 ; 2 |
364: 09 f0 breq .+2 ; 0x368 <FrameMgr_processLine+0x46> |
366: 6a c0 rjmp .+212 ; 0x43c <FrameMgr_processLine+0x11a> |
368: 8b e0 ldi r24, 0x0B ; 11 |
36a: fc d3 rcall .+2040 ; 0xb64 <UartInt_txByte> |
36c: 80 91 75 00 lds r24, 0x0075 |
370: f9 d3 rcall .+2034 ; 0xb64 <UartInt_txByte> |
372: 0f 2e mov r0, r31 |
374: fc eb ldi r31, 0xBC ; 188 |
376: cf 2e mov r12, r31 |
378: f1 e0 ldi r31, 0x01 ; 1 |
37a: df 2e mov r13, r31 |
37c: f0 2d mov r31, r0 |
37e: 00 e0 ldi r16, 0x00 ; 0 |
380: 10 e0 ldi r17, 0x00 ; 0 |
382: 0f 2e mov r0, r31 |
384: fc e0 ldi r31, 0x0C ; 12 |
386: ef 2e mov r14, r31 |
388: f1 e0 ldi r31, 0x01 ; 1 |
38a: ff 2e mov r15, r31 |
38c: f0 2d mov r31, r0 |
38e: f6 01 movw r30, r12 |
390: 80 81 ld r24, Z |
392: 89 83 std Y+1, r24 ; 0x01 |
394: 89 81 ldd r24, Y+1 ; 0x01 |
396: 8f 70 andi r24, 0x0F ; 15 |
398: 89 83 std Y+1, r24 ; 0x01 |
39a: 89 81 ldd r24, Y+1 ; 0x01 |
39c: 82 95 swap r24 |
39e: 80 7f andi r24, 0xF0 ; 240 |
3a0: 89 83 std Y+1, r24 ; 0x01 |
3a2: 99 81 ldd r25, Y+1 ; 0x01 |
3a4: f7 01 movw r30, r14 |
3a6: 80 81 ld r24, Z |
3a8: 8f 70 andi r24, 0x0F ; 15 |
3aa: 89 2b or r24, r25 |
3ac: 89 83 std Y+1, r24 ; 0x01 |
3ae: 89 81 ldd r24, Y+1 ; 0x01 |
3b0: d9 d3 rcall .+1970 ; 0xb64 <UartInt_txByte> |
3b2: d8 01 movw r26, r16 |
3b4: 11 96 adiw r26, 0x01 ; 1 |
3b6: fd 01 movw r30, r26 |
3b8: e4 5f subi r30, 0xF4 ; 244 |
3ba: fe 4f sbci r31, 0xFE ; 254 |
3bc: 80 81 ld r24, Z |
3be: 89 83 std Y+1, r24 ; 0x01 |
3c0: 89 81 ldd r24, Y+1 ; 0x01 |
3c2: 8f 70 andi r24, 0x0F ; 15 |
3c4: 89 83 std Y+1, r24 ; 0x01 |
3c6: 89 81 ldd r24, Y+1 ; 0x01 |
3c8: 82 95 swap r24 |
3ca: 80 7f andi r24, 0xF0 ; 240 |
3cc: 89 83 std Y+1, r24 ; 0x01 |
3ce: 99 81 ldd r25, Y+1 ; 0x01 |
3d0: a4 54 subi r26, 0x44 ; 68 |
3d2: be 4f sbci r27, 0xFE ; 254 |
3d4: 8c 91 ld r24, X |
3d6: 8f 70 andi r24, 0x0F ; 15 |
3d8: 89 2b or r24, r25 |
3da: 89 83 std Y+1, r24 ; 0x01 |
3dc: 89 81 ldd r24, Y+1 ; 0x01 |
3de: c2 d3 rcall .+1924 ; 0xb64 <UartInt_txByte> |
3e0: 82 e0 ldi r24, 0x02 ; 2 |
3e2: 90 e0 ldi r25, 0x00 ; 0 |
3e4: c8 0e add r12, r24 |
3e6: d9 1e adc r13, r25 |
3e8: 0e 5f subi r16, 0xFE ; 254 |
3ea: 1f 4f sbci r17, 0xFF ; 255 |
3ec: e8 0e add r14, r24 |
3ee: f9 1e adc r15, r25 |
3f0: 00 3b cpi r16, 0xB0 ; 176 |
3f2: 11 05 cpc r17, r1 |
3f4: 61 f6 brne .-104 ; 0x38e <FrameMgr_processLine+0x6c> |
3f6: 8f e0 ldi r24, 0x0F ; 15 |
3f8: b5 d3 rcall .+1898 ; 0xb64 <UartInt_txByte> |
3fa: 80 91 75 00 lds r24, 0x0075 |
3fe: 8f 5f subi r24, 0xFF ; 255 |
400: 80 93 75 00 sts 0x0075, r24 |
404: 88 34 cpi r24, 0x48 ; 72 |
406: 60 f0 brcs .+24 ; 0x420 <FrameMgr_processLine+0xfe> |
408: 10 92 75 00 sts 0x0075, r1 |
40c: 10 92 74 00 sts 0x0074, r1 |
410: 89 b7 in r24, 0x39 ; 57 |
412: 8b 7f andi r24, 0xFB ; 251 |
414: 89 bf out 0x39, r24 ; 57 |
416: 60 e0 ldi r22, 0x00 ; 0 |
418: 81 e1 ldi r24, 0x11 ; 17 |
41a: e9 d4 rcall .+2514 ; 0xdee <CamConfig_setCamReg> |
41c: ed d4 rcall .+2522 ; 0xdf8 <CamConfig_sendFifoCmds> |
41e: c8 c0 rjmp .+400 ; 0x5b0 <__stack+0x151> |
420: 80 91 72 00 lds r24, 0x0072 |
424: 82 60 ori r24, 0x02 ; 2 |
426: 80 93 72 00 sts 0x0072, r24 |
42a: c2 c0 rjmp .+388 ; 0x5b0 <__stack+0x151> |
42c: 80 e2 ldi r24, 0x20 ; 32 |
42e: a9 de rcall .-686 ; 0x182 <Exec_writeEventFifo> |
430: 89 b7 in r24, 0x39 ; 57 |
432: 8b 7f andi r24, 0xFB ; 251 |
434: 89 bf out 0x39, r24 ; 57 |
436: 10 92 76 00 sts 0x0076, r1 |
43a: ba c0 rjmp .+372 ; 0x5b0 <__stack+0x151> |
43c: 81 30 cpi r24, 0x01 ; 1 |
43e: 09 f0 breq .+2 ; 0x442 <FrameMgr_processLine+0x120> |
440: b7 c0 rjmp .+366 ; 0x5b0 <__stack+0x151> |
442: f0 90 76 00 lds r15, 0x0076 |
446: cf 2c mov r12, r15 |
448: dd 24 eor r13, r13 |
44a: 36 01 movw r6, r12 |
44c: 08 94 sec |
44e: 61 08 sbc r6, r1 |
450: 71 08 sbc r7, r1 |
452: 70 91 73 00 lds r23, 0x0073 |
456: 0f 2e mov r0, r31 |
458: fc eb ldi r31, 0xBC ; 188 |
45a: 2f 2e mov r2, r31 |
45c: f1 e0 ldi r31, 0x01 ; 1 |
45e: 3f 2e mov r3, r31 |
460: f0 2d mov r31, r0 |
462: 50 e0 ldi r21, 0x00 ; 0 |
464: 40 e0 ldi r20, 0x00 ; 0 |
466: 61 e0 ldi r22, 0x01 ; 1 |
468: ef 2c mov r14, r15 |
46a: e3 94 inc r14 |
46c: f1 01 movw r30, r2 |
46e: 30 81 ld r19, Z |
470: 56 0f add r21, r22 |
472: 61 81 ldd r22, Z+1 ; 0x01 |
474: 82 e0 ldi r24, 0x02 ; 2 |
476: 90 e0 ldi r25, 0x00 ; 0 |
478: 28 0e add r2, r24 |
47a: 39 1e adc r3, r25 |
47c: 46 0f add r20, r22 |
47e: 33 23 and r19, r19 |
480: 09 f4 brne .+2 ; 0x484 <__stack+0x25> |
482: 5c c0 rjmp .+184 ; 0x53c <__stack+0xdd> |
484: 64 30 cpi r22, 0x04 ; 4 |
486: 08 f4 brcc .+2 ; 0x48a <__stack+0x2b> |
488: 59 c0 rjmp .+178 ; 0x53c <__stack+0xdd> |
48a: d8 01 movw r26, r16 |
48c: 20 e0 ldi r18, 0x00 ; 0 |
48e: 8c 91 ld r24, X |
490: 38 17 cp r19, r24 |
492: c9 f5 brne .+114 ; 0x506 <__stack+0xa7> |
494: fd 01 movw r30, r26 |
496: 87 81 ldd r24, Z+7 ; 0x07 |
498: 81 30 cpi r24, 0x01 ; 1 |
49a: a9 f5 brne .+106 ; 0x506 <__stack+0xa7> |
49c: 0f 2e mov r0, r31 |
49e: f6 e0 ldi r31, 0x06 ; 6 |
4a0: af 2e mov r10, r31 |
4a2: bb 24 eor r11, r11 |
4a4: f0 2d mov r31, r0 |
4a6: aa 0e add r10, r26 |
4a8: bb 1e adc r11, r27 |
4aa: 86 81 ldd r24, Z+6 ; 0x06 |
4ac: 99 27 eor r25, r25 |
4ae: 86 15 cp r24, r6 |
4b0: 97 05 cpc r25, r7 |
4b2: 49 f5 brne .+82 ; 0x506 <__stack+0xa7> |
4b4: 2d 01 movw r4, r26 |
4b6: 08 94 sec |
4b8: 41 1c adc r4, r1 |
4ba: 51 1c adc r5, r1 |
4bc: 81 81 ldd r24, Z+1 ; 0x01 |
4be: 88 24 eor r8, r8 |
4c0: 99 24 eor r9, r9 |
4c2: 68 94 set |
4c4: 81 f8 bld r8, 1 |
4c6: 8a 0e add r8, r26 |
4c8: 9b 1e adc r9, r27 |
4ca: 92 81 ldd r25, Z+2 ; 0x02 |
4cc: 58 17 cp r21, r24 |
4ce: 10 f0 brcs .+4 ; 0x4d4 <__stack+0x75> |
4d0: 95 17 cp r25, r21 |
4d2: 40 f4 brcc .+16 ; 0x4e4 <__stack+0x85> |
4d4: 48 17 cp r20, r24 |
4d6: 10 f0 brcs .+4 ; 0x4dc <__stack+0x7d> |
4d8: 94 17 cp r25, r20 |
4da: 20 f4 brcc .+8 ; 0x4e4 <__stack+0x85> |
4dc: 85 17 cp r24, r21 |
4de: 98 f0 brcs .+38 ; 0x506 <__stack+0xa7> |
4e0: 49 17 cp r20, r25 |
4e2: 88 f0 brcs .+34 ; 0x506 <__stack+0xa7> |
4e4: f2 01 movw r30, r4 |
4e6: 50 83 st Z, r21 |
4e8: f4 01 movw r30, r8 |
4ea: 40 83 st Z, r20 |
4ec: fd 01 movw r30, r26 |
4ee: 83 81 ldd r24, Z+3 ; 0x03 |
4f0: 58 17 cp r21, r24 |
4f2: 08 f4 brcc .+2 ; 0x4f6 <__stack+0x97> |
4f4: 53 83 std Z+3, r21 ; 0x03 |
4f6: fd 01 movw r30, r26 |
4f8: 85 81 ldd r24, Z+5 ; 0x05 |
4fa: 84 17 cp r24, r20 |
4fc: 08 f4 brcc .+2 ; 0x500 <__stack+0xa1> |
4fe: 45 83 std Z+5, r20 ; 0x05 |
500: f5 01 movw r30, r10 |
502: f0 82 st Z, r15 |
504: 1b c0 rjmp .+54 ; 0x53c <__stack+0xdd> |
506: 2f 5f subi r18, 0xFF ; 255 |
508: 28 30 cpi r18, 0x08 ; 8 |
50a: 09 f4 brne .+2 ; 0x50e <__stack+0xaf> |
50c: 4d c0 rjmp .+154 ; 0x5a8 <__stack+0x149> |
50e: 18 96 adiw r26, 0x08 ; 8 |
510: be cf rjmp .-132 ; 0x48e <__stack+0x2f> |
512: d8 01 movw r26, r16 |
514: 90 e0 ldi r25, 0x00 ; 0 |
516: fd 01 movw r30, r26 |
518: 87 81 ldd r24, Z+7 ; 0x07 |
51a: 88 23 and r24, r24 |
51c: 21 f0 breq .+8 ; 0x526 <__stack+0xc7> |
51e: 18 96 adiw r26, 0x08 ; 8 |
520: 9f 5f subi r25, 0xFF ; 255 |
522: 98 30 cpi r25, 0x08 ; 8 |
524: c1 f7 brne .-16 ; 0x516 <__stack+0xb7> |
526: 3c 93 st X, r19 |
528: fd 01 movw r30, r26 |
52a: 51 83 std Z+1, r21 ; 0x01 |
52c: 42 83 std Z+2, r20 ; 0x02 |
52e: 53 83 std Z+3, r21 ; 0x03 |
530: f4 82 std Z+4, r15 ; 0x04 |
532: 45 83 std Z+5, r20 ; 0x05 |
534: f6 82 std Z+6, r15 ; 0x06 |
536: 81 e0 ldi r24, 0x01 ; 1 |
538: 87 83 std Z+7, r24 ; 0x07 |
53a: 7f 5f subi r23, 0xFF ; 255 |
53c: 40 3b cpi r20, 0xB0 ; 176 |
53e: 08 f4 brcc .+2 ; 0x542 <__stack+0xe3> |
540: 95 cf rjmp .-214 ; 0x46c <__stack+0xd> |
542: 70 93 73 00 sts 0x0073, r23 |
546: c6 01 movw r24, r12 |
548: 87 70 andi r24, 0x07 ; 7 |
54a: 90 70 andi r25, 0x00 ; 0 |
54c: 07 97 sbiw r24, 0x07 ; 7 |
54e: 01 f5 brne .+64 ; 0x590 <__stack+0x131> |
550: d8 01 movw r26, r16 |
552: 17 96 adiw r26, 0x07 ; 7 |
554: 40 e0 ldi r20, 0x00 ; 0 |
556: 8c 91 ld r24, X |
558: 81 30 cpi r24, 0x01 ; 1 |
55a: a1 f4 brne .+40 ; 0x584 <__stack+0x125> |
55c: fd 01 movw r30, r26 |
55e: 31 97 sbiw r30, 0x01 ; 1 |
560: 90 81 ld r25, Z |
562: fd 01 movw r30, r26 |
564: 33 97 sbiw r30, 0x03 ; 3 |
566: 80 81 ld r24, Z |
568: 29 2f mov r18, r25 |
56a: 33 27 eor r19, r19 |
56c: f9 01 movw r30, r18 |
56e: e8 1b sub r30, r24 |
570: f1 09 sbc r31, r1 |
572: 33 97 sbiw r30, 0x03 ; 3 |
574: 3c f4 brge .+14 ; 0x584 <__stack+0x125> |
576: c6 01 movw r24, r12 |
578: 82 1b sub r24, r18 |
57a: 93 0b sbc r25, r19 |
57c: 03 97 sbiw r24, 0x03 ; 3 |
57e: 14 f0 brlt .+4 ; 0x584 <__stack+0x125> |
580: 1c 92 st X, r1 |
582: 71 50 subi r23, 0x01 ; 1 |
584: 4f 5f subi r20, 0xFF ; 255 |
586: 18 96 adiw r26, 0x08 ; 8 |
588: 48 30 cpi r20, 0x08 ; 8 |
58a: 29 f7 brne .-54 ; 0x556 <__stack+0xf7> |
58c: 70 93 73 00 sts 0x0073, r23 |
590: e0 92 76 00 sts 0x0076, r14 |
594: f0 e9 ldi r31, 0x90 ; 144 |
596: ef 16 cp r14, r31 |
598: 09 f4 brne .+2 ; 0x59c <__stack+0x13d> |
59a: 48 cf rjmp .-368 ; 0x42c <FrameMgr_processLine+0x10a> |
59c: 80 91 72 00 lds r24, 0x0072 |
5a0: 82 60 ori r24, 0x02 ; 2 |
5a2: 80 93 72 00 sts 0x0072, r24 |
5a6: 04 c0 rjmp .+8 ; 0x5b0 <__stack+0x151> |
5a8: 78 30 cpi r23, 0x08 ; 8 |
5aa: 08 f4 brcc .+2 ; 0x5ae <__stack+0x14f> |
5ac: b2 cf rjmp .-156 ; 0x512 <__stack+0xb3> |
5ae: c6 cf rjmp .-116 ; 0x53c <__stack+0xdd> |
5b0: 21 96 adiw r28, 0x01 ; 1 |
5b2: 0f b6 in r0, 0x3f ; 63 |
5b4: f8 94 cli |
5b6: de bf out 0x3e, r29 ; 62 |
5b8: 0f be out 0x3f, r0 ; 63 |
5ba: cd bf out 0x3d, r28 ; 61 |
5bc: df 91 pop r29 |
5be: cf 91 pop r28 |
5c0: 1f 91 pop r17 |
5c2: 0f 91 pop r16 |
5c4: ff 90 pop r15 |
5c6: ef 90 pop r14 |
5c8: df 90 pop r13 |
5ca: cf 90 pop r12 |
5cc: bf 90 pop r11 |
5ce: af 90 pop r10 |
5d0: 9f 90 pop r9 |
5d2: 8f 90 pop r8 |
5d4: 7f 90 pop r7 |
5d6: 6f 90 pop r6 |
5d8: 5f 90 pop r5 |
5da: 4f 90 pop r4 |
5dc: 3f 90 pop r3 |
5de: 2f 90 pop r2 |
5e0: 08 95 ret |
000005e2 <FrameMgr_init>: |
5e2: 80 e4 ldi r24, 0x40 ; 64 |
5e4: e8 e7 ldi r30, 0x78 ; 120 |
5e6: f0 e0 ldi r31, 0x00 ; 0 |
5e8: 11 92 st Z+, r1 |
5ea: 8a 95 dec r24 |
5ec: e9 f7 brne .-6 ; 0x5e8 <FrameMgr_init+0x6> |
5ee: 08 95 ret |
000005f0 <FrameMgr_acquireLine>: |
5f0: 80 91 74 00 lds r24, 0x0074 |
5f4: 82 30 cpi r24, 0x02 ; 2 |
5f6: 49 f5 brne .+82 ; 0x64a <FrameMgr_acquireLine+0x5a> |
5f8: 80 91 75 00 lds r24, 0x0075 |
5fc: 28 2f mov r18, r24 |
5fe: 22 0f add r18, r18 |
600: 80 eb ldi r24, 0xB0 ; 176 |
602: ec eb ldi r30, 0xBC ; 188 |
604: f1 e0 ldi r31, 0x01 ; 1 |
606: 98 2f mov r25, r24 |
608: 11 92 st Z+, r1 |
60a: 9a 95 dec r25 |
60c: e9 f7 brne .-6 ; 0x608 <FrameMgr_acquireLine+0x18> |
60e: ec e0 ldi r30, 0x0C ; 12 |
610: f1 e0 ldi r31, 0x01 ; 1 |
612: 11 92 st Z+, r1 |
614: 8a 95 dec r24 |
616: e9 f7 brne .-6 ; 0x612 <FrameMgr_acquireLine+0x22> |
618: 82 9b sbis 0x10, 2 ; 16 |
61a: fe cf rjmp .-4 ; 0x618 <FrameMgr_acquireLine+0x28> |
61c: 82 9b sbis 0x10, 2 ; 16 |
61e: 07 c0 rjmp .+14 ; 0x62e <FrameMgr_acquireLine+0x3e> |
620: fd cf rjmp .-6 ; 0x61c <FrameMgr_acquireLine+0x2c> |
622: 90 e0 ldi r25, 0x00 ; 0 |
624: 84 9b sbis 0x10, 4 ; 16 |
626: fe cf rjmp .-4 ; 0x624 <FrameMgr_acquireLine+0x34> |
628: 84 9b sbis 0x10, 4 ; 16 |
62a: 04 c0 rjmp .+8 ; 0x634 <FrameMgr_acquireLine+0x44> |
62c: fd cf rjmp .-6 ; 0x628 <FrameMgr_acquireLine+0x38> |
62e: 22 23 and r18, r18 |
630: c1 f7 brne .-16 ; 0x622 <FrameMgr_acquireLine+0x32> |
632: 05 c0 rjmp .+10 ; 0x63e <FrameMgr_acquireLine+0x4e> |
634: 91 50 subi r25, 0x01 ; 1 |
636: 82 2f mov r24, r18 |
638: 81 95 neg r24 |
63a: 98 17 cp r25, r24 |
63c: 99 f7 brne .-26 ; 0x624 <FrameMgr_acquireLine+0x34> |
63e: 6c e0 ldi r22, 0x0C ; 12 |
640: 71 e0 ldi r23, 0x01 ; 1 |
642: 8c eb ldi r24, 0xBC ; 188 |
644: 91 e0 ldi r25, 0x01 ; 1 |
646: c3 d4 rcall .+2438 ; 0xfce <CamIntAsm_acquireDumpLine> |
648: 08 95 ret |
64a: 81 30 cpi r24, 0x01 ; 1 |
64c: 39 f4 brne .+14 ; 0x65c <FrameMgr_acquireLine+0x6c> |
64e: 84 99 sbic 0x10, 4 ; 16 |
650: fe cf rjmp .-4 ; 0x64e <FrameMgr_acquireLine+0x5e> |
652: 60 e0 ldi r22, 0x00 ; 0 |
654: 73 e0 ldi r23, 0x03 ; 3 |
656: 8c eb ldi r24, 0xBC ; 188 |
658: 91 e0 ldi r25, 0x01 ; 1 |
65a: 72 d4 rcall .+2276 ; 0xf40 <CamIntAsm_acquireTrackingLine> |
65c: 08 95 ret |
0000065e <FrameMgr_acquireFrame>: |
65e: 80 91 74 00 lds r24, 0x0074 |
662: 81 30 cpi r24, 0x01 ; 1 |
664: a9 f4 brne .+42 ; 0x690 <FrameMgr_acquireFrame+0x32> |
666: 10 92 76 00 sts 0x0076, r1 |
66a: 80 91 73 00 lds r24, 0x0073 |
66e: 80 93 77 00 sts 0x0077, r24 |
672: 10 92 73 00 sts 0x0073, r1 |
676: 80 e4 ldi r24, 0x40 ; 64 |
678: e8 e7 ldi r30, 0x78 ; 120 |
67a: f0 e0 ldi r31, 0x00 ; 0 |
67c: 11 92 st Z+, r1 |
67e: 8a 95 dec r24 |
680: e9 f7 brne .-6 ; 0x67c <FrameMgr_acquireFrame+0x1e> |
682: 82 9b sbis 0x10, 2 ; 16 |
684: fe cf rjmp .-4 ; 0x682 <FrameMgr_acquireFrame+0x24> |
686: 60 e0 ldi r22, 0x00 ; 0 |
688: 73 e0 ldi r23, 0x03 ; 3 |
68a: 8c eb ldi r24, 0xBC ; 188 |
68c: 91 e0 ldi r25, 0x01 ; 1 |
68e: 58 d4 rcall .+2224 ; 0xf40 <CamIntAsm_acquireTrackingLine> |
690: 08 95 ret |
00000692 <FrameMgr_dispatchEvent>: |
692: 84 30 cpi r24, 0x04 ; 4 |
694: 19 f1 breq .+70 ; 0x6dc <FrameMgr_dispatchEvent+0x4a> |
696: 85 30 cpi r24, 0x05 ; 5 |
698: 28 f4 brcc .+10 ; 0x6a4 <FrameMgr_dispatchEvent+0x12> |
69a: 81 30 cpi r24, 0x01 ; 1 |
69c: 09 f1 breq .+66 ; 0x6e0 <FrameMgr_dispatchEvent+0x4e> |
69e: 82 30 cpi r24, 0x02 ; 2 |
6a0: 41 f5 brne .+80 ; 0x6f2 <FrameMgr_dispatchEvent+0x60> |
6a2: 07 c0 rjmp .+14 ; 0x6b2 <FrameMgr_dispatchEvent+0x20> |
6a4: 80 38 cpi r24, 0x80 ; 128 |
6a6: 99 f0 breq .+38 ; 0x6ce <FrameMgr_dispatchEvent+0x3c> |
6a8: 81 38 cpi r24, 0x81 ; 129 |
6aa: 09 f1 breq .+66 ; 0x6ee <FrameMgr_dispatchEvent+0x5c> |
6ac: 80 32 cpi r24, 0x20 ; 32 |
6ae: 09 f5 brne .+66 ; 0x6f2 <FrameMgr_dispatchEvent+0x60> |
6b0: 13 c0 rjmp .+38 ; 0x6d8 <FrameMgr_dispatchEvent+0x46> |
6b2: 61 e0 ldi r22, 0x01 ; 1 |
6b4: 81 e1 ldi r24, 0x11 ; 17 |
6b6: 9b d3 rcall .+1846 ; 0xdee <CamConfig_setCamReg> |
6b8: 9f d3 rcall .+1854 ; 0xdf8 <CamConfig_sendFifoCmds> |
6ba: 88 ee ldi r24, 0xE8 ; 232 |
6bc: 93 e0 ldi r25, 0x03 ; 3 |
6be: e7 d3 rcall .+1998 ; 0xe8e <Utility_delay> |
6c0: 10 92 75 00 sts 0x0075, r1 |
6c4: 82 e0 ldi r24, 0x02 ; 2 |
6c6: 80 93 74 00 sts 0x0074, r24 |
6ca: 92 df rcall .-220 ; 0x5f0 <FrameMgr_acquireLine> |
6cc: 08 95 ret |
6ce: 81 e0 ldi r24, 0x01 ; 1 |
6d0: 80 93 74 00 sts 0x0074, r24 |
6d4: c4 df rcall .-120 ; 0x65e <FrameMgr_acquireFrame> |
6d6: 08 95 ret |
6d8: cb dd rcall .-1130 ; 0x270 <FrameMgr_processFrame> |
6da: 08 95 ret |
6dc: c0 df rcall .-128 ; 0x65e <FrameMgr_acquireFrame> |
6de: 08 95 ret |
6e0: 80 91 74 00 lds r24, 0x0074 |
6e4: 88 23 and r24, r24 |
6e6: 29 f0 breq .+10 ; 0x6f2 <FrameMgr_dispatchEvent+0x60> |
6e8: 84 e0 ldi r24, 0x04 ; 4 |
6ea: 4b dd rcall .-1386 ; 0x182 <Exec_writeEventFifo> |
6ec: 08 95 ret |
6ee: 10 92 74 00 sts 0x0074, r1 |
6f2: 08 95 ret |
000006f4 <UIMgr_writeBufferToTxFifo>: |
6f4: dc 01 movw r26, r24 |
6f6: 86 2f mov r24, r22 |
6f8: 66 23 and r22, r22 |
6fa: c9 f0 breq .+50 ; 0x72e <UIMgr_writeBufferToTxFifo+0x3a> |
6fc: f8 94 cli |
6fe: 61 50 subi r22, 0x01 ; 1 |
700: 6f 3f cpi r22, 0xFF ; 255 |
702: a1 f0 breq .+40 ; 0x72c <UIMgr_writeBufferToTxFifo+0x38> |
704: 26 2f mov r18, r22 |
706: 44 e9 ldi r20, 0x94 ; 148 |
708: 52 e0 ldi r21, 0x02 ; 2 |
70a: 86 1b sub r24, r22 |
70c: 68 2f mov r22, r24 |
70e: 62 50 subi r22, 0x02 ; 2 |
710: 80 91 ba 00 lds r24, 0x00BA |
714: fa 01 movw r30, r20 |
716: e8 0f add r30, r24 |
718: f1 1d adc r31, r1 |
71a: 9d 91 ld r25, X+ |
71c: 90 83 st Z, r25 |
71e: 8f 5f subi r24, 0xFF ; 255 |
720: 8f 73 andi r24, 0x3F ; 63 |
722: 80 93 ba 00 sts 0x00BA, r24 |
726: 21 50 subi r18, 0x01 ; 1 |
728: 62 17 cp r22, r18 |
72a: 91 f7 brne .-28 ; 0x710 <UIMgr_writeBufferToTxFifo+0x1c> |
72c: 78 94 sei |
72e: 08 95 ret |
00000730 <UIMgr_readTxFifo>: |
730: f8 94 cli |
732: 90 91 bb 00 lds r25, 0x00BB |
736: e4 e9 ldi r30, 0x94 ; 148 |
738: f2 e0 ldi r31, 0x02 ; 2 |
73a: e9 0f add r30, r25 |
73c: f1 1d adc r31, r1 |
73e: 80 81 ld r24, Z |
740: 9f 5f subi r25, 0xFF ; 255 |
742: 9f 73 andi r25, 0x3F ; 63 |
744: 90 93 bb 00 sts 0x00BB, r25 |
748: 78 94 sei |
74a: 99 27 eor r25, r25 |
74c: 08 95 ret |
0000074e <UIMgr_writeTxFifo>: |
74e: f8 94 cli |
750: 90 91 ba 00 lds r25, 0x00BA |
754: e4 e9 ldi r30, 0x94 ; 148 |
756: f2 e0 ldi r31, 0x02 ; 2 |
758: e9 0f add r30, r25 |
75a: f1 1d adc r31, r1 |
75c: 80 83 st Z, r24 |
75e: 9f 5f subi r25, 0xFF ; 255 |
760: 9f 73 andi r25, 0x3F ; 63 |
762: 90 93 ba 00 sts 0x00BA, r25 |
766: 78 94 sei |
768: 08 95 ret |
0000076a <UIMgr_flushTxBuffer>: |
76a: 90 91 ba 00 lds r25, 0x00BA |
76e: 80 91 bb 00 lds r24, 0x00BB |
772: 98 17 cp r25, r24 |
774: 41 f0 breq .+16 ; 0x786 <UIMgr_flushTxBuffer+0x1c> |
776: dc df rcall .-72 ; 0x730 <UIMgr_readTxFifo> |
778: f5 d1 rcall .+1002 ; 0xb64 <UartInt_txByte> |
77a: 90 91 ba 00 lds r25, 0x00BA |
77e: 80 91 bb 00 lds r24, 0x00BB |
782: 98 17 cp r25, r24 |
784: c1 f7 brne .-16 ; 0x776 <UIMgr_flushTxBuffer+0xc> |
786: 08 95 ret |
00000788 <UIMgr_txBuffer>: |
788: 0f 93 push r16 |
78a: 1f 93 push r17 |
78c: cf 93 push r28 |
78e: df 93 push r29 |
790: ec 01 movw r28, r24 |
792: 86 2f mov r24, r22 |
794: 61 50 subi r22, 0x01 ; 1 |
796: 6f 3f cpi r22, 0xFF ; 255 |
798: 49 f0 breq .+18 ; 0x7ac <UIMgr_txBuffer+0x24> |
79a: 16 2f mov r17, r22 |
79c: 86 1b sub r24, r22 |
79e: 08 2f mov r16, r24 |
7a0: 02 50 subi r16, 0x02 ; 2 |
7a2: 89 91 ld r24, Y+ |
7a4: df d1 rcall .+958 ; 0xb64 <UartInt_txByte> |
7a6: 11 50 subi r17, 0x01 ; 1 |
7a8: 01 17 cp r16, r17 |
7aa: d9 f7 brne .-10 ; 0x7a2 <UIMgr_txBuffer+0x1a> |
7ac: df 91 pop r29 |
7ae: cf 91 pop r28 |
7b0: 1f 91 pop r17 |
7b2: 0f 91 pop r16 |
7b4: 08 95 ret |
000007b6 <UIMgr_transmitPendingData>: |
7b6: 90 91 ba 00 lds r25, 0x00BA |
7ba: 80 91 bb 00 lds r24, 0x00BB |
7be: 98 17 cp r25, r24 |
7c0: 11 f0 breq .+4 ; 0x7c6 <UIMgr_transmitPendingData+0x10> |
7c2: b6 df rcall .-148 ; 0x730 <UIMgr_readTxFifo> |
7c4: cf d1 rcall .+926 ; 0xb64 <UartInt_txByte> |
7c6: 08 95 ret |
000007c8 <UIMgr_convertTokenToCmd>: |
7c8: 90 91 bf 00 lds r25, 0x00BF |
7cc: 90 35 cpi r25, 0x50 ; 80 |
7ce: 41 f4 brne .+16 ; 0x7e0 <UIMgr_convertTokenToCmd+0x18> |
7d0: 80 91 c0 00 lds r24, 0x00C0 |
7d4: 87 34 cpi r24, 0x47 ; 71 |
7d6: 09 f5 brne .+66 ; 0x81a <UIMgr_convertTokenToCmd+0x52> |
7d8: 81 e0 ldi r24, 0x01 ; 1 |
7da: 80 93 62 00 sts 0x0062, r24 |
7de: 48 c0 rjmp .+144 ; 0x870 <UIMgr_convertTokenToCmd+0xa8> |
7e0: 97 34 cpi r25, 0x47 ; 71 |
7e2: 39 f4 brne .+14 ; 0x7f2 <UIMgr_convertTokenToCmd+0x2a> |
7e4: 80 91 c0 00 lds r24, 0x00C0 |
7e8: 86 35 cpi r24, 0x56 ; 86 |
7ea: 09 f5 brne .+66 ; 0x82e <UIMgr_convertTokenToCmd+0x66> |
7ec: 10 92 62 00 sts 0x0062, r1 |
7f0: 3f c0 rjmp .+126 ; 0x870 <UIMgr_convertTokenToCmd+0xa8> |
7f2: 94 34 cpi r25, 0x44 ; 68 |
7f4: 41 f4 brne .+16 ; 0x806 <UIMgr_convertTokenToCmd+0x3e> |
7f6: 80 91 c0 00 lds r24, 0x00C0 |
7fa: 86 34 cpi r24, 0x46 ; 70 |
7fc: 11 f5 brne .+68 ; 0x842 <UIMgr_convertTokenToCmd+0x7a> |
7fe: 83 e0 ldi r24, 0x03 ; 3 |
800: 80 93 62 00 sts 0x0062, r24 |
804: 35 c0 rjmp .+106 ; 0x870 <UIMgr_convertTokenToCmd+0xa8> |
806: 93 34 cpi r25, 0x43 ; 67 |
808: 41 f4 brne .+16 ; 0x81a <UIMgr_convertTokenToCmd+0x52> |
80a: 80 91 c0 00 lds r24, 0x00C0 |
80e: 82 35 cpi r24, 0x52 ; 82 |
810: 11 f5 brne .+68 ; 0x856 <UIMgr_convertTokenToCmd+0x8e> |
812: 82 e0 ldi r24, 0x02 ; 2 |
814: 80 93 62 00 sts 0x0062, r24 |
818: 2b c0 rjmp .+86 ; 0x870 <UIMgr_convertTokenToCmd+0xa8> |
81a: 95 34 cpi r25, 0x45 ; 69 |
81c: 41 f4 brne .+16 ; 0x82e <UIMgr_convertTokenToCmd+0x66> |
81e: 80 91 c0 00 lds r24, 0x00C0 |
822: 84 35 cpi r24, 0x54 ; 84 |
824: 11 f5 brne .+68 ; 0x86a <UIMgr_convertTokenToCmd+0xa2> |
826: 84 e0 ldi r24, 0x04 ; 4 |
828: 80 93 62 00 sts 0x0062, r24 |
82c: 21 c0 rjmp .+66 ; 0x870 <UIMgr_convertTokenToCmd+0xa8> |
82e: 93 35 cpi r25, 0x53 ; 83 |
830: 41 f4 brne .+16 ; 0x842 <UIMgr_convertTokenToCmd+0x7a> |
832: 80 91 c0 00 lds r24, 0x00C0 |
836: 8d 34 cpi r24, 0x4D ; 77 |
838: c1 f4 brne .+48 ; 0x86a <UIMgr_convertTokenToCmd+0xa2> |
83a: 86 e0 ldi r24, 0x06 ; 6 |
83c: 80 93 62 00 sts 0x0062, r24 |
840: 17 c0 rjmp .+46 ; 0x870 <UIMgr_convertTokenToCmd+0xa8> |
842: 94 34 cpi r25, 0x44 ; 68 |
844: 41 f4 brne .+16 ; 0x856 <UIMgr_convertTokenToCmd+0x8e> |
846: 80 91 c0 00 lds r24, 0x00C0 |
84a: 84 35 cpi r24, 0x54 ; 84 |
84c: 71 f4 brne .+28 ; 0x86a <UIMgr_convertTokenToCmd+0xa2> |
84e: 85 e0 ldi r24, 0x05 ; 5 |
850: 80 93 62 00 sts 0x0062, r24 |
854: 0d c0 rjmp .+26 ; 0x870 <UIMgr_convertTokenToCmd+0xa8> |
856: 92 35 cpi r25, 0x52 ; 82 |
858: 41 f4 brne .+16 ; 0x86a <UIMgr_convertTokenToCmd+0xa2> |
85a: 80 91 c0 00 lds r24, 0x00C0 |
85e: 83 35 cpi r24, 0x53 ; 83 |
860: 21 f4 brne .+8 ; 0x86a <UIMgr_convertTokenToCmd+0xa2> |
862: 87 e0 ldi r24, 0x07 ; 7 |
864: 80 93 62 00 sts 0x0062, r24 |
868: 03 c0 rjmp .+6 ; 0x870 <UIMgr_convertTokenToCmd+0xa8> |
86a: 89 e0 ldi r24, 0x09 ; 9 |
86c: 80 93 62 00 sts 0x0062, r24 |
870: 83 e0 ldi r24, 0x03 ; 3 |
872: ef eb ldi r30, 0xBF ; 191 |
874: f0 e0 ldi r31, 0x00 ; 0 |
876: 11 92 st Z+, r1 |
878: 8a 95 dec r24 |
87a: e9 f7 brne .-6 ; 0x876 <UIMgr_convertTokenToCmd+0xae> |
87c: 10 92 be 00 sts 0x00BE, r1 |
880: 10 92 bd 00 sts 0x00BD, r1 |
884: 08 95 ret |
00000886 <UIMgr_init>: |
886: 10 92 bf 00 sts 0x00BF, r1 |
88a: 10 92 c0 00 sts 0x00C0, r1 |
88e: 10 92 c1 00 sts 0x00C1, r1 |
892: 10 92 c2 00 sts 0x00C2, r1 |
896: 80 e4 ldi r24, 0x40 ; 64 |
898: e3 ec ldi r30, 0xC3 ; 195 |
89a: f0 e0 ldi r31, 0x00 ; 0 |
89c: 98 2f mov r25, r24 |
89e: 11 92 st Z+, r1 |
8a0: 9a 95 dec r25 |
8a2: e9 f7 brne .-6 ; 0x89e <UIMgr_init+0x18> |
8a4: e4 e9 ldi r30, 0x94 ; 148 |
8a6: f2 e0 ldi r31, 0x02 ; 2 |
8a8: 11 92 st Z+, r1 |
8aa: 8a 95 dec r24 |
8ac: e9 f7 brne .-6 ; 0x8a8 <UIMgr_init+0x22> |
8ae: 80 e2 ldi r24, 0x20 ; 32 |
8b0: e4 e7 ldi r30, 0x74 ; 116 |
8b2: f2 e0 ldi r31, 0x02 ; 2 |
8b4: 11 92 st Z+, r1 |
8b6: 8a 95 dec r24 |
8b8: e9 f7 brne .-6 ; 0x8b4 <UIMgr_init+0x2e> |
8ba: 08 95 ret |
000008bc <UIMgr_convertTokenToValue>: |
8bc: 8f eb ldi r24, 0xBF ; 191 |
8be: 90 e0 ldi r25, 0x00 ; 0 |
8c0: b0 d3 rcall .+1888 ; 0x1022 <atoi> |
8c2: 9c 01 movw r18, r24 |
8c4: 8f 3f cpi r24, 0xFF ; 255 |
8c6: 91 05 cpc r25, r1 |
8c8: 69 f0 breq .+26 ; 0x8e4 <UIMgr_convertTokenToValue+0x28> |
8ca: 60 f0 brcs .+24 ; 0x8e4 <UIMgr_convertTokenToValue+0x28> |
8cc: 89 e0 ldi r24, 0x09 ; 9 |
8ce: 80 93 62 00 sts 0x0062, r24 |
8d2: 80 91 bc 00 lds r24, 0x00BC |
8d6: e3 ec ldi r30, 0xC3 ; 195 |
8d8: f0 e0 ldi r31, 0x00 ; 0 |
8da: e8 0f add r30, r24 |
8dc: f1 1d adc r31, r1 |
8de: 8f ef ldi r24, 0xFF ; 255 |
8e0: 80 83 st Z, r24 |
8e2: 07 c0 rjmp .+14 ; 0x8f2 <UIMgr_convertTokenToValue+0x36> |
8e4: 80 91 bc 00 lds r24, 0x00BC |
8e8: e3 ec ldi r30, 0xC3 ; 195 |
8ea: f0 e0 ldi r31, 0x00 ; 0 |
8ec: e8 0f add r30, r24 |
8ee: f1 1d adc r31, r1 |
8f0: 20 83 st Z, r18 |
8f2: 83 e0 ldi r24, 0x03 ; 3 |
8f4: ef eb ldi r30, 0xBF ; 191 |
8f6: f0 e0 ldi r31, 0x00 ; 0 |
8f8: 11 92 st Z+, r1 |
8fa: 8a 95 dec r24 |
8fc: e9 f7 brne .-6 ; 0x8f8 <UIMgr_convertTokenToValue+0x3c> |
8fe: 10 92 be 00 sts 0x00BE, r1 |
902: 10 92 bd 00 sts 0x00BD, r1 |
906: 08 95 ret |
00000908 <UIMgr_processReceivedData>: |
908: ff 92 push r15 |
90a: 0f 93 push r16 |
90c: 1f 93 push r17 |
90e: cf 93 push r28 |
910: df 93 push r29 |
912: 0f 2e mov r0, r31 |
914: f9 e0 ldi r31, 0x09 ; 9 |
916: ff 2e mov r15, r31 |
918: f0 2d mov r31, r0 |
91a: ff c0 rjmp .+510 ; 0xb1a <UIMgr_processReceivedData+0x212> |
91c: f8 94 cli |
91e: e2 2f mov r30, r18 |
920: ff 27 eor r31, r31 |
922: ec 58 subi r30, 0x8C ; 140 |
924: fd 4f sbci r31, 0xFD ; 253 |
926: 90 81 ld r25, Z |
928: 82 2f mov r24, r18 |
92a: 8f 5f subi r24, 0xFF ; 255 |
92c: 8f 71 andi r24, 0x1F ; 31 |
92e: 80 93 b9 00 sts 0x00B9, r24 |
932: 78 94 sei |
934: 9d 30 cpi r25, 0x0D ; 13 |
936: 09 f0 breq .+2 ; 0x93a <UIMgr_processReceivedData+0x32> |
938: b1 c0 rjmp .+354 ; 0xa9c <UIMgr_processReceivedData+0x194> |
93a: 80 91 bc 00 lds r24, 0x00BC |
93e: 88 23 and r24, r24 |
940: 11 f4 brne .+4 ; 0x946 <UIMgr_processReceivedData+0x3e> |
942: 42 df rcall .-380 ; 0x7c8 <UIMgr_convertTokenToCmd> |
944: 06 c0 rjmp .+12 ; 0x952 <UIMgr_processReceivedData+0x4a> |
946: ba df rcall .-140 ; 0x8bc <UIMgr_convertTokenToValue> |
948: 80 91 bc 00 lds r24, 0x00BC |
94c: 8f 5f subi r24, 0xFF ; 255 |
94e: 80 93 bc 00 sts 0x00BC, r24 |
952: 84 e6 ldi r24, 0x64 ; 100 |
954: 90 e0 ldi r25, 0x00 ; 0 |
956: 9b d2 rcall .+1334 ; 0xe8e <Utility_delay> |
958: 80 91 62 00 lds r24, 0x0062 |
95c: 88 50 subi r24, 0x08 ; 8 |
95e: 82 30 cpi r24, 0x02 ; 2 |
960: 58 f4 brcc .+22 ; 0x978 <UIMgr_processReceivedData+0x70> |
962: 8e e4 ldi r24, 0x4E ; 78 |
964: f4 de rcall .-536 ; 0x74e <UIMgr_writeTxFifo> |
966: 83 e4 ldi r24, 0x43 ; 67 |
968: f2 de rcall .-540 ; 0x74e <UIMgr_writeTxFifo> |
96a: 8b e4 ldi r24, 0x4B ; 75 |
96c: f0 de rcall .-544 ; 0x74e <UIMgr_writeTxFifo> |
96e: 8d e0 ldi r24, 0x0D ; 13 |
970: ee de rcall .-548 ; 0x74e <UIMgr_writeTxFifo> |
972: 80 e9 ldi r24, 0x90 ; 144 |
974: 06 dc rcall .-2036 ; 0x182 <Exec_writeEventFifo> |
976: 89 c0 rjmp .+274 ; 0xa8a <UIMgr_processReceivedData+0x182> |
978: 81 e4 ldi r24, 0x41 ; 65 |
97a: e9 de rcall .-558 ; 0x74e <UIMgr_writeTxFifo> |
97c: 83 e4 ldi r24, 0x43 ; 67 |
97e: e7 de rcall .-562 ; 0x74e <UIMgr_writeTxFifo> |
980: 8b e4 ldi r24, 0x4B ; 75 |
982: e5 de rcall .-566 ; 0x74e <UIMgr_writeTxFifo> |
984: 8d e0 ldi r24, 0x0D ; 13 |
986: e3 de rcall .-570 ; 0x74e <UIMgr_writeTxFifo> |
988: 80 e9 ldi r24, 0x90 ; 144 |
98a: fb db rcall .-2058 ; 0x182 <Exec_writeEventFifo> |
98c: 80 91 62 00 lds r24, 0x0062 |
990: 81 30 cpi r24, 0x01 ; 1 |
992: 09 f4 brne .+2 ; 0x996 <UIMgr_processReceivedData+0x8e> |
994: 7a c0 rjmp .+244 ; 0xa8a <UIMgr_processReceivedData+0x182> |
996: 88 23 and r24, r24 |
998: 71 f4 brne .+28 ; 0x9b6 <UIMgr_processReceivedData+0xae> |
99a: 80 91 63 00 lds r24, 0x0063 |
99e: 88 23 and r24, r24 |
9a0: 09 f4 brne .+2 ; 0x9a4 <UIMgr_processReceivedData+0x9c> |
9a2: 73 c0 rjmp .+230 ; 0xa8a <UIMgr_processReceivedData+0x182> |
9a4: c3 e6 ldi r28, 0x63 ; 99 |
9a6: d0 e0 ldi r29, 0x00 ; 0 |
9a8: 21 96 adiw r28, 0x01 ; 1 |
9aa: d1 de rcall .-606 ; 0x74e <UIMgr_writeTxFifo> |
9ac: 88 81 ld r24, Y |
9ae: 88 23 and r24, r24 |
9b0: 09 f4 brne .+2 ; 0x9b4 <UIMgr_processReceivedData+0xac> |
9b2: 6b c0 rjmp .+214 ; 0xa8a <UIMgr_processReceivedData+0x182> |
9b4: f9 cf rjmp .-14 ; 0x9a8 <UIMgr_processReceivedData+0xa0> |
9b6: 87 30 cpi r24, 0x07 ; 7 |
9b8: 11 f4 brne .+4 ; 0x9be <UIMgr_processReceivedData+0xb6> |
9ba: a1 db rcall .-2238 ; 0xfe <CamInt_resetCam> |
9bc: 66 c0 rjmp .+204 ; 0xa8a <UIMgr_processReceivedData+0x182> |
9be: 83 30 cpi r24, 0x03 ; 3 |
9c0: 31 f4 brne .+12 ; 0x9ce <UIMgr_processReceivedData+0xc6> |
9c2: 84 e6 ldi r24, 0x64 ; 100 |
9c4: 90 e0 ldi r25, 0x00 ; 0 |
9c6: 63 d2 rcall .+1222 ; 0xe8e <Utility_delay> |
9c8: 82 e0 ldi r24, 0x02 ; 2 |
9ca: db db rcall .-2122 ; 0x182 <Exec_writeEventFifo> |
9cc: 5e c0 rjmp .+188 ; 0xa8a <UIMgr_processReceivedData+0x182> |
9ce: 82 30 cpi r24, 0x02 ; 2 |
9d0: 99 f4 brne .+38 ; 0x9f8 <UIMgr_processReceivedData+0xf0> |
9d2: 80 91 bc 00 lds r24, 0x00BC |
9d6: 82 30 cpi r24, 0x02 ; 2 |
9d8: 68 f0 brcs .+26 ; 0x9f4 <UIMgr_processReceivedData+0xec> |
9da: 11 e0 ldi r17, 0x01 ; 1 |
9dc: e1 2f mov r30, r17 |
9de: ff 27 eor r31, r31 |
9e0: ed 53 subi r30, 0x3D ; 61 |
9e2: ff 4f sbci r31, 0xFF ; 255 |
9e4: 61 81 ldd r22, Z+1 ; 0x01 |
9e6: 80 81 ld r24, Z |
9e8: 02 d2 rcall .+1028 ; 0xdee <CamConfig_setCamReg> |
9ea: 1e 5f subi r17, 0xFE ; 254 |
9ec: 80 91 bc 00 lds r24, 0x00BC |
9f0: 18 17 cp r17, r24 |
9f2: a0 f3 brcs .-24 ; 0x9dc <UIMgr_processReceivedData+0xd4> |
9f4: 01 d2 rcall .+1026 ; 0xdf8 <CamConfig_sendFifoCmds> |
9f6: 49 c0 rjmp .+146 ; 0xa8a <UIMgr_processReceivedData+0x182> |
9f8: 84 30 cpi r24, 0x04 ; 4 |
9fa: 31 f4 brne .+12 ; 0xa08 <UIMgr_processReceivedData+0x100> |
9fc: 84 e6 ldi r24, 0x64 ; 100 |
9fe: 90 e0 ldi r25, 0x00 ; 0 |
a00: 46 d2 rcall .+1164 ; 0xe8e <Utility_delay> |
a02: 80 e8 ldi r24, 0x80 ; 128 |
a04: be db rcall .-2180 ; 0x182 <Exec_writeEventFifo> |
a06: 41 c0 rjmp .+130 ; 0xa8a <UIMgr_processReceivedData+0x182> |
a08: 85 30 cpi r24, 0x05 ; 5 |
a0a: 19 f4 brne .+6 ; 0xa12 <UIMgr_processReceivedData+0x10a> |
a0c: 81 e8 ldi r24, 0x81 ; 129 |
a0e: b9 db rcall .-2190 ; 0x182 <Exec_writeEventFifo> |
a10: 3c c0 rjmp .+120 ; 0xa8a <UIMgr_processReceivedData+0x182> |
a12: 86 30 cpi r24, 0x06 ; 6 |
a14: 09 f0 breq .+2 ; 0xa18 <UIMgr_processReceivedData+0x110> |
a16: 39 c0 rjmp .+114 ; 0xa8a <UIMgr_processReceivedData+0x182> |
a18: 80 91 bc 00 lds r24, 0x00BC |
a1c: 88 23 and r24, r24 |
a1e: 09 f4 brne .+2 ; 0xa22 <UIMgr_processReceivedData+0x11a> |
a20: 34 c0 rjmp .+104 ; 0xa8a <UIMgr_processReceivedData+0x182> |
a22: 40 e0 ldi r20, 0x00 ; 0 |
a24: 03 ec ldi r16, 0xC3 ; 195 |
a26: 10 e0 ldi r17, 0x00 ; 0 |
a28: 60 e0 ldi r22, 0x00 ; 0 |
a2a: 73 e0 ldi r23, 0x03 ; 3 |
a2c: 84 2f mov r24, r20 |
a2e: 99 27 eor r25, r25 |
a30: 9c 01 movw r18, r24 |
a32: 2f 5f subi r18, 0xFF ; 255 |
a34: 3f 4f sbci r19, 0xFF ; 255 |
a36: f9 01 movw r30, r18 |
a38: e0 0f add r30, r16 |
a3a: f1 1f adc r31, r17 |
a3c: e0 81 ld r30, Z |
a3e: ec 01 movw r28, r24 |
a40: c6 0f add r28, r22 |
a42: d7 1f adc r29, r23 |
a44: e8 83 st Y, r30 |
uint8_t |
eeprom_read_byte (const uint8_t *addr) |
{ |
uint8_t result; |
asm volatile |
a46: d9 01 movw r26, r18 |
a48: 20 d3 rcall .+1600 ; 0x108a <__eeprom_read_byte_1C1D1E> |
a4a: 80 2d mov r24, r0 |
static unsigned char tokenBuffer[MAX_TOKEN_COUNT]; |
static UIMgr_Cmd_t receivedCmd = noCmd; |
static unsigned char AVRcamVersion[] = "AVRcam v1.4\r"; |
/* Local Function Declaration */ |
static unsigned char UIMgr_readRxFifo(void); |
static unsigned char UIMgr_readTxFifo(void); |
static unsigned char UIMgr_readRxFifo(void); |
static void UIMgr_sendNck(void); |
static void UIMgr_sendAck(void); |
static void UIMgr_convertTokenToCmd(void); |
static void UIMgr_convertTokenToValue(void); |
static void UIMgr_executeCmd(void); |
/* Extern Variables */ |
unsigned char UIMgr_rxFifo[UI_MGR_RX_FIFO_SIZE]; |
unsigned char UIMgr_rxFifoHead=0; |
unsigned char UIMgr_rxFifoTail=0; |
unsigned char UIMgr_txFifo[UI_MGR_TX_FIFO_SIZE]; |
unsigned char UIMgr_txFifoHead=0; |
unsigned char UIMgr_txFifoTail=0; |
/* Definitions */ |
#define IS_DATA_IN_TX_FIFO() (!(UIMgr_txFifoHead == UIMgr_txFifoTail)) |
#define IS_DATA_IN_RX_FIFO() (!(UIMgr_rxFifoHead == UIMgr_rxFifoTail)) |
/* MAX_EEPROM_WRITE_ATTEMPTS limits the number of writes that can be |
done to a particular EEPROM cell, so that it can't possible just |
write to the same cell over and over */ |
#define MAX_EEPROM_WRITE_ATTEMPTS 3 |
/*********************************************************** |
Function Name: UIMgr_init |
Function Description: This function is responsible for |
initializing the UIMgr module. It sets up the fifo |
used to hold incoming data, etc. |
Inputs: none |
Outputs: none |
***********************************************************/ |
void UIMgr_init(void) |
{ |
memset(asciiTokenBuffer,0x00,MAX_TOKEN_LENGTH+1); |
memset(tokenBuffer,0x00,MAX_TOKEN_COUNT); |
memset(UIMgr_txFifo,0x00,UI_MGR_TX_FIFO_SIZE); |
memset(UIMgr_rxFifo,0x00,UI_MGR_RX_FIFO_SIZE); |
} |
/*********************************************************** |
Function Name: UIMgr_dispatchEvent |
Function Description: This function is responsible for |
processing events that pertain to the UIMgr. |
Inputs: event - the generated event |
Outputs: none |
***********************************************************/ |
void UIMgr_dispatchEvent(unsigned char event) |
{ |
switch(event) |
{ |
case EV_ACQUIRE_LINE_COMPLETE: |
UIMgr_transmitPendingData(); |
break; |
case EV_SERIAL_DATA_RECEIVED: |
UIMgr_processReceivedData(); |
break; |
case EV_SERIAL_DATA_PENDING_TX: |
UIMgr_flushTxBuffer(); |
break; |
} |
} |
/*********************************************************** |
Function Name: UIMgr_transmitPendingData |
Function Description: This function is responsible for |
transmitting a single byte of data if data is waiting |
to be sent. Otherwise, if nothing is waiting, the |
function just returns. |
Inputs: none |
Outputs: none |
***********************************************************/ |
void UIMgr_transmitPendingData(void) |
{ |
if (IS_DATA_IN_TX_FIFO() == TRUE) |
{ |
/* data is waiting...send a single byte */ |
UartInt_txByte( UIMgr_readTxFifo() ); |
} |
} |
/*********************************************************** |
Function Name: UIMgr_processReceivedData |
Function Description: This function is responsible for |
parsing any serial data waiting in the rx fifo |
Inputs: none |
Outputs: none |
***********************************************************/ |
void UIMgr_processReceivedData(void) |
{ |
unsigned char tmpData = 0; |
/* still need to add a mechanism to handle token counts |
that are excessive!!! FIX ME!!! */ |
while(IS_DATA_IN_RX_FIFO() == TRUE) |
{ |
tmpData = UIMgr_readRxFifo(); |
if (tmpData == '\r') |
{ |
/* we have reached a token separator */ |
if (tokenCount == 0) |
{ |
/* convert the command */ |
UIMgr_convertTokenToCmd(); |
} |
else |
{ |
/* convert a value */ |
UIMgr_convertTokenToValue(); |
tokenCount++; |
} |
/* either way, it is time to try to process the received |
token list since we have reached the end of the cmd. */ |
Utility_delay(100); |
if (receivedCmd == invalidCmd || |
receivedCmd == noCmd ) |
{ |
UIMgr_sendNck(); |
PUBLISH_EVENT(EV_SERIAL_DATA_PENDING_TX); |
} |
else |
{ |
UIMgr_sendAck(); |
/* publish the serial data pending event, so it |
will push the ACK out before we execute the cmd */ |
PUBLISH_EVENT(EV_SERIAL_DATA_PENDING_TX); |
UIMgr_executeCmd(); |
} |
/* reset any necessary data */ |
tokenCount = 0; |
memset(tokenBuffer,0x00,MAX_TOKEN_COUNT); |
} |
else if (tmpData == ' ') /* space char */ |
{ |
/* the end of a token has been reached */ |
if (tokenCount == 0) |
{ |
UIMgr_convertTokenToCmd(); |
tokenCount++; /* check this...why is this being incremented here??? This |
means we have received a token, with tokenCount == 0, which means it is a |
command...why is this contributing to tokenCount? |
This might cause the set color map command to include too much data, since |
it sets the color map based on tokenCount...CHECK*/ |
} |
else |
{ |
/* check to see if this token is going to push |
us over the limit...if so, abort the transaction */ |
if (tokenCount+1 >= MAX_TOKEN_COUNT) |
{ |
/* we received too many tokens, and |
need to NCK this request, since its too |
large...reset everything...*/ |
charCount=0; |
charIndex=0; |
tokenCount=0; |
receivedCmd = invalidCmd; |
} |
else |
{ |
/* tokenCount is still in range...*/ |
UIMgr_convertTokenToValue(); |
tokenCount++; |
} |
} |
} |
else if ( (tmpData >= 'A' && tmpData <= 'Z') || |
(tmpData >= '0' && tmpData <= '9') ) |
{ |
/* a valid range of token was received */ |
asciiTokenBuffer[charIndex] = tmpData; |
charCount++; |
charIndex++; |
if (charCount > MAX_TOKEN_LENGTH) |
{ |
/* we have received a token that cannot be handled... |
set the received cmd to an invalid cmd, and wait |
for the \r to process it */ |
receivedCmd = invalidCmd; |
charIndex = 0; /* ...so we won't overwrite memory */ |
} |
} |
else |
{ |
/* an invalid character was received */ |
receivedCmd = invalidCmd; |
} |
} /* end while */ |
asm volatile("clt"::); /* clear out the T flag in case it wasn't |
cleared already */ |
} |
/*********************************************************** |
Function Name: UIMgr_executeCmd |
Function Description: This function is responsible for |
executing whatever cmd is stored in the receivedCmd |
object. |
Inputs: none |
Outputs: none |
***********************************************************/ |
static void UIMgr_executeCmd(void) |
{ |
unsigned char i,eepromData, num_writes=0; |
unsigned char *pData; |
unsigned char eeprom_write_succeeded = FALSE; |
#if DEBUG_COLOR_MAP |
unsigned char asciiBuffer[5]; |
#endif |
if (receivedCmd == pingCmd) |
{ |
} |
else if (receivedCmd == getVersionCmd) |
{ |
pData = AVRcamVersion; |
while(*pData != 0) |
{ |
UIMgr_writeTxFifo(*pData++); |
} |
} |
else if (receivedCmd == resetCameraCmd) |
{ |
CamInt_resetCam(); |
} |
else if (receivedCmd == dumpFrameCmd) |
{ |
/* publish the event that will indicate that |
a request has come to dump a frame...this will |
be received by the FrameMgr, which will begin |
dumping the frame...a short delay is needed |
here to keep the Java demo app happy (sometimes |
it wouldn't be able to receive the serial data |
as quickly as AVRcam can provide it). */ |
Utility_delay(100); |
PUBLISH_EVENT(EV_DUMP_FRAME); |
} |
else if (receivedCmd == setCameraRegsCmd) |
{ |
/* we need to gather the tokens and |
build config cmds to be sent to the camera */ |
for (i=1; i<tokenCount; i+=2) /* starts at 1 since first token |
is the CR cmd */ |
{ |
CamConfig_setCamReg(tokenBuffer[i],tokenBuffer[i+1]); |
} |
CamConfig_sendFifoCmds(); |
} |
else if (receivedCmd == enableTrackingCmd) |
{ |
/* publish the event...again with a short delay */ |
Utility_delay(100); |
PUBLISH_EVENT(EV_ENABLE_TRACKING); |
} |
else if (receivedCmd == disableTrackingCmd) |
{ |
PUBLISH_EVENT(EV_DISABLE_TRACKING); |
} |
else if (receivedCmd == setColorMapCmd) |
{ |
/* copy the received tokens into the color map */ |
for (i=0; i<tokenCount; i++) |
{ |
colorMap[i] = tokenBuffer[i+1]; |
/* write each colorMap byte to EEPROM, but only those |
that changed...this will help reduce wear on the EEPROM */ |
eepromData = eeprom_read_byte( (unsigned char*)(i+1)); |
if (eepromData != colorMap[i]) |
a4c: e8 17 cp r30, r24 |
a4e: c1 f0 breq .+48 ; 0xa80 <UIMgr_processReceivedData+0x178> |
void |
eeprom_write_byte (uint8_t *addr,uint8_t value) |
{ |
asm volatile ( |
a50: d9 01 movw r26, r18 |
a52: 0e 2e mov r0, r30 |
a54: 27 d3 rcall .+1614 ; 0x10a4 <__eeprom_write_byte_1C1D1E> |
a56: d9 01 movw r26, r18 |
a58: 18 d3 rcall .+1584 ; 0x108a <__eeprom_read_byte_1C1D1E> |
a5a: 80 2d mov r24, r0 |
{ |
/* need to actually perform the write because the |
data in eeprom is different than the current colorMap */ |
eeprom_write_succeeded = FALSE; |
while(eeprom_write_succeeded == FALSE && num_writes < MAX_EEPROM_WRITE_ATTEMPTS) |
{ |
eeprom_write_byte((unsigned char*)(i+1),colorMap[i]); |
num_writes++; |
eepromData = eeprom_read_byte( (unsigned char*)(i+1)); |
if (eepromData == colorMap[i]) |
a5c: 98 81 ld r25, Y |
a5e: 98 17 cp r25, r24 |
a60: 79 f0 breq .+30 ; 0xa80 <UIMgr_processReceivedData+0x178> |
void |
eeprom_write_byte (uint8_t *addr,uint8_t value) |
{ |
asm volatile ( |
a62: d9 01 movw r26, r18 |
a64: 09 2e mov r0, r25 |
a66: 1e d3 rcall .+1596 ; 0x10a4 <__eeprom_write_byte_1C1D1E> |
a68: d9 01 movw r26, r18 |
a6a: 0f d3 rcall .+1566 ; 0x108a <__eeprom_read_byte_1C1D1E> |
a6c: 80 2d mov r24, r0 |
a6e: 98 81 ld r25, Y |
a70: 98 17 cp r25, r24 |
a72: 31 f0 breq .+12 ; 0xa80 <UIMgr_processReceivedData+0x178> |
void |
eeprom_write_byte (uint8_t *addr,uint8_t value) |
{ |
asm volatile ( |
a74: d9 01 movw r26, r18 |
a76: 09 2e mov r0, r25 |
a78: 15 d3 rcall .+1578 ; 0x10a4 <__eeprom_write_byte_1C1D1E> |
a7a: d9 01 movw r26, r18 |
a7c: 06 d3 rcall .+1548 ; 0x108a <__eeprom_read_byte_1C1D1E> |
a7e: 80 2d mov r24, r0 |
a80: 4f 5f subi r20, 0xFF ; 255 |
a82: 80 91 bc 00 lds r24, 0x00BC |
a86: 48 17 cp r20, r24 |
a88: 88 f2 brcs .-94 ; 0xa2c <UIMgr_processReceivedData+0x124> |
a8a: 10 92 bc 00 sts 0x00BC, r1 |
a8e: 80 e4 ldi r24, 0x40 ; 64 |
a90: e3 ec ldi r30, 0xC3 ; 195 |
a92: f0 e0 ldi r31, 0x00 ; 0 |
a94: 11 92 st Z+, r1 |
a96: 8a 95 dec r24 |
a98: e9 f7 brne .-6 ; 0xa94 <UIMgr_processReceivedData+0x18c> |
a9a: 3f c0 rjmp .+126 ; 0xb1a <UIMgr_processReceivedData+0x212> |
a9c: 90 32 cpi r25, 0x20 ; 32 |
a9e: f1 f4 brne .+60 ; 0xadc <UIMgr_processReceivedData+0x1d4> |
aa0: 80 91 bc 00 lds r24, 0x00BC |
aa4: 88 23 and r24, r24 |
aa6: 39 f4 brne .+14 ; 0xab6 <UIMgr_processReceivedData+0x1ae> |
aa8: 8f de rcall .-738 ; 0x7c8 <UIMgr_convertTokenToCmd> |
aaa: 80 91 bc 00 lds r24, 0x00BC |
aae: 8f 5f subi r24, 0xFF ; 255 |
ab0: 80 93 bc 00 sts 0x00BC, r24 |
ab4: 32 c0 rjmp .+100 ; 0xb1a <UIMgr_processReceivedData+0x212> |
ab6: 99 27 eor r25, r25 |
ab8: cf 97 sbiw r24, 0x3f ; 63 |
aba: 4c f0 brlt .+18 ; 0xace <UIMgr_processReceivedData+0x1c6> |
abc: 10 92 bd 00 sts 0x00BD, r1 |
ac0: 10 92 be 00 sts 0x00BE, r1 |
ac4: 10 92 bc 00 sts 0x00BC, r1 |
ac8: f0 92 62 00 sts 0x0062, r15 |
acc: 26 c0 rjmp .+76 ; 0xb1a <UIMgr_processReceivedData+0x212> |
ace: f6 de rcall .-532 ; 0x8bc <UIMgr_convertTokenToValue> |
ad0: 80 91 bc 00 lds r24, 0x00BC |
ad4: 8f 5f subi r24, 0xFF ; 255 |
ad6: 80 93 bc 00 sts 0x00BC, r24 |
ada: 1f c0 rjmp .+62 ; 0xb1a <UIMgr_processReceivedData+0x212> |
adc: 89 2f mov r24, r25 |
ade: 81 54 subi r24, 0x41 ; 65 |
ae0: 8a 31 cpi r24, 0x1A ; 26 |
ae2: 18 f0 brcs .+6 ; 0xaea <UIMgr_processReceivedData+0x1e2> |
ae4: 8f 5e subi r24, 0xEF ; 239 |
ae6: 8a 30 cpi r24, 0x0A ; 10 |
ae8: b0 f4 brcc .+44 ; 0xb16 <UIMgr_processReceivedData+0x20e> |
aea: 80 91 be 00 lds r24, 0x00BE |
aee: e8 2f mov r30, r24 |
af0: ff 27 eor r31, r31 |
af2: e1 54 subi r30, 0x41 ; 65 |
af4: ff 4f sbci r31, 0xFF ; 255 |
af6: 90 83 st Z, r25 |
af8: 90 91 bd 00 lds r25, 0x00BD |
afc: 9f 5f subi r25, 0xFF ; 255 |
afe: 90 93 bd 00 sts 0x00BD, r25 |
b02: 8f 5f subi r24, 0xFF ; 255 |
b04: 80 93 be 00 sts 0x00BE, r24 |
b08: 94 30 cpi r25, 0x04 ; 4 |
b0a: 38 f0 brcs .+14 ; 0xb1a <UIMgr_processReceivedData+0x212> |
b0c: f0 92 62 00 sts 0x0062, r15 |
b10: 10 92 be 00 sts 0x00BE, r1 |
b14: 02 c0 rjmp .+4 ; 0xb1a <UIMgr_processReceivedData+0x212> |
b16: f0 92 62 00 sts 0x0062, r15 |
b1a: 20 91 b9 00 lds r18, 0x00B9 |
b1e: 80 91 b8 00 lds r24, 0x00B8 |
b22: 82 17 cp r24, r18 |
b24: 09 f0 breq .+2 ; 0xb28 <UIMgr_processReceivedData+0x220> |
b26: fa ce rjmp .-524 ; 0x91c <UIMgr_processReceivedData+0x14> |
b28: e8 94 clt |
b2a: df 91 pop r29 |
b2c: cf 91 pop r28 |
b2e: 1f 91 pop r17 |
b30: 0f 91 pop r16 |
b32: ff 90 pop r15 |
b34: 08 95 ret |
00000b36 <UIMgr_dispatchEvent>: |
b36: 80 31 cpi r24, 0x10 ; 16 |
b38: 29 f0 breq .+10 ; 0xb44 <UIMgr_dispatchEvent+0xe> |
b3a: 80 39 cpi r24, 0x90 ; 144 |
b3c: 39 f0 breq .+14 ; 0xb4c <UIMgr_dispatchEvent+0x16> |
b3e: 81 30 cpi r24, 0x01 ; 1 |
b40: 31 f4 brne .+12 ; 0xb4e <UIMgr_dispatchEvent+0x18> |
b42: 02 c0 rjmp .+4 ; 0xb48 <UIMgr_dispatchEvent+0x12> |
b44: 38 de rcall .-912 ; 0x7b6 <UIMgr_transmitPendingData> |
b46: 08 95 ret |
b48: df de rcall .-578 ; 0x908 <UIMgr_processReceivedData> |
b4a: 08 95 ret |
b4c: 0e de rcall .-996 ; 0x76a <UIMgr_flushTxBuffer> |
b4e: 08 95 ret |
00000b50 <UartInt_init>: |
b50: 10 bc out 0x20, r1 ; 32 |
b52: 82 e1 ldi r24, 0x12 ; 18 |
b54: 89 b9 out 0x09, r24 ; 9 |
b56: 88 e9 ldi r24, 0x98 ; 152 |
b58: 8a b9 out 0x0a, r24 ; 10 |
b5a: 86 e8 ldi r24, 0x86 ; 134 |
b5c: 80 bd out 0x20, r24 ; 32 |
b5e: 82 e0 ldi r24, 0x02 ; 2 |
b60: 8b b9 out 0x0b, r24 ; 11 |
b62: 08 95 ret |
00000b64 <UartInt_txByte>: |
b64: 5d 9b sbis 0x0b, 5 ; 11 |
b66: fe cf rjmp .-4 ; 0xb64 <UartInt_txByte> |
b68: 8c b9 out 0x0c, r24 ; 12 |
b6a: 08 95 ret |
00000b6c <__vector_11>: |
b6c: 1f 92 push r1 |
b6e: 0f 92 push r0 |
b70: 0f b6 in r0, 0x3f ; 63 |
b72: 0f 92 push r0 |
b74: 11 24 eor r1, r1 |
b76: 8f 93 push r24 |
b78: 9f 93 push r25 |
b7a: ef 93 push r30 |
b7c: ff 93 push r31 |
b7e: 80 91 b8 00 lds r24, 0x00B8 |
b82: 9c b1 in r25, 0x0c ; 12 |
b84: e4 e7 ldi r30, 0x74 ; 116 |
b86: f2 e0 ldi r31, 0x02 ; 2 |
b88: e8 0f add r30, r24 |
b8a: f1 1d adc r31, r1 |
b8c: 90 83 st Z, r25 |
b8e: 8f 5f subi r24, 0xFF ; 255 |
b90: 8f 71 andi r24, 0x1F ; 31 |
b92: 80 93 b8 00 sts 0x00B8, r24 |
b96: 80 91 70 00 lds r24, 0x0070 |
b9a: ec e6 ldi r30, 0x6C ; 108 |
b9c: f2 e0 ldi r31, 0x02 ; 2 |
b9e: e8 0f add r30, r24 |
ba0: f1 1d adc r31, r1 |
ba2: 91 e0 ldi r25, 0x01 ; 1 |
ba4: 90 83 st Z, r25 |
ba6: 8f 5f subi r24, 0xFF ; 255 |
ba8: 87 70 andi r24, 0x07 ; 7 |
baa: 80 93 70 00 sts 0x0070, r24 |
bae: ff 91 pop r31 |
bb0: ef 91 pop r30 |
bb2: 9f 91 pop r25 |
bb4: 8f 91 pop r24 |
bb6: 0f 90 pop r0 |
bb8: 0f be out 0x3f, r0 ; 63 |
bba: 0f 90 pop r0 |
bbc: 1f 90 pop r1 |
bbe: 18 95 reti |
00000bc0 <I2CInt_init>: |
bc0: 11 b8 out 0x01, r1 ; 1 |
bc2: 88 e4 ldi r24, 0x48 ; 72 |
bc4: 80 b9 out 0x00, r24 ; 0 |
bc6: 08 95 ret |
00000bc8 <I2CInt_writeData>: |
bc8: 98 2f mov r25, r24 |
bca: 80 91 08 01 lds r24, 0x0108 |
bce: 88 23 and r24, r24 |
bd0: e4 f3 brlt .-8 ; 0xbca <I2CInt_writeData+0x2> |
bd2: 06 b6 in r0, 0x36 ; 54 |
bd4: 04 fc sbrc r0, 4 |
bd6: fd cf rjmp .-6 ; 0xbd2 <I2CInt_writeData+0xa> |
bd8: 90 93 03 01 sts 0x0103, r25 |
bdc: 70 93 05 01 sts 0x0105, r23 |
be0: 60 93 04 01 sts 0x0104, r22 |
be4: 40 93 07 01 sts 0x0107, r20 |
be8: 10 92 06 01 sts 0x0106, r1 |
bec: 10 92 09 01 sts 0x0109, r1 |
bf0: 85 ea ldi r24, 0xA5 ; 165 |
bf2: 86 bf out 0x36, r24 ; 54 |
bf4: 80 91 08 01 lds r24, 0x0108 |
bf8: 80 68 ori r24, 0x80 ; 128 |
bfa: 80 93 08 01 sts 0x0108, r24 |
bfe: 08 95 ret |
00000c00 <I2CInt_readData>: |
c00: 98 2f mov r25, r24 |
c02: 80 91 08 01 lds r24, 0x0108 |
c06: 88 23 and r24, r24 |
c08: e4 f3 brlt .-8 ; 0xc02 <I2CInt_readData+0x2> |
c0a: 90 93 03 01 sts 0x0103, r25 |
c0e: 70 93 05 01 sts 0x0105, r23 |
c12: 60 93 04 01 sts 0x0104, r22 |
c16: 40 93 07 01 sts 0x0107, r20 |
c1a: 81 e0 ldi r24, 0x01 ; 1 |
c1c: 80 93 06 01 sts 0x0106, r24 |
c20: 10 92 09 01 sts 0x0109, r1 |
c24: 85 ea ldi r24, 0xA5 ; 165 |
c26: 86 bf out 0x36, r24 ; 54 |
c28: 80 91 08 01 lds r24, 0x0108 |
c2c: 80 68 ori r24, 0x80 ; 128 |
c2e: 80 93 08 01 sts 0x0108, r24 |
c32: 08 95 ret |
00000c34 <I2CInt_isI2cBusy>: |
c34: 80 91 08 01 lds r24, 0x0108 |
c38: 88 1f adc r24, r24 |
c3a: 88 27 eor r24, r24 |
c3c: 88 1f adc r24, r24 |
c3e: 99 27 eor r25, r25 |
c40: 08 95 ret |
00000c42 <__vector_17>: |
c42: 1f 92 push r1 |
c44: 0f 92 push r0 |
c46: 0f b6 in r0, 0x3f ; 63 |
c48: 0f 92 push r0 |
c4a: 11 24 eor r1, r1 |
c4c: 8f 93 push r24 |
c4e: 9f 93 push r25 |
c50: af 93 push r26 |
c52: bf 93 push r27 |
c54: ef 93 push r30 |
c56: ff 93 push r31 |
c58: 81 b1 in r24, 0x01 ; 1 |
c5a: 99 27 eor r25, r25 |
c5c: aa 27 eor r26, r26 |
c5e: bb 27 eor r27, r27 |
c60: 88 7f andi r24, 0xF8 ; 248 |
c62: 90 70 andi r25, 0x00 ; 0 |
c64: a0 70 andi r26, 0x00 ; 0 |
c66: b0 70 andi r27, 0x00 ; 0 |
c68: fc 01 movw r30, r24 |
c6a: 38 97 sbiw r30, 0x08 ; 8 |
c6c: e1 35 cpi r30, 0x51 ; 81 |
c6e: f1 05 cpc r31, r1 |
c70: 08 f0 brcs .+2 ; 0xc74 <__vector_17+0x32> |
c72: 9a c0 rjmp .+308 ; 0xda8 <__vector_17+0x166> |
c74: ed 5e subi r30, 0xED ; 237 |
c76: ff 4f sbci r31, 0xFF ; 255 |
c78: 09 94 ijmp |
c7a: 80 91 09 01 lds r24, 0x0109 |
c7e: 83 30 cpi r24, 0x03 ; 3 |
c80: 48 f0 brcs .+18 ; 0xc94 <__vector_17+0x52> |
c82: 86 b7 in r24, 0x36 ; 54 |
c84: 80 69 ori r24, 0x90 ; 144 |
c86: 86 bf out 0x36, r24 ; 54 |
c88: 80 91 08 01 lds r24, 0x0108 |
c8c: 8f 77 andi r24, 0x7F ; 127 |
c8e: 80 93 08 01 sts 0x0108, r24 |
c92: 8a c0 rjmp .+276 ; 0xda8 <__vector_17+0x166> |
c94: 80 91 03 01 lds r24, 0x0103 |
c98: 90 91 06 01 lds r25, 0x0106 |
c9c: 88 0f add r24, r24 |
c9e: 89 0f add r24, r25 |
ca0: 83 b9 out 0x03, r24 ; 3 |
ca2: 86 b7 in r24, 0x36 ; 54 |
ca4: 8f 7d andi r24, 0xDF ; 223 |
ca6: 86 bf out 0x36, r24 ; 54 |
ca8: 7f c0 rjmp .+254 ; 0xda8 <__vector_17+0x166> |
caa: 10 92 09 01 sts 0x0109, r1 |
cae: e0 91 04 01 lds r30, 0x0104 |
cb2: f0 91 05 01 lds r31, 0x0105 |
cb6: 80 81 ld r24, Z |
cb8: 83 b9 out 0x03, r24 ; 3 |
cba: 31 96 adiw r30, 0x01 ; 1 |
cbc: f0 93 05 01 sts 0x0105, r31 |
cc0: e0 93 04 01 sts 0x0104, r30 |
cc4: 86 b7 in r24, 0x36 ; 54 |
cc6: 80 68 ori r24, 0x80 ; 128 |
cc8: 86 bf out 0x36, r24 ; 54 |
cca: 6e c0 rjmp .+220 ; 0xda8 <__vector_17+0x166> |
ccc: 80 91 09 01 lds r24, 0x0109 |
cd0: 8f 5f subi r24, 0xFF ; 255 |
cd2: 80 93 09 01 sts 0x0109, r24 |
cd6: 86 b7 in r24, 0x36 ; 54 |
cd8: 80 6b ori r24, 0xB0 ; 176 |
cda: 86 bf out 0x36, r24 ; 54 |
cdc: 65 c0 rjmp .+202 ; 0xda8 <__vector_17+0x166> |
cde: 80 91 07 01 lds r24, 0x0107 |
ce2: 81 50 subi r24, 0x01 ; 1 |
ce4: 80 93 07 01 sts 0x0107, r24 |
ce8: 80 91 07 01 lds r24, 0x0107 |
cec: 88 23 and r24, r24 |
cee: 79 f0 breq .+30 ; 0xd0e <__vector_17+0xcc> |
cf0: e0 91 04 01 lds r30, 0x0104 |
cf4: f0 91 05 01 lds r31, 0x0105 |
cf8: 80 81 ld r24, Z |
cfa: 83 b9 out 0x03, r24 ; 3 |
cfc: 31 96 adiw r30, 0x01 ; 1 |
cfe: f0 93 05 01 sts 0x0105, r31 |
d02: e0 93 04 01 sts 0x0104, r30 |
d06: 86 b7 in r24, 0x36 ; 54 |
d08: 80 68 ori r24, 0x80 ; 128 |
d0a: 86 bf out 0x36, r24 ; 54 |
d0c: 4d c0 rjmp .+154 ; 0xda8 <__vector_17+0x166> |
d0e: 86 b7 in r24, 0x36 ; 54 |
d10: 80 69 ori r24, 0x90 ; 144 |
d12: 86 bf out 0x36, r24 ; 54 |
d14: 80 91 08 01 lds r24, 0x0108 |
d18: 8f 77 andi r24, 0x7F ; 127 |
d1a: 80 93 08 01 sts 0x0108, r24 |
d1e: 44 c0 rjmp .+136 ; 0xda8 <__vector_17+0x166> |
d20: 86 b7 in r24, 0x36 ; 54 |
d22: 80 69 ori r24, 0x90 ; 144 |
d24: 86 bf out 0x36, r24 ; 54 |
d26: 80 91 08 01 lds r24, 0x0108 |
d2a: 8f 77 andi r24, 0x7F ; 127 |
d2c: 80 93 08 01 sts 0x0108, r24 |
d30: 3b c0 rjmp .+118 ; 0xda8 <__vector_17+0x166> |
d32: 80 91 07 01 lds r24, 0x0107 |
d36: 81 50 subi r24, 0x01 ; 1 |
d38: 80 93 07 01 sts 0x0107, r24 |
d3c: 80 91 07 01 lds r24, 0x0107 |
d40: 88 23 and r24, r24 |
d42: 21 f0 breq .+8 ; 0xd4c <__vector_17+0x10a> |
d44: 86 b7 in r24, 0x36 ; 54 |
d46: 80 6c ori r24, 0xC0 ; 192 |
d48: 86 bf out 0x36, r24 ; 54 |
d4a: 2e c0 rjmp .+92 ; 0xda8 <__vector_17+0x166> |
d4c: 86 b7 in r24, 0x36 ; 54 |
d4e: 80 68 ori r24, 0x80 ; 128 |
d50: 86 bf out 0x36, r24 ; 54 |
d52: 2a c0 rjmp .+84 ; 0xda8 <__vector_17+0x166> |
d54: e0 91 04 01 lds r30, 0x0104 |
d58: f0 91 05 01 lds r31, 0x0105 |
d5c: 83 b1 in r24, 0x03 ; 3 |
d5e: 80 83 st Z, r24 |
d60: 31 96 adiw r30, 0x01 ; 1 |
d62: f0 93 05 01 sts 0x0105, r31 |
d66: e0 93 04 01 sts 0x0104, r30 |
d6a: 80 91 07 01 lds r24, 0x0107 |
d6e: 81 50 subi r24, 0x01 ; 1 |
d70: 80 93 07 01 sts 0x0107, r24 |
d74: 80 91 07 01 lds r24, 0x0107 |
d78: 88 23 and r24, r24 |
d7a: 21 f0 breq .+8 ; 0xd84 <__vector_17+0x142> |
d7c: 86 b7 in r24, 0x36 ; 54 |
d7e: 80 6c ori r24, 0xC0 ; 192 |
d80: 86 bf out 0x36, r24 ; 54 |
d82: 12 c0 rjmp .+36 ; 0xda8 <__vector_17+0x166> |
d84: 86 b7 in r24, 0x36 ; 54 |
d86: 8f 7b andi r24, 0xBF ; 191 |
d88: 86 bf out 0x36, r24 ; 54 |
d8a: 0e c0 rjmp .+28 ; 0xda8 <__vector_17+0x166> |
d8c: e0 91 04 01 lds r30, 0x0104 |
d90: f0 91 05 01 lds r31, 0x0105 |
d94: 83 b1 in r24, 0x03 ; 3 |
d96: 80 83 st Z, r24 |
d98: 86 b7 in r24, 0x36 ; 54 |
d9a: 80 69 ori r24, 0x90 ; 144 |
d9c: 86 bf out 0x36, r24 ; 54 |
d9e: 80 91 08 01 lds r24, 0x0108 |
da2: 8f 77 andi r24, 0x7F ; 127 |
da4: 80 93 08 01 sts 0x0108, r24 |
da8: ff 91 pop r31 |
daa: ef 91 pop r30 |
dac: bf 91 pop r27 |
dae: af 91 pop r26 |
db0: 9f 91 pop r25 |
db2: 8f 91 pop r24 |
db4: 0f 90 pop r0 |
db6: 0f be out 0x3f, r0 ; 63 |
db8: 0f 90 pop r0 |
dba: 1f 90 pop r1 |
dbc: 18 95 reti |
00000dbe <CamConfig_writeTxFifo>: |
dbe: 20 91 0a 01 lds r18, 0x010A |
dc2: e2 2f mov r30, r18 |
dc4: ff 27 eor r31, r31 |
dc6: ee 0f add r30, r30 |
dc8: ff 1f adc r31, r31 |
dca: ec 52 subi r30, 0x2C ; 44 |
dcc: fd 4f sbci r31, 0xFD ; 253 |
dce: 91 83 std Z+1, r25 ; 0x01 |
dd0: 80 83 st Z, r24 |
dd2: 2f 5f subi r18, 0xFF ; 255 |
dd4: 27 70 andi r18, 0x07 ; 7 |
dd6: 20 93 0a 01 sts 0x010A, r18 |
dda: 90 e0 ldi r25, 0x00 ; 0 |
ddc: 80 91 0b 01 lds r24, 0x010B |
de0: 28 17 cp r18, r24 |
de2: 09 f4 brne .+2 ; 0xde6 <CamConfig_writeTxFifo+0x28> |
de4: 91 e0 ldi r25, 0x01 ; 1 |
de6: 81 e0 ldi r24, 0x01 ; 1 |
de8: 89 27 eor r24, r25 |
dea: 99 27 eor r25, r25 |
dec: 08 95 ret |
00000dee <CamConfig_setCamReg>: |
dee: 28 2f mov r18, r24 |
df0: 36 2f mov r19, r22 |
df2: c9 01 movw r24, r18 |
df4: e4 df rcall .-56 ; 0xdbe <CamConfig_writeTxFifo> |
df6: 08 95 ret |
00000df8 <CamConfig_sendFifoCmds>: |
df8: 0f 93 push r16 |
dfa: 1f 93 push r17 |
dfc: cf 93 push r28 |
dfe: df 93 push r29 |
e00: cd b7 in r28, 0x3d ; 61 |
e02: de b7 in r29, 0x3e ; 62 |
e04: 22 97 sbiw r28, 0x02 ; 2 |
e06: 0f b6 in r0, 0x3f ; 63 |
e08: f8 94 cli |
e0a: de bf out 0x3e, r29 ; 62 |
e0c: 0f be out 0x3f, r0 ; 63 |
e0e: cd bf out 0x3d, r28 ; 61 |
e10: 8e 01 movw r16, r28 |
e12: 0f 5f subi r16, 0xFF ; 255 |
e14: 1f 4f sbci r17, 0xFF ; 255 |
e16: 19 c0 rjmp .+50 ; 0xe4a <CamConfig_sendFifoCmds+0x52> |
e18: e3 2f mov r30, r19 |
e1a: ff 27 eor r31, r31 |
e1c: ee 0f add r30, r30 |
e1e: ff 1f adc r31, r31 |
e20: ec 52 subi r30, 0x2C ; 44 |
e22: fd 4f sbci r31, 0xFD ; 253 |
e24: 91 81 ldd r25, Z+1 ; 0x01 |
e26: 20 81 ld r18, Z |
e28: 83 2f mov r24, r19 |
e2a: 8f 5f subi r24, 0xFF ; 255 |
e2c: 87 70 andi r24, 0x07 ; 7 |
e2e: 80 93 0b 01 sts 0x010B, r24 |
e32: 9a 83 std Y+2, r25 ; 0x02 |
e34: 29 83 std Y+1, r18 ; 0x01 |
e36: 42 e0 ldi r20, 0x02 ; 2 |
e38: b8 01 movw r22, r16 |
e3a: 80 e6 ldi r24, 0x60 ; 96 |
e3c: c5 de rcall .-630 ; 0xbc8 <I2CInt_writeData> |
e3e: 84 e6 ldi r24, 0x64 ; 100 |
e40: 90 e0 ldi r25, 0x00 ; 0 |
e42: 25 d0 rcall .+74 ; 0xe8e <Utility_delay> |
e44: f7 de rcall .-530 ; 0xc34 <I2CInt_isI2cBusy> |
e46: 81 30 cpi r24, 0x01 ; 1 |
e48: e9 f3 breq .-6 ; 0xe44 <CamConfig_sendFifoCmds+0x4c> |
e4a: 30 91 0b 01 lds r19, 0x010B |
e4e: 80 91 0a 01 lds r24, 0x010A |
e52: 83 17 cp r24, r19 |
e54: 09 f7 brne .-62 ; 0xe18 <CamConfig_sendFifoCmds+0x20> |
e56: 22 96 adiw r28, 0x02 ; 2 |
e58: 0f b6 in r0, 0x3f ; 63 |
e5a: f8 94 cli |
e5c: de bf out 0x3e, r29 ; 62 |
e5e: 0f be out 0x3f, r0 ; 63 |
e60: cd bf out 0x3d, r28 ; 61 |
e62: df 91 pop r29 |
e64: cf 91 pop r28 |
e66: 1f 91 pop r17 |
e68: 0f 91 pop r16 |
e6a: 08 95 ret |
00000e6c <CamConfig_init>: |
e6c: 60 e2 ldi r22, 0x20 ; 32 |
e6e: 84 e1 ldi r24, 0x14 ; 20 |
e70: be df rcall .-132 ; 0xdee <CamConfig_setCamReg> |
e72: 60 e4 ldi r22, 0x40 ; 64 |
e74: 89 e3 ldi r24, 0x39 ; 57 |
e76: bb df rcall .-138 ; 0xdee <CamConfig_setCamReg> |
e78: 68 e2 ldi r22, 0x28 ; 40 |
e7a: 82 e1 ldi r24, 0x12 ; 18 |
e7c: b8 df rcall .-144 ; 0xdee <CamConfig_setCamReg> |
e7e: 65 e0 ldi r22, 0x05 ; 5 |
e80: 88 e2 ldi r24, 0x28 ; 40 |
e82: b5 df rcall .-150 ; 0xdee <CamConfig_setCamReg> |
e84: 61 e0 ldi r22, 0x01 ; 1 |
e86: 83 e1 ldi r24, 0x13 ; 19 |
e88: b2 df rcall .-156 ; 0xdee <CamConfig_setCamReg> |
e8a: b6 df rcall .-148 ; 0xdf8 <CamConfig_sendFifoCmds> |
e8c: 08 95 ret |
00000e8e <Utility_delay>: |
e8e: cf 93 push r28 |
e90: df 93 push r29 |
e92: cd b7 in r28, 0x3d ; 61 |
e94: de b7 in r29, 0x3e ; 62 |
e96: 24 97 sbiw r28, 0x04 ; 4 |
e98: 0f b6 in r0, 0x3f ; 63 |
e9a: f8 94 cli |
e9c: de bf out 0x3e, r29 ; 62 |
e9e: 0f be out 0x3f, r0 ; 63 |
ea0: cd bf out 0x3d, r28 ; 61 |
ea2: 9c 01 movw r18, r24 |
ea4: 1a 82 std Y+2, r1 ; 0x02 |
ea6: 19 82 std Y+1, r1 ; 0x01 |
ea8: 1c 82 std Y+4, r1 ; 0x04 |
eaa: 1b 82 std Y+3, r1 ; 0x03 |
eac: 1a 82 std Y+2, r1 ; 0x02 |
eae: 19 82 std Y+1, r1 ; 0x01 |
eb0: 89 81 ldd r24, Y+1 ; 0x01 |
eb2: 9a 81 ldd r25, Y+2 ; 0x02 |
eb4: 82 17 cp r24, r18 |
eb6: 93 07 cpc r25, r19 |
eb8: e0 f4 brcc .+56 ; 0xef2 <Utility_delay+0x64> |
eba: 1c 82 std Y+4, r1 ; 0x04 |
ebc: 1b 82 std Y+3, r1 ; 0x03 |
ebe: 8b 81 ldd r24, Y+3 ; 0x03 |
ec0: 9c 81 ldd r25, Y+4 ; 0x04 |
ec2: 88 5e subi r24, 0xE8 ; 232 |
ec4: 93 40 sbci r25, 0x03 ; 3 |
ec6: 58 f4 brcc .+22 ; 0xede <Utility_delay+0x50> |
ec8: 00 00 nop |
eca: 8b 81 ldd r24, Y+3 ; 0x03 |
ecc: 9c 81 ldd r25, Y+4 ; 0x04 |
ece: 01 96 adiw r24, 0x01 ; 1 |
ed0: 9c 83 std Y+4, r25 ; 0x04 |
ed2: 8b 83 std Y+3, r24 ; 0x03 |
ed4: 8b 81 ldd r24, Y+3 ; 0x03 |
ed6: 9c 81 ldd r25, Y+4 ; 0x04 |
ed8: 88 5e subi r24, 0xE8 ; 232 |
eda: 93 40 sbci r25, 0x03 ; 3 |
edc: a8 f3 brcs .-22 ; 0xec8 <Utility_delay+0x3a> |
ede: 89 81 ldd r24, Y+1 ; 0x01 |
ee0: 9a 81 ldd r25, Y+2 ; 0x02 |
ee2: 01 96 adiw r24, 0x01 ; 1 |
ee4: 9a 83 std Y+2, r25 ; 0x02 |
ee6: 89 83 std Y+1, r24 ; 0x01 |
ee8: 89 81 ldd r24, Y+1 ; 0x01 |
eea: 9a 81 ldd r25, Y+2 ; 0x02 |
eec: 82 17 cp r24, r18 |
eee: 93 07 cpc r25, r19 |
ef0: 20 f3 brcs .-56 ; 0xeba <Utility_delay+0x2c> |
ef2: 24 96 adiw r28, 0x04 ; 4 |
ef4: 0f b6 in r0, 0x3f ; 63 |
ef6: f8 94 cli |
ef8: de bf out 0x3e, r29 ; 62 |
efa: 0f be out 0x3f, r0 ; 63 |
efc: cd bf out 0x3d, r28 ; 61 |
efe: df 91 pop r29 |
f00: cf 91 pop r28 |
f02: 08 95 ret |
00000f04 <DebugInt_init>: |
f04: 8e 9a sbi 0x11, 6 ; 17 |
f06: 96 9a sbi 0x12, 6 ; 18 |
f08: 84 ef ldi r24, 0xF4 ; 244 |
f0a: 91 e0 ldi r25, 0x01 ; 1 |
f0c: c0 df rcall .-128 ; 0xe8e <Utility_delay> |
f0e: 96 98 cbi 0x12, 6 ; 18 |
f10: 84 ef ldi r24, 0xF4 ; 244 |
f12: 91 e0 ldi r25, 0x01 ; 1 |
f14: bc df rcall .-136 ; 0xe8e <Utility_delay> |
f16: 96 9a sbi 0x12, 6 ; 18 |
f18: 84 ef ldi r24, 0xF4 ; 244 |
f1a: 91 e0 ldi r25, 0x01 ; 1 |
f1c: b8 df rcall .-144 ; 0xe8e <Utility_delay> |
f1e: 96 98 cbi 0x12, 6 ; 18 |
f20: 84 ef ldi r24, 0xF4 ; 244 |
f22: 91 e0 ldi r25, 0x01 ; 1 |
f24: b4 df rcall .-152 ; 0xe8e <Utility_delay> |
f26: 96 9a sbi 0x12, 6 ; 18 |
f28: 84 ef ldi r24, 0xF4 ; 244 |
f2a: 91 e0 ldi r25, 0x01 ; 1 |
f2c: b0 df rcall .-160 ; 0xe8e <Utility_delay> |
f2e: 96 98 cbi 0x12, 6 ; 18 |
f30: 84 ef ldi r24, 0xF4 ; 244 |
f32: 91 e0 ldi r25, 0x01 ; 1 |
f34: ac df rcall .-168 ; 0xe8e <Utility_delay> |
f36: 96 9a sbi 0x12, 6 ; 18 |
f38: 08 95 ret |
00000f3a <CamIntAsm_waitForNewTrackingFrame>: |
; set, and the function will return. |
;***************************************************************** |
CamIntAsm_waitForNewTrackingFrame: |
sbi _SFR_IO_ADDR(PORTD),PD6 ; For testing... |
f3a: 96 9a sbi 0x12, 6 ; 18 |
cbi _SFR_IO_ADDR(PORTD),PD6 |
f3c: 96 98 cbi 0x12, 6 ; 18 |
sleep |
f3e: 88 95 sleep |
00000f40 <CamIntAsm_acquireTrackingLine>: |
;***************************************************************** |
; REMEMBER...everything from here on out is critically timed to be |
; synchronized with the flow of pixel data from the camera... |
;***************************************************************** |
CamIntAsm_acquireTrackingLine: |
brts _cleanUp |
f40: e6 f1 brts .+120 ; 0xfba <_cleanUp> |
;sbi _SFR_IO_ADDR(PORTD),PD6 ; For testing... |
;cbi _SFR_IO_ADDR(PORTD),PD6 |
in tmp1,_SFR_IO_ADDR(TCCR1B) ; Enable the PCLK line to actually |
f42: 3e b5 in r19, 0x2e ; 46 |
ori tmp1, 0x07 ; feed Timer1 |
f44: 37 60 ori r19, 0x07 ; 7 |
out _SFR_IO_ADDR(TCCR1B),tmp1 |
f46: 3e bd out 0x2e, r19 ; 46 |
; The line is about to start... |
ldi pixelCount,0 ; Initialize the RLE stats... |
f48: 00 e0 ldi r16, 0x00 ; 0 |
ldi pixelRunStart,PIXEL_RUN_START_INITIAL ; Remember, we always calculate |
f4a: 10 e5 ldi r17, 0x50 ; 80 |
; the pixel run length as |
; TCNT1L - pixelRunStart |
ldi lastColor,0x00 ; clear out the last color before we start |
f4c: 20 e0 ldi r18, 0x00 ; 0 |
mov XH,currLineBuffHigh ; Load the pointer to the current line |
f4e: b9 2f mov r27, r25 |
mov XL,currLineBuffLow ; buffer into the X pointer regs |
f50: a8 2f mov r26, r24 |
mov ZH,colorMapHigh ; Load the pointers to the membership |
f52: f7 2f mov r31, r23 |
mov ZL,colorMapLow ; lookup tables (ZL and YL will be overwritten |
f54: e6 2f mov r30, r22 |
mov YH,colorMapHigh ; as soon as we start reading data) to Z and Y |
f56: d7 2f mov r29, r23 |
in tmp1, _SFR_IO_ADDR(TIMSK) ; enable TIMER1 to start counting |
f58: 39 b7 in r19, 0x39 ; 57 |
ori tmp1, ENABLE_PCLK_TIMER1_OVERFLOW_BITMASK ; external PCLK pulses and interrupt on |
f5a: 34 60 ori r19, 0x04 ; 4 |
out _SFR_IO_ADDR(TIMSK),tmp1 ; overflow |
f5c: 39 bf out 0x39, r19 ; 57 |
ldi tmp1,PIXEL_RUN_START_INITIAL ; set up the TCNT1 to overflow (and |
f5e: 30 e5 ldi r19, 0x50 ; 80 |
ldi tmp2,0xFF ; interrupts) after 176 pixels |
f60: 4f ef ldi r20, 0xFF ; 255 |
out _SFR_IO_ADDR(TCNT1H),tmp2 |
f62: 4d bd out 0x2d, r20 ; 45 |
out _SFR_IO_ADDR(TCNT1L),tmp1 |
f64: 3c bd out 0x2c, r19 ; 44 |
mov YL,colorMapLow |
f66: c6 2f mov r28, r22 |
in tmp1, _SFR_IO_ADDR(GICR) ; enable the HREF interrupt...remember, we |
f68: 3b b7 in r19, 0x3b ; 59 |
; only use this interrupt to synchronize |
; the beginning of the line |
ori tmp1, HREF_INTERRUPT_ENABLE_MASK |
f6a: 30 68 ori r19, 0x80 ; 128 |
out _SFR_IO_ADDR(GICR), tmp1 |
f6c: 3b bf out 0x3b, r19 ; 59 |
00000f6e <_trackFrame>: |
;******************************************************************************************* |
; Track Frame handler |
;******************************************************************************************* |
_trackFrame: |
sbi _SFR_IO_ADDR(PORTD),PD6 |
f6e: 96 9a sbi 0x12, 6 ; 18 |
sleep ; ...And we wait... |
f70: 88 95 sleep |
; Returning from the interrupt/sleep wakeup will consume |
; 14 clock cycles (7 to wakeup from idle sleep, 3 to vector, and 4 to return) |
; Disable the HREF interrupt |
cbi _SFR_IO_ADDR(PORTD),PD6 |
f72: 96 98 cbi 0x12, 6 ; 18 |
in tmp1, _SFR_IO_ADDR(GICR) |
f74: 3b b7 in r19, 0x3b ; 59 |
andi tmp1, HREF_INTERRUPT_DISABLE_MASK |
f76: 3f 77 andi r19, 0x7F ; 127 |
out _SFR_IO_ADDR(GICR), tmp1 |
f78: 3b bf out 0x3b, r19 ; 59 |
; A couple of NOPs are needed here to sync up the pixel data...the number (2) |
; of NOPs was determined emperically by trial and error. |
nop |
f7a: 00 00 nop |
... |
00000f7e <_acquirePixelBlock>: |
nop |
_acquirePixelBlock: ; Clock Cycle Count |
in ZL,RB_PORT ; sample the red value (PINB) (1) |
f7e: e6 b3 in r30, 0x16 ; 22 |
in YL,G_PORT ; sample the green value (PINC) (1) |
f80: c3 b3 in r28, 0x13 ; 19 |
andi YL,0x0F ; clear the high nibble (1) |
f82: cf 70 andi r28, 0x0F ; 15 |
ldd color,Z+RED_MEM_OFFSET ; lookup the red membership (2) |
f84: 30 81 ld r19, Z |
in ZL,RB_PORT ; sample the blue value (PINB) (1) |
f86: e6 b3 in r30, 0x16 ; 22 |
ldd greenData,Y+GREEN_MEM_OFFSET; lookup the green membership (2) |
f88: 48 89 ldd r20, Y+16 ; 0x10 |
ldd blueData,Z+BLUE_MEM_OFFSET ; lookup the blue membership (2) |
f8a: 50 a1 ldd r21, Z+32 ; 0x20 |
and color,greenData ; mask memberships together (1) |
f8c: 34 23 and r19, r20 |
and color,blueData ; to produce the final color (1) |
f8e: 35 23 and r19, r21 |
brts _cleanUpTrackingLine ; if some interrupt routine has (1...not set) |
f90: 76 f0 brts .+28 ; 0xfae <_cleanUpTrackingLine> |
; come in and set our T flag in |
; SREG, then we need to hop out |
; and blow away this frames data (common cleanup) |
cp color,lastColor ; check to see if the run continues (1) |
f92: 32 17 cp r19, r18 |
breq _acquirePixelBlock ; (2...equal) |
f94: a1 f3 breq .-24 ; 0xf7e <_acquirePixelBlock> |
; ___________ |
; 16 clock cycles |
; (16 clock cycles = 1 uS = 1 pixelBlock time) |
; Toggle the debug line to indicate a color change |
sbi _SFR_IO_ADDR(PORTD),PD6 |
f96: 96 9a sbi 0x12, 6 ; 18 |
nop |
f98: 00 00 nop |
cbi _SFR_IO_ADDR(PORTD),PD6 |
f9a: 96 98 cbi 0x12, 6 ; 18 |
mov tmp2,pixelRunStart ; get the count value of the |
f9c: 41 2f mov r20, r17 |
; current pixel run |
in pixelCount,_SFR_IO_ADDR(TCNT1L) ; get the current TCNT1 value |
f9e: 0c b5 in r16, 0x2c ; 44 |
mov pixelRunStart,pixelCount ; reload pixelRunStart for the |
fa0: 10 2f mov r17, r16 |
; next run |
sub pixelCount,tmp2 ; pixelCount = TCNT1L - pixelRunStart |
fa2: 04 1b sub r16, r20 |
st X+,lastColor ; record the color run in the current line buffer |
fa4: 2d 93 st X+, r18 |
st X+,pixelCount ; with its length |
fa6: 0d 93 st X+, r16 |
mov lastColor,color ; set lastColor so we can figure out when it changes |
fa8: 23 2f mov r18, r19 |
nop ; waste one more cycle for a total of 16 |
faa: 00 00 nop |
rjmp _acquirePixelBlock |
fac: e8 cf rjmp .-48 ; 0xf7e <_acquirePixelBlock> |
00000fae <_cleanUpTrackingLine>: |
; _cleanUpTrackingLine is used to write the last run length block off to the currentLineBuffer so |
; that all 176 pixels in the line are accounted for. |
_cleanUpTrackingLine: |
ldi pixelCount,0xFF ; the length of the last run is ALWAYS 0xFF minus the last |
fae: 0f ef ldi r16, 0xFF ; 255 |
sub pixelCount,pixelRunStart ; pixelRunStart |
fb0: 01 1b sub r16, r17 |
inc pixelCount ; increment pixelCount since we actually need to account |
fb2: 03 95 inc r16 |
; for the overflow of TCNT1 |
st X+,color ; record the color run in the current line buffer |
fb4: 3d 93 st X+, r19 |
st X,pixelCount |
fb6: 0c 93 st X, r16 |
rjmp _cleanUp |
fb8: 00 c0 rjmp .+0 ; 0xfba <_cleanUp> |
00000fba <_cleanUp>: |
_cleanUpDumpLine: |
; NOTE: If serial data is received, to interrupt the tracking of a line, we'll |
; get a EV_SERIAL_DATA_RECEIVED event, and the T bit set so we will end the |
; line's processing...however, the PCLK will keep on ticking for the rest of |
; the frame/line, which will cause the TCNT to eventually overflow and |
; interrupt us, generating a EV_ACQUIRE_LINE_COMPLETE event. We don't want |
; this, so we need to actually turn off the PCLK counting each time we exit |
; this loop, and only turn it on when we begin acquiring lines.... |
; NOT NEEDED FOR NOW... |
;in tmp1, _SFR_IO_ADDR(TIMSK) ; disable TIMER1 to stop counting |
;andi tmp1, DISABLE_PCLK_TIMER1_OVERFLOW_BITMASK ; external PCLK pulses |
;out _SFR_IO_ADDR(TIMSK),tmp1 |
_cleanUp: |
; Disable the external clocking of the Timer1 counter |
in tmp1, _SFR_IO_ADDR(TCCR1B) |
fba: 3e b5 in r19, 0x2e ; 46 |
andi tmp1, 0xF8 |
fbc: 38 7f andi r19, 0xF8 ; 248 |
out _SFR_IO_ADDR(TCCR1B),tmp1 |
fbe: 3e bd out 0x2e, r19 ; 46 |
; Toggle the debug line to indicate the line is complete |
sbi _SFR_IO_ADDR(PORTD),PD6 |
fc0: 96 9a sbi 0x12, 6 ; 18 |
cbi _SFR_IO_ADDR(PORTD),PD6 |
fc2: 96 98 cbi 0x12, 6 ; 18 |
clt ; clear out the T bit since we have detected |
fc4: e8 94 clt |
00000fc6 <_exit>: |
; the interruption and are exiting to handle it |
_exit: |
ret |
fc6: 08 95 ret |
00000fc8 <CamIntAsm_waitForNewDumpFrame>: |
;***************************************************************** |
; Function Name: CamIntAsm_waitForNewDumpFrame |
; Function Description: This function is responsible for |
; going to sleep until a new frame begins (indicated by |
; VSYNC transitioning from low to high. This will wake |
; the "VSYNC sleep" up and allow it to continue with |
; acquiring a line of pixel data to dump out to the UI. |
; Inputs: r25 - MSB of currentLineBuffer |
; r24 - LSB of currentLineBuffer |
; r23 - MSB of prevLineBuffer |
; r22 - LSB of prevLineBuffer |
; Outputs: none |
; NOTES: This function doesn't really return...it sorta just |
; floats into the acquireDumpLine function after the "VSYNC sleep" |
; is awoken. |
;***************************************************************** |
CamIntAsm_waitForNewDumpFrame: |
sbi _SFR_IO_ADDR(PORTD),PD6 ; For testing... |
fc8: 96 9a sbi 0x12, 6 ; 18 |
cbi _SFR_IO_ADDR(PORTD),PD6 |
fca: 96 98 cbi 0x12, 6 ; 18 |
sleep |
fcc: 88 95 sleep |
00000fce <CamIntAsm_acquireDumpLine>: |
;***************************************************************** |
; REMEMBER...everything from here on out is critically timed to be |
; synchronized with the flow of pixel data from the camera... |
;***************************************************************** |
CamIntAsm_acquireDumpLine: |
brts _cleanUp |
fce: ae f3 brts .-22 ; 0xfba <_cleanUp> |
;sbi _SFR_IO_ADDR(PORTD),PD6 ; For testing... |
;cbi _SFR_IO_ADDR(PORTD),PD6 |
mov XH,currLineBuffHigh ; Load the pointer to the current line |
fd0: b9 2f mov r27, r25 |
mov XL,currLineBuffLow ; buffer into the X pointer regs |
fd2: a8 2f mov r26, r24 |
mov YH,prevLineBuffHigh ; Load the pointer to the previous line |
fd4: d7 2f mov r29, r23 |
mov YL,prevLineBuffLow ; buffer into the Y pointer regs |
fd6: c6 2f mov r28, r22 |
ldi tmp1,PIXEL_RUN_START_INITIAL ; set up the TCNT1 to overflow (and |
fd8: 30 e5 ldi r19, 0x50 ; 80 |
ldi tmp2,0xFF ; interrupts) after 176 pixels |
fda: 4f ef ldi r20, 0xFF ; 255 |
out _SFR_IO_ADDR(TCNT1H),tmp2 |
fdc: 4d bd out 0x2d, r20 ; 45 |
out _SFR_IO_ADDR(TCNT1L),tmp1 |
fde: 3c bd out 0x2c, r19 ; 44 |
in tmp1, _SFR_IO_ADDR(TCCR1B) ; Enable the PCLK line to actually |
fe0: 3e b5 in r19, 0x2e ; 46 |
ori tmp1, 0x07 ; feed Timer1 |
fe2: 37 60 ori r19, 0x07 ; 7 |
out _SFR_IO_ADDR(TCCR1B),tmp1 |
fe4: 3e bd out 0x2e, r19 ; 46 |
nop |
fe6: 00 00 nop |
in tmp1, _SFR_IO_ADDR(TIMSK) ; enable TIMER1 to start counting |
fe8: 39 b7 in r19, 0x39 ; 57 |
ori tmp1, ENABLE_PCLK_TIMER1_OVERFLOW_BITMASK ; external PCLK pulses and interrupt on |
fea: 34 60 ori r19, 0x04 ; 4 |
out _SFR_IO_ADDR(TIMSK),tmp1 ; overflow |
fec: 39 bf out 0x39, r19 ; 57 |
in tmp1, _SFR_IO_ADDR(GICR) ; enable the HREF interrupt...remember, we |
fee: 3b b7 in r19, 0x3b ; 59 |
; only use this interrupt to synchronize |
; the beginning of the line |
ori tmp1, HREF_INTERRUPT_ENABLE_MASK |
ff0: 30 68 ori r19, 0x80 ; 128 |
out _SFR_IO_ADDR(GICR), tmp1 |
ff2: 3b bf out 0x3b, r19 ; 59 |
00000ff4 <_dumpFrame>: |
;******************************************************************************************* |
; Dump Frame handler |
;******************************************************************************************* |
_dumpFrame: |
sbi _SFR_IO_ADDR(PORTD),PD6 |
ff4: 96 9a sbi 0x12, 6 ; 18 |
sleep ; ...And we wait... |
ff6: 88 95 sleep |
cbi _SFR_IO_ADDR(PORTD),PD6 |
ff8: 96 98 cbi 0x12, 6 ; 18 |
in tmp1, _SFR_IO_ADDR(GICR) ; disable the HREF interrupt |
ffa: 3b b7 in r19, 0x3b ; 59 |
andi tmp1, HREF_INTERRUPT_DISABLE_MASK ; so we don't get interrupted |
ffc: 3f 77 andi r19, 0x7F ; 127 |
out _SFR_IO_ADDR(GICR), tmp1 ; while dumping the line |
ffe: 3b bf out 0x3b, r19 ; 59 |
... |
00001002 <_sampleDumpPixel>: |
nop ; Remember...if we ever remove the "cbi" instruction above, |
; we need to add two more NOPs to cover this |
; Ok...the following loop needs to run in 8 clock cycles, so we can get every |
; pixel in the line...this shouldn't be a problem, since the PCLK timing was |
; reduced by a factor of 2 whenever we go to dump a line (this is to give us |
; enough time to do the sampling and storing of the pixel data). In addition, |
; it is assumed that we will have to do some minor processing on the data right |
; before we send it out, like mask off the top 4-bits of each, and then pack both |
; low nibbles into a single byte for transmission...we just don't have time to |
; do that here (only 8 instruction cycles :-) ) |
_sampleDumpPixel: |
in tmp1,G_PORT ; sample the G value (1) |
1002: 33 b3 in r19, 0x13 ; 19 |
in tmp2,RB_PORT ; sample the R/B value (1) |
1004: 46 b3 in r20, 0x16 ; 22 |
st X+,tmp1 ; store to the currLineBuff and inc ptrs(2) |
1006: 3d 93 st X+, r19 |
st Y+,tmp2 ; store to the prevLineBuff and inc ptrs(2) |
1008: 49 93 st Y+, r20 |
brtc _sampleDumpPixel ; loop back unless flag is set (2...if not set) |
100a: de f7 brtc .-10 ; 0x1002 <_sampleDumpPixel> |
; ___________ |
; 8 cycles normally |
; if we make it here, it means the T flag is set, and we must have been interrupted |
; so we need to exit (what if we were interrupted for serial? should we disable it?) |
rjmp _cleanUpDumpLine |
100c: d6 cf rjmp .-84 ; 0xfba <_cleanUp> |
0000100e <__vector_1>: |
;*********************************************************** |
; Function Name: <interrupt handler for External Interrupt0> |
; Function Description: This function is responsible |
; for handling a rising edge on the Ext Interrupt 0. This |
; routine simply returns, since we just want to wake up |
; whenever the VSYNC transitions (meaning the start of a new |
; frame). |
; Inputs: none |
; Outputs: none |
;*********************************************************** |
SIG_INTERRUPT0: |
; This will wake us up when VSYNC transitions high...we just want to return |
reti |
100e: 18 95 reti |
00001010 <__vector_2>: |
;*********************************************************** |
; Function Name: <interrupt handler for External Interrupt1> |
; Function Description: This function is responsible |
; for handling a falling edge on the Ext Interrupt 1. This |
; routine simply returns, since we just want to wake up |
; whenever the HREF transitions (meaning the pixels |
; are starting after VSYNC transitioned, and we need to |
; start acquiring the pixel blocks |
; Inputs: none |
; Outputs: none |
;*********************************************************** |
SIG_INTERRUPT1: |
; This will wake us up when HREF transitions high...we just want to return |
reti |
1010: 18 95 reti |
00001012 <__vector_8>: |
;*********************************************************** |
; Function Name: <interrupt handler for Timer0 overflow> |
; Function Description: This function is responsible |
; for handling the Timer0 overflow (hooked up to indicate |
; when we have reached the number of HREFs required in a |
; single frame). We set the T flag in the SREG to |
; indicate to the _acquirePixelBlock routine that it needs |
; to exit, and then set the appropriate action to take in |
; the eventList of the Executive module. |
; Inputs: none |
; Outputs: none |
; Note: Originally, the HREF pulses were also going to |
; be counted by a hardware counter, but it didn't end up |
; being necessary |
;*********************************************************** |
;SIG_OVERFLOW0: |
; set ; set the T bit in SREG |
; lds tmp1,eventBitmask |
; ori tmp1,EV_ACQUIRE_FRAME_COMPLETE |
; sts eventBitmask,tmp1 |
; reti |
;*********************************************************** |
; Function Name: <interrupt handler for Timer1 overflow> |
; Function Description: This function is responsible |
; for handling the Timer1 overflow (hooked up to indicate |
; when we have reached the end of a line of pixel data, |
; since PCLK is hooked up to overflow TCNT1 after 176 |
; pixels). This routine generates an acquire line complete |
; event in the fastEventBitmask, which is streamlined for |
; efficiency reasons. |
;*********************************************************** |
SIG_OVERFLOW1: |
lds tmp1,fastEventBitmask ; set a flag indicating |
1012: 30 91 72 00 lds r19, 0x0072 |
ori tmp1,FEV_ACQUIRE_LINE_COMPLETE ; a line is complete |
1016: 31 60 ori r19, 0x01 ; 1 |
sts fastEventBitmask,tmp1 |
1018: 30 93 72 00 sts 0x0072, r19 |
set ; set the T bit in SREG |
101c: 68 94 set |
;sbi _SFR_IO_ADDR(PORTD),PD6 ; For testing... |
;cbi _SFR_IO_ADDR(PORTD),PD6 ; For testing... |
reti |
101e: 18 95 reti |
00001020 <__vector_default>: |
; This is the default handler for all interrupts that don't |
; have handler routines specified for them. |
.global __vector_default |
__vector_default: |
reti |
1020: 18 95 reti |
00001022 <atoi>: |
1022: fc 01 movw r30, r24 |
1024: 88 27 eor r24, r24 |
1026: 99 27 eor r25, r25 |
1028: e8 94 clt |
102a: 21 91 ld r18, Z+ |
102c: 22 23 and r18, r18 |
102e: e9 f0 breq .+58 ; 0x106a <atoi+0x48> |
1030: 20 32 cpi r18, 0x20 ; 32 |
1032: d9 f3 breq .-10 ; 0x102a <atoi+0x8> |
1034: 29 30 cpi r18, 0x09 ; 9 |
1036: c9 f3 breq .-14 ; 0x102a <atoi+0x8> |
1038: 2a 30 cpi r18, 0x0A ; 10 |
103a: b9 f3 breq .-18 ; 0x102a <atoi+0x8> |
103c: 2c 30 cpi r18, 0x0C ; 12 |
103e: a9 f3 breq .-22 ; 0x102a <atoi+0x8> |
1040: 2d 30 cpi r18, 0x0D ; 13 |
1042: 99 f3 breq .-26 ; 0x102a <atoi+0x8> |
1044: 26 37 cpi r18, 0x76 ; 118 |
1046: 89 f3 breq .-30 ; 0x102a <atoi+0x8> |
1048: 2b 32 cpi r18, 0x2B ; 43 |
104a: 19 f0 breq .+6 ; 0x1052 <atoi+0x30> |
104c: 2d 32 cpi r18, 0x2D ; 45 |
104e: 21 f4 brne .+8 ; 0x1058 <atoi+0x36> |
1050: 68 94 set |
1052: 21 91 ld r18, Z+ |
1054: 22 23 and r18, r18 |
1056: 49 f0 breq .+18 ; 0x106a <atoi+0x48> |
1058: 20 33 cpi r18, 0x30 ; 48 |
105a: 3c f0 brlt .+14 ; 0x106a <atoi+0x48> |
105c: 2a 33 cpi r18, 0x3A ; 58 |
105e: 2c f4 brge .+10 ; 0x106a <atoi+0x48> |
1060: 20 53 subi r18, 0x30 ; 48 |
1062: 0b d0 rcall .+22 ; 0x107a <__mulhi_const_10> |
1064: 82 0f add r24, r18 |
1066: 91 1d adc r25, r1 |
1068: f4 cf rjmp .-24 ; 0x1052 <atoi+0x30> |
106a: 81 15 cp r24, r1 |
106c: 91 05 cpc r25, r1 |
106e: 21 f0 breq .+8 ; 0x1078 <atoi+0x56> |
1070: 1e f4 brtc .+6 ; 0x1078 <atoi+0x56> |
1072: 80 95 com r24 |
1074: 90 95 com r25 |
1076: 01 96 adiw r24, 0x01 ; 1 |
1078: 08 95 ret |
0000107a <__mulhi_const_10>: |
107a: 7a e0 ldi r23, 0x0A ; 10 |
107c: 97 9f mul r25, r23 |
107e: 90 2d mov r25, r0 |
1080: 87 9f mul r24, r23 |
1082: 80 2d mov r24, r0 |
1084: 91 0d add r25, r1 |
1086: 11 24 eor r1, r1 |
1088: 08 95 ret |
0000108a <__eeprom_read_byte_1C1D1E>: |
108a: e1 99 sbic 0x1c, 1 ; 28 |
108c: fe cf rjmp .-4 ; 0x108a <__eeprom_read_byte_1C1D1E> |
108e: bf bb out 0x1f, r27 ; 31 |
1090: ae bb out 0x1e, r26 ; 30 |
1092: e0 9a sbi 0x1c, 0 ; 28 |
1094: 11 96 adiw r26, 0x01 ; 1 |
1096: 0d b2 in r0, 0x1d ; 29 |
1098: 08 95 ret |
0000109a <__eeprom_read_block_1C1D1E>: |
109a: f7 df rcall .-18 ; 0x108a <__eeprom_read_byte_1C1D1E> |
109c: 01 92 st Z+, r0 |
109e: 1a 94 dec r1 |
10a0: e1 f7 brne .-8 ; 0x109a <__eeprom_read_block_1C1D1E> |
10a2: 08 95 ret |
000010a4 <__eeprom_write_byte_1C1D1E>: |
10a4: e1 99 sbic 0x1c, 1 ; 28 |
10a6: fe cf rjmp .-4 ; 0x10a4 <__eeprom_write_byte_1C1D1E> |
10a8: bf bb out 0x1f, r27 ; 31 |
10aa: ae bb out 0x1e, r26 ; 30 |
10ac: 0d ba out 0x1d, r0 ; 29 |
10ae: 11 96 adiw r26, 0x01 ; 1 |
10b0: 0f b6 in r0, 0x3f ; 63 |
10b2: f8 94 cli |
10b4: e2 9a sbi 0x1c, 2 ; 28 |
10b6: e1 9a sbi 0x1c, 1 ; 28 |
10b8: 0f be out 0x3f, r0 ; 63 |
10ba: 08 95 ret |
000010bc <_exit>: |
10bc: ff cf rjmp .-2 ; 0x10bc <_exit> |
/programy/C/avr/AVRcam/AVRcam.map |
---|
0,0 → 1,593 |
Archive member included because of file (symbol) |
/usr/lib/gcc/avr/4.1.0/avr4/libgcc.a(_exit.o) |
Main.o (exit) |
/usr/lib/gcc/avr/4.1.0/avr4/libgcc.a(_copy_data.o) |
CamInterface.o (__do_copy_data) |
/usr/lib/gcc/avr/4.1.0/avr4/libgcc.a(_clear_bss.o) |
CamInterface.o (__do_clear_bss) |
/usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/libc.a(atoi.o) |
UIMgr.o (atoi) |
/usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/libc.a(mul10.o) |
/usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/libc.a(atoi.o) (__mulhi_const_10) |
/usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/libc.a(ee_rb.1C1D1E.o) |
UIMgr.o (__eeprom_read_byte_1C1D1E) |
/usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/libc.a(ee_rblk.1C1D1E.o) |
CamInterface.o (__eeprom_read_block_1C1D1E) |
/usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/libc.a(ee_wb.1C1D1E.o) |
UIMgr.o (__eeprom_write_byte_1C1D1E) |
Allocating common symbols |
Common symbol size file |
previousLineBuffer 0xb0 CamInterface.o |
UIMgr_rxFifo 0x20 UIMgr.o |
currentLineBuffer 0xb0 CamInterface.o |
Exec_eventFifo 0x8 Executive.o |
CamConfig_txFifo 0x10 CamConfig.o |
UIMgr_txFifo 0x40 UIMgr.o |
Memory Configuration |
Name Origin Length Attributes |
text 0x00000000 0x00002000 xr |
data 0x00800060 0x0000ffa0 rw !x |
eeprom 0x00810000 0x00010000 rw !x |
*default* 0x00000000 0xffffffff |
Linker script and memory map |
LOAD /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
LOAD CamInterface.o |
LOAD Main.o |
LOAD Executive.o |
LOAD FrameMgr.o |
LOAD UIMgr.o |
LOAD UartInterface.o |
LOAD I2CInterface.o |
LOAD CamConfig.o |
LOAD Utility.o |
LOAD DebugInterface.o |
LOAD CamInterfaceAsm.o |
Address of section .noinit set to 0x800300 |
LOAD /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/libm.a |
LOAD /usr/lib/gcc/avr/4.1.0/avr4/libgcc.a |
LOAD /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/libc.a |
LOAD /usr/lib/gcc/avr/4.1.0/avr4/libgcc.a |
.hash |
*(.hash) |
.dynsym |
*(.dynsym) |
.dynstr |
*(.dynstr) |
.gnu.version |
*(.gnu.version) |
.gnu.version_d |
*(.gnu.version_d) |
.gnu.version_r |
*(.gnu.version_r) |
.rel.init |
*(.rel.init) |
.rela.init |
*(.rela.init) |
.rel.text |
*(.rel.text) |
*(.rel.text.*) |
*(.rel.gnu.linkonce.t*) |
.rela.text |
*(.rela.text) |
*(.rela.text.*) |
*(.rela.gnu.linkonce.t*) |
.rel.fini |
*(.rel.fini) |
.rela.fini |
*(.rela.fini) |
.rel.rodata |
*(.rel.rodata) |
*(.rel.rodata.*) |
*(.rel.gnu.linkonce.r*) |
.rela.rodata |
*(.rela.rodata) |
*(.rela.rodata.*) |
*(.rela.gnu.linkonce.r*) |
.rel.data |
*(.rel.data) |
*(.rel.data.*) |
*(.rel.gnu.linkonce.d*) |
.rela.data |
*(.rela.data) |
*(.rela.data.*) |
*(.rela.gnu.linkonce.d*) |
.rel.ctors |
*(.rel.ctors) |
.rela.ctors |
*(.rela.ctors) |
.rel.dtors |
*(.rel.dtors) |
.rela.dtors |
*(.rela.dtors) |
.rel.got |
*(.rel.got) |
.rela.got |
*(.rela.got) |
.rel.bss |
*(.rel.bss) |
.rela.bss |
*(.rela.bss) |
.rel.plt |
*(.rel.plt) |
.rela.plt |
*(.rela.plt) |
.text 0x00000000 0x10be |
*(.vectors) |
.vectors 0x00000000 0x26 /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
0x00000000 __vectors |
0x00000026 __ctors_start = . |
*(.ctors) |
0x00000026 __ctors_end = . |
0x00000026 __dtors_start = . |
*(.dtors) |
0x00000026 __dtors_end = . |
*(.progmem.gcc*) |
.progmem.gcc_sw_table |
0x00000026 0xa2 I2CInterface.o |
*(.progmem*) |
0x000000c8 . = ALIGN (0x2) |
*(.init0) |
*(.init1) |
*(.init2) |
.init2 0x000000c8 0xc /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
*(.init3) |
*(.init4) |
.init4 0x000000d4 0x16 /usr/lib/gcc/avr/4.1.0/avr4/libgcc.a(_copy_data.o) |
0x000000d4 __do_copy_data |
.init4 0x000000ea 0x10 /usr/lib/gcc/avr/4.1.0/avr4/libgcc.a(_clear_bss.o) |
0x000000ea __do_clear_bss |
*(.init5) |
*(.init6) |
*(.init7) |
*(.init8) |
*(.init9) |
.init9 0x000000fa 0x2 /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
*(.text) |
.text 0x000000fc 0x2 /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
0x000000fc __vector_12 |
0x000000fc __bad_interrupt |
0x000000fc __vector_6 |
0x000000fc __vector_3 |
0x000000fc __vector_13 |
0x000000fc __vector_7 |
0x000000fc __vector_5 |
0x000000fc __vector_4 |
0x000000fc __vector_9 |
0x000000fc __vector_15 |
0x000000fc __vector_14 |
0x000000fc __vector_10 |
0x000000fc __vector_16 |
0x000000fc __vector_18 |
.text 0x000000fe 0x5e CamInterface.o |
0x00000100 CamInt_init |
0x000000fe CamInt_resetCam |
.text 0x0000015c 0x26 Main.o |
0x0000015c main |
.text 0x00000182 0xee Executive.o |
0x00000182 Exec_writeEventFifo |
0x0000019e Exec_run |
.text 0x00000270 0x484 FrameMgr.o |
0x0000065e FrameMgr_acquireFrame |
0x000005f0 FrameMgr_acquireLine |
0x00000692 FrameMgr_dispatchEvent |
0x00000270 FrameMgr_processFrame |
0x000005e2 FrameMgr_init |
0x00000322 FrameMgr_processLine |
.text 0x000006f4 0x45c UIMgr.o |
0x0000076a UIMgr_flushTxBuffer |
0x0000074e UIMgr_writeTxFifo |
0x00000908 UIMgr_processReceivedData |
0x00000886 UIMgr_init |
0x000006f4 UIMgr_writeBufferToTxFifo |
0x00000788 UIMgr_txBuffer |
0x000007b6 UIMgr_transmitPendingData |
0x00000b36 UIMgr_dispatchEvent |
.text 0x00000b50 0x70 UartInterface.o |
0x00000b50 UartInt_init |
0x00000b6c __vector_11 |
0x00000b64 UartInt_txByte |
.text 0x00000bc0 0x1fe I2CInterface.o |
0x00000c34 I2CInt_isI2cBusy |
0x00000c00 I2CInt_readData |
0x00000c42 __vector_17 |
0x00000bc0 I2CInt_init |
0x00000bc8 I2CInt_writeData |
.text 0x00000dbe 0xd0 CamConfig.o |
0x00000e6c CamConfig_init |
0x00000dbe CamConfig_writeTxFifo |
0x00000df8 CamConfig_sendFifoCmds |
0x00000dee CamConfig_setCamReg |
.text 0x00000e8e 0x76 Utility.o |
0x00000e8e Utility_delay |
.text 0x00000f04 0x36 DebugInterface.o |
0x00000f04 DebugInt_init |
.text 0x00000f3a 0xe8 CamInterfaceAsm.o |
0x0000100e __vector_1 |
0x00000fce CamIntAsm_acquireDumpLine |
0x00001020 __vector_default |
0x00001010 __vector_2 |
0x00000fc8 CamIntAsm_waitForNewDumpFrame |
0x00000f3a CamIntAsm_waitForNewTrackingFrame |
0x00000f40 CamIntAsm_acquireTrackingLine |
0x00001012 __vector_8 |
.text 0x00001022 0x58 /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/libc.a(atoi.o) |
0x00001022 atoi |
.text 0x0000107a 0x10 /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/libc.a(mul10.o) |
0x0000107a __mulhi_const_10 |
0x0000108a . = ALIGN (0x2) |
*(.text.*) |
.text.eeprom 0x0000108a 0x10 /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/libc.a(ee_rb.1C1D1E.o) |
0x0000108a __eeprom_read_byte_1C1D1E |
.text.eeprom 0x0000109a 0xa /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/libc.a(ee_rblk.1C1D1E.o) |
0x0000109a __eeprom_read_block_1C1D1E |
.text.eeprom 0x000010a4 0x18 /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/libc.a(ee_wb.1C1D1E.o) |
0x000010a4 __eeprom_write_byte_1C1D1E |
0x000010bc . = ALIGN (0x2) |
*(.fini9) |
*(.fini8) |
*(.fini7) |
*(.fini6) |
*(.fini5) |
*(.fini4) |
*(.fini3) |
*(.fini2) |
*(.fini1) |
*(.fini0) |
.fini0 0x000010bc 0x2 /usr/lib/gcc/avr/4.1.0/avr4/libgcc.a(_exit.o) |
0x000010be _etext = . |
.data 0x00800060 0x10 load address 0x000010be |
0x00800060 PROVIDE (__data_start, .) |
*(.data) |
.data 0x00800060 0x2 FrameMgr.o |
.data 0x00800062 0xe UIMgr.o |
*(.gnu.linkonce.d*) |
0x00800070 . = ALIGN (0x2) |
0x00800070 _edata = . |
0x00800070 PROVIDE (__data_end, .) |
.bss 0x00800070 0x274 |
0x00800070 PROVIDE (__bss_start, .) |
*(.bss) |
.bss 0x00800070 0x3 Executive.o |
0x00800071 Exec_eventFifoTail |
0x00800072 fastEventBitmask |
0x00800070 Exec_eventFifoHead |
.bss 0x00800073 0x45 FrameMgr.o |
.bss 0x008000b8 0x4b UIMgr.o |
0x008000b9 UIMgr_rxFifoTail |
0x008000bb UIMgr_txFifoTail |
0x008000ba UIMgr_txFifoHead |
0x008000b8 UIMgr_rxFifoHead |
.bss 0x00800103 0x7 I2CInterface.o |
.bss 0x0080010a 0x2 CamConfig.o |
0x0080010a CamConfig_txFifoHead |
0x0080010b CamConfig_txFifoTail |
*(COMMON) |
COMMON 0x0080010c 0x160 CamInterface.o |
0x0080010c previousLineBuffer |
0x008001bc currentLineBuffer |
COMMON 0x0080026c 0x8 Executive.o |
0x0080026c Exec_eventFifo |
COMMON 0x00800274 0x60 UIMgr.o |
0x00800274 UIMgr_rxFifo |
0x00800294 UIMgr_txFifo |
COMMON 0x008002d4 0x10 CamConfig.o |
0x008002d4 CamConfig_txFifo |
0x008002e4 PROVIDE (__bss_end, .) |
0x000010be __data_load_start = LOADADDR (.data) |
0x000010ce __data_load_end = (__data_load_start + SIZEOF (.data)) |
.noinit 0x00800300 0x30 |
0x00800300 PROVIDE (__noinit_start, .) |
*(.noinit*) |
.noinit 0x00800300 0x30 CamInterface.o |
0x00800300 colorMap |
0x00800330 PROVIDE (__noinit_end, .) |
0x00800330 _end = . |
0x00800330 PROVIDE (__heap_start, .) |
.eeprom 0x00810000 0x0 |
*(.eeprom*) |
0x00810000 __eeprom_end = . |
.stab 0x00000000 0x3ed0 |
*(.stab) |
.stab 0x00000000 0x36c /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
.stab 0x0000036c 0x51c CamInterface.o |
0x528 (size before relaxing) |
.stab 0x00000888 0x240 Main.o |
0x42c (size before relaxing) |
.stab 0x00000ac8 0x3cc Executive.o |
0x600 (size before relaxing) |
.stab 0x00000e94 0xa80 FrameMgr.o |
0xca8 (size before relaxing) |
.stab 0x00001914 0xc84 UIMgr.o |
0xeb8 (size before relaxing) |
.stab 0x00002598 0x264 UartInterface.o |
0x420 (size before relaxing) |
.stab 0x000027fc 0x57c I2CInterface.o |
0x75c (size before relaxing) |
.stab 0x00002d78 0x3d8 CamConfig.o |
0x5b8 (size before relaxing) |
.stab 0x00003150 0x1ec Utility.o |
0x3b4 (size before relaxing) |
.stab 0x0000333c 0x210 DebugInterface.o |
0x3d8 (size before relaxing) |
.stab 0x0000354c 0x570 CamInterfaceAsm.o |
0x57c (size before relaxing) |
.stab 0x00003abc 0x228 /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/libc.a(atoi.o) |
0x234 (size before relaxing) |
.stab 0x00003ce4 0x78 /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/libc.a(mul10.o) |
0x84 (size before relaxing) |
.stab 0x00003d5c 0x78 /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/libc.a(ee_rb.1C1D1E.o) |
0x84 (size before relaxing) |
.stab 0x00003dd4 0x54 /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/libc.a(ee_rblk.1C1D1E.o) |
0x60 (size before relaxing) |
.stab 0x00003e28 0xa8 /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/libc.a(ee_wb.1C1D1E.o) |
0xb4 (size before relaxing) |
.stabstr 0x00000000 0x17c9 |
*(.stabstr) |
.stabstr 0x00000000 0x17c9 /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
.stab.excl |
*(.stab.excl) |
.stab.exclstr |
*(.stab.exclstr) |
.stab.index |
*(.stab.index) |
.stab.indexstr |
*(.stab.indexstr) |
.comment |
*(.comment) |
.debug |
*(.debug) |
.line |
*(.line) |
.debug_srcinfo |
*(.debug_srcinfo) |
.debug_sfnames |
*(.debug_sfnames) |
.debug_aranges |
*(.debug_aranges) |
.debug_pubnames |
*(.debug_pubnames) |
.debug_info |
*(.debug_info) |
*(.gnu.linkonce.wi.*) |
.debug_abbrev |
*(.debug_abbrev) |
.debug_line |
*(.debug_line) |
.debug_frame |
*(.debug_frame) |
.debug_str |
*(.debug_str) |
.debug_loc |
*(.debug_loc) |
.debug_macinfo |
*(.debug_macinfo) |
OUTPUT(AVRcam.elf elf32-avr) |
Cross Reference Table |
Symbol File |
CamConfig_init CamConfig.o |
Main.o |
CamConfig_sendFifoCmds CamConfig.o |
UIMgr.o |
FrameMgr.o |
CamConfig_setCamReg CamConfig.o |
UIMgr.o |
FrameMgr.o |
CamConfig_txFifo CamConfig.o |
CamConfig_txFifoHead CamConfig.o |
CamConfig_txFifoTail CamConfig.o |
CamConfig_writeTxFifo CamConfig.o |
CamIntAsm_acquireDumpLine CamInterfaceAsm.o |
FrameMgr.o |
CamIntAsm_acquireTrackingLine CamInterfaceAsm.o |
FrameMgr.o |
CamIntAsm_waitForNewDumpFrame CamInterfaceAsm.o |
CamIntAsm_waitForNewTrackingFrame CamInterfaceAsm.o |
CamInt_init CamInterface.o |
Main.o |
CamInt_resetCam CamInterface.o |
UIMgr.o |
DebugInt_init DebugInterface.o |
Main.o |
Exec_eventFifo UartInterface.o |
Executive.o |
Exec_eventFifoHead Executive.o |
UartInterface.o |
Exec_eventFifoTail Executive.o |
Exec_run Executive.o |
Main.o |
Exec_writeEventFifo Executive.o |
UIMgr.o |
FrameMgr.o |
FrameMgr_acquireFrame FrameMgr.o |
FrameMgr_acquireLine FrameMgr.o |
Executive.o |
FrameMgr_dispatchEvent FrameMgr.o |
Executive.o |
FrameMgr_init FrameMgr.o |
Main.o |
FrameMgr_processFrame FrameMgr.o |
FrameMgr_processLine FrameMgr.o |
Executive.o |
I2CInt_init I2CInterface.o |
Main.o |
I2CInt_isI2cBusy I2CInterface.o |
CamConfig.o |
I2CInt_readData I2CInterface.o |
I2CInt_writeData I2CInterface.o |
CamConfig.o |
UIMgr_dispatchEvent UIMgr.o |
Executive.o |
UIMgr_flushTxBuffer UIMgr.o |
UIMgr_init UIMgr.o |
Main.o |
UIMgr_processReceivedData UIMgr.o |
UIMgr_rxFifo UartInterface.o |
UIMgr.o |
UIMgr_rxFifoHead UIMgr.o |
UartInterface.o |
UIMgr_rxFifoTail UIMgr.o |
UIMgr_transmitPendingData UIMgr.o |
Executive.o |
UIMgr_txBuffer UIMgr.o |
UIMgr_txFifo UIMgr.o |
UIMgr_txFifoHead UIMgr.o |
UIMgr_txFifoTail UIMgr.o |
UIMgr_writeBufferToTxFifo UIMgr.o |
UIMgr_writeTxFifo UIMgr.o |
FrameMgr.o |
UartInt_init UartInterface.o |
Main.o |
UartInt_txByte UartInterface.o |
UIMgr.o |
FrameMgr.o |
Utility_delay Utility.o |
DebugInterface.o |
CamConfig.o |
UIMgr.o |
FrameMgr.o |
Main.o |
__bad_interrupt /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
__bss_end /usr/lib/gcc/avr/4.1.0/avr4/libgcc.a(_clear_bss.o) |
__bss_start /usr/lib/gcc/avr/4.1.0/avr4/libgcc.a(_clear_bss.o) |
__data_end /usr/lib/gcc/avr/4.1.0/avr4/libgcc.a(_copy_data.o) |
__data_load_start /usr/lib/gcc/avr/4.1.0/avr4/libgcc.a(_copy_data.o) |
__data_start /usr/lib/gcc/avr/4.1.0/avr4/libgcc.a(_copy_data.o) |
__do_clear_bss /usr/lib/gcc/avr/4.1.0/avr4/libgcc.a(_clear_bss.o) |
DebugInterface.o |
Utility.o |
CamConfig.o |
I2CInterface.o |
UartInterface.o |
UIMgr.o |
FrameMgr.o |
Executive.o |
Main.o |
CamInterface.o |
__do_copy_data /usr/lib/gcc/avr/4.1.0/avr4/libgcc.a(_copy_data.o) |
DebugInterface.o |
Utility.o |
CamConfig.o |
I2CInterface.o |
UartInterface.o |
UIMgr.o |
FrameMgr.o |
Executive.o |
Main.o |
CamInterface.o |
__eeprom_read_block_1C1D1E /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/libc.a(ee_rblk.1C1D1E.o) |
CamInterface.o |
__eeprom_read_byte_1C1D1E /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/libc.a(ee_rb.1C1D1E.o) |
/usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/libc.a(ee_rblk.1C1D1E.o) |
UIMgr.o |
__eeprom_write_byte_1C1D1E /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/libc.a(ee_wb.1C1D1E.o) |
UIMgr.o |
__heap_end /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
__init /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
__mulhi_const_10 /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/libc.a(mul10.o) |
/usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/libc.a(atoi.o) |
__stack /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
Main.o |
__vector_1 CamInterfaceAsm.o |
/usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
__vector_10 /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
__vector_11 UartInterface.o |
/usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
__vector_12 /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
__vector_13 /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
__vector_14 /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
__vector_15 /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
__vector_16 /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
__vector_17 I2CInterface.o |
/usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
__vector_18 /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
__vector_2 CamInterfaceAsm.o |
/usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
__vector_3 /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
__vector_4 /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
__vector_5 /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
__vector_6 /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
__vector_7 /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
__vector_8 CamInterfaceAsm.o |
/usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
__vector_9 /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
CamInterfaceAsm.o |
__vector_default CamInterfaceAsm.o |
/usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
__vectors /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
_exit /usr/lib/gcc/avr/4.1.0/avr4/libgcc.a(_exit.o) |
atoi /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/libc.a(atoi.o) |
UIMgr.o |
colorMap CamInterface.o |
UIMgr.o |
FrameMgr.o |
currentLineBuffer FrameMgr.o |
CamInterface.o |
exit /usr/lib/gcc/avr/4.1.0/avr4/libgcc.a(_exit.o) |
Main.o |
fastEventBitmask Executive.o |
CamInterfaceAsm.o |
FrameMgr.o |
main Main.o |
/usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
previousLineBuffer FrameMgr.o |
CamInterface.o |
/programy/C/avr/AVRcam/CamInterface.c |
---|
0,0 → 1,235 |
/* |
Copyright (C) 2004 John Orlando |
AVRcam: a small real-time image processing engine. |
This program is free software; you can redistribute it and/or |
modify it under the terms of the GNU General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
General Public License for more details. |
You should have received a copy of the GNU General Public |
License along with this program; if not, write to the Free Software |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
For more information on the AVRcam, please contact: |
john@jrobot.net |
or go to www.jrobot.net for more details regarding the system. |
*/ |
/*********************************************************** |
Module Name: CamInterface.c |
Module Date: 04/12/2004 |
Module Auth: John Orlando |
Description: This file is responsible for providing an |
interface to the OV6620 camera hardware. This includes |
an interface to CamInterface.S for certain low-level, |
optimized camera access routines. |
Revision History: |
Date Rel Ver. Notes |
4/10/2004 0.1 Module created |
6/30/2004 1.0 Initial release for Circuit Cellar |
contest. |
11/15/2004 1.2 ifdef'd out the resetCam routine, since |
resetting the cam now causes the OV6620's |
clock to not be output (we have to start |
it up after each reset with the external |
tiny12 processor). |
1/16/2005 1.4 Ensure that the TCCR1B register is set so |
nothing is clocking timer1 at startup. |
***********************************************************/ |
/* Includes */ |
#include <avr/interrupt.h> |
#include <avr/sleep.h> |
#include <avr/eeprom.h> |
#include <stdlib.h> |
#include <string.h> |
#include "CommonDefs.h" |
#include "CamInterface.h" |
#include "Utility.h" |
#include "UIMgr.h" |
#include "Executive.h" |
#include "UartInterface.h" |
/* Local Variables */ |
/* Local Structures and Typedefs */ |
/* Definitions */ |
//#define OUTPUT_INITIAL_COLOR_MAP 1 |
#define FAST_ACQUIRE 1 |
#define CAM_G_BUS PINB |
#define CAM_G_BUS_DIR DDRB |
#define CAM_RB_BUS PINC |
#define CAM_RB_BUS_DIR DDRC |
#define CAM_CONTROL_PORT PORTD |
#define CAM_CONTROL_PORT_DIR DDRD |
#define CAM_RESET_LINE BIT7 |
#define CAM_PIXEL_CLK_COUNT BIT5 |
#define CAM_HREF BIT4 |
#define CAM_PIXEL_CLK_INT BIT3 |
#define CAM_VSYNC BIT2 |
/* Global Variables */ |
/* NOTE: This file MUST appear first in the Makefile for these variables to |
be placed properly in RAM */ |
/* The colorMap[] table provides the membership lookup table to convert |
RGB or YUV pixel values into actual colors. The membership table contains |
16 elements for each color channel, concatenated together. The Red (or Y) |
value is located in the first 16 bytes, the G (or U) value is located in |
the second 16 bytes, and the B (or V) value is located in the last 16 bytes: |
---------------------------------------------------------------------------------- |
|red0|red1|red2|...|red15|green0|green1|green2|...|green15|blue0|blue1|...|blue15| |
mem:|0x00 0x01 0x02 0x15 0x16 0x17 0x18 0x31 0x32 0x33 0x47 | |
--------------------------------------------------------------------------------- |
Thus, the red lookup is accessed at colorMap+0, the green lookup is accessed |
at colorMap+16, and the blue lookup is accessed at colorMap+32. */ |
unsigned char colorMap[NUM_ELEMENTS_IN_COLOR_MAP] __attribute__ ((section (".noinit"))); |
/* Extern Variables */ |
/* These two buffers hold the current and previous lines |
of pixel data. They are sized to the worst case scenario, |
where the color changes between every pixel (unrealistic). |
The format of each buffer is for all the even bytes to hold |
the run-length, and the odd bytes to hold the color data. */ |
/* In addition, if we are in frameDump mode, we use these buffers |
to store the acquired line data...we are actually grabbing ALL of the |
pixels in a line (176) instead of the 88 we get normally during tracking. |
But since we have enough to hold 88-RLE blocks, we already have the 176 |
allocated for this... */ |
unsigned char currentLineBuffer[LENGTH_OF_LINE_BUFFER]; |
unsigned char previousLineBuffer[LENGTH_OF_LINE_BUFFER]; |
/* Extern Functions */ |
/* These functions are located in assembly files, and thus |
must be externed here so they can be referenced in the source below. */ |
extern void CamIntAsm_waitForNewTrackingFrame(unsigned char *pBuffer, unsigned char *pMemLookup); |
extern void CamIntAsm_waitForNewDumpFrame(unsigned char *pCurrBuffer, unsigned char *pPrevBuffer); |
extern void CamIntAsm_acquireTrackingLine(unsigned char *pBuffer, unsigned char *pMemLookup); |
extern void CamIntAsm_acquireDumpLine(unsigned char *pCurrBuffer, unsigned char *pPrevBuffer); |
/*********************************************************** |
Function Name: CamInt_init |
Function Description: This function is responsible |
for initializing the camera interface. This includes |
setting up the i/o ports that are used to read the |
camera busses, as well as resetting the camera. |
Inputs: none |
Outputs: none |
***********************************************************/ |
void CamInt_init(void) |
{ |
#if OUTPUT_INITIAL_COLOR_MAP |
unsigned char asciiBuffer[5]; |
unsigned char i; |
#endif |
/* set up the mega8 ports that will be interfacing |
with the camera */ |
CAM_CONTROL_PORT_DIR |= (1<<CAM_RESET_LINE); /* cam reset is output */ |
CAM_CONTROL_PORT_DIR |= 0x80; /* set just the MSB as an output */ |
CAM_CONTROL_PORT_DIR &= 0xFB; /* make sure bit2 is clear (input) */ |
CAM_CONTROL_PORT &= 0x7F; /* set reset line low */ |
CAM_G_BUS_DIR &= 0xF0; /* 4-bit G bus all inputs */ |
CAM_G_BUS_DIR |= 0xF0; /* disable the pull-up on PB4 and PB5 */ |
CAM_RB_BUS_DIR &= 0xF0; /* 4-bit RB bus all inputs */ |
/* ensure that timer1 is disabled to start...eventually, when PCLK needs |
to feed timer1 through the external counter, it will be enabled on an |
"as needed" basis...*/ |
TCCR1B &= ~( (1<<CS12)|(1<<CS11)|(1<<CS10) ); |
/* we'll turn on the interrupt after we assign the initial TCNT value */ |
/* set up External Interrupt1 to interrupt us on rising edges (HREF)... |
this is needed to indicate when the first pixel of each line is about to start, so |
we can synch up with it...this interrupt will be disabled once HREF goes high */ |
MCUCR |= (1<<ISC11) | (1<<ISC10); /* rising edge interrupt */ |
/* the interrupt will be enabled when we are ready to detect the rising edge of |
HREF...its now primed and ready to go */ |
/* set up External Interrupt0 to interrupt us on rising edges (VSYNC) */ |
MCUCR |= (1<<ISC01) | (1<<ISC00); /* rising edge interrupt */ |
GICR |= (1<<INT0); /* interrupt request enabled */ |
/* set up TimerO to count and be clocked from an external pulse source |
(HREF) on falling edges...eventually, we need to enable the interrupt |
for this! FIX THIS */ |
TCCR0 = (1<<CS02)|(1<<CS01)|(0<<CS00); |
/* setting up the PCLK counter with Timer1 will be done right after |
we start receiving pixels in each line...we sacrifice the first pixel |
in each line, but we'll account for it...*/ |
/* set up the mega8 so that its sleep mode puts it in an IDLE sleep |
mode, where it can wake up as fast as possible */ |
set_sleep_mode(SLEEP_MODE_IDLE); |
/* umm....we need to actually enable the sleep mode...*/ |
MCUCR |= 0x80; |
/* initialize the memLookup table */ |
memset(colorMap,0x00,NUM_ELEMENTS_IN_COLOR_MAP); |
/* read the color map out of EEPROM */ |
eeprom_read_block(colorMap, (unsigned char*)0x01,NUM_ELEMENTS_IN_COLOR_MAP); |
#if OUTPUT_INITIAL_COLOR_MAP |
UIMgr_txBuffer("\r\n",2); |
for (i=0; i<NUM_ELEMENTS_IN_COLOR_MAP; i++) |
{ |
memset(asciiBuffer,0x00,5); |
itoa(colorMap[i],asciiBuffer,10); |
UIMgr_txBuffer(asciiBuffer,3); |
UIMgr_txBuffer(" ",1); |
if (i==15 || i == 31) |
{ |
/* break up the output */ |
UIMgr_txBuffer("\r\n",2); |
} |
} |
#endif |
#ifndef NO_CRYSTAL |
CamInt_resetCam(); |
#endif |
} |
/*********************************************************** |
Function Name: CamInt_resetCam |
Function Description: This function is responsible |
for resetting the camera. This is accomplished by |
toggling the reset line on the OV6620 for ~100 mS. |
Inputs: none |
Outputs: none |
IMPORTANT NOTE: This function has effectively been removed |
since resetting the camera now causes the camera to not |
output the clock signal. Thus, if we reset the cam, the |
AVR has no clock, and thus doesn't run... |
***********************************************************/ |
void CamInt_resetCam(void) |
{ |
#if 0 |
CAM_CONTROL_PORT |= (1<<CAM_RESET_LINE); /* cam reset line high */ |
Utility_delay(500); |
CAM_CONTROL_PORT &= (0<<CAM_RESET_LINE); /* cam reset line low */ |
Utility_delay(100); |
#endif |
} |
/programy/C/avr/AVRcam/I2CInterface.c |
---|
0,0 → 1,293 |
/* |
Copyright (C) 2004 John Orlando |
AVRcam: a small real-time image processing engine. |
This program is free software; you can redistribute it and/or |
modify it under the terms of the GNU General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
General Public License for more details. |
You should have received a copy of the GNU General Public |
License along with this program; if not, write to the Free Software |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
For more information on the AVRcam, please contact: |
john@jrobot.net |
or go to www.jrobot.net for more details regarding the system. |
*/ |
/*********************************************************** |
Module Name: I2CInterface.c |
Module Date: 4/10/2004 |
Module Auth: John Orlando |
Description: This module is responsible for providing a |
low-level interface to the I2C hardware resident on the |
mega8 processor (also known as the Two-Wire Interface, |
or TWI). The interface is needed to configure the |
needed registers in the OV6620 camera. This interface |
is interrupt-driven based on the events that should |
occur upon successful writing of an I2C register. |
Revision History: |
Date Rel Ver. Notes |
4/10/2004 0.1 Module created |
6/30/2004 1.0 Initial release for Circuit Cellar |
contest. |
***********************************************************/ |
/* Includes */ |
#include <avr/io.h> |
#include <util/twi.h> |
#include <avr/interrupt.h> |
#include "CamConfig.h" |
#include "CommonDefs.h" |
/* Local Variables */ |
/* These variables are used as storage space for the current |
I2C command being sent over the interface. They need to |
be volatile since they are dealt with an the TWI ISR */ |
volatile static unsigned char twi_address; |
volatile static unsigned char *twi_data; |
volatile static unsigned char twi_ddr; |
volatile static unsigned char twi_bytes; |
volatile static unsigned char status; |
volatile static unsigned char retry_cnt; |
/* Local Structures and Typedefs */ |
/* Extern Variables */ |
/* Definitions */ |
/* Bit definitions for the tw_status register */ |
#define MAX_TWI_RETRIES 2 |
#define BUSY 7 |
/*********************************************************** |
Function Name: I2CInt_init |
Function Description: This function is responsible |
for setting up the registers needed for the TWI |
interface |
Inputs: none |
Outputs: none |
***********************************************************/ |
void I2CInt_init(void) |
{ |
TWSR = 0; |
/* init the speed of the I2C interface, running at |
100 Kbps */ |
TWBR = (FOSC / I2C_SPEED - 16)/2; |
} |
/*********************************************************** |
Function Name: I2CInt_writeData |
Function Description: This function is responsible for |
initiating the process of writing a sequence of bytes |
an I2C slave address. This function will try to write |
the data three times before giving up. |
Inputs: address: the address of the I2C slave device |
data: a pointer to the data to be written |
to the slave...for camera interfacing, |
the data follows a <register #><data> |
format |
bytes: the number of bytes to write |
Outputs: none |
***********************************************************/ |
void I2CInt_writeData(unsigned char address, unsigned char *data, unsigned char bytes) |
{ |
while(status & (1<<BUSY)); /* Bus is busy wait (or exit with error code) */ |
while(TWCR & (1<<TWSTO)); |
/* copy the needed data and state info to our local I2C command structure */ |
twi_address = address; |
twi_data = data; |
twi_bytes = bytes; |
twi_ddr = TW_WRITE; |
retry_cnt = 0; |
/* Generate start condition, the remainder of the transfer is interrupt driven and |
will be performed in the background */ |
TWCR = (1<<TWINT)|(1<<TWSTA)|(1<<TWEN)|(1<<TWIE); |
status |= (1<<BUSY); |
} |
/*********************************************************** |
Function Name: I2CInt_readData |
Function Description: This funcion is responsible for |
reading the specified number of bytes from a slave |
device. |
Inputs: address: the slave address to read from |
data: a pointer to where the data will be stored |
bytes: the number of bytes to read |
Outputs: none |
***********************************************************/ |
void I2CInt_readData(unsigned char address, unsigned char *data, unsigned char bytes) |
{ |
/* Bus is busy wait (or exit with error code) */ |
while(status & (1<<BUSY)); |
twi_address = address; |
twi_data = data; |
twi_bytes = bytes; |
twi_ddr = TW_READ; |
retry_cnt = 0; |
/* Generate start condition, the remainder of the transfer is interrupt driven and |
will be performed in the background */ |
TWCR = (1<<TWINT)|(1<<TWSTA)|(1<<TWEN)|(1<<TWIE); |
status |= (1<<BUSY); |
} |
/*********************************************************** |
Function Name: I2CInt_isI2cBusy |
Function Description: This funcion is responsible for |
indicating if the I2C bus is currently busy to external |
modules. |
device. |
Inputs: none |
Outputs: bool_t - indicating if bus is busy |
***********************************************************/ |
bool_t I2CInt_isI2cBusy(void) |
{ |
bool_t retVal = FALSE; |
if ( (status & (1<<BUSY)) != 0) |
{ |
retVal = TRUE; |
} |
return(retVal); |
} |
/*********************************************************** |
Function Name: <interrupt handler for I2C> |
Function Description: This function is responsible for |
implementing the control logic needed to perform a |
read or write operation with an I2C slave. |
Inputs: none |
Outputs: none |
***********************************************************/ |
SIGNAL(SIG_2WIRE_SERIAL) |
{ |
unsigned char TWI_status = TWSR & TW_STATUS_MASK; /* grab just the status bits */ |
/* the entire I2C handler is state-based...determine |
what needs to be done based on TWI_status */ |
switch(TWI_status) |
{ |
case TW_START: /* Start condition */ |
case TW_REP_START: /* Repeated start condition */ |
if(retry_cnt > MAX_TWI_RETRIES) |
{ |
/* generate stop condition if we've reached our retry limit */ |
TWCR |= (1<<TWINT)|(1<<TWSTO); |
status &= ~(1<<BUSY); |
return; |
} |
/* indicate read or write */ |
TWDR = (twi_address<<1) + twi_ddr; |
/* TWSTA must be cleared...also clears TWINT */ |
TWCR &= ~(1<<TWSTA); |
break; |
case TW_MT_SLA_ACK: /* Slave acknowledged address, */ |
retry_cnt = 0; |
/* tx the data, and increment the data pointer */ |
TWDR = *twi_data; |
twi_data++; |
/* clear the int to continue */ |
TWCR |= (1<<TWINT); |
break; |
case TW_MT_SLA_NACK: /* Slave didn't acknowledge address, */ |
case TW_MR_SLA_NACK: |
retry_cnt++; |
/* retry...*/ |
TWCR |= (1<<TWINT)|(1<<TWSTA)|(1<<TWSTO); |
break; |
case TW_MT_DATA_ACK: /* Slave Acknowledged data, */ |
if(--twi_bytes > 0) |
{ |
/* more data to send, so send it */ |
TWDR = *twi_data; |
twi_data++; |
TWCR |= (1<<TWINT); |
} |
else |
{ |
/* generate the stop condition if needed */ |
TWCR |= (1<<TWSTO)|(1<<TWINT); |
status &= ~(1<<BUSY); |
} |
break; |
case TW_MT_DATA_NACK: /* Slave didn't acknowledge data */ |
/* send the stop condition */ |
TWCR |= (1<<TWINT)|(1<<TWSTO); |
status &= ~(1<<BUSY); |
break; |
case TW_MR_SLA_ACK: /* Slave acknowledged address */ |
if(--twi_bytes > 0) |
{ |
/* if there is more than one byte to read, acknowledge */ |
TWCR |= (1<<TWEA)|(1<<TWINT); |
} |
else |
{ |
/* no acknowledge */ |
TWCR |= (1<<TWINT); |
} |
break; |
case TW_MR_DATA_ACK: /* Master acknowledged data */ |
/* grab the received data */ |
*twi_data = TWDR; |
twi_data++; |
if(--twi_bytes > 0) |
{ |
/* get the next data byte and ack */ |
TWCR |= (1<<TWEA)|(1<<TWINT); |
} |
else |
{ |
/* clear out the enable acknowledge bit */ |
TWCR &= ~(1<<TWEA); |
} |
break; |
case TW_MR_DATA_NACK: /* Master didn't acknowledge data -> end of read process */ |
/* read data, and generate the stop condition */ |
*twi_data = TWDR; |
TWCR |= (1<<TWSTO)|(1<<TWINT); |
status &= ~(1<<BUSY); |
break; |
} |
} |
/programy/C/avr/AVRcam/UartInterface.c |
---|
0,0 → 1,156 |
/* |
Copyright (C) 2004 John Orlando |
AVRcam: a small real-time image processing engine. |
This program is free software; you can redistribute it and/or |
modify it under the terms of the GNU General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
General Public License for more details. |
You should have received a copy of the GNU General Public |
License along with this program; if not, write to the Free Software |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
For more information on the AVRcam, please contact: |
john@jrobot.net |
or go to www.jrobot.net for more details regarding the system. |
*/ |
/*********************************************************** |
Module Name: UartInterface.c |
Module Date: 04/10/2004 |
Module Auth: John Orlando |
Description: This module is responsible for providing an |
interface to the UART hardware available on the mega8. |
This interface is an interrupt-driven interface. |
Revision History: |
Date Rel Ver. Notes |
4/10/2004 0.1 Module created |
6/30/2004 1.0 Initial release for Circuit Cellar |
contest. |
11/15/2004 1.2 Updated UART baud rate regs so that |
it runs at 115.2 kbps when the input |
crystal is at 17.7 MHz (which is the |
speed of the OV6620's crystal). |
1/16/2005 1.4 Moved the serial received ISR to |
this file, instead of having it |
in its own UartInterfaceAsm.S file |
written in assembly. |
***********************************************************/ |
/* Includes */ |
#include <avr/io.h> |
#include <avr/interrupt.h> |
#include "CommonDefs.h" |
#include "UartInterface.h" |
#include "UIMgr.h" |
#include "Executive.h" |
/* Local Variables */ |
/* Local Structures and Typedefs */ |
/* Extern Variables */ |
/* Definitions */ |
/*********************************************************** |
Function Name: UartInt_init |
Function Description: This function is responsible for |
initializing the UART interface on the mega8. This |
interface is set to communicate at 115.2 Kbps, with an |
8N1 protocol. |
Inputs: none |
Outputs: none |
***********************************************************/ |
void UartInt_init(void) |
{ |
/* set up the baud rate registers so the UART will operate |
at 115.2 Kbps */ |
UBRRH = 0x00; |
#ifdef NO_CRYSTAL |
UBRRL = 18; /* 18 for double clocking at 115.2 kbps */ |
#else |
UBRRL = 0x08; /* for 16 MHz crystal at 115.2 kbps */ |
#endif |
/* enable the tx and rx capabilities of the UART...as well |
as the receive complete interrupt */ |
UCSRB = (1<<RXCIE)|(1<<RXEN)|(1<<TXEN); |
/* set up the control registers so the UART works at 8N1 */ |
UCSRC = (1<<URSEL)|(1<<UCSZ1)|(1<<UCSZ0); |
#ifdef NO_CRYSTAL |
/* set the baud rate to use the double-speed */ |
UCSRA = (1<<U2X); |
#endif |
} |
/*********************************************************** |
Function Name: UartInt_txByte |
Function Description: This function is responsible for |
transmitting a single byte on the uart. |
Inputs: txByte - the byte to send |
Outputs: none |
NOTES: When the TX UDRE (data register empty) is set, there |
is puposefully no interrupt...thus, to send a string of |
data out, the calling routine needs to hold up the entire |
application while this takes place (or just send one |
byte at a time at strtegically timed intervals, like |
the stats data is sent out :-) |
***********************************************************/ |
void UartInt_txByte(unsigned char txByte) |
{ |
/* Wait for empty transmit buffer */ |
while ( !( UCSRA & (1<<UDRE)) ); |
/* Put data into buffer, sends the data */ |
UDR = txByte; |
} |
/*********************************************************** |
Function Name: SIG_UART_RECV ISR |
Function Description: This function is responsible for |
handling the interrupt caused when a data byte is |
received by the UART. |
Inputs: none |
Outputs: none |
NOTES: This function was originally written in assembly, |
but moved over to C when the setting of the "T" bit at |
the end of the routine was no longer necessary (this |
theoretically allowed the AVRcam to respond to serial |
bytes in the middle of tracking or dumping a frame. |
But it wasn't really needed, and understanding the C |
is easier :-) |
***********************************************************/ |
SIGNAL(SIG_UART_RECV) |
{ |
unsigned char tmpHead; |
/* read the data byte, put it in the serial queue, and |
post the event */ |
UIMgr_rxFifo[UIMgr_rxFifoHead] = UDR; |
/* now move the head up */ |
tmpHead = (UIMgr_rxFifoHead + 1) & (UI_MGR_RX_FIFO_MASK); |
UIMgr_rxFifoHead = tmpHead; |
/* write the serial received event to the event fifo */ |
Exec_eventFifo[Exec_eventFifoHead] = EV_SERIAL_DATA_RECEIVED; |
/* now move the head up */ |
tmpHead = (Exec_eventFifoHead + 1) & (EXEC_EVENT_FIFO_MASK); |
Exec_eventFifoHead = tmpHead; |
} |
/programy/C/avr/AVRcam/CamConfig.c |
---|
0,0 → 1,192 |
/* |
Copyright (C) 2004 John Orlando |
AVRcam: a small real-time image processing engine. |
This program is free software; you can redistribute it and/or |
modify it under the terms of the GNU General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
General Public License for more details. |
You should have received a copy of the GNU General Public |
License along with this program; if not, write to the Free Software |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
For more information on the AVRcam, please contact: |
john@jrobot.net |
or go to www.jrobot.net for more details regarding the system. |
*/ |
/********************************************************** |
Module Name: CamConfig.c |
Module Date: 04/10/2004 |
Module Auth: John Orlando |
Description: This module is responsible for the |
high-level configuration activities of the OV6620 |
camera module. This module interfaces with the |
I2CInterface module to perform this configuration. |
Revision History: |
Date Rel Ver. Notes |
4/10/2004 0.1 Module created |
6/30/2004 1.0 Initial release for Circuit Cellar |
contest. |
11/15/2004 1.2 Added code to un-tri-state the |
OV6620's pixel data busses at |
startup after four seconds. |
This was added in to |
allow the user to re-program the |
mega8 at startup if needed. |
***********************************************************/ |
/* Includes */ |
#include <avr/io.h> |
#include "CamConfig.h" |
#include "I2CInterface.h" |
#include "CommonDefs.h" |
#include "Utility.h" |
/**********************************************************/ |
/* Definitions */ |
/* The length of an I2C command is made up of a register address |
plus the actual value of the register */ |
#define SIZE_OF_I2C_CMD 2 |
#define MAX_NUM_CONFIG_CMDS 8 |
#define CAM_CONFIG_TX_FIFO_SIZE MAX_NUM_CONFIG_CMDS |
#define CAM_CONFIG_TX_FIFO_MASK CAM_CONFIG_TX_FIFO_SIZE-1 |
/* Local Variables */ |
/* Local Structures and Typedefs */ |
/* Local Function Prototypes */ |
static i2cCmd_t CamConfig_readTxFifo(void); |
/* Extern Variables */ |
i2cCmd_t CamConfig_txFifo[CAM_CONFIG_TX_FIFO_SIZE]; |
unsigned char CamConfig_txFifoHead=0; |
unsigned char CamConfig_txFifoTail=0; |
/*********************************************************** |
Function Name: CamConfig_init |
Function Description: This function is responsible for |
performing the initial configuration of the camera. |
Inputs: none |
Outputs: none |
***********************************************************/ |
void CamConfig_init(void) |
{ |
CamConfig_setCamReg(0x14,0x20); /* reduce frame size */ |
CamConfig_setCamReg(0x39,0x40); /* gate PCLK with HREF */ |
CamConfig_setCamReg(0x12,0x28); /* set RGB mode, with no AWB */ |
CamConfig_setCamReg(0x28,0x05); /* set color sequencer */ |
CamConfig_setCamReg(0x13,0x01); /* un-tri-state the Y/UV lines */ |
/* send the first four cmds in the I2C fifo */ |
CamConfig_sendFifoCmds(); |
} |
/*********************************************************** |
Function Name: CamConfig_setCamReg |
Function Description: This function is responsible for |
creating an I2C cmd structure and placing it into the |
cmd fifo. |
Inputs: reg - the register to modify |
val - the new value of the register |
Outputs: none |
***********************************************************/ |
void CamConfig_setCamReg(unsigned char reg, unsigned char val) |
{ |
i2cCmd_t cmd; |
cmd.configReg = reg; |
cmd.data = val; |
#ifndef SIMULATION |
CamConfig_writeTxFifo(cmd); |
#endif |
} |
/*********************************************************** |
Function Name: CamConfig_sendFifoCmds |
Function Description: This function is responsible for |
sending the entire contents of the config fifo. This |
function won't return until the configuration process |
is complete (or an error is encountered). |
Inputs: none |
Outputs: none |
Note: Since this function is written to use the TWI |
interrupt in the I2CInterface module, there will be |
some busy-waiting here...no big deal, since we end up |
having to trash the frame that we are executing this |
slave write in anyway (since we can't meet the strict |
timing requirements and write i2c at the same time). |
***********************************************************/ |
void CamConfig_sendFifoCmds(void) |
{ |
i2cCmd_t cmd; |
while (CamConfig_txFifoHead != CamConfig_txFifoTail) |
{ |
cmd = CamConfig_readTxFifo(); |
I2CInt_writeData(CAM_ADDRESS,&cmd.configReg,SIZE_OF_I2C_CMD); |
Utility_delay(100); |
/* wait for the I2C transaction to complete */ |
while(I2CInt_isI2cBusy() == TRUE); |
} |
} |
/*********************************************************** |
Function Name: CamConfig_writeTxFifo |
Function Description: This function is responsible for |
adding a new command to the tx fifo. It adjusts all |
needed pointers. |
Inputs: cmd - the i2cCmd_t to add to the fifo |
Outputs: bool_t - indicating if writing to the fifo |
causes it to wrap |
***********************************************************/ |
bool_t CamConfig_writeTxFifo(i2cCmd_t cmd) |
{ |
unsigned char tmpHead; |
bool_t retVal = TRUE; |
CamConfig_txFifo[CamConfig_txFifoHead] = cmd; |
/* see if we need to wrap */ |
tmpHead = (CamConfig_txFifoHead+1) & (CAM_CONFIG_TX_FIFO_MASK); |
CamConfig_txFifoHead = tmpHead; |
/* check to see if we have filled up the queue */ |
if (CamConfig_txFifoHead == CamConfig_txFifoTail) |
{ |
/* we wrapped the fifo...return false */ |
retVal = FALSE; |
} |
return(retVal); |
} |
/*********************************************************** |
Function Name: CamConfig_readTxFifo |
Function Description: This function is responsible for |
reading a cmd out of the tx fifo. |
Inputs: none |
Outputs: i2cCmd_t - the cmd read from the fifo |
***********************************************************/ |
static i2cCmd_t CamConfig_readTxFifo(void) |
{ |
i2cCmd_t cmd; |
unsigned char tmpTail; |
/* just return the current tail from the rx fifo */ |
cmd = CamConfig_txFifo[CamConfig_txFifoTail]; |
tmpTail = (CamConfig_txFifoTail+1) & (CAM_CONFIG_TX_FIFO_MASK); |
CamConfig_txFifoTail = tmpTail; |
return(cmd); |
} |
/programy/C/avr/AVRcam/CamConfig.d |
---|
0,0 → 1,2 |
CamConfig.o CamConfig.d : CamConfig.c CamConfig.h I2CInterface.h CommonDefs.h \ |
Utility.h |
/programy/C/avr/AVRcam/CamConfig.h |
---|
0,0 → 1,65 |
#ifndef CAMCONFIG_H |
#define CAMCONFIG_H |
/* |
Copyright (C) 2004 John Orlando |
AVRcam: a small real-time image processing engine. |
This program is free software; you can redistribute it and/or |
modify it under the terms of the GNU General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
General Public License for more details. |
You should have received a copy of the GNU General Public |
License along with this program; if not, write to the Free Software |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
For more information on the AVRcam, please contact: |
john@jrobot.net |
or go to www.jrobot.net for more details regarding the system. |
*/ |
/*********************************************************** |
Module Name: CamConfig.h |
Module Date: 04/12/2004 |
Module Auth: John Orlando |
Description: This file provides the external interface |
to the CamConfig module. |
Revision History: |
Date Rel Ver. Notes |
4/10/2004 0.1 Module created |
6/30/2004 1.0 Initial release for Circuit Cellar |
contest. |
***********************************************************/ |
#include "I2CInterface.h" |
/* This is the I2C slave address of the OV6620 module. |
NOTE: The actual address of the camera is 0xC0. However, |
the TWI interface on the mega8 needs to have the address |
shifted one bit to the right, which yields 0x60. The |
LSB is used to set whether the operation is read or |
write. */ |
#define CAM_ADDRESS 0x60 |
extern i2cCmd_t CamConfig_txFifo[]; |
extern unsigned char CamConfig_txFifoHead; |
extern unsigned char CamConfig_txFifoTail; |
extern bool_t CamConfig_txComplete; |
extern void CamConfig_init(void); |
extern bool_t CamConfig_writeTxFifo(i2cCmd_t cmd); |
extern void CamConfig_setCamReg(unsigned char reg, unsigned char val); |
extern void CamConfig_sendFifoCmds(void); |
#endif |
/programy/C/avr/AVRcam/CamInterface.S |
---|
0,0 → 1,76 |
; Module Name: CanInterface.S |
; Module Date: 04/14/2004 |
; Module Auth: John O. |
; |
; Description: This module provides the low-level interface |
; to the OV6620 camera hardware. It is responsible for |
; acquiring each pixel block (RG,GB), performing the mapping |
; into an actual color (orange, purple, etc), run-length |
; encoding the data, and storing the info off to the appropriate |
; line buffer. This routine is synchronized with the pixel data |
; so that no polling of the camera data needs to be done (the |
; OV6620 is clocked off of the same crystal source as the mega8, |
; thus providing inherent synchronization between the two). |
#include <avr/io.h> |
#define PCLK_INTERRUPT_ENABLE_MASK $40 |
#define PCLK_INTERRUPT_DISABLE_MASK $BF |
.section .text |
.global CamInt_waitForNewFrame |
.global CamInt_acquireLine |
.global SIG_INTERRUPT0 |
.global SIG_INTERRUPT1 |
;***************************************************************** |
; Function Name: CamInt_waitForNewFrame |
; Function Description: This function is responsible for |
; going to sleep until a new frame begins (indicated by |
; VSYNC transitioning from high to low. This will wake |
; the "VSYNC sleep" up and allow it to continue with |
; the acquireLine function, where the system waits for |
; a "PCLK sleep" that we use to synchronize with the |
; data. |
; Inputs: none |
; Outputs: none |
; NOTES: This function doesn't really return...it sorta just |
; floats into the acquireLine function after the "VSYNC sleep" |
; is awoken. |
;***************************************************************** |
CamInt_waitForNewFrame: |
sleep ; sleep mode already set to sleep idle |
CamInt_acquireLine: |
in r1,_SFR_IO_ADDR(GICR) ;enable the PCLK interrupt |
or r1,PCLK_INTERRUPT_ENABLE_MASK |
out _SFR_IO_ADDR(GICR),r1 |
sleep |
in r1,_SFR_IO_ADDR(GICR) ;disable the PCLK interrupt |
and r1,PCLK_INTERRUPT_DISABLE_MASK |
out _SFR_IO_ADDR(GICR),r1 |
_acquirePixelBlock: |
_exit: |
ret |
SIG_INTERRUPT0: |
; This will wake us up when VSYNC transitions low...we just want to return |
reti |
SIG_INTERRUPT1: |
; This will wake us up when PCLK transitions low...we just want to return |
reti |
.global __vector_default ; Note [10] |
__vector_default: |
reti |
.end |
/programy/C/avr/AVRcam/CamInterface.d |
---|
0,0 → 1,2 |
CamInterface.o CamInterface.d : CamInterface.c CommonDefs.h CamInterface.h Utility.h \ |
UIMgr.h Executive.h Events.h UartInterface.h |
/programy/C/avr/AVRcam/CamInterface.h |
---|
0,0 → 1,82 |
#ifndef CAMINTERFACE_H |
#define CAMINTERFACE_H |
/* |
Copyright (C) 2004 John Orlando |
AVRcam: a small real-time image processing engine. |
This program is free software; you can redistribute it and/or |
modify it under the terms of the GNU General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
General Public License for more details. |
You should have received a copy of the GNU General Public |
License along with this program; if not, write to the Free Software |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
For more information on the AVRcam, please contact: |
john@jrobot.net |
or go to www.jrobot.net for more details regarding the system. |
*/ |
/*********************************************************** |
Module Name: CamInterface.h |
Module Date: 04/14/2004 |
Module Auth: John Orlando |
Description: This file is responsible for providing the |
external interface to the CamInterface module. |
Revision History: |
Date Rel Ver. Notes |
4/10/2004 0.1 Module created |
6/30/2004 1.0 Initial release for Circuit Cellar |
contest. |
***********************************************************/ |
#define NUM_PIXELS_IN_A_TRACKED_LINE 88 |
#define NUM_PIXELS_IN_A_DUMP_LINE 176 |
#define ACTUAL_NUM_PIXELS_IN_A_LINE 176 |
#define ACTUAL_NUM_LINES_IN_A_FRAME 144 |
#define LENGTH_OF_RUN_LENGTH_BLOCK 2 |
#define LENGTH_OF_LINE_BUFFER NUM_PIXELS_IN_A_DUMP_LINE |
#define WAIT_FOR_VSYNC_LOW() while( (PIND & 0x04) != 0) |
#define WAIT_FOR_VSYNC_HIGH() while( (PIND & 0x04) == 0) |
#define WAIT_FOR_HREF_LOW() while( (PIND & 0x10) != 0) |
#define WAIT_FOR_HREF_HIGH() while( (PIND & 0x10) == 0) |
#define WAIT_FOR_PCLK_LOW() while( (PIND & 0x20) != 0) |
#define WAIT_FOR_PCLK_HIGH() while( (PIND & 0x20) == 0) |
#define NUM_COLOR_STEPS 16 |
#define NUM_COLOR_CHANNELS 3 |
#define NUM_ELEMENTS_IN_COLOR_MAP (NUM_COLOR_STEPS * NUM_COLOR_CHANNELS) |
#define RED_OFFSET 0 |
#define GREEN_OFFSET 16 |
#define BLUE_OFFSET 32 |
extern unsigned char currentLineBuffer[]; |
extern unsigned char previousLineBuffer[]; |
extern unsigned char colorMap[]; |
extern unsigned char frameCount; |
/* Extern functions */ |
extern void CamInt_init(void); |
extern void CamInt_resetCam(void); |
extern void CamInt_waitForNewDumpFrame(void); |
extern void CamInt_waitForNewTrackingFrame(void); |
extern void CamInt_acquireTrackingLine(void); |
extern void CamInt_acquireDumpLine(void); |
#endif |
/programy/C/avr/AVRcam/CamInterfaceAsm.S |
---|
0,0 → 1,490 |
; |
; Copyright (C) 2004 John Orlando |
; |
; AVRcam: a small real-time image processing engine. |
; This program is free software; you can redistribute it and/or |
; modify it under the terms of the GNU General Public |
; License as published by the Free Software Foundation; either |
; version 2 of the License, or (at your option) any later version. |
; This program is distributed in the hope that it will be useful, |
; but WITHOUT ANY WARRANTY; without even the implied warranty of |
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
; General Public License for more details. |
; You should have received a copy of the GNU General Public |
; License along with this program; if not, write to the Free Software |
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
; For more information on the AVRcam, please contact: |
; john@jrobot.net |
; or go to www.jrobot.net for more details regarding the system. |
;********************************************************************** |
; Module Name: CanInterfaceAsm.S |
; Module Date: 04/14/2004 |
; Module Auth: John Orlando |
; |
; Description: This module provides the low-level interface |
; to the OV6620 camera hardware. It is responsible for |
; acquiring each pixel block (R,G,B), performing the mapping |
; into an actual color (orange, purple, etc), run-length |
; encoding the data, and storing the info off to the appropriate |
; line buffer. This routine is synchronized with the pixel data |
; so that no polling of the camera data needs to be done (the |
; OV6620 is clocked off of the same crystal source as the mega8, |
; thus providing inherent synchronization between the two). |
; |
; Revision History: |
; Date Rel Ver. Notes |
; 4/10/2004 0.1 Module created |
; 6/30/2004 1.0 Initial release for Circuit Cellar |
; contest. |
; 1/16/2005 1.4 Fixed issue with the TCCR1B register |
; where PCLK was getting routed to the |
; timer1 even when it wasn't needed. |
; This caused excessive counter overflow |
; interrupts, and caused problems. Now, |
; the "PCLK" pipe feeds timer1 when needed, |
; and is turned off when it isn't needed. |
#include <avr/io.h> |
#include "Events.h" |
.extern fastEventBitmask ; This is the flag used to indicate to the rest |
; of the system that the line is complete |
#define HREF_INTERRUPT_ENABLE_MASK 0x80 |
#define HREF_INTERRUPT_DISABLE_MASK 0x7F |
#define ENABLE_PCLK_TIMER1_OVERFLOW_BITMASK 0x04 |
#define DISABLE_PCLK_TIMER1_OVERFLOW_BITMASK 0xFB |
#define G_PORT _SFR_IO_ADDR(PINC) |
#define RB_PORT _SFR_IO_ADDR(PINB) |
#define PIXEL_RUN_START_INITIAL 0x50 ; This value causes our pixel counter (TCNT1) |
; to overflow after 176 (horizontal) pixels |
#define RED_MEM_OFFSET 0x00 |
#define GREEN_MEM_OFFSET 0x10 |
#define BLUE_MEM_OFFSET 0x20 |
; A pixelBlock is defined as a contiguous group of 4 pixels that are combined |
; together to form a specific color. Typically, this is formed by sampling a |
; a green value, followed by a red and blue value (since we are dealing |
; with Bayer color data). We could optionally sample a second green with |
; the red and average the greens, because the eye is more sensitive to |
; green, but for speed we don't do this. These three values (RGB) are then |
; used as indices into the color membership lookup table (memLookup) to |
; determine which color the pixelBlock maps into. The memLookup table is |
; manually generated for now (though it will hopefully be modified over |
; the serial interface eventually). |
; |
; Here is a pixel block: |
; ...G G G G... (row x) |
; ...B R B R... (row x+1) |
; | | | |--this is skipped |
; | | |--this is skipped |
; | |--this is sampled |
; |--this is sampled |
; As pixel blocks are sampled, the red, green, and blue values are |
; used to index into their respective color maps. The color maps |
; return values that can be logically ANDed together so that a |
; particular RGB triplet will result in a single bit being set |
; after the AND operation. This single bit indicates which color |
; the RGB triplet represents. It is also possible for no bits to |
; be set after the AND process, indicating that the RGB triplet |
; does not map to any of the colors configured in the color map. |
; This isn't quite as fast as a pure RGB lookup table, but |
; it then again it doesn't require 2^12 (4-bits for each color |
; channel) bytes to store the lookup table. It takes just a few |
; more cycles, and only requires 48 bytes of precious RAM (16 |
; per color channel, since our resolution on each color channel |
; is only 4-bits). Not bad....for more information, see: |
; http://www.cs.cmu.edu/~trb/papers/wirevision00.pdf for more |
; information on this color segmentation technique. |
; One other note: this code does depend on the colorMap residing |
; at a well-defined position in memory; specifically, it mus |
; start at a 256-byte boundary so that the lowest byte in the |
; map is set to 0x00. Currently, the colorMap is forced to |
; start at RAM location 0x300. This could potentially be changed |
; by the developer if needed, but offsets would have to be added |
; in to the colorMap look-up code below to make it work. |
; These are the registers that will be used throughout this |
; module for acquiring each line of pixel data |
pixelCount = 16 |
pixelRunStart = 17 |
lastColor = 18 |
tmp1 = 19 ; be sure to not use tmp1 and color simultaneously |
tmp2 = 20 |
color = 19 |
greenData = 20 |
blueData = 21 |
colorMapLow = 22 |
colorMapHigh = 23 |
prevLineBuffLow = 22 ; overlaps with memLookupLow (but orthogonal) |
prevLineBuffHigh = 23 ; overlaps with memLookupHigh (but orthogonal) |
currLineBuffLow = 24 |
currLineBuffHigh = 25 |
.section .text |
; These are the global assembly function names that are accessed via other |
; C functions |
.global CamIntAsm_waitForNewTrackingFrame |
.global CamIntAsm_waitForNewDumpFrame |
.global CamIntAsm_acquireDumpLine |
.global CamIntAsm_acquireTrackingLine |
.global SIG_INTERRUPT0 |
.global SIG_INTERRUPT1 |
.global SIG_OVERFLOW0 |
.global SIG_OVERFLOW1 |
;***************************************************************** |
; Function Name: CamIntAsm_waitForNewTrackingFrame |
; Function Description: This function is responsible for |
; going to sleep until a new frame begins (indicated by |
; VSYNC transitioning from low to high. This will wake |
; the "VSYNC sleep" up and allow it to continue with |
; the acquireLine function, where the system waits for |
; an "HREF sleep" that we use to synchronize with the |
; data. |
; Inputs: r25 - MSB of currentLineBuffer |
; r24 - LSB of currentLineBuffer |
; r23 - MSB of colorMap |
; r22 - LSB of colorMap |
; Outputs: none |
; NOTES: This function doesn't really return...it sorta just |
; floats into the acquireLine function after the "VSYNC sleep" |
; is awoken, then begins processing the line data. Once |
; 176 pixels are sampled (and the counter overflows), then |
; an interrupt will occur, the 'T' bit in the SREG will be |
; set, and the function will return. |
;***************************************************************** |
CamIntAsm_waitForNewTrackingFrame: |
sbi _SFR_IO_ADDR(PORTD),PD6 ; For testing... |
cbi _SFR_IO_ADDR(PORTD),PD6 |
sleep |
;***************************************************************** |
; REMEMBER...everything from here on out is critically timed to be |
; synchronized with the flow of pixel data from the camera... |
;***************************************************************** |
CamIntAsm_acquireTrackingLine: |
brts _cleanUp |
;sbi _SFR_IO_ADDR(PORTD),PD6 ; For testing... |
;cbi _SFR_IO_ADDR(PORTD),PD6 |
in tmp1,_SFR_IO_ADDR(TCCR1B) ; Enable the PCLK line to actually |
ori tmp1, 0x07 ; feed Timer1 |
out _SFR_IO_ADDR(TCCR1B),tmp1 |
; The line is about to start... |
ldi pixelCount,0 ; Initialize the RLE stats... |
ldi pixelRunStart,PIXEL_RUN_START_INITIAL ; Remember, we always calculate |
; the pixel run length as |
; TCNT1L - pixelRunStart |
ldi lastColor,0x00 ; clear out the last color before we start |
mov XH,currLineBuffHigh ; Load the pointer to the current line |
mov XL,currLineBuffLow ; buffer into the X pointer regs |
mov ZH,colorMapHigh ; Load the pointers to the membership |
mov ZL,colorMapLow ; lookup tables (ZL and YL will be overwritten |
mov YH,colorMapHigh ; as soon as we start reading data) to Z and Y |
in tmp1, _SFR_IO_ADDR(TIMSK) ; enable TIMER1 to start counting |
ori tmp1, ENABLE_PCLK_TIMER1_OVERFLOW_BITMASK ; external PCLK pulses and interrupt on |
out _SFR_IO_ADDR(TIMSK),tmp1 ; overflow |
ldi tmp1,PIXEL_RUN_START_INITIAL ; set up the TCNT1 to overflow (and |
ldi tmp2,0xFF ; interrupts) after 176 pixels |
out _SFR_IO_ADDR(TCNT1H),tmp2 |
out _SFR_IO_ADDR(TCNT1L),tmp1 |
mov YL,colorMapLow |
in tmp1, _SFR_IO_ADDR(GICR) ; enable the HREF interrupt...remember, we |
; only use this interrupt to synchronize |
; the beginning of the line |
ori tmp1, HREF_INTERRUPT_ENABLE_MASK |
out _SFR_IO_ADDR(GICR), tmp1 |
;******************************************************************************************* |
; Track Frame handler |
;******************************************************************************************* |
_trackFrame: |
sbi _SFR_IO_ADDR(PORTD),PD6 |
sleep ; ...And we wait... |
; Returning from the interrupt/sleep wakeup will consume |
; 14 clock cycles (7 to wakeup from idle sleep, 3 to vector, and 4 to return) |
; Disable the HREF interrupt |
cbi _SFR_IO_ADDR(PORTD),PD6 |
in tmp1, _SFR_IO_ADDR(GICR) |
andi tmp1, HREF_INTERRUPT_DISABLE_MASK |
out _SFR_IO_ADDR(GICR), tmp1 |
; A couple of NOPs are needed here to sync up the pixel data...the number (2) |
; of NOPs was determined emperically by trial and error. |
nop |
nop |
_acquirePixelBlock: ; Clock Cycle Count |
in ZL,RB_PORT ; sample the red value (PINB) (1) |
in YL,G_PORT ; sample the green value (PINC) (1) |
andi YL,0x0F ; clear the high nibble (1) |
ldd color,Z+RED_MEM_OFFSET ; lookup the red membership (2) |
in ZL,RB_PORT ; sample the blue value (PINB) (1) |
ldd greenData,Y+GREEN_MEM_OFFSET; lookup the green membership (2) |
ldd blueData,Z+BLUE_MEM_OFFSET ; lookup the blue membership (2) |
and color,greenData ; mask memberships together (1) |
and color,blueData ; to produce the final color (1) |
brts _cleanUpTrackingLine ; if some interrupt routine has (1...not set) |
; come in and set our T flag in |
; SREG, then we need to hop out |
; and blow away this frames data (common cleanup) |
cp color,lastColor ; check to see if the run continues (1) |
breq _acquirePixelBlock ; (2...equal) |
; ___________ |
; 16 clock cycles |
; (16 clock cycles = 1 uS = 1 pixelBlock time) |
; Toggle the debug line to indicate a color change |
sbi _SFR_IO_ADDR(PORTD),PD6 |
nop |
cbi _SFR_IO_ADDR(PORTD),PD6 |
mov tmp2,pixelRunStart ; get the count value of the |
; current pixel run |
in pixelCount,_SFR_IO_ADDR(TCNT1L) ; get the current TCNT1 value |
mov pixelRunStart,pixelCount ; reload pixelRunStart for the |
; next run |
sub pixelCount,tmp2 ; pixelCount = TCNT1L - pixelRunStart |
st X+,lastColor ; record the color run in the current line buffer |
st X+,pixelCount ; with its length |
mov lastColor,color ; set lastColor so we can figure out when it changes |
nop ; waste one more cycle for a total of 16 |
rjmp _acquirePixelBlock |
; _cleanUpTrackingLine is used to write the last run length block off to the currentLineBuffer so |
; that all 176 pixels in the line are accounted for. |
_cleanUpTrackingLine: |
ldi pixelCount,0xFF ; the length of the last run is ALWAYS 0xFF minus the last |
sub pixelCount,pixelRunStart ; pixelRunStart |
inc pixelCount ; increment pixelCount since we actually need to account |
; for the overflow of TCNT1 |
st X+,color ; record the color run in the current line buffer |
st X,pixelCount |
rjmp _cleanUp |
_cleanUpDumpLine: |
; NOTE: If serial data is received, to interrupt the tracking of a line, we'll |
; get a EV_SERIAL_DATA_RECEIVED event, and the T bit set so we will end the |
; line's processing...however, the PCLK will keep on ticking for the rest of |
; the frame/line, which will cause the TCNT to eventually overflow and |
; interrupt us, generating a EV_ACQUIRE_LINE_COMPLETE event. We don't want |
; this, so we need to actually turn off the PCLK counting each time we exit |
; this loop, and only turn it on when we begin acquiring lines.... |
; NOT NEEDED FOR NOW... |
;in tmp1, _SFR_IO_ADDR(TIMSK) ; disable TIMER1 to stop counting |
;andi tmp1, DISABLE_PCLK_TIMER1_OVERFLOW_BITMASK ; external PCLK pulses |
;out _SFR_IO_ADDR(TIMSK),tmp1 |
_cleanUp: |
; Disable the external clocking of the Timer1 counter |
in tmp1, _SFR_IO_ADDR(TCCR1B) |
andi tmp1, 0xF8 |
out _SFR_IO_ADDR(TCCR1B),tmp1 |
; Toggle the debug line to indicate the line is complete |
sbi _SFR_IO_ADDR(PORTD),PD6 |
cbi _SFR_IO_ADDR(PORTD),PD6 |
clt ; clear out the T bit since we have detected |
; the interruption and are exiting to handle it |
_exit: |
ret |
;***************************************************************** |
; Function Name: CamIntAsm_waitForNewDumpFrame |
; Function Description: This function is responsible for |
; going to sleep until a new frame begins (indicated by |
; VSYNC transitioning from low to high. This will wake |
; the "VSYNC sleep" up and allow it to continue with |
; acquiring a line of pixel data to dump out to the UI. |
; Inputs: r25 - MSB of currentLineBuffer |
; r24 - LSB of currentLineBuffer |
; r23 - MSB of prevLineBuffer |
; r22 - LSB of prevLineBuffer |
; Outputs: none |
; NOTES: This function doesn't really return...it sorta just |
; floats into the acquireDumpLine function after the "VSYNC sleep" |
; is awoken. |
;***************************************************************** |
CamIntAsm_waitForNewDumpFrame: |
sbi _SFR_IO_ADDR(PORTD),PD6 ; For testing... |
cbi _SFR_IO_ADDR(PORTD),PD6 |
sleep |
;***************************************************************** |
; REMEMBER...everything from here on out is critically timed to be |
; synchronized with the flow of pixel data from the camera... |
;***************************************************************** |
CamIntAsm_acquireDumpLine: |
brts _cleanUp |
;sbi _SFR_IO_ADDR(PORTD),PD6 ; For testing... |
;cbi _SFR_IO_ADDR(PORTD),PD6 |
mov XH,currLineBuffHigh ; Load the pointer to the current line |
mov XL,currLineBuffLow ; buffer into the X pointer regs |
mov YH,prevLineBuffHigh ; Load the pointer to the previous line |
mov YL,prevLineBuffLow ; buffer into the Y pointer regs |
ldi tmp1,PIXEL_RUN_START_INITIAL ; set up the TCNT1 to overflow (and |
ldi tmp2,0xFF ; interrupts) after 176 pixels |
out _SFR_IO_ADDR(TCNT1H),tmp2 |
out _SFR_IO_ADDR(TCNT1L),tmp1 |
in tmp1, _SFR_IO_ADDR(TCCR1B) ; Enable the PCLK line to actually |
ori tmp1, 0x07 ; feed Timer1 |
out _SFR_IO_ADDR(TCCR1B),tmp1 |
nop |
in tmp1, _SFR_IO_ADDR(TIMSK) ; enable TIMER1 to start counting |
ori tmp1, ENABLE_PCLK_TIMER1_OVERFLOW_BITMASK ; external PCLK pulses and interrupt on |
out _SFR_IO_ADDR(TIMSK),tmp1 ; overflow |
in tmp1, _SFR_IO_ADDR(GICR) ; enable the HREF interrupt...remember, we |
; only use this interrupt to synchronize |
; the beginning of the line |
ori tmp1, HREF_INTERRUPT_ENABLE_MASK |
out _SFR_IO_ADDR(GICR), tmp1 |
;******************************************************************************************* |
; Dump Frame handler |
;******************************************************************************************* |
_dumpFrame: |
sbi _SFR_IO_ADDR(PORTD),PD6 |
sleep ; ...And we wait... |
cbi _SFR_IO_ADDR(PORTD),PD6 |
in tmp1, _SFR_IO_ADDR(GICR) ; disable the HREF interrupt |
andi tmp1, HREF_INTERRUPT_DISABLE_MASK ; so we don't get interrupted |
out _SFR_IO_ADDR(GICR), tmp1 ; while dumping the line |
nop ; Remember...if we ever remove the "cbi" instruction above, |
; we need to add two more NOPs to cover this |
; Ok...the following loop needs to run in 8 clock cycles, so we can get every |
; pixel in the line...this shouldn't be a problem, since the PCLK timing was |
; reduced by a factor of 2 whenever we go to dump a line (this is to give us |
; enough time to do the sampling and storing of the pixel data). In addition, |
; it is assumed that we will have to do some minor processing on the data right |
; before we send it out, like mask off the top 4-bits of each, and then pack both |
; low nibbles into a single byte for transmission...we just don't have time to |
; do that here (only 8 instruction cycles :-) ) |
_sampleDumpPixel: |
in tmp1,G_PORT ; sample the G value (1) |
in tmp2,RB_PORT ; sample the R/B value (1) |
st X+,tmp1 ; store to the currLineBuff and inc ptrs(2) |
st Y+,tmp2 ; store to the prevLineBuff and inc ptrs(2) |
brtc _sampleDumpPixel ; loop back unless flag is set (2...if not set) |
; ___________ |
; 8 cycles normally |
; if we make it here, it means the T flag is set, and we must have been interrupted |
; so we need to exit (what if we were interrupted for serial? should we disable it?) |
rjmp _cleanUpDumpLine |
;*********************************************************** |
; Function Name: <interrupt handler for External Interrupt0> |
; Function Description: This function is responsible |
; for handling a rising edge on the Ext Interrupt 0. This |
; routine simply returns, since we just want to wake up |
; whenever the VSYNC transitions (meaning the start of a new |
; frame). |
; Inputs: none |
; Outputs: none |
;*********************************************************** |
SIG_INTERRUPT0: |
; This will wake us up when VSYNC transitions high...we just want to return |
reti |
;*********************************************************** |
; Function Name: <interrupt handler for External Interrupt1> |
; Function Description: This function is responsible |
; for handling a falling edge on the Ext Interrupt 1. This |
; routine simply returns, since we just want to wake up |
; whenever the HREF transitions (meaning the pixels |
; are starting after VSYNC transitioned, and we need to |
; start acquiring the pixel blocks |
; Inputs: none |
; Outputs: none |
;*********************************************************** |
SIG_INTERRUPT1: |
; This will wake us up when HREF transitions high...we just want to return |
reti |
;*********************************************************** |
; Function Name: <interrupt handler for Timer0 overflow> |
; Function Description: This function is responsible |
; for handling the Timer0 overflow (hooked up to indicate |
; when we have reached the number of HREFs required in a |
; single frame). We set the T flag in the SREG to |
; indicate to the _acquirePixelBlock routine that it needs |
; to exit, and then set the appropriate action to take in |
; the eventList of the Executive module. |
; Inputs: none |
; Outputs: none |
; Note: Originally, the HREF pulses were also going to |
; be counted by a hardware counter, but it didn't end up |
; being necessary |
;*********************************************************** |
;SIG_OVERFLOW0: |
; set ; set the T bit in SREG |
; lds tmp1,eventBitmask |
; ori tmp1,EV_ACQUIRE_FRAME_COMPLETE |
; sts eventBitmask,tmp1 |
; reti |
;*********************************************************** |
; Function Name: <interrupt handler for Timer1 overflow> |
; Function Description: This function is responsible |
; for handling the Timer1 overflow (hooked up to indicate |
; when we have reached the end of a line of pixel data, |
; since PCLK is hooked up to overflow TCNT1 after 176 |
; pixels). This routine generates an acquire line complete |
; event in the fastEventBitmask, which is streamlined for |
; efficiency reasons. |
;*********************************************************** |
SIG_OVERFLOW1: |
lds tmp1,fastEventBitmask ; set a flag indicating |
ori tmp1,FEV_ACQUIRE_LINE_COMPLETE ; a line is complete |
sts fastEventBitmask,tmp1 |
set ; set the T bit in SREG |
;sbi _SFR_IO_ADDR(PORTD),PD6 ; For testing... |
;cbi _SFR_IO_ADDR(PORTD),PD6 ; For testing... |
reti |
; This is the default handler for all interrupts that don't |
; have handler routines specified for them. |
.global __vector_default |
__vector_default: |
reti |
.end |
/programy/C/avr/AVRcam/CommonDefs.h |
---|
0,0 → 1,81 |
#ifndef COMMONDEFS_H |
#define COMMONDEFS_H |
/* |
Copyright (C) 2004 John Orlando |
AVRcam: a small real-time image processing engine. |
This program is free software; you can redistribute it and/or |
modify it under the terms of the GNU General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
General Public License for more details. |
You should have received a copy of the GNU General Public |
License along with this program; if not, write to the Free Software |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
For more information on the AVRcam, please contact: |
john@jrobot.net |
or go to www.jrobot.net for more details regarding the system. |
*/ |
/*********************************************************** |
Module Name: CommonDefs.h |
Module Date: 04/10/2004 |
Module Auth: John Orlando |
Description: This module provides some of the generic |
definitions and declarations needed by the AVRcam |
system. |
Revision History: |
Date Rel Ver. Notes |
4/10/2004 0.1 Module created |
6/30/2004 1.0 Initial release for Circuit Cellar |
contest. |
11/15/2004 1.2 Added the NO_CRYSTAL definition |
for when the OV6620 is providing |
the mega8's clock source. |
***********************************************************/ |
#include <avr/interrupt.h> |
/* Defines */ |
/* FOSC defines the frequency of the crystal connected to |
the mega8, supplying the instruction clock cycle */ |
#define FOSC 16000000 |
/* For defining boolean operations */ |
typedef unsigned char bool_t; |
#define TRUE 1 |
#define FALSE 0 |
#define BIT0 0 |
#define BIT1 1 |
#define BIT2 2 |
#define BIT3 3 |
#define BIT4 4 |
#define BIT5 5 |
#define BIT6 6 |
#define BIT7 7 |
#define DISABLE_INTS() cli() |
#define ENABLE_INTS() sei() |
//#define SIMULATION 1 |
//#define SLOW_FRAMES 1 |
//#define DEBUG_FRAME_DATA 1 |
//#define DEBUG_TRACKED_LINE 1 |
//#define DEBUG_COLOR_MAP 1 |
#define COMPLETE_COLOR_MAP 1 |
#define NO_CRYSTAL 1 |
#endif |
/programy/C/avr/AVRcam/DebugInterface.c |
---|
0,0 → 1,89 |
/* |
Copyright (C) 2004 John Orlando |
AVRcam: a small real-time image processing engine. |
This program is free software; you can redistribute it and/or |
modify it under the terms of the GNU General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
General Public License for more details. |
You should have received a copy of the GNU General Public |
License along with this program; if not, write to the Free Software |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
For more information on the AVRcam, please contact: |
john@jrobot.net |
or go to www.jrobot.net for more details regarding the system. |
*/ |
/*********************************************************** |
Module Name: DebugInterface.c |
Module Date: 04/15/2004 |
Module Auth: John Orlando |
Description: This module is responsible for providing a |
debug interface to the system. Currently, the only |
debugging that is available is through the on-board |
UART (which is used by the main application as well) in |
addition to the LED hooked up at PORTD bit 6. |
Revision History: |
Date Rel Ver. Notes |
4/10/2004 0.1 Module created |
6/30/2004 1.0 Initial release for Circuit Cellar |
contest. |
***********************************************************/ |
/* Includes */ |
#include "CommonDefs.h" |
#include "UartInterface.h" |
#include "Utility.h" |
/* Local Variables */ |
/* Local Structures and Typedefs */ |
/* Extern Variables */ |
/* Definitions */ |
/*********************************************************** |
Function Name: DebugInt_init |
Function Description: This function is responsible for |
initializing the debug module. It sets up the debug LED |
as well as any other debugging that will be done. The |
LED blinks four times, which indicates to the user |
that the system is available for re-programming if |
necessary. This works because the data lines on the |
OV6620 are still tri-stated at this point, but won't |
be for long after this function returns. |
Inputs: none |
Outputs: none |
***********************************************************/ |
void DebugInt_init(void) |
{ |
/* set PortD pin6 for output */ |
DDRD |= 0x40; |
/* turn on LED */ |
PORTD |= 0x40; |
Utility_delay(500); |
PORTD &= 0xBF; |
Utility_delay(500); |
PORTD |= 0x40; |
Utility_delay(500); |
PORTD &= 0xBF; |
Utility_delay(500); |
PORTD |= 0x40; |
Utility_delay(500); |
PORTD &= 0xBF; |
Utility_delay(500); |
PORTD |= 0x40; |
} |
/programy/C/avr/AVRcam/DebugInterface.d |
---|
0,0 → 1,0 |
DebugInterface.o DebugInterface.d : DebugInterface.c CommonDefs.h UartInterface.h Utility.h |
/programy/C/avr/AVRcam/DebugInterface.h |
---|
0,0 → 1,48 |
#ifndef DEBUGINTERFACE_H |
#define DEBUGINTERFACE_H |
/* |
Copyright (C) 2004 John Orlando |
AVRcam: a small real-time image processing engine. |
This program is free software; you can redistribute it and/or |
modify it under the terms of the GNU General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
General Public License for more details. |
You should have received a copy of the GNU General Public |
License along with this program; if not, write to the Free Software |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
For more information on the AVRcam, please contact: |
john@jrobot.net |
or go to www.jrobot.net for more details regarding the system. |
*/ |
/*********************************************************** |
Module Name: DebugInterface.h |
Module Date: 04/15/2004 |
Module Auth: John Orlando |
Description: This file is responsible for providing the |
external interface to the DebugInterface module. |
Revision History: |
Date Rel Ver. Notes |
4/10/2004 0.1 Module created |
6/30/2004 1.0 Initial release for Circuit Cellar |
contest. |
***********************************************************/ |
/* Extern Functions */ |
extern void DebugInt_init(void); |
#endif |
/programy/C/avr/AVRcam/Events.h |
---|
0,0 → 1,78 |
#ifndef EVENTS_H |
#define EVENTS_H |
/* |
Copyright (C) 2004 John Orlando |
AVRcam: a small real-time image processing engine. |
This program is free software; you can redistribute it and/or |
modify it under the terms of the GNU General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
General Public License for more details. |
You should have received a copy of the GNU General Public |
License along with this program; if not, write to the Free Software |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
For more information on the AVRcam, please contact: |
john@jrobot.net |
or go to www.jrobot.net for more details regarding the system. |
*/ |
/*********************************************************** |
Module Name: Events.h |
Module Date: 05/23/2004 |
Module Auth: John Orlando |
Description: This file provides the external interface |
to the events that can be published/processed in the |
system. It is specifically by itself (and nothing |
else should be defined in here) so that both .c and |
.S (assembly) files can include this file without |
a problem. |
Revision History: |
Date Rel Ver. Notes |
4/10/2004 0.1 Module created |
6/30/2004 1.0 Initial release for Circuit Cellar |
contest. |
*******************************************************/ |
/* Definitions */ |
/* Originally, all events were passed in a bitmask...however, |
an event FIFO was finally used, but the coding of the event |
definitions were never translated back....doesn't make a |
difference, but looks a little weird */ |
#define EV_SERIAL_DATA_RECEIVED 0x01 |
#define EV_DUMP_FRAME 0x02 |
#define EV_PROCESS_FRAME_COMPLETE 0x04 |
#define EV_PROCESS_LINE_COMPLETE 0x08 |
#define EV_ACQUIRE_LINE_COMPLETE 0x10 |
#define EV_ACQUIRE_FRAME_COMPLETE 0x20 |
#define EV_CONFIGURE_CAMERA 0x40 |
#define EV_ENABLE_TRACKING 0x80 |
#define EV_DISABLE_TRACKING 0x81 |
#define EV_SERIAL_DATA_PENDING_TX 0x90 |
#define EV_RED_COLOR_MAP_RECEIVED 0x91 |
#define EV_BLUE_COLOR_MAP_RECEIVED 0x92 |
#define EV_GREEN_COLOR_MAP_RECEIVED 0x93 |
/* This is used to pass fast events through the system |
so there is a minimum of processing time needed |
between lines of tracking data */ |
#define FEV_ACQUIRE_LINE_COMPLETE 0x01 |
#define FEV_PROCESS_LINE_COMPLETE 0x02 |
/* This is needed for the event fifo */ |
#define EXEC_EVENT_FIFO_SIZE 8 |
#define EXEC_EVENT_FIFO_MASK EXEC_EVENT_FIFO_SIZE-1 |
#endif |
/programy/C/avr/AVRcam/Executive.c |
---|
0,0 → 1,219 |
/* |
Copyright (C) 2004 John Orlando |
AVRcam: a small real-time image processing engine. |
This program is free software; you can redistribute it and/or |
modify it under the terms of the GNU General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
General Public License for more details. |
You should have received a copy of the GNU General Public |
License along with this program; if not, write to the Free Software |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
For more information on the AVRcam, please contact: |
john@jrobot.net |
or go to www.jrobot.net for more details regarding the system. |
*/ |
/*********************************************************** |
Module Name: Executive.c |
Module Date: 04/12/2004 |
Module Auth: John Orlando |
Description: This file is responsible for implementing a |
minimalist event dispatcher. It keeps track of an event |
fifo that waits for new events to come in, and dispatches |
them to any entities that care about them. |
Revision History: |
Date Rel Ver. Notes |
4/10/2004 0.1 Module created |
6/30/2004 1.0 Initial release for Circuit Cellar |
contest. |
1/16/2005 1.4 Fixed issue where the interrupts weren't |
being turned off when the fastEventBitmask |
was being accessed. Also removed redundant |
interrupt masking when accessing the |
main event fifo. Also fixed issue where |
the main event fifo wasn't being checked |
for events if an event was pending in |
the fast event fifo. |
***********************************************************/ |
/* Includes */ |
#include <stdlib.h> |
#include "CommonDefs.h" |
#include "Executive.h" |
#include "FrameMgr.h" |
#include "CamInterface.h" |
#include "UIMgr.h" |
#include "UartInterface.h" |
#include "CamConfig.h" |
#include "Utility.h" |
/* Local Variables */ |
unsigned char Exec_eventFifo[EXEC_EVENT_FIFO_SIZE]; |
unsigned char Exec_eventFifoHead=0; |
unsigned char Exec_eventFifoTail=0; |
/* Local Function Definitions */ |
static unsigned char Exec_readEventFifo(void); |
/* Local Structures and Typedefs */ |
/* Extern Variables */ |
/* This bitmask holds events that need to be processed as fast as possible */ |
unsigned char fastEventBitmask = 0x00; |
/* Definitions */ |
#define IS_DATA_IN_EVENT_FIFO() (!(Exec_eventFifoHead == Exec_eventFifoTail)) |
/*********************************************************** |
Function Name: Exec_run |
Function Description: This function is responsible for |
running the main control loop. The control loop is |
based on checking both the fast-event bitmask (for high |
priority events) and the event FIFO to determine if an |
event needs to be handled. The event is then dispatched |
to the appropriate handler. |
Inputs: none |
Outputs: none |
***********************************************************/ |
void Exec_run(void) |
{ |
unsigned char eventGenerated; |
while(1) |
{ |
if (fastEventBitmask) |
{ |
/* an event needing fast processing has been received */ |
/* a received line needs to be processed...this |
needs to be processed as quickly as possible */ |
if (fastEventBitmask & FEV_ACQUIRE_LINE_COMPLETE) |
{ |
DISABLE_INTS(); |
fastEventBitmask &= ~FEV_ACQUIRE_LINE_COMPLETE; |
ENABLE_INTS(); |
FrameMgr_processLine(); |
/* also check if serial data needs to be sent |
out through UIMgr */ |
UIMgr_transmitPendingData(); |
/* we can't just call acquire line again here, |
since we don't know if we need to acquire another |
line or not (it depends on the FrameMgr to figure |
this out) */ |
} |
if (fastEventBitmask & FEV_PROCESS_LINE_COMPLETE) |
{ |
DISABLE_INTS(); |
fastEventBitmask &= ~FEV_PROCESS_LINE_COMPLETE; |
ENABLE_INTS(); |
FrameMgr_acquireLine(); |
} |
} |
if (IS_DATA_IN_EVENT_FIFO() == TRUE) |
{ |
eventGenerated = Exec_readEventFifo(); |
switch(eventGenerated) |
{ |
case (EV_DUMP_FRAME): |
FrameMgr_dispatchEvent(eventGenerated); |
break; |
case (EV_ENABLE_TRACKING): |
FrameMgr_dispatchEvent(eventGenerated); |
break; |
case (EV_DISABLE_TRACKING): |
FrameMgr_dispatchEvent(eventGenerated); |
break; |
case (EV_ACQUIRE_LINE_COMPLETE): |
FrameMgr_dispatchEvent(eventGenerated); |
UIMgr_dispatchEvent(eventGenerated); |
break; |
case (EV_ACQUIRE_FRAME_COMPLETE): |
FrameMgr_dispatchEvent(eventGenerated); |
break; |
case (EV_PROCESS_LINE_COMPLETE): |
FrameMgr_dispatchEvent(eventGenerated); |
break; |
case (EV_PROCESS_FRAME_COMPLETE): |
FrameMgr_dispatchEvent(eventGenerated); |
break; |
case (EV_SERIAL_DATA_RECEIVED): |
UIMgr_dispatchEvent(eventGenerated); |
FrameMgr_dispatchEvent(eventGenerated); |
break; |
case (EV_SERIAL_DATA_PENDING_TX): |
UIMgr_dispatchEvent(eventGenerated); |
break; |
default: |
break; |
} |
} |
/* toggle the debug line */ |
} |
} |
/*********************************************************** |
Function Name: Exec_readEventFifo |
Function Description: This function is responsible for |
reading a single event out of the event fifo. |
Inputs: none |
Outputs: unsigned char-the data read |
***********************************************************/ |
static unsigned char Exec_readEventFifo(void) |
{ |
unsigned char dataByte, tmpTail; |
DISABLE_INTS(); |
/* just return the current tail from the tx fifo */ |
dataByte = Exec_eventFifo[Exec_eventFifoTail]; |
tmpTail = (Exec_eventFifoTail+1) & (EXEC_EVENT_FIFO_MASK); |
Exec_eventFifoTail = tmpTail; |
ENABLE_INTS(); |
return(dataByte); |
} |
/*********************************************************** |
Function Name: Exec_writeEventFifo |
Function Description: This function is responsible for |
writing a single event to the event fifo and |
updating the appropriate pointers. |
Inputs: data - the byte to write to the Fifo |
Outputs: none |
***********************************************************/ |
void Exec_writeEventFifo(unsigned char event) |
{ |
unsigned char tmpHead; |
DISABLE_INTS(); |
Exec_eventFifo[Exec_eventFifoHead] = event; |
/* now move the head up */ |
tmpHead = (Exec_eventFifoHead + 1) & (EXEC_EVENT_FIFO_MASK); |
Exec_eventFifoHead = tmpHead; |
ENABLE_INTS(); |
} |
/programy/C/avr/AVRcam/Executive.d |
---|
0,0 → 1,3 |
Executive.o Executive.d : Executive.c CommonDefs.h Executive.h Events.h FrameMgr.h \ |
CamInterface.h UIMgr.h UartInterface.h CamConfig.h I2CInterface.h \ |
Utility.h |
/programy/C/avr/AVRcam/Executive.h |
---|
0,0 → 1,66 |
#ifndef EXECUTIVE_H |
#define EXECUTIVE_H |
/* |
Copyright (C) 2004 John Orlando |
AVRcam: a small real-time image processing engine. |
This program is free software; you can redistribute it and/or |
modify it under the terms of the GNU General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
General Public License for more details. |
You should have received a copy of the GNU General Public |
License along with this program; if not, write to the Free Software |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
For more information on the AVRcam, please contact: |
john@jrobot.net |
or go to www.jrobot.net for more details regarding the system. |
*/ |
/*********************************************************** |
Module Name: Executive.h |
Module Date: 04/12/2004 |
Module Auth: John Orlando |
Description: This file provides the external interface |
to the Executive module. |
Revision History: |
Date Rel Ver. Notes |
4/10/2004 0.1 Module created |
6/30/2004 1.0 Initial release for Circuit Cellar |
contest. |
*******************************************************/ |
#include "Events.h" |
/* Definitions */ |
#define PUBLISH_EVENT(event) Exec_writeEventFifo(event) |
#define PUBLISH_FAST_EVENT(event) fastEventBitmask |= event |
/* Extern Functions */ |
extern void Exec_run(void); |
extern void Exec_writeEventFifo(unsigned char event); |
/* Extern Data */ |
extern unsigned char fastEventBitmask; |
extern unsigned char Exec_eventFifo[]; |
extern unsigned char Exec_eventFifoHead; |
extern unsigned char Exec_eventFifoTail; |
#endif |
/programy/C/avr/AVRcam/FrameMgr.c |
---|
0,0 → 1,792 |
/* |
Copyright (C) 2004 John Orlando |
AVRcam: a small real-time image processing engine. |
This program is free software; you can redistribute it and/or |
modify it under the terms of the GNU General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
General Public License for more details. |
You should have received a copy of the GNU General Public |
License along with this program; if not, write to the Free Software |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
For more information on the AVRcam, please contact: |
john@jrobot.net |
or go to www.jrobot.net for more details regarding the system. |
*/ |
/********************************************************* |
Module Name: FrameMgr.c |
Module Date: 04/10/2004 |
Module Auth: John Orlando |
Description: This modules is responsible for performing |
both medium and high level processing on image data. |
This is performed at both the line level as well as |
the frame level. It controls the main flow of the |
system, adhering to all the critical timing |
requirements (such as when serial data can be transferred, |
etc). |
Revision History: |
Date Rel Ver. Notes |
4/10/2004 0.1 Module created |
6/30/2004 1.0 Initial release for Circuit Cellar |
contest. |
11/15/2004 1.2 Updated processLine() function so |
it will remove objects less than |
a specified length/width (reduces |
shot noise) |
*********************************************************/ |
/* Includes */ |
#include <stdlib.h> |
#include <string.h> |
#include <avr/io.h> |
#include "Executive.h" |
#include "UIMgr.h" |
#include "FrameMgr.h" |
#include "CamInterface.h" |
#include "UartInterface.h" |
#include "Utility.h" |
#include "I2CInterface.h" |
#include "CamConfig.h" |
#include "CommonDefs.h" |
/* Local Structures and Typedefs */ |
enum |
{ |
ST_FrameMgr_idle, |
ST_FrameMgr_TrackingFrame, |
ST_FrameMgr_DumpingFrame |
}; |
typedef unsigned char FrameMgr_State_t; |
/* Definitions */ |
/* The most objects that can be tracked at any one time is 8. |
This number is determined by the number of bytes that can be |
sent out during a frame (one byte per line, 144 lines per frame) |
with the number of bytes in a tracked object (7) + some wiggle |
room :-) ... I guess this could be increased to around 20 if |
we had enough room and cycles to process objects between lines */ |
#define MAX_TRACKED_OBJECTS 8 |
/* This defines the number of bytes that make up a trackedObject_t |
structure... */ |
#define SIZE_OF_TRACKED_OBJECT 8 |
/* This define is used to turn off the timer overflow interrupt |
that is generated when the PCLK overflows TIMER1 */ |
#define DISABLE_PCLK_TIMER1_OVERFLOW_BITMASK 0xFB |
/* This define is used to determine if a run length is too small |
to be concerned with. This helps to reduce the number of false |
positives. */ |
#define MIN_OBJECT_TRACKING_WIDTH 3 |
/* This define is used to determine if an object has enough |
height to be considered worth tracking...it is used to reduce |
shot noise */ |
#define MIN_OBJECT_TRACKING_HEIGHT 3 |
/* This define is used to indicate how often the filter routine |
that removes objects less than MIN_OBJECT_TRACKING_HEIGHT should |
be executed. It is measured in a number of lines (7 nominally). */ |
#define RUN_OBJECT_FILTER_MASK 0x07 |
/* This enum describes the possible colors that can |
be tracked by the system. This can't be represented as |
simple color names (red, brown, etc) due to the fact that |
the user sets which colors will be associated with which |
bits. Remember...after the AND operation of the indexed |
color map values executes, either a single bit indicating |
the color should be set, or no bits indicating that the |
color isn't represented in the color map (notTracked). */ |
enum |
{ |
notTracked, |
color1, /* bit 1 color */ |
color2, /* bit 2 color */ |
color3, /* bit 3 color */ |
color4, /* bit 4 color */ |
color5, /* bit 5 color */ |
color6, /* bit 6 color */ |
color7, /* bit 7 color */ |
color8 /* bit 8 color */ |
}; |
typedef unsigned char trackedColor_t; |
/* This structure defines the info that needs to be |
maintained for each trackedObject in the trackingTable */ |
typedef struct |
{ |
trackedColor_t color; |
unsigned char lastLineXStart; |
unsigned char lastLineXFinish; |
unsigned char x_upperLeft; |
unsigned char y_upperLeft; |
unsigned char x_lowerRight; |
unsigned char y_lowerRight; |
unsigned char objectValid; /* used to be a fill byte...now it is |
used to determine if the object is valid |
or not...it gets invalidated if it is |
determined that it is too small, or |
that the object is within another object */ |
} trackedObject_t; |
/* These defines are used to index into each individual element in the |
trackedObject_t structure. This seems to be MUCH more efficient than |
accessing the elements in GCC. */ |
#define COLOR_OFFSET 0 |
#define LAST_LINE_X_START_OFFSET 1 |
#define LAST_LINE_X_FINISH_OFFSET 2 |
#define X_UPPER_LEFT_OFFSET 3 |
#define Y_UPPER_LEFT_OFFSET 4 |
#define X_LOWER_RIGHT_OFFSET 5 |
#define Y_LOWER_RIGHT_OFFSET 6 |
#define VALID_OBJECT_OFFSET 7 |
/* Local Variables */ |
/* The trackedObjectTable is used to hold up to eight tracked objects |
while they are being acquired. */ |
static trackedObject_t trackedObjectTable[MAX_TRACKED_OBJECTS]; |
static trackedObject_t *pCurrentTrackedObjectTable = trackedObjectTable; |
static unsigned char lineCount = 0; |
static FrameMgr_State_t currentState = ST_FrameMgr_idle; |
static unsigned char numCurrTrackedObjects = 0; |
static unsigned char numPrevTrackedObjects = 0; |
static unsigned char trackedLineCount = 0; |
/* Local Functions */ |
static void FrameMgr_findConnectedness(void); |
/* Extern Functions */ |
/* These functions are located in assembly files, and thus |
must be externed here so they can be referenced in the source below. */ |
extern void CamIntAsm_waitForNewTrackingFrame(unsigned char *pBuffer, unsigned char *pMemLookup); |
extern void CamIntAsm_waitForNewDumpFrame(unsigned char *pCurrBuffer, unsigned char *pPrevBuffer); |
extern void CamIntAsm_acquireTrackingLine(unsigned char *pBuffer, unsigned char *pMemLookup); |
extern void CamIntAsm_acquireDumpLine(unsigned char *pCurrBuffer, unsigned char *pPrevBuffer); |
/*********************************************************** |
Function Name: FrameMgr_init |
Function Description: This function is responsible |
for initializing the FrameMgr. This includes |
setting up the various buffers and data needed to |
process each frame of image data. |
Inputs: none |
Outputs: none |
***********************************************************/ |
void FrameMgr_init(void) |
{ |
memset(trackedObjectTable,0x00,sizeof(trackedObjectTable)); |
} |
/*********************************************************** |
Function Name: FrameMgr_dispatchEvent |
Function Description: This function is responsible for |
taking an incoming event and performing the needed |
actions with it as pertains to the FrameMgr. |
Inputs: event - the generated event |
Outputs: none |
***********************************************************/ |
void FrameMgr_dispatchEvent(unsigned char event) |
{ |
switch(event) |
{ |
case EV_DUMP_FRAME: |
/* try re-initializing the camera before we start dumping */ |
CamConfig_setCamReg(0x11,0x01); /* reduce the frame rate for dumping*/ |
CamConfig_sendFifoCmds(); |
Utility_delay(1000); /* allow the new frame rate to settle */ |
lineCount = 0; |
currentState = ST_FrameMgr_DumpingFrame; |
//CamIntAsm_waitForNewDumpFrame(currentLineBuffer,previousLineBuffer); |
FrameMgr_acquireLine(); |
break; |
case EV_ENABLE_TRACKING: |
currentState = ST_FrameMgr_TrackingFrame; |
FrameMgr_acquireFrame(); |
break; |
case EV_ACQUIRE_FRAME_COMPLETE: |
FrameMgr_processFrame(); |
break; |
case EV_PROCESS_FRAME_COMPLETE: |
FrameMgr_acquireFrame(); |
break; |
case EV_SERIAL_DATA_RECEIVED: |
if (currentState != ST_FrameMgr_idle) |
{ |
/* we need to go back to processing line data, since |
serial data reception interrupted us....just trash the |
frame and act like the frame has been processed, which |
will kick off the system to wait for the next line */ |
PUBLISH_EVENT(EV_PROCESS_FRAME_COMPLETE); |
} |
break; |
case EV_DISABLE_TRACKING: |
/* tracking needs to be turned off */ |
currentState = ST_FrameMgr_idle; |
break; |
} |
} |
/*********************************************************** |
Function Name: FrameMgr_acquireFrame |
Function Description: This function is responsible for |
beginning of the acquisition of a new frame of data |
from the camera interface. The acquisition of this line |
depends on the current state of the FrameMgr. |
Inputs: none |
Outputs: none |
***********************************************************/ |
void FrameMgr_acquireFrame(void) |
{ |
if (currentState == ST_FrameMgr_TrackingFrame) |
{ |
trackedLineCount = 0; |
numPrevTrackedObjects = numCurrTrackedObjects; |
numCurrTrackedObjects = 0; |
/* clear out the tracking table, and wait for the new frame |
to start */ |
memset(trackedObjectTable,0x00,sizeof(trackedObjectTable)); |
//CamIntAsm_waitForNewTrackingFrame(currentLineBuffer,colorMap); |
WAIT_FOR_VSYNC_HIGH(); |
CamIntAsm_acquireTrackingLine(currentLineBuffer,colorMap); |
} |
} |
/*********************************************************** |
Function Name: FrameMgr_acquireLine |
Function Description: This function is responsible for |
acquiring a line of data from the camera interface. |
The acquisition of this line depends on the current |
state of the FrameMgr. |
Inputs: none |
Outputs: none |
***********************************************************/ |
void FrameMgr_acquireLine(void) |
{ |
unsigned char tmpLineCount; |
/* clearing out the buffers takes too long...we should |
just overwrite the data here without a problem when |
we start acquiring...at no point do we check for |
a 0x00 value in the current or previous lineBuffers, |
so it was a bit excessive :-) */ |
/* check which state we are in and proceed as needed */ |
if (currentState == ST_FrameMgr_DumpingFrame) |
{ |
tmpLineCount = lineCount*2; |
/* clearing out the line data in dump mode is ok, and actually |
is needed, since it is possible for the first dump line in |
a frame to come back with the last line captured of the |
last capture session...*/ |
memset(currentLineBuffer,0x00,LENGTH_OF_LINE_BUFFER); |
memset(previousLineBuffer,0x00,LENGTH_OF_LINE_BUFFER); |
/* wait for another VSYNC so we know which frame to use |
to start looking for a line to receive */ |
WAIT_FOR_VSYNC_HIGH(); |
WAIT_FOR_VSYNC_LOW(); |
/* look at lineCount to determine how many HREFs we should |
wait before we start sampling */ |
while(tmpLineCount != 0) |
{ |
WAIT_FOR_HREF_HIGH(); |
tmpLineCount--; |
WAIT_FOR_HREF_LOW(); |
} |
/* we should now be ready to sample our line...*/ |
CamIntAsm_acquireDumpLine(currentLineBuffer,previousLineBuffer); |
} |
else if (currentState == ST_FrameMgr_TrackingFrame) |
{ |
WAIT_FOR_HREF_LOW(); |
CamIntAsm_acquireTrackingLine(currentLineBuffer,colorMap); |
} |
} |
/*********************************************************** |
Function Name: FrameMgr_processLine |
Function Description: This function is responsible for |
parsing the received image line and performing either |
connected region mapping (if in the Tracking state) or |
sending out the raw sampled data (if in the Dumping |
state). |
Inputs: none |
Outputs: none |
***********************************************************/ |
void FrameMgr_processLine(void) |
{ |
unsigned char i; |
volatile unsigned char dataToSend; |
unsigned char *pTrackedObjectData = (unsigned char *)pCurrentTrackedObjectTable; |
#ifdef DEBUG_TRACKED_LINE |
unsigned char *pSendData; |
unsigned char asciiBuffer[5]; |
unsigned char pixelCount = 0; |
#endif |
if (currentState == ST_FrameMgr_DumpingFrame) |
{ |
/* we want to sit in a tight loop and send the acquired data |
sitting in current and previous line buffers out the serial |
port...it is sent out the serial port immediately instead |
of going into the UIMgr tx fifo because we can't do anything |
until its sent out anyway...may as well just get it out now */ |
/* currentLineBuffer is getting "g" previousLineBuffer is getting "b-r" */ |
UartInt_txByte(0x0B); /* send the header byte */ |
UartInt_txByte(lineCount); /* send the line count */ |
for (i=0; i<NUM_PIXELS_IN_A_DUMP_LINE; i+=2) |
{ |
/* when a dump line is sampled, the upper byte can potentially |
have garbage in it...we don't have time to mask it off as we're |
sampling, so it is done here before we send it out...we also |
combine the samples together so we really are sending up a |
sample for line N as well as line N+1 */ |
dataToSend = currentLineBuffer[i]; |
dataToSend &= 0x0F; |
dataToSend <<= 4; |
dataToSend |= (previousLineBuffer[i] & 0x0F); |
/* dataToSend should be packed now */ |
UartInt_txByte(dataToSend); |
/* flip the colors around since we are doing all G on Y and BR on UV */ |
dataToSend = previousLineBuffer[i+1]; |
dataToSend &= 0x0F; |
dataToSend <<= 4; |
dataToSend |= (currentLineBuffer[i+1] & 0x0F); |
/* dataToSend should be packed now */ |
UartInt_txByte(dataToSend); |
} |
UartInt_txByte(0x0F); /* send line end */ |
/* once all the data is sent, increment out line count by 2 since |
we really get 2 lines worth of pixels on each pass */ |
/* Update...increment only by 1, but only send 72 double-lines */ |
lineCount++; |
/* check to see if we have retrieved all of the needed lines */ |
if (lineCount >= 72) /* half 144, since we send two lines at a time */ |
{ |
/* we're done, so send the dump complete?...nope, just change |
states and we should be fine */ |
lineCount = 0; |
currentState = ST_FrameMgr_idle; |
/* disable the PCLK counting overflow interrupt */ |
TIMSK &= DISABLE_PCLK_TIMER1_OVERFLOW_BITMASK; |
CamConfig_setCamReg(0x11,0x00); /* reset the frame rate to normal*/ |
CamConfig_sendFifoCmds(); |
} |
else |
{ |
/* we have more lines to acquire in this frame, so keep on truckin...*/ |
PUBLISH_FAST_EVENT(FEV_PROCESS_LINE_COMPLETE); |
} |
} |
else if (currentState == ST_FrameMgr_TrackingFrame) |
{ |
#ifdef DEBUG_TRACKED_LINE |
/* send the received line over serial...this should only send |
until a pixelCount == 176 */ |
pSendData = currentLineBuffer; |
itoa(trackedLineCount,asciiBuffer,10); |
UIMgr_txBuffer(asciiBuffer,3); |
UIMgr_txBuffer(" ",1); |
while(pixelCount < ACTUAL_NUM_PIXELS_IN_A_LINE) |
{ |
memset(asciiBuffer,0x00,5); |
itoa(*pSendData++,asciiBuffer,10); /* color is first byte */ |
UIMgr_txBuffer(asciiBuffer,3); /* 3 ascii bytes for data */ |
UIMgr_txBuffer(" ",1); |
pixelCount += *pSendData; /* run-length is second byte */ |
memset(asciiBuffer,0x00,5); |
itoa(*pSendData++,asciiBuffer,10); |
UIMgr_txBuffer(asciiBuffer,3); |
UIMgr_txBuffer(" ",1); |
} |
UIMgr_txBuffer("\n\r",2); |
trackedLineCount++; |
if (trackedLineCount == 144) |
{ |
UIMgr_txBuffer(" FC \n\r",8); |
trackedLineCount = 0; |
PUBLISH_EVENT(EV_PROCESS_FRAME_COMPLETE); |
} |
else |
{ |
PUBLISH_EVENT(EV_PROCESS_LINE_COMPLETE); |
} |
#else |
/* determine if any of the RLE blocks overlap */ |
FrameMgr_findConnectedness(); |
/* we also want to remove any objects that are less than |
a minimum height...we already removed portions of the |
run-length that are less than MIN_PIXEL_WIDTH in the |
findConnectedness() routine...doing it here instead of |
a function to speed things up...this may end up slowing down the |
frame rate slightly, and can be removed if this isn't needed */ |
/* run this routine once every 8 lines */ |
if ( (trackedLineCount & RUN_OBJECT_FILTER_MASK) == RUN_OBJECT_FILTER_MASK) |
{ |
for (i=0; i<MAX_TRACKED_OBJECTS; i++) |
{ |
if ( *(pTrackedObjectData + VALID_OBJECT_OFFSET) == TRUE) |
{ |
/* check to see if the object is already in |
our past...i.e., its last */ |
if ( (*(pTrackedObjectData + Y_LOWER_RIGHT_OFFSET) - |
*(pTrackedObjectData + Y_UPPER_LEFT_OFFSET)) < MIN_OBJECT_TRACKING_HEIGHT) |
{ |
/* the object is less than the minimum height...see if it is adjacent |
to the current line we just processed...if so, leave it here...otherwise, |
it needs to be invalidated since its too small */ |
if ( trackedLineCount - *(pTrackedObjectData + Y_LOWER_RIGHT_OFFSET) > 2) |
{ |
/* invalidate the object */ |
*(pTrackedObjectData + VALID_OBJECT_OFFSET) = FALSE; |
numCurrTrackedObjects--; |
} |
} |
} |
pTrackedObjectData += SIZE_OF_TRACKED_OBJECT; |
} |
} |
trackedLineCount++; |
if (trackedLineCount == ACTUAL_NUM_LINES_IN_A_FRAME) |
{ |
/* an entire frame of tracking data has been acquired, so |
publish an event letting the system know this fact */ |
PUBLISH_EVENT(EV_ACQUIRE_FRAME_COMPLETE); |
/* disable the PCLK counting overflow interrupt */ |
TIMSK &= DISABLE_PCLK_TIMER1_OVERFLOW_BITMASK; |
trackedLineCount = 0; |
} |
else |
{ |
PUBLISH_FAST_EVENT(FEV_PROCESS_LINE_COMPLETE); |
} |
#endif |
} |
else |
{ |
/* ...and here? */ |
} |
} |
/*********************************************************** |
Function Name: FrameMgr_processFrame |
Function Description: This function is responsible for |
parsing the completed frame and performing all actions |
needed at this level. |
Inputs: none |
Outputs: none |
***********************************************************/ |
void FrameMgr_processFrame(void) |
{ |
unsigned char i,k,color; |
#if DEBUG_FRAME_DATA |
unsigned char asciiBuffer[5]; |
unsigned char j; |
#endif |
unsigned char *pTableData = (unsigned char *)pCurrentTrackedObjectTable; |
unsigned char tmpUpperLeftX,tmpUpperLeftY,tmpLowerRightX,tmpLowerRightY; |
#if DEBUG_FRAME_DATA |
/* we want to send all of the currently tracked table out |
the serial port for debugging */ |
for (i=0; i<numCurrTrackedObjects; i++) |
{ |
UIMgr_txBuffer("----------\r\n",12); |
for (j=0; j<SIZE_OF_TRACKED_OBJECT; j++) |
{ |
memset(asciiBuffer,0x00,5); |
itoa(*pTableData++,asciiBuffer,10); |
UIMgr_txBuffer(asciiBuffer,3); /* 3 ascii bytes for data |
+ 1 space */ |
UIMgr_txBuffer("\r\n",2); |
} |
} |
/* finally, send a new line */ |
UIMgr_txBuffer("\r\n",2); |
memset(asciiBuffer,0x00,5); |
itoa(numCurrTrackedObjects,asciiBuffer,10); |
UIMgr_txBuffer(asciiBuffer,3); |
UIMgr_txBuffer(" PFC\r\n",5); |
#else |
/* we only send tracking packets if there are tracked objects */ |
if (numCurrTrackedObjects > 0) |
{ |
UIMgr_writeTxFifo(0x0A); /* header byte for a tracking packet */ |
/* reset the pointer */ |
pTableData = (unsigned char *)pCurrentTrackedObjectTable; |
UIMgr_writeTxFifo(numCurrTrackedObjects); /* num of objects tracked */ |
for (i=0; i<MAX_TRACKED_OBJECTS; i++) |
{ |
/* we only want to process objects that have their objectValid flag |
set to TRUE */ |
if ( *(pTableData + VALID_OBJECT_OFFSET) == TRUE) |
{ |
/* the object is valid...convert the color from bit position to value...remember, |
each bit in the "color" byte corresponds to a color */ |
k=0; |
color = *(pTableData + COLOR_OFFSET); |
if (color == 128) k=0; |
else if (color == 64) k=1; |
else if (color == 32) k=2; |
else if (color == 16) k=3; |
else if (color == 8) k=4; |
else if (color == 4) k=5; |
else if (color == 2) k=6; |
else if (color == 1) k=7; |
tmpUpperLeftX = *(pTableData + X_UPPER_LEFT_OFFSET); /* get the upper left X */ |
tmpUpperLeftY = *(pTableData + Y_UPPER_LEFT_OFFSET); /* get the upper left Y */ |
tmpLowerRightX = *(pTableData + X_LOWER_RIGHT_OFFSET); /* get the lower right X */ |
tmpLowerRightY = *(pTableData + Y_LOWER_RIGHT_OFFSET); /* get the lower right Y */ |
UIMgr_writeTxFifo(k); /* send the color first */ |
UIMgr_writeTxFifo(tmpUpperLeftX); |
UIMgr_writeTxFifo(tmpUpperLeftY); |
UIMgr_writeTxFifo(tmpLowerRightX); |
UIMgr_writeTxFifo(tmpLowerRightY); |
} |
/* move our pointer up to the beginning of the next object */ |
pTableData += SIZE_OF_TRACKED_OBJECT; |
} |
/* all done...send the end of tracking packets char */ |
UIMgr_writeTxFifo(0xFF); |
} |
#endif |
/* the tracked object table will be cleared out right before we start |
to wait for VSYNC to indicate a new frame...so it doesn't need to be |
done now */ |
/* schedule the next action to acquire a new frame */ |
PUBLISH_EVENT(EV_PROCESS_FRAME_COMPLETE); |
} |
/*********************************************************** |
Function Name: FrameMgr_findConnectedness |
Function Description: This function is responsible for |
finding the connectedness between two particular run- |
length encoded lines of pixel data. It updates the |
trackingTable as needed. |
Inputs: none |
Outputs: none |
***********************************************************/ |
static void FrameMgr_findConnectedness(void) |
{ |
trackedColor_t currColor; |
unsigned char *pCurrLineColorInfo = currentLineBuffer; |
unsigned char *pTrackedObjectData; |
register unsigned char currPixelRunStart=0; |
register unsigned char currPixelRunFinish=0; |
register unsigned char lastLineXStart=0; |
register unsigned char lastLineXFinish=0; |
register unsigned char runLength=1; |
unsigned char i; |
bool_t colorConnected; |
do |
{ |
/* grab both the current color and the number of pixels |
in the run...remember, pixels start at 1, not 0! */ |
colorConnected = FALSE; |
currColor = *pCurrLineColorInfo++; |
currPixelRunStart += runLength; |
runLength = *pCurrLineColorInfo++; |
currPixelRunFinish += runLength; |
/* make sure that the run-length is at least as wide as |
the minimum horizontal tracking width, and we care about the color */ |
if ( (currColor != notTracked) && (runLength > MIN_OBJECT_TRACKING_WIDTH) ) |
{ |
/* this run contains a color we care about, so |
either it will begin a new tracked object, or it |
is connected to a currently tracked object... |
compare it with each object in the tracking |
table...we can't just look at the numTrackedObjects because |
it is entirely possible that the first couple of objects could |
be invalid... |
NOTE: Instead of accessing each element in the trackedObjectTable |
through the 'i' index, and then accessing the fields in each structure, |
a pointer to each entry is established each time through the loop, followed |
by accessing the elements through specified offsets. GCC seems to be |
able to optimize this code much better than simply accessing the elements |
of each structure in the array the more normal way...*/ |
pTrackedObjectData = (unsigned char *)pCurrentTrackedObjectTable; |
for (i=0; i<MAX_TRACKED_OBJECTS; i++) |
{ |
if ( (currColor == *(pTrackedObjectData + COLOR_OFFSET)) && |
(*(pTrackedObjectData + VALID_OBJECT_OFFSET) == TRUE) && |
(*(pTrackedObjectData + Y_LOWER_RIGHT_OFFSET) == trackedLineCount - 1) ) |
{ |
/* found a color match and the object is valid...check to see if there is |
connectedness */ |
lastLineXStart = *(pTrackedObjectData + LAST_LINE_X_START_OFFSET); |
lastLineXFinish = *(pTrackedObjectData + LAST_LINE_X_FINISH_OFFSET); |
/* Check for the 5 following types of line connectedness: |
--------------------- |
| | |
--------------------- |
------------------------- |
| | |
------------------------- */ |
if ( ( (currPixelRunStart >= lastLineXStart) && |
(currPixelRunStart <= lastLineXFinish) ) || |
/* --------------------- |
| | |
--------------------- |
------------------- |
| | |
------------------- |
OR |
------------------------------ |
| | |
------------------------------ |
--------- |
| | |
--------- */ |
( (currPixelRunFinish >= lastLineXStart) && |
(currPixelRunFinish <= lastLineXFinish) ) || |
/* ------------------------------- |
| | |
------------------------------- |
------------------------------- |
| | |
------------------------------- |
OR |
------------- |
| | |
------------- |
------------------------------- |
| | |
------------------------------- */ |
( (currPixelRunStart <= lastLineXStart) && |
(currPixelRunFinish >= lastLineXFinish) ) ) |
{ |
/* THERE IS CONNECTEDNESS...update the lastLineXStart and lastLineXFinish |
data pointed to by pTrackedObjectData */ |
*(pTrackedObjectData + LAST_LINE_X_START_OFFSET) = currPixelRunStart; |
*(pTrackedObjectData + LAST_LINE_X_FINISH_OFFSET) = currPixelRunFinish; |
/* check if the bounding box needs to be updated */ |
if (*(pTrackedObjectData + X_UPPER_LEFT_OFFSET) > currPixelRunStart) |
{ |
/* need to update the bounding box for the upper left point to |
enclose this new left-most point...we never have to update the |
upper left Y point, since each scan line we process moves from |
top to bottom */ |
*(pTrackedObjectData + X_UPPER_LEFT_OFFSET) = currPixelRunStart; |
} |
if ( *(pTrackedObjectData + X_LOWER_RIGHT_OFFSET) < currPixelRunFinish) |
{ |
/* need to update the bounding box for the lower right X point to |
enclose this new right-most point */ |
*(pTrackedObjectData + X_LOWER_RIGHT_OFFSET) = currPixelRunFinish; |
} |
/* the lower right 'y' point always gets updated when connectedness is found */ |
*(pTrackedObjectData + Y_LOWER_RIGHT_OFFSET) = trackedLineCount; |
/* set a flag indicating that that color run is part of another |
object and thus doesn't need to be added as a new entry into the |
tracking table */ |
colorConnected = TRUE; |
break; |
} |
} |
/* go to the next object */ |
pTrackedObjectData += SIZE_OF_TRACKED_OBJECT; |
} |
if (colorConnected == FALSE) |
{ |
/* a new entry needs to be made to the tracking table, since we have |
a run-length with a color, and it isn't connected to anything...but we |
can only do this if there is space left in the trackedObject table */ |
if (numCurrTrackedObjects < MAX_TRACKED_OBJECTS) |
{ |
/* space is available...add the object...but first we need to find an |
invalid object in the object tracking table */ |
pTrackedObjectData = (unsigned char *)pCurrentTrackedObjectTable; |
for (i=0; i<MAX_TRACKED_OBJECTS; i++) |
{ |
if ( *(pTrackedObjectData + VALID_OBJECT_OFFSET) == FALSE) break; |
/* if we haven't broken above, then the object must have been valid... |
go ahead and move the pointer to the next object to check it */ |
pTrackedObjectData += SIZE_OF_TRACKED_OBJECT; |
} |
/* now that we have a pointer to the tracked object to be updated, update all |
the fields */ |
*(pTrackedObjectData + COLOR_OFFSET) = currColor; /* color */ |
*(pTrackedObjectData + LAST_LINE_X_START_OFFSET) = currPixelRunStart; /* lastLineXStart */ |
*(pTrackedObjectData + LAST_LINE_X_FINISH_OFFSET) = currPixelRunFinish; /* lastLineXFinish */ |
*(pTrackedObjectData + X_UPPER_LEFT_OFFSET) = currPixelRunStart; /* x_upperLeft */ |
*(pTrackedObjectData + Y_UPPER_LEFT_OFFSET) = trackedLineCount; /* y_upperLeft */ |
*(pTrackedObjectData + X_LOWER_RIGHT_OFFSET) = currPixelRunFinish; /* x_lowerRight */ |
*(pTrackedObjectData + Y_LOWER_RIGHT_OFFSET) = trackedLineCount; /* y_lowerRight */ |
*(pTrackedObjectData + VALID_OBJECT_OFFSET) = TRUE; /* objectValid flag */ |
numCurrTrackedObjects++; |
} |
} |
/* move the pointer to the beginning of the next tracked object */ |
pTrackedObjectData += SIZE_OF_TRACKED_OBJECT; |
} |
} while(currPixelRunFinish < ACTUAL_NUM_PIXELS_IN_A_LINE); |
} |
/programy/C/avr/AVRcam/FrameMgr.d |
---|
0,0 → 1,3 |
FrameMgr.o FrameMgr.d : FrameMgr.c Executive.h Events.h UIMgr.h FrameMgr.h \ |
CamInterface.h UartInterface.h Utility.h I2CInterface.h CommonDefs.h \ |
CamConfig.h |
/programy/C/avr/AVRcam/FrameMgr.h |
---|
0,0 → 1,58 |
#ifndef FRAMEMGR_H |
#define FRAMEMGR_H |
/* |
Copyright (C) 2004 John Orlando |
AVRcam: a small real-time image processing engine. |
This program is free software; you can redistribute it and/or |
modify it under the terms of the GNU General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
General Public License for more details. |
You should have received a copy of the GNU General Public |
License along with this program; if not, write to the Free Software |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
For more information on the AVRcam, please contact: |
john@jrobot.net |
or go to www.jrobot.net for more details regarding the system. |
*/ |
/*********************************************************** |
Module Name: FrameMgr.h |
Module Date: 04/10/2004 |
Module Auth: John Orlando |
Description: This module provides the external interface |
to the FrameMgr module. |
Revision History: |
Date Rel Ver. Notes |
4/10/2004 0.1 Module created |
6/30/2004 1.0 Initial release for Circuit Cellar |
contest. |
***********************************************************/ |
/* Extern Variables */ |
extern unsigned char testLineCount; |
/* External Function Declarations */ |
extern void FrameMgr_init(void); |
extern void FrameMgr_processLine(void); |
extern void FrameMgr_processFrame(void); |
extern void FrameMgr_acquireLine(void); |
extern void FrameMgr_acquireFrame(void); |
extern void FrameMgr_dispatchEvent(unsigned char event); |
#endif |
/programy/C/avr/AVRcam/I2CInterface.d |
---|
0,0 → 1,0 |
I2CInterface.o I2CInterface.d : I2CInterface.c CamConfig.h I2CInterface.h CommonDefs.h |
/programy/C/avr/AVRcam/I2CInterface.h |
---|
0,0 → 1,70 |
#ifndef I2CINTERFACE_H |
#define I2CINTERFACE_H |
/* |
Copyright (C) 2004 John Orlando |
AVRcam: a small real-time image processing engine. |
This program is free software; you can redistribute it and/or |
modify it under the terms of the GNU General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
General Public License for more details. |
You should have received a copy of the GNU General Public |
License along with this program; if not, write to the Free Software |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
For more information on the AVRcam, please contact: |
john@jrobot.net |
or go to www.jrobot.net for more details regarding the system. |
*/ |
/*********************************************************** |
Module Name: I2CInterface.h |
Module Date: 04/10/2004 |
Module Auth: John Orlando |
Description: This module provides the external interface |
to the I2C hardware available on the mega8. It also |
contains defines and declarations for how the I2C |
interface will be used in this system. |
Revision History: |
Date Rel Ver. Notes |
4/10/2004 0.1 Module created |
6/30/2004 1.0 Initial release for Circuit Cellar |
contest. |
***********************************************************/ |
#include "CommonDefs.h" |
/* Structures and Typedefs */ |
typedef struct |
{ |
unsigned char configReg; |
unsigned char data; |
} i2cCmd_t; |
/* Defines */ |
/* The I2C interface will run at 100 KHz (the OV6620 can |
support up to 400 KHz, but this hasn't been tested) */ |
#define I2C_SPEED 100000 |
/* External Function Prototypes */ |
extern void I2CInt_init(void); |
extern void I2CInt_writeData(unsigned char address, unsigned char *data, unsigned char bytes); |
extern void I2CInt_readData(unsigned char address, unsigned char *data, unsigned char bytes); |
extern bool_t I2CInt_isI2cBusy(void); |
#endif |
/programy/C/avr/AVRcam/Main.c |
---|
0,0 → 1,95 |
/* |
Copyright (C) 2004 John Orlando |
AVRcam: a small real-time image processing engine. |
This program is free software; you can redistribute it and/or |
modify it under the terms of the GNU General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
General Public License for more details. |
You should have received a copy of the GNU General Public |
License along with this program; if not, write to the Free Software |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
For more information on the AVRcam, please contact: |
john@jrobot.net |
or go to www.jrobot.net for more details regarding the system. |
*/ |
/*********************************************************** |
Module Name: Main.c |
Module Date: 04/10/2004 |
Module Auth: John Orlando |
Description: This module is responsible for providing |
the entry point to the code through the "main" function. |
Revision History: |
Date Rel Ver. Notes |
4/10/2004 0.1 Module created |
6/30/2004 1.0 Initial release for Circuit Cellar |
contest. |
***********************************************************/ |
/* Includes */ |
#include <avr/io.h> |
#include <stdlib.h> |
#include <string.h> |
#include "UIMgr.h" |
#include "UartInterface.h" |
#include "I2CInterface.h" |
#include "CamInterface.h" |
#include "DebugInterface.h" |
#include "FrameMgr.h" |
#include "CommonDefs.h" |
#include "CamConfig.h" |
#include "Executive.h" |
#include "Utility.h" |
/* Local Structures and Typedefs */ |
/* Extern Variables */ |
/* Definitions */ |
/*********************************************************** |
Function Name: main |
Function Description: This function provides the entry |
point into AVRcam application. |
Inputs: none |
Outputs: int |
***********************************************************/ |
int main(void) |
{ |
/* initialize all of the interface modules */ |
DebugInt_init(); |
UartInt_init(); |
I2CInt_init(); |
CamInt_init(); |
/* initialize the remaining modules that will process |
data...interrupts need to be on for these */ |
ENABLE_INTS(); |
CamConfig_init(); |
UIMgr_init(); |
FrameMgr_init(); |
/* provide a short delay for the camera to stabilize before |
we let the executive start up */ |
Utility_delay(1000); |
/* the rest of the application will be under the |
control of the Executive. */ |
Exec_run(); |
/* this should never be reached */ |
return(0); |
} |
/programy/C/avr/AVRcam/Main.d |
---|
0,0 → 1,3 |
Main.o Main.d : Main.c UIMgr.h UartInterface.h I2CInterface.h CommonDefs.h \ |
CamInterface.h DebugInterface.h FrameMgr.h CamConfig.h Executive.h \ |
Events.h Utility.h |
/programy/C/avr/AVRcam/README.txt |
---|
0,0 → 1,62 |
AVRcam Release 1.4 |
1/16/2005 |
Whats New in v1.4: |
-Greatly improved the issue where the AVRcam would potentially |
lock up in particular situations (especially after lots of frame |
dumps). This was due to a combination of bugs, which have all been fixed: |
-turned off interrupts in certain critical sections that were missed |
previously |
-only allow PCLK to be piped into timer1 when needed (i.e., when dumping |
a line or tracking a frame). |
-allowed the main executive to check both the fast event bitmask as well |
as the normal event queue on each pass of the main executive |
I'll be curious to hear if this has completely fixed the issue (I haven't |
seen it happen after ~500 frame dumps, but the real test is when |
others try it :-). Also note: an input voltage below 6 volts will |
cause the system to work sometimes and lock up others. The input voltage |
regulator really wants to see a 6V minimum. I had drained |
8 AA NiMH batteries down to where they were only providing ~4.8 V at the |
input. The system worked for a little while, and then started locking |
up. I immediately changed batteries and everything was fine. |
-Improved how the colorMap gets written to EEPROM. Now, before |
each byte in the colorMap is written to EEPROM, a check of the |
current value in EEPROM is made to see if the old value matches |
the new value. If so, the write is skipped. Also, after a value |
is written, it is read back to ensure that it is correct, and |
will re-write up to three times if needed. |
-Moved the UART rx ISR to the UartInterface.c file, instead of having |
it in its own UartInterfaceAsm.S file. The ISR is in C now. |
-Added a revision history to each source file so that people can |
see the changes on a per-version basis. |
---Misc Info about AVRcam--- |
* The AVRcam source files were built using the WinAVR distribution |
(version 3.3.1 of GCC). I haven't tested other versions of GCC, |
but they should compile without too much difficulty. The makefile |
used to build the source is included. |
* Currently, the AVRcam only works at a baud rate of 115.2 kbps. I |
am in the process of working on autobaud routines that will set the |
baud rate automatically at start up. I'm pretty sure the system |
should be able to track 8 objects all the way down to a baud rate |
of 38.4 kbps. Check back to www.jrobot.net for more info about the |
AVRcam. |
* Different portions of the code are #ifdef'ed in or out to show |
the various debugging that can be turned on in the system. The |
debugging mechanisms are typically for dumping additional information |
out to a serial terminal for viewing, and are not intended to work |
with the AVRcamVIEW PC application. The code, as released, doesn't |
have any debugging features turned on. |
* For more info about the AVRcam, check out http://www.jrobot.net |
John Orlando |
January 16, 2005 |
/programy/C/avr/AVRcam/UIMgr.c |
---|
0,0 → 1,664 |
/* |
Copyright (C) 2004 John Orlando |
AVRcam: a small real-time image processing engine. |
This program is free software; you can redistribute it and/or |
modify it under the terms of the GNU General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
General Public License for more details. |
You should have received a copy of the GNU General Public |
License along with this program; if not, write to the Free Software |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
For more information on the AVRcam, please contact: |
john@jrobot.net |
or go to www.jrobot.net for more details regarding the system. |
*/ |
/*********************************************************** |
Module Name: UIMgr.c |
Module Date: 04/10/2004 |
Module Auth: John Orlando |
Description: This module is responsible for providing |
the processing to manage the user interface of the |
system. This user interface is provided via the UART. |
This module handles the incoming serial commands, and |
performs the needed functionality. It is then |
responsible for generating any needed response to |
the external entity. |
Revision History: |
Date Rel Ver. Notes |
4/10/2004 0.1 Module created |
6/30/2004 1.0 Initial release for Circuit Cellar |
contest. |
11/15/2004 1.2 Updated version string to 1.2. |
1/16/2005 1.4 Added code to write the colorMap |
to EEPROM one byte at a time, |
ensuring that the EEPROM is only |
written when the data is different |
than the current value (thus saving |
EEPROM writes). Updated version |
string to 1.4. |
***********************************************************/ |
/* Includes */ |
#include <avr/io.h> |
#include <stdlib.h> |
#include <string.h> |
#include <avr/eeprom.h> |
#include "CommonDefs.h" |
#include "UIMgr.h" |
#include "UartInterface.h" |
#include "CamConfig.h" |
#include "Utility.h" |
#include "Executive.h" |
#include "CamInterface.h" |
/* Local Structures and Typedefs */ |
typedef enum |
{ |
getVersionCmd, |
pingCmd, |
setCameraRegsCmd, |
dumpFrameCmd, |
enableTrackingCmd, |
disableTrackingCmd, |
setColorMapCmd, |
resetCameraCmd, |
noCmd, |
invalidCmd |
} UIMgr_Cmd_t; |
typedef enum |
{ |
setRed, |
setGreen, |
setBlue |
} setColorState_t; |
/* Local Variables */ |
static unsigned char charCount = 0; |
static unsigned char charIndex = 0; |
static unsigned char asciiTokenBuffer[MAX_TOKEN_LENGTH+1]; /* +1 to ensure NULL at end */ |
static unsigned char tokenCount = 0; |
static unsigned char tokenBuffer[MAX_TOKEN_COUNT]; |
static UIMgr_Cmd_t receivedCmd = noCmd; |
static unsigned char AVRcamVersion[] = "AVRcam v1.4\r"; |
/* Local Function Declaration */ |
static unsigned char UIMgr_readRxFifo(void); |
static unsigned char UIMgr_readTxFifo(void); |
static unsigned char UIMgr_readRxFifo(void); |
static void UIMgr_sendNck(void); |
static void UIMgr_sendAck(void); |
static void UIMgr_convertTokenToCmd(void); |
static void UIMgr_convertTokenToValue(void); |
static void UIMgr_executeCmd(void); |
/* Extern Variables */ |
unsigned char UIMgr_rxFifo[UI_MGR_RX_FIFO_SIZE]; |
unsigned char UIMgr_rxFifoHead=0; |
unsigned char UIMgr_rxFifoTail=0; |
unsigned char UIMgr_txFifo[UI_MGR_TX_FIFO_SIZE]; |
unsigned char UIMgr_txFifoHead=0; |
unsigned char UIMgr_txFifoTail=0; |
/* Definitions */ |
#define IS_DATA_IN_TX_FIFO() (!(UIMgr_txFifoHead == UIMgr_txFifoTail)) |
#define IS_DATA_IN_RX_FIFO() (!(UIMgr_rxFifoHead == UIMgr_rxFifoTail)) |
/* MAX_EEPROM_WRITE_ATTEMPTS limits the number of writes that can be |
done to a particular EEPROM cell, so that it can't possible just |
write to the same cell over and over */ |
#define MAX_EEPROM_WRITE_ATTEMPTS 3 |
/*********************************************************** |
Function Name: UIMgr_init |
Function Description: This function is responsible for |
initializing the UIMgr module. It sets up the fifo |
used to hold incoming data, etc. |
Inputs: none |
Outputs: none |
***********************************************************/ |
void UIMgr_init(void) |
{ |
memset(asciiTokenBuffer,0x00,MAX_TOKEN_LENGTH+1); |
memset(tokenBuffer,0x00,MAX_TOKEN_COUNT); |
memset(UIMgr_txFifo,0x00,UI_MGR_TX_FIFO_SIZE); |
memset(UIMgr_rxFifo,0x00,UI_MGR_RX_FIFO_SIZE); |
} |
/*********************************************************** |
Function Name: UIMgr_dispatchEvent |
Function Description: This function is responsible for |
processing events that pertain to the UIMgr. |
Inputs: event - the generated event |
Outputs: none |
***********************************************************/ |
void UIMgr_dispatchEvent(unsigned char event) |
{ |
switch(event) |
{ |
case EV_ACQUIRE_LINE_COMPLETE: |
UIMgr_transmitPendingData(); |
break; |
case EV_SERIAL_DATA_RECEIVED: |
UIMgr_processReceivedData(); |
break; |
case EV_SERIAL_DATA_PENDING_TX: |
UIMgr_flushTxBuffer(); |
break; |
} |
} |
/*********************************************************** |
Function Name: UIMgr_transmitPendingData |
Function Description: This function is responsible for |
transmitting a single byte of data if data is waiting |
to be sent. Otherwise, if nothing is waiting, the |
function just returns. |
Inputs: none |
Outputs: none |
***********************************************************/ |
void UIMgr_transmitPendingData(void) |
{ |
if (IS_DATA_IN_TX_FIFO() == TRUE) |
{ |
/* data is waiting...send a single byte */ |
UartInt_txByte( UIMgr_readTxFifo() ); |
} |
} |
/*********************************************************** |
Function Name: UIMgr_processReceivedData |
Function Description: This function is responsible for |
parsing any serial data waiting in the rx fifo |
Inputs: none |
Outputs: none |
***********************************************************/ |
void UIMgr_processReceivedData(void) |
{ |
unsigned char tmpData = 0; |
/* still need to add a mechanism to handle token counts |
that are excessive!!! FIX ME!!! */ |
while(IS_DATA_IN_RX_FIFO() == TRUE) |
{ |
tmpData = UIMgr_readRxFifo(); |
if (tmpData == '\r') |
{ |
/* we have reached a token separator */ |
if (tokenCount == 0) |
{ |
/* convert the command */ |
UIMgr_convertTokenToCmd(); |
} |
else |
{ |
/* convert a value */ |
UIMgr_convertTokenToValue(); |
tokenCount++; |
} |
/* either way, it is time to try to process the received |
token list since we have reached the end of the cmd. */ |
Utility_delay(100); |
if (receivedCmd == invalidCmd || |
receivedCmd == noCmd ) |
{ |
UIMgr_sendNck(); |
PUBLISH_EVENT(EV_SERIAL_DATA_PENDING_TX); |
} |
else |
{ |
UIMgr_sendAck(); |
/* publish the serial data pending event, so it |
will push the ACK out before we execute the cmd */ |
PUBLISH_EVENT(EV_SERIAL_DATA_PENDING_TX); |
UIMgr_executeCmd(); |
} |
/* reset any necessary data */ |
tokenCount = 0; |
memset(tokenBuffer,0x00,MAX_TOKEN_COUNT); |
} |
else if (tmpData == ' ') /* space char */ |
{ |
/* the end of a token has been reached */ |
if (tokenCount == 0) |
{ |
UIMgr_convertTokenToCmd(); |
tokenCount++; /* check this...why is this being incremented here??? This |
means we have received a token, with tokenCount == 0, which means it is a |
command...why is this contributing to tokenCount? |
This might cause the set color map command to include too much data, since |
it sets the color map based on tokenCount...CHECK*/ |
} |
else |
{ |
/* check to see if this token is going to push |
us over the limit...if so, abort the transaction */ |
if (tokenCount+1 >= MAX_TOKEN_COUNT) |
{ |
/* we received too many tokens, and |
need to NCK this request, since its too |
large...reset everything...*/ |
charCount=0; |
charIndex=0; |
tokenCount=0; |
receivedCmd = invalidCmd; |
} |
else |
{ |
/* tokenCount is still in range...*/ |
UIMgr_convertTokenToValue(); |
tokenCount++; |
} |
} |
} |
else if ( (tmpData >= 'A' && tmpData <= 'Z') || |
(tmpData >= '0' && tmpData <= '9') ) |
{ |
/* a valid range of token was received */ |
asciiTokenBuffer[charIndex] = tmpData; |
charCount++; |
charIndex++; |
if (charCount > MAX_TOKEN_LENGTH) |
{ |
/* we have received a token that cannot be handled... |
set the received cmd to an invalid cmd, and wait |
for the \r to process it */ |
receivedCmd = invalidCmd; |
charIndex = 0; /* ...so we won't overwrite memory */ |
} |
} |
else |
{ |
/* an invalid character was received */ |
receivedCmd = invalidCmd; |
} |
} /* end while */ |
asm volatile("clt"::); /* clear out the T flag in case it wasn't |
cleared already */ |
} |
/*********************************************************** |
Function Name: UIMgr_executeCmd |
Function Description: This function is responsible for |
executing whatever cmd is stored in the receivedCmd |
object. |
Inputs: none |
Outputs: none |
***********************************************************/ |
static void UIMgr_executeCmd(void) |
{ |
unsigned char i,eepromData, num_writes=0; |
unsigned char *pData; |
unsigned char eeprom_write_succeeded = FALSE; |
#if DEBUG_COLOR_MAP |
unsigned char asciiBuffer[5]; |
#endif |
if (receivedCmd == pingCmd) |
{ |
} |
else if (receivedCmd == getVersionCmd) |
{ |
pData = AVRcamVersion; |
while(*pData != 0) |
{ |
UIMgr_writeTxFifo(*pData++); |
} |
} |
else if (receivedCmd == resetCameraCmd) |
{ |
CamInt_resetCam(); |
} |
else if (receivedCmd == dumpFrameCmd) |
{ |
/* publish the event that will indicate that |
a request has come to dump a frame...this will |
be received by the FrameMgr, which will begin |
dumping the frame...a short delay is needed |
here to keep the Java demo app happy (sometimes |
it wouldn't be able to receive the serial data |
as quickly as AVRcam can provide it). */ |
Utility_delay(100); |
PUBLISH_EVENT(EV_DUMP_FRAME); |
} |
else if (receivedCmd == setCameraRegsCmd) |
{ |
/* we need to gather the tokens and |
build config cmds to be sent to the camera */ |
for (i=1; i<tokenCount; i+=2) /* starts at 1 since first token |
is the CR cmd */ |
{ |
CamConfig_setCamReg(tokenBuffer[i],tokenBuffer[i+1]); |
} |
CamConfig_sendFifoCmds(); |
} |
else if (receivedCmd == enableTrackingCmd) |
{ |
/* publish the event...again with a short delay */ |
Utility_delay(100); |
PUBLISH_EVENT(EV_ENABLE_TRACKING); |
} |
else if (receivedCmd == disableTrackingCmd) |
{ |
PUBLISH_EVENT(EV_DISABLE_TRACKING); |
} |
else if (receivedCmd == setColorMapCmd) |
{ |
/* copy the received tokens into the color map */ |
for (i=0; i<tokenCount; i++) |
{ |
colorMap[i] = tokenBuffer[i+1]; |
/* write each colorMap byte to EEPROM, but only those |
that changed...this will help reduce wear on the EEPROM */ |
eepromData = eeprom_read_byte( (unsigned char*)(i+1)); |
if (eepromData != colorMap[i]) |
{ |
/* need to actually perform the write because the |
data in eeprom is different than the current colorMap */ |
eeprom_write_succeeded = FALSE; |
while(eeprom_write_succeeded == FALSE && num_writes < MAX_EEPROM_WRITE_ATTEMPTS) |
{ |
eeprom_write_byte((unsigned char*)(i+1),colorMap[i]); |
num_writes++; |
eepromData = eeprom_read_byte( (unsigned char*)(i+1)); |
if (eepromData == colorMap[i]) |
{ |
eeprom_write_succeeded = TRUE; |
} |
} |
num_writes = 0; |
} |
} |
#if DEBUG_COLOR_MAP |
/* for debugging...send out the entire color map */ |
UIMgr_txBuffer("\r\n",2); |
for (i=0; i<NUM_ELEMENTS_IN_COLOR_MAP; i++) |
{ |
memset(asciiBuffer,0x00,5); |
itoa(colorMap[i],asciiBuffer,10); |
UIMgr_txBuffer(asciiBuffer,3); |
UIMgr_txBuffer(" ",1); |
if (i==15 || i == 31) |
{ |
/* break up the output */ |
UIMgr_txBuffer("\r\n",2); |
} |
} |
#endif |
} |
} |
/*********************************************************** |
Function Name: UIMgr_convertTokenToValue |
Function Description: This function is responsible for |
converting a received token to a hex value It will |
access the asciiTokenBuffer directly, and store the |
result in the appropriate token buffer. |
Inputs: none |
Outputs: none |
***********************************************************/ |
static void UIMgr_convertTokenToValue(void) |
{ |
unsigned int newValue; |
newValue = atoi(asciiTokenBuffer); |
if (newValue > 255) |
{ |
/* the value is too large */ |
receivedCmd = invalidCmd; |
tokenBuffer[tokenCount] = 0xFF; /* to indicate an error */ |
} |
else |
{ |
/* copy the value into the tokenBuffer */ |
tokenBuffer[tokenCount] = newValue; |
} |
memset(asciiTokenBuffer,0x00,MAX_TOKEN_LENGTH); |
charIndex = 0; |
charCount = 0; |
} |
/*********************************************************** |
Function Name: UIMgr_convertTokenToCmd |
Function Description: This function is responsible for |
parsing a received 2-character command. It will |
access the asciiTokenBuffer directly. |
Inputs: none |
Outputs: none |
***********************************************************/ |
static void UIMgr_convertTokenToCmd(void) |
{ |
if ( (asciiTokenBuffer[0] == 'P') && |
(asciiTokenBuffer[1] == 'G') ) |
{ |
/* we got a "ping" command...but we still need to see |
if we are going to get the \r */ |
receivedCmd = pingCmd; |
} |
else if ( (asciiTokenBuffer[0] == 'G') && |
(asciiTokenBuffer[1] == 'V') ) |
{ |
/* we got the "get version" command */ |
receivedCmd = getVersionCmd; |
} |
else if ( (asciiTokenBuffer[0] == 'D') && |
(asciiTokenBuffer[1] == 'F') ) |
{ |
/* we should go into frame dump mode */ |
receivedCmd = dumpFrameCmd; |
} |
else if ( (asciiTokenBuffer[0] == 'C') && |
(asciiTokenBuffer[1] == 'R') ) |
{ |
/* the user wants to set registers in the OV6620 */ |
receivedCmd = setCameraRegsCmd; |
} |
else if ( (asciiTokenBuffer[0] == 'E') && |
(asciiTokenBuffer[1] == 'T') ) |
{ |
/* the user wants to enable tracking */ |
receivedCmd = enableTrackingCmd; |
} |
else if ( (asciiTokenBuffer[0] == 'S') && |
(asciiTokenBuffer[1] == 'M') ) |
{ |
/* the user wants to set the color map */ |
receivedCmd = setColorMapCmd; |
} |
else if ( (asciiTokenBuffer[0] == 'D') && |
(asciiTokenBuffer[1] == 'T') ) |
{ |
receivedCmd = disableTrackingCmd; |
} |
else if ( (asciiTokenBuffer[0] == 'R') && |
(asciiTokenBuffer[1] == 'S') ) |
{ |
receivedCmd = resetCameraCmd; |
} |
else |
{ |
/* don't recognize the cmd */ |
receivedCmd = invalidCmd; |
} |
memset(asciiTokenBuffer,0x00,MAX_TOKEN_LENGTH); |
charIndex = 0; |
charCount = 0; |
} |
/*********************************************************** |
Function Name: UIMgr_sendAck |
Function Description: This function is responsible for |
queuing up an ACK to be sent to the user. |
Inputs: none |
Outputs: none |
***********************************************************/ |
static void UIMgr_sendAck(void) |
{ |
UIMgr_writeTxFifo('A'); |
UIMgr_writeTxFifo('C'); |
UIMgr_writeTxFifo('K'); |
UIMgr_writeTxFifo('\r'); |
} |
/*********************************************************** |
Function Name: UIMgr_sendNck |
Function Description: This function is responsible for |
queueing up an NCK to be sent to the user. |
Inputs: none |
Outputs: none |
***********************************************************/ |
static void UIMgr_sendNck(void) |
{ |
UIMgr_writeTxFifo('N'); |
UIMgr_writeTxFifo('C'); |
UIMgr_writeTxFifo('K'); |
UIMgr_writeTxFifo('\r'); |
} |
/*********************************************************** |
Function Name: UIMgr_writeBufferToTxFifo |
Function Description: This function is responsible for |
placing "length" bytes into the tx FIFO. |
Inputs: pData - a pointer to the data to send |
length - the number of bytes to send |
Outputs: none |
***********************************************************/ |
void UIMgr_writeBufferToTxFifo(unsigned char *pData, unsigned char length) |
{ |
unsigned char tmpHead; |
if (length == 0) |
{ |
return; |
} |
DISABLE_INTS(); |
while(length-- != 0) |
{ |
UIMgr_txFifo[UIMgr_txFifoHead] = *pData++; |
/* now move the head up */ |
tmpHead = (UIMgr_txFifoHead + 1) & (UI_MGR_TX_FIFO_MASK); |
UIMgr_txFifoHead = tmpHead; |
} |
ENABLE_INTS(); |
} |
/*********************************************************** |
Function Name: UIMgr_txBuffer |
Function Description: This function is responsible for |
sending 'length' bytes out using the UartInterface |
module. |
Inputs: pData - a pointer to the data to send |
length - the number of bytes to send |
Outputs: none |
***********************************************************/ |
void UIMgr_txBuffer(unsigned char *pData, unsigned char length) |
{ |
while(length-- != 0) |
{ |
UartInt_txByte(*pData++); |
} |
} |
/*********************************************************** |
Function Name: UIMgr_flushTxBuffer |
Function Description: This function is responsible for |
sending all data currently in the serial tx buffer |
to the user. |
Inputs: none |
Outputs: none |
***********************************************************/ |
void UIMgr_flushTxBuffer(void) |
{ |
while(IS_DATA_IN_TX_FIFO() == TRUE) |
{ |
UartInt_txByte(UIMgr_readTxFifo() ); |
} |
} |
/*********************************************************** |
Function Name: UIMgr_readRxFifo |
Function Description: This function is responsible for |
reading a single byte of data from the rx fifo, and |
updating the appropriate pointers. |
Inputs: none |
Outputs: unsigned char-the data read |
***********************************************************/ |
static unsigned char UIMgr_readRxFifo(void) |
{ |
unsigned char dataByte, tmpTail; |
/* just return the current tail from the rx fifo */ |
DISABLE_INTS(); |
dataByte = UIMgr_rxFifo[UIMgr_rxFifoTail]; |
tmpTail = (UIMgr_rxFifoTail+1) & (UI_MGR_RX_FIFO_MASK); |
UIMgr_rxFifoTail = tmpTail; |
ENABLE_INTS(); |
return(dataByte); |
} |
/*********************************************************** |
Function Name: UIMgr_readTxFifo |
Function Description: This function is responsible for |
reading a single byte of data from the tx fifo, and |
updating the appropriate pointers. |
Inputs: none |
Outputs: unsigned char-the data read |
***********************************************************/ |
static unsigned char UIMgr_readTxFifo(void) |
{ |
unsigned char dataByte, tmpTail; |
/* just return the current tail from the tx fifo */ |
DISABLE_INTS(); |
dataByte = UIMgr_txFifo[UIMgr_txFifoTail]; |
tmpTail = (UIMgr_txFifoTail+1) & (UI_MGR_TX_FIFO_MASK); |
UIMgr_txFifoTail = tmpTail; |
ENABLE_INTS(); |
return(dataByte); |
} |
/*********************************************************** |
Function Name: UIMgr_writeTxFifo |
Function Description: This function is responsible for |
writing a single byte to the TxFifo and |
updating the appropriate pointers. |
Inputs: data - the byte to write to the Fifo |
Outputs: none |
***********************************************************/ |
void UIMgr_writeTxFifo(unsigned char data) |
{ |
unsigned char tmpHead; |
DISABLE_INTS(); |
UIMgr_txFifo[UIMgr_txFifoHead] = data; |
/* now move the head up */ |
tmpHead = (UIMgr_txFifoHead + 1) & (UI_MGR_TX_FIFO_MASK); |
UIMgr_txFifoHead = tmpHead; |
ENABLE_INTS(); |
} |
/programy/C/avr/AVRcam/UIMgr.d |
---|
0,0 → 1,2 |
UIMgr.o UIMgr.d : UIMgr.c CommonDefs.h UIMgr.h UartInterface.h CamConfig.h \ |
I2CInterface.h Utility.h Executive.h Events.h CamInterface.h |
/programy/C/avr/AVRcam/UIMgr.h |
---|
0,0 → 1,74 |
#ifndef UIMGR_H |
#define UIMGR_H |
/* |
Copyright (C) 2004 John Orlando |
AVRcam: a small real-time image processing engine. |
This program is free software; you can redistribute it and/or |
modify it under the terms of the GNU General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
General Public License for more details. |
You should have received a copy of the GNU General Public |
License along with this program; if not, write to the Free Software |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
For more information on the AVRcam, please contact: |
john@jrobot.net |
or go to www.jrobot.net for more details regarding the system. |
*/ |
/*********************************************************** |
Module Name: UIMgr.h |
Module Date: 04/10/2004 |
Module Auth: John Orlando |
Description: This file provides the external interface |
to the UI Mgr. |
Revision History: |
Date Rel Ver. Notes |
4/10/2004 0.1 Module created |
6/30/2004 1.0 Initial release for Circuit Cellar |
contest. |
***********************************************************/ |
/* Defines */ |
#define UI_MGR_RX_FIFO_SIZE 32 |
#define UI_MGR_RX_FIFO_MASK UI_MGR_RX_FIFO_SIZE-1 |
#define UI_MGR_TX_FIFO_SIZE 64 |
#define UI_MGR_TX_FIFO_MASK UI_MGR_TX_FIFO_SIZE-1 |
#define LENGTH_OF_UI_CMD 2 |
#define UI_MGR_MAX_CMD_LENGTH 32 |
#define MAX_TOKEN_LENGTH 3 /* needs to hold 0 - 255 in ASCII format */ |
#define MAX_TOKEN_COUNT 64 /* for setting the color maps */ |
/* External Variable Reference */ |
extern unsigned char UIMgr_rxFifo[]; |
extern unsigned char UIMgr_rxFifoHead; |
extern unsigned char UIMgr_rxFifoTail; |
/* External Function Declaration */ |
extern void UIMgr_init(void); |
extern void UIMgr_writeBufferToTxFifo(unsigned char *pData, unsigned char length); |
extern void UIMgr_txBuffer(unsigned char *pData, unsigned char length); |
extern void UIMgr_processReceivedData(void); |
extern void UIMgr_transmitPendingData(void); |
extern void UIMgr_dispatchEvent(unsigned char event); |
extern void UIMgr_flushTxBuffer(void); |
extern void UIMgr_writeTxFifo(unsigned char data); |
#endif |
/programy/C/avr/AVRcam/UartInterface.d |
---|
0,0 → 1,2 |
UartInterface.o UartInterface.d : UartInterface.c CommonDefs.h UartInterface.h UIMgr.h \ |
Executive.h Events.h |
/programy/C/avr/AVRcam/UartInterface.h |
---|
0,0 → 1,52 |
#ifndef UARTINTERFACE_H |
#define UARTINTERFACE_H |
/* |
Copyright (C) 2004 John Orlando |
AVRcam: a small real-time image processing engine. |
This program is free software; you can redistribute it and/or |
modify it under the terms of the GNU General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
General Public License for more details. |
You should have received a copy of the GNU General Public |
License along with this program; if not, write to the Free Software |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
For more information on the AVRcam, please contact: |
john@jrobot.net |
or go to www.jrobot.net for more details regarding the system. |
*/ |
/*********************************************************** |
Module Name: UartInterface.h |
Module Date: 04/10/2004 |
Module Auth: John Orlando |
Description: This modules provides the external interface |
to the UartInterface module. |
Revision History: |
Date Rel Ver. Notes |
4/10/2004 0.1 Module created |
6/30/2004 1.0 Initial release for Circuit Cellar |
contest. |
***********************************************************/ |
/* extern variables */ |
extern unsigned char serialReceivedFlag; |
/* External Function Prototypes */ |
extern void UartInt_init(void); |
extern void UartInt_txByte(unsigned char txByte); |
#endif |
/programy/C/avr/AVRcam/Utility.c |
---|
0,0 → 1,78 |
/* |
Copyright (C) 2004 John Orlando |
AVRcam: a small real-time image processing engine. |
This program is free software; you can redistribute it and/or |
modify it under the terms of the GNU General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
General Public License for more details. |
You should have received a copy of the GNU General Public |
License along with this program; if not, write to the Free Software |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
For more information on the AVRcam, please contact: |
john@jrobot.net |
or go to www.jrobot.net for more details regarding the system. |
*/ |
/*********************************************************** |
Module Name: Utility.c |
Module Date: 04/13/2004 |
Module Auth: John Orlando |
Description: This module provides a basic set of |
general purpose utilities that can be used by any |
module needing them. |
Revision History: |
Date Rel Ver. Notes |
4/10/2004 0.1 Module created |
6/30/2004 1.0 Initial release for Circuit Cellar |
contest. |
***********************************************************/ |
/* Includes */ |
#include "CommonDefs.h" |
/* Local Variables */ |
/* Local Structures and Typedefs */ |
/* Extern Variables */ |
/* Definitions */ |
/*********************************************************** |
Function Name: Utility_delay |
Function Description: This function provides a busy-wait |
delay for a specified number of milliseconds. |
Inputs: numMs - the number of milliseconds to delay |
Outputs: none |
NOTES: The delay_loop_1 and delay_loop_2 functions found |
in avr/delay.h provide accurate 3 and 4 cycle delay loops |
if needed...this isn't really a millisecond, so DON'T |
depend on it for exact timing... |
***********************************************************/ |
void Utility_delay(unsigned short numMs) |
{ |
volatile unsigned short i=0,j=0; |
#ifndef SIMULATION |
for (i=0; i<numMs; i++) |
{ |
for (j=0; j<1000; j++) |
{ |
asm volatile("nop"::); |
} |
} |
#endif |
} |
/programy/C/avr/AVRcam/Utility.d |
---|
0,0 → 1,0 |
Utility.o Utility.d : Utility.c CommonDefs.h |
/programy/C/avr/AVRcam/Utility.h |
---|
0,0 → 1,48 |
#ifndef UTILITY_H |
#define UTILITY_H |
/* |
Copyright (C) 2004 John Orlando |
AVRcam: a small real-time image processing engine. |
This program is free software; you can redistribute it and/or |
modify it under the terms of the GNU General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
General Public License for more details. |
You should have received a copy of the GNU General Public |
License along with this program; if not, write to the Free Software |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
For more information on the AVRcam, please contact: |
john@jrobot.net |
or go to www.jrobot.net for more details regarding the system. |
*/ |
/*********************************************************** |
Module Name: Utility.h |
Module Date: 04/13/2004 |
Module Auth: John Orlando |
Description: This file provides the external interface |
to the Utility module. |
Revision History: |
Date Rel Ver. Notes |
4/10/2004 0.1 Module created |
6/30/2004 1.0 Initial release for Circuit Cellar |
contest. |
***********************************************************/ |
/* Extern Functions */ |
extern void Utility_delay(unsigned short numMs); |
#endif |
/programy/C/avr/Blik/avrm8ledtest.map |
---|
0,0 → 1,274 |
Archive member included because of file (symbol) |
/usr/lib/gcc/avr/4.1.0/avr4/libgcc.a(_copy_data.o) |
avrm8ledtest.o (__do_copy_data) |
/usr/lib/gcc/avr/4.1.0/avr4/libgcc.a(_clear_bss.o) |
avrm8ledtest.o (__do_clear_bss) |
Memory Configuration |
Name Origin Length Attributes |
text 0x00000000 0x00002000 xr |
data 0x00800060 0x0000ffa0 rw !x |
eeprom 0x00810000 0x00010000 rw !x |
*default* 0x00000000 0xffffffff |
Linker script and memory map |
LOAD /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
LOAD avrm8ledtest.o |
LOAD /usr/lib/gcc/avr/4.1.0/avr4/libgcc.a |
LOAD /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/libc.a |
LOAD /usr/lib/gcc/avr/4.1.0/avr4/libgcc.a |
.hash |
*(.hash) |
.dynsym |
*(.dynsym) |
.dynstr |
*(.dynstr) |
.gnu.version |
*(.gnu.version) |
.gnu.version_d |
*(.gnu.version_d) |
.gnu.version_r |
*(.gnu.version_r) |
.rel.init |
*(.rel.init) |
.rela.init |
*(.rela.init) |
.rel.text |
*(.rel.text) |
*(.rel.text.*) |
*(.rel.gnu.linkonce.t*) |
.rela.text |
*(.rela.text) |
*(.rela.text.*) |
*(.rela.gnu.linkonce.t*) |
.rel.fini |
*(.rel.fini) |
.rela.fini |
*(.rela.fini) |
.rel.rodata |
*(.rel.rodata) |
*(.rel.rodata.*) |
*(.rel.gnu.linkonce.r*) |
.rela.rodata |
*(.rela.rodata) |
*(.rela.rodata.*) |
*(.rela.gnu.linkonce.r*) |
.rel.data |
*(.rel.data) |
*(.rel.data.*) |
*(.rel.gnu.linkonce.d*) |
.rela.data |
*(.rela.data) |
*(.rela.data.*) |
*(.rela.gnu.linkonce.d*) |
.rel.ctors |
*(.rel.ctors) |
.rela.ctors |
*(.rela.ctors) |
.rel.dtors |
*(.rel.dtors) |
.rela.dtors |
*(.rela.dtors) |
.rel.got |
*(.rel.got) |
.rela.got |
*(.rela.got) |
.rel.bss |
*(.rel.bss) |
.rela.bss |
*(.rela.bss) |
.rel.plt |
*(.rel.plt) |
.rela.plt |
*(.rela.plt) |
.text 0x00000000 0x92 |
*(.vectors) |
.vectors 0x00000000 0x26 /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
0x00000000 __vectors |
0x00000000 __vector_default |
0x00000026 __ctors_start = . |
*(.ctors) |
0x00000026 __ctors_end = . |
0x00000026 __dtors_start = . |
*(.dtors) |
0x00000026 __dtors_end = . |
*(.progmem.gcc*) |
*(.progmem*) |
0x00000026 . = ALIGN (0x2) |
*(.init0) |
*(.init1) |
*(.init2) |
.init2 0x00000026 0xc /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
*(.init3) |
*(.init4) |
.init4 0x00000032 0x16 /usr/lib/gcc/avr/4.1.0/avr4/libgcc.a(_copy_data.o) |
0x00000032 __do_copy_data |
.init4 0x00000048 0x10 /usr/lib/gcc/avr/4.1.0/avr4/libgcc.a(_clear_bss.o) |
0x00000048 __do_clear_bss |
*(.init5) |
*(.init6) |
*(.init7) |
*(.init8) |
*(.init9) |
.init9 0x00000058 0x2 /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
*(.text) |
.text 0x0000005a 0x2 /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
0x0000005a __vector_1 |
0x0000005a __vector_12 |
0x0000005a __bad_interrupt |
0x0000005a __vector_6 |
0x0000005a __vector_3 |
0x0000005a __vector_11 |
0x0000005a __vector_13 |
0x0000005a __vector_17 |
0x0000005a __vector_7 |
0x0000005a __vector_5 |
0x0000005a __vector_4 |
0x0000005a __vector_9 |
0x0000005a __vector_2 |
0x0000005a __vector_15 |
0x0000005a __vector_8 |
0x0000005a __vector_14 |
0x0000005a __vector_10 |
0x0000005a __vector_16 |
0x0000005a __vector_18 |
.text 0x0000005c 0x36 avrm8ledtest.o |
0x00000076 main |
0x0000005c delay_ms |
0x00000092 . = ALIGN (0x2) |
*(.text.*) |
0x00000092 . = ALIGN (0x2) |
*(.fini9) |
*(.fini8) |
*(.fini7) |
*(.fini6) |
*(.fini5) |
*(.fini4) |
*(.fini3) |
*(.fini2) |
*(.fini1) |
*(.fini0) |
0x00000092 _etext = . |
.data 0x00800060 0x0 load address 0x00000092 |
0x00800060 PROVIDE (__data_start, .) |
*(.data) |
*(.gnu.linkonce.d*) |
0x00800060 . = ALIGN (0x2) |
0x00800060 _edata = . |
0x00800060 PROVIDE (__data_end, .) |
.bss 0x00800060 0x0 |
0x00800060 PROVIDE (__bss_start, .) |
*(.bss) |
*(COMMON) |
0x00800060 PROVIDE (__bss_end, .) |
0x00000092 __data_load_start = LOADADDR (.data) |
0x00000092 __data_load_end = (__data_load_start + SIZEOF (.data)) |
.noinit 0x00800060 0x0 |
0x00800060 PROVIDE (__noinit_start, .) |
*(.noinit*) |
0x00800060 PROVIDE (__noinit_end, .) |
0x00800060 _end = . |
0x00800060 PROVIDE (__heap_start, .) |
.eeprom 0x00810000 0x0 |
*(.eeprom*) |
0x00810000 __eeprom_end = . |
.stab 0x00000000 0x738 |
*(.stab) |
.stab 0x00000000 0x36c /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
.stab 0x0000036c 0x3cc avrm8ledtest.o |
0x3d8 (size before relaxing) |
.stabstr 0x00000000 0x76d |
*(.stabstr) |
.stabstr 0x00000000 0x76d /usr/lib/gcc/avr/4.1.0/../../../../avr/lib/avr4/crtm8.o |
.stab.excl |
*(.stab.excl) |
.stab.exclstr |
*(.stab.exclstr) |
.stab.index |
*(.stab.index) |
.stab.indexstr |
*(.stab.indexstr) |
.comment |
*(.comment) |
.debug |
*(.debug) |
.line |
*(.line) |
.debug_srcinfo |
*(.debug_srcinfo) |
.debug_sfnames |
*(.debug_sfnames) |
.debug_aranges |
*(.debug_aranges) |
.debug_pubnames |
*(.debug_pubnames) |
.debug_info |
*(.debug_info) |
*(.gnu.linkonce.wi.*) |
.debug_abbrev |
*(.debug_abbrev) |
.debug_line |
*(.debug_line) |
.debug_frame |
*(.debug_frame) |
.debug_str |
*(.debug_str) |
.debug_loc |
*(.debug_loc) |
.debug_macinfo |
*(.debug_macinfo) |
OUTPUT(avrm8ledtest.out elf32-avr) |
/programy/C/avr/Blik/avrm8ledtest.out |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr/Blik/avrm8ledtest.c |
---|
0,0 → 1,76 |
/********************************************* |
* vim: set sw=8 ts=8 si : |
* Author: Guido Socher, Copyright: GPL |
* This program is to test the led connected to |
* PC5. |
* See http://linuxfocus.org/English/November2004/ |
* for details. |
* Chip type : ATMEGA8 |
* Clock frequency : Internal clock 1 Mhz (factory default) |
*********************************************/ |
#include <avr/io.h> |
#include <inttypes.h> |
#define F_CPU 17000000UL // 1 MHz |
#include <avr/delay.h> |
/* compatibilty macros for old style */ |
#ifndef cbi |
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit)) |
#endif |
#ifndef sbi |
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit)) |
#endif |
void delay_ms(unsigned int ms) |
/* delay for a minimum of <ms> */ |
{ |
// we use a calibrated macro. This is more |
// accurate and not so much compiler dependent |
// as self made code. |
while(ms){ |
_delay_ms(0.96); |
ms--; |
} |
} |
/* new style */ |
int main(void) |
{ |
/* INITIALIZE */ |
/* enable PC5 as output */ |
DDRC|= (1<<DDC5); |
/* PC5 is 5 (see file include/avr/iom8.h) and 1<<PC5 is 00100000 |
* This can also be written as _BV(PC5)*/ |
while (1) { |
/* led on, pin=0 */ |
PORTC &= ~(1<<PC5); |
delay_ms(500); |
/* set output to 5V, LED off */ |
PORTC|= (1<<PC5); |
delay_ms(500); |
} |
return(0); |
} |
// // old style now depricated: |
// int main(void) |
// { |
// // enable PC5 as output |
// sbi(DDRC,PC5); |
// while (1) { |
// // led on, pin=0 |
// cbi(PORTC,PC5); |
// delay_ms(500); |
// // set output to 5V, LED off |
// sbi(PORTC,PC5); |
// delay_ms(500); |
// } |
// return(0); |
// } |
// // end of old style |
/programy/C/avr/Blik/avrm8ledtest.hex |
---|
0,0 → 1,11 |
:1000000012C02BC02AC029C028C027C026C025C0C6 |
:1000100024C023C022C021C020C01FC01EC01DC0DC |
:100020001CC01BC01AC011241FBECFE5D4E0DEBF28 |
:10003000CDBF10E0A0E6B0E0E2E9F0E002C005903C |
:100040000D92A036B107D9F710E0A0E6B0E001C0EC |
:100050001D92A036B107E1F70EC0D2CF9C01E0EFB0 |
:10006000FFE005C0CF010197F1F721503040211585 |
:100070003105C1F70895CFE5D4E0DEBFCDBFA59A25 |
:10008000AD9884EF91E0EADFAD9A84EF91E0E6DF8E |
:02009000F7CFA8 |
:00000001FF |
/programy/C/avr/Blik/Makefile |
---|
0,0 → 1,62 |
# makefile, written by guido socher |
MCU=atmega8 |
#MCU=at90s4433 |
CC=avr-gcc |
OBJCOPY=avr-objcopy |
# optimize for size: |
CFLAGS=-g -mmcu=$(MCU) -Wall -Wstrict-prototypes -Os -mcall-prologues |
#------------------- |
all: avrm8ledtest.hex |
#------------------- |
help: |
@echo "Usage: make all|load|load_pre|rdfuses|wrfuse1mhz|wrfuse4mhz|wrfusecrystal" |
@echo "Warning: you will not be able to undo wrfusecrystal unless you connect an" |
@echo " external crystal! uC is dead after wrfusecrystal if you do not" |
@echo " have an external crystal." |
#------------------- |
avrm8ledtest.hex : avrm8ledtest.out |
$(OBJCOPY) -R .eeprom -O ihex avrm8ledtest.out avrm8ledtest.hex |
avrm8ledtest.out : avrm8ledtest.o |
$(CC) $(CFLAGS) -o avrm8ledtest.out -Wl,-Map,avrm8ledtest.map avrm8ledtest.o |
avrm8ledtest.o : avrm8ledtest.c |
$(CC) $(CFLAGS) -Os -c avrm8ledtest.c |
#------------------ |
load: avrm8ledtest.hex |
./prg_load_uc avrm8ledtest.hex |
# here is a pre-compiled version in case you have trouble with |
# your development environment |
load_pre: avrm8ledtest_pre.hex |
./prg_load_uc avrm8ledtest.hex |
# |
loaduisp: avrm8ledtest.hex |
./prg_load_uc -u avrm8ledtest.hex |
# here is a pre-compiled version in case you have trouble with |
# your development environment |
load_preuisp: avrm8ledtest_pre.hex |
./prg_load_uc -u avrm8ledtest.hex |
#------------------- |
# fuse byte settings: |
# Atmel AVR ATmega8 |
# Fuse Low Byte = 0xe1 (1MHz internal), 0xe3 (4MHz internal), 0xe4 (8MHz internal) |
# Fuse High Byte = 0xd9 |
# Factory default is 0xe1 for low byte and 0xd9 for high byte |
# Check this with make rdfuses |
rdfuses: |
./prg_fusebit_uc -r |
# use internal RC oscillator 1 Mhz |
wrfuse1mhz: |
./prg_fusebit_uc -w 1 |
# use internal RC oscillator 4 Mhz |
wrfuse4mhz: |
./prg_fusebit_uc -w 4 |
# use external 3-8 Mhz crystal |
# Warning: you can not reset this to intenal unless you connect a crystal!! |
wrfusecrystal: |
@echo "Warning: The external crystal setting can not be changed back without a working crystal" |
@echo " You have 3 seconds to abort this with crtl-c" |
@sleep 3 |
./prg_fusebit_uc -w 0 |
#------------------- |
clean: |
rm -f *.o *.map *.out *t.hex |
#------------------- |
/programy/C/avr/Blik/README.txt |
---|
0,0 → 1,63 |
AVR GCC development environment test software. |
See the following article for details: |
http://main.linuxfocus.org/English/November2004/article352.shtml |
To compile type the command: |
make |
Note: You will get some warnings "#warning "This header file is obsolete." |
during compilation with avr-libc-1.4.X. This is because this code will |
also work with avr-libc-1.2.X |
Alternative 1: Programming with uisp (dapa programmer): |
------------------------------------------------------- |
Make sure that you have loaded the following modules in the kernel (for 2.4.x) |
before you use the uisp programmer: |
> /sbin/lsmod |
Module Size Used by |
parport_pc 17808 0 |
ppdev 5312 0 (unused) |
parport 25856 0 [parport_pc ppdev] |
To compile and load use: |
make loaduisp |
Alternative 2: Programming with avrusb500 (high speed usb programmer from tuxgraphics): |
--------------------------------------------------------------------------------------- |
Make sure that you have loaded the following modules in the kernel |
before you use the uisp programmer: |
> /sbin/lsmod |
Module Size Used by |
ftdi_sio 20568 0 |
usbcore 57792 1 [ftdi_sio usbserial] |
To compile and load use: |
make load |
Files: |
------ |
avrm8ledtest.c # the c source code for ATmega8 |
avrm8ledtest_pre.hex # pre-compiled loadable object in case you have |
# trouble to compile the software |
Makefile # Makefile |
README.txt # this file |
circuit.gif # schematic as gif image |
------------------------------------------- |
History: |
version 0.1: 2004-10-01, first Version |
version 0.2: 2004-12-30, corrected fault in delay_ms function |
version 0.3: 2005-10-04, new modular programming with the scripts prg_load_uc |
and prg_fusebit_uc for easy transition to the new |
avrusb500 programmer |
version 0.4: 2006-03-02, compiler independent delay loop. The old delay_ms |
would behave totally different with the new gcc-4 |
version. |
version 0.5: 2006-03-10, Fault in delay_ms corrected |
------------------------------------------- |
Copyright: GPL |
Written by guido socher <guido at tuxgraphics.org> |
------------------------------------------- |
/programy/C/avr/Blik/avrm8ledtest_pre.hex |
---|
0,0 → 1,11 |
:1000000012C02BC02AC029C028C027C026C025C0C6 |
:1000100024C023C022C021C020C01FC01EC01DC0DC |
:100020001CC01BC01AC011241FBECFE5D4E0DEBF28 |
:10003000CDBF10E0A0E6B0E0E6E9F0E002C0059038 |
:100040000D92A036B107D9F710E0A0E6B0E001C0EC |
:100050001D92A036B107E1F710C0D2CFAC0120E06D |
:1000600030E0E0EFF0E005C0CF010197F1F72F5F3E |
:100070003F4F24173507C1F70895CFE5D4E0DEBF21 |
:10008000CDBFA59AAD9884EF91E0E8DFAD9A84EFFB |
:0600900091E0E4DFF7CF70 |
:00000001FF |
/programy/C/avr/Blik/prg_fusebit_uc |
---|
0,0 → 1,97 |
#!/bin/sh |
prg="adude" |
# |
help() |
{ |
echo "prg_fusebit_uc -- read and write fuse bits of the atmega8" |
echo "" |
echo "Usage: prg_fusebit_uc [-hu] -r|-w Freq" |
echo "" |
echo "OPTIONS: -h this help" |
echo " -r read fuse bytes" |
echo " -u use uisp instead of avrdude" |
echo " avrdude can automatically detect dapa or avrusb500." |
echo " uisp can only be used with the parallel port dapa." |
echo " -w write fuse bytes such that a given Freq is used" |
echo " a frequency of 0 means external crystal. Possible" |
echo " values are 0,1,2,4,8" |
echo "" |
echo "EXAMPLE: program the fuses to 4MHz internal" |
echo " prg_fusebit_uc -w 4" |
echo "" |
echo "Warning: you can not undo the setting \"external crystal\" unless" |
echo " you have a crystal that works." |
echo "This script can be easily adapted to different programmer types" |
exit 0 |
} |
while [ -n "$1" ]; do |
case $1 in |
-h) help;shift 1;; |
-u) prg="uisp";shift 1;; |
-r) opt_r="1";shift 1;; |
-w) opt_w="1";freq="$2";shift 2;; |
-*) echo "error: no such option $1. -h for help";exit 1;; |
*) break;; |
esac |
done |
if [ -z "$opt_r" -a -z "$opt_w" ];then |
# one of those options is mandatory |
help |
fi |
hf=0xd9 |
if [ "$opt_w" = "1" ]; then |
case $freq in |
0) lf=0xee;echo "Make sure you have a crystal otherwise you can not change this!";sleep 2;; |
1) lf=0xe1;; |
2) lf=0xe2;; |
4) lf=0xe3;; |
8) lf=0xe4;; |
*) echo "error: no such frequency, -h for help";exit 1;; |
esac |
fi |
if [ "$prg" = "uisp" ]; then |
if [ "$opt_r" = "1" ];then |
set -x |
uisp -dlpt=/dev/parport0 -dprog=dapa --rd_fuses |
set +x |
echo "Explanation: Fuse Low Byte: 0xe1 (1MHz intern), 0xe3 (4MHz intern), " |
echo " 0xe4 (8MHz intern)" |
echo " Fuse High Byte should be 0xd9" |
exit 0 |
fi |
if [ "$opt_w" = "1" ]; then |
set -x |
uisp -dlpt=/dev/parport0 -dprog=dapa --wr_fuse_l=$lf |
uisp -dlpt=/dev/parport0 -dprog=dapa --wr_fuse_h=$hf |
set +x |
exit 0 |
fi |
fi |
if [ "$prg" = "adude" ]; then |
if grep "Vendor=0403 ProdID=6001" /proc/bus/usb/devices > /dev/null ; then |
prg="avrusb500" |
else |
prg="dapa" |
fi |
if [ "$opt_r" = "1" ];then |
set -x |
avrdude -p m8 -c $prg -v -q |
set +x |
echo "Explanation: Fuse Low Byte: 0xe1 (1MHz intern), 0xe3 (4MHz intern), " |
echo " 0xe4 (8MHz intern)" |
echo " Fuse High Byte should be 0xd9" |
exit 0 |
fi |
if [ "$opt_w" = "1" ]; then |
set -x |
avrdude -p m8 -c $prg -u -v -U lfuse:w:$lf:m |
avrdude -p m8 -c $prg -u -v -U hfuse:w:$hf:m |
set +x |
exit 0 |
fi |
fi |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/programy/C/avr/Blik/prg_load_uc |
---|
0,0 → 1,38 |
#!/bin/sh |
prg="adude" |
if [ "$1" = "-u" ]; then |
shift; |
prg="uisp" |
fi |
if [ -z "$1" -o "$1" = "-h" -o "$1" = "--help" ]; then |
echo "prg_load_uc -- load a .hex file into a atmega8 microcontroller" |
echo "" |
echo "Usage: prg_load_uc [-hu] File.hex" |
echo "" |
echo "OPTIONS: -h this help" |
echo " -u use uisp instead of avrdude" |
echo " avrdude can automatically detect dapa or avrusb500." |
echo " uisp can only be used with the parallel port dapa." |
echo "" |
echo "This script can be easily adapted to different programmer types" |
exit 0 |
fi |
pfile="$1" |
if [ "$prg" = "uisp" ]; then |
set -x |
uisp -dlpt=/dev/parport0 --erase -dprog=dapa |
uisp -dlpt=/dev/parport0 --upload if="$pfile" -dprog=dapa -v=3 --hash=32 --verify |
set +x |
fi |
if [ "$prg" = "adude" ]; then |
if grep "Vendor=0403 ProdID=6001" /proc/bus/usb/devices > /dev/null ; then |
set -x |
avrdude -p m8 -c avrusb500 -e -U flash:w:"$pfile" |
set +x |
else |
set -x |
avrdude -p m8 -c dapa -e -U flash:w:"$pfile" |
set +x |
fi |
fi |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/programy/C/avr/Blik/prg_read_uc |
---|
0,0 → 1,38 |
#!/bin/sh |
prg="adude" |
if [ "$1" = "-u" ]; then |
shift; |
prg="uisp" |
fi |
if [ -z "$1" -o "$1" = "-h" -o "$1" = "--help" ]; then |
echo "prg_read_uc -- read the flahs of an atmega8 microcontroller" |
echo "" |
echo "Usage: prg_load_uc [-hu] File.hex" |
echo "" |
echo "OPTIONS: -h this help" |
echo " -u use uisp instead of avrdude" |
echo " avrdude can automatically detect dapa or avrusb500." |
echo " uisp can only be used with the parallel port dapa." |
echo "" |
echo "This script can be easily adapted to different programmer types" |
exit 0 |
fi |
pfile="$1" |
if [ "$prg" = "uisp" ]; then |
set -x |
#uisp -dlpt=/dev/parport0 --erase -dprog=dapa |
#uisp -dlpt=/dev/parport0 --upload if="$pfile" -dprog=dapa -v=3 --hash=32 --verify |
set +x |
fi |
if [ "$prg" = "adude" ]; then |
if grep "Vendor=0403 ProdID=6001" /proc/bus/usb/devices > /dev/null ; then |
set -x |
avrdude -v -v -p m8 -c avrusb500 -U flash:r:"$pfile:i" |
set +x |
else |
set -x |
avrdude -p m8 -c dapa -U flash:r:"$pfile:i" |
set +x |
fi |
fi |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/programy/C/avr/SFR08/Readme.txt |
---|
0,0 → 1,28 |
/**************************************************************************** |
Title : SRF08 RANGING MODULE FUNCTIONS library |
Author: Chris Efstathiou hendrix@otenet.gr |
Date: 13/Jul/2002 |
Software: AVR-GCC with AVR-AS |
Target: any AVR device |
Info: This code is FREE. There are no copyright issues with this code. |
*****************************************************************************/ |
I use it to drive the SRF08 ultrasonic ranging module |
for use with Free Fall night parachute landing |
where i MUST know the distance from ground in order to land safely. |
Infrared goggles gives you an idea about the drop zone |
but you cannot judje the precise distance from the ground due to |
optics distortion. |
For programming example see the SRF08 module code. |
CAUTION: THIS IS A TEST PROGRAM. DO NOT USE IT FOR PARACHUTE LANDING!!! |
There are too many thing missing from the code like |
audio and visual alerts, height averaging, variable gain, |
variable range settings and many other safety features |
needed to make it suitable for this task! |
I can experiment because it is my life! |
Its only purpose is to give an idea of how to use the driver code. |
I hope it can help someone. |
Chris. |
/programy/C/avr/SFR08/SRF08 Ultra sonic range finder.htm |
---|
0,0 → 1,595 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
<!-- saved from url=(0054)http://www.robot-electronics.co.uk/htm/srf08tech.shtml --> |
<HTML><HEAD><TITLE>SRF08 Ultra sonic range finder</TITLE> |
<META http-equiv=Content-Type content="text/html; charset=windows-1253"> |
<META content="MSHTML 6.00.2600.0" name=GENERATOR></HEAD> |
<BODY> |
<P align=center><B><FONT size=5>SRF08 Ultra sonic range finder </FONT><FONT |
size=3><BR>Technical Specification</FONT></B></P> |
<P align=left>Communication with the SRF08 ultrasonic rangefinder is via the I2C |
bus. This is available on popular controllers such as the OOPic and Stamp BS2p, |
as well as a wide variety of micro-controllers. To the programmer the SRF08 |
behaves in the same way as the ubiquitous 24xx series eeprom's, except that the |
I2C address is different. The default shipped address of the SRF08 is 0xE0. It |
can be changed by the user to any of 16 addresses E0, E2, E4, E6, E8, EA, EC, |
EE, F0, F2, F4, F6, F8, FA, FC or FE, therefore up to 16 sonar's can be used. In |
addition to the above addresses, all sonar's on the I2C bus will respond to |
address 0 - the General Broadcast address. This means that writing a ranging |
command to I2C address 0 (0x00) will start all sonar's ranging at the same time. |
This should be useful in ANN Mode (See below). The results must be read |
individually from each sonar's real address. We have <A |
href="http://www.robot-electronics.co.uk/htm/examples.shtml">examples</A> of |
using the SRF08 module with a wide range of popular controllers.</P> |
<P align=left><B>Connections<BR></B>The "Do Not Connect" pin should be left |
unconnected. It is actually the CPU MCLR line and is used once only in our |
workshop to program the PIC16F872 on-board after assembly, and has an internal |
pull-up resistor. The SCL and SDA lines should each have a pull-up resistor to |
+5v somewhere on the I2C bus. You only need one pair of resistors, not a pair |
for every module. They are normally located with the bus master rather than the |
slaves. The SRF08 is always a slave - never a bus master. If you need them, I |
recommend 1.8k resistors. Some modules such as the OOPic already have pull-up |
resistors and you do not need to add any more. </P> |
<P align=center><IMG height=232 |
src="SRF08 Ultra sonic range finder_files/srf08con.jpg" width=302 border=0></P> |
<P align=left><B>Registers</B><BR> The SRF08 appears as a set of 36 |
registers.</P> |
<DIV align=center> |
<CENTER> |
<TABLE cellSpacing=0 cellPadding=0 width="53%" bgColor=#ffffcc border=1> |
<TBODY> |
<TR> |
<TD width="24%"> |
<P align=center>Location</P></TD> |
<TD width="32%"> |
<P align=center>Read</P></TD> |
<TD width="44%"> |
<P align=center>Write</P></TD></TR> |
<TR> |
<TD width="24%"> |
<P align=center>0</P></TD> |
<TD width="32%"> |
<P align=center>Software Revision</P></TD> |
<TD width="44%"> |
<P align=center>Command Register</P></TD></TR> |
<TR> |
<TD width="24%"> |
<P align=center>1</P></TD> |
<TD width="32%"> |
<P align=center>Light Sensor</P></TD> |
<TD width="44%"> |
<P align=center>Max Gain Register (default 31) </P></TD></TR> |
<TR> |
<TD width="24%"> |
<P align=center>2</P></TD> |
<TD width="32%"> |
<P align=center>1st Echo High Byte</P></TD> |
<TD width="44%"> |
<P align=center>Range Register (default 255)</P></TD></TR> |
<TR> |
<TD width="24%"> |
<P align=center>3</P></TD> |
<TD width="32%"> |
<P align=center>1st Echo Low Byte</P></TD> |
<TD width="44%"> |
<P align=center>N/A</P></TD></TR> |
<TR> |
<TD width="24%"> |
<P align=center>~~~~</P></TD> |
<TD width="32%"> |
<P align=center>~~~~</P></TD> |
<TD width="44%"> |
<P align=center>~~~~</P></TD></TR> |
<TR> |
<TD width="24%"> |
<P align=center>34</P></TD> |
<TD width="32%"> |
<P align=center>17th Echo High Byte</P></TD> |
<TD width="44%"> |
<P align=center>N/A</P></TD></TR> |
<TR> |
<TD width="24%"> |
<P align=center>35</P></TD> |
<TD width="32%"> |
<P align=center>17th Echo Low Byte</P></TD> |
<TD width="44%"> |
<P align=center>N/A</P></TD></TR></TBODY></TABLE></CENTER></DIV> |
<P align=left>Only locations 0, 1 and 2 can be written to. Location 0 is the |
command register and is used to start a ranging session. It cannot be read. |
Reading from location 0 returns the SRF08 software revision. By default, |
the ranging lasts for 65mS, but can be changed by writing to the range register |
at location 2. If you do so, then you will likely need to change the analogue |
gain by writing to location 1. See the <B>Changing Range</B> and <B>Analogue |
Gain</B> sections below.</P> |
<P align=left>Location 1 is the onboard light sensor. This data is updated every |
time a new ranging command has completed and can be read when range data is |
read. The next two locations, 2 and 3, are the 16bit unsigned result from the |
latest ranging - high byte first. The meaning of this value depends on the |
command used, and is either the range in inches, or the range in cm or the |
flight time in uS. A value of zero indicates that no objects were detected. |
There are up to a further 16 results indicating echo's from more distant |
objects. </P> |
<P align=left><B>Commands</B><BR>The are three commands to initiate a ranging |
(80 to 82), to return the result in inches, centimeters or microseconds. There |
is also an ANN mode (Artificial Neural Network) mode which is described later |
and a set of commands to change the I2C address.</P> |
<DIV align=center> |
<CENTER> |
<TABLE cellSpacing=0 cellPadding=0 width="77%" bgColor=#ffffcc border=1> |
<TBODY> |
<TR> |
<TD align=middle width="34%" colSpan=2>Command</TD> |
<TD align=middle width="94%" rowSpan=2>Action</TD></TR> |
<TR> |
<TD align=middle width="16%">Decimal</TD> |
<TD align=middle width="18%">Hex</TD></TR> |
<TR> |
<TD align=middle width="16%">80</TD> |
<TD align=middle width="18%">0x50</TD> |
<TD align=left width="94%">Ranging Mode - Result in inches</TD></TR> |
<TR> |
<TD align=middle width="16%">81</TD> |
<TD align=middle width="18%">0x51</TD> |
<TD align=left width="94%">Ranging Mode - Result in centimeters</TD></TR> |
<TR> |
<TD align=middle width="16%">82</TD> |
<TD align=middle width="18%">0x52</TD> |
<TD align=left width="94%">Ranging Mode - Result in micro-seconds</TD></TR> |
<TR> |
<TD align=middle width="16%"> </TD> |
<TD align=middle width="18%"> </TD> |
<TD align=left width="94%"> </TD></TR> |
<TR> |
<TD align=middle width="16%">83</TD> |
<TD align=middle width="18%">0x53</TD> |
<TD align=left width="94%">ANN Mode - Result in inches</TD></TR> |
<TR> |
<TD align=middle width="16%">84</TD> |
<TD align=middle width="18%">0x54</TD> |
<TD align=left width="94%">ANN Mode - Result in centimeters</TD></TR> |
<TR> |
<TD align=middle width="16%">85</TD> |
<TD align=middle width="18%">0x55</TD> |
<TD align=left width="94%">ANN Mode - Result in micro-seconds</TD></TR> |
<TR> |
<TD align=middle width="16%"> </TD> |
<TD align=middle width="18%"> </TD> |
<TD align=left width="94%"> </TD></TR> |
<TR> |
<TD align=middle width="16%">160</TD> |
<TD align=middle width="18%">0xA0</TD> |
<TD align=left width="94%">1st in sequence to change I2C address</TD></TR> |
<TR> |
<TD align=middle width="16%">165</TD> |
<TD align=middle width="18%">0xA5</TD> |
<TD align=left width="94%">3rd in sequence to change I2C address</TD></TR> |
<TR> |
<TD align=middle width="16%">170</TD> |
<TD align=middle width="18%">0xAA</TD> |
<TD align=left width="94%">2nd in sequence to change I2C |
address</TD></TR></TBODY></TABLE></CENTER></DIV> |
<P align=left><B>Ranging Mode</B><BR>To initiate a ranging, write one of the |
above commands to the command register and wait the required amount of time for |
completion and read as many results as you wish. The echo buffer is cleared at |
the start of each ranging. The first echo range is placed in locations 2,3. the |
second in 4,5, etc. If a location (high and low bytes) is 0, then there will be |
no further reading in the rest of the registers. The default and recommended |
time for completion of ranging is 65mS, however you can shorten this by writing |
to the range register before issuing a ranging command. Light sensor data at |
location 1 will also have been updated after a ranging command. </P> |
<P align=left><B>ANN Mode<BR></B>ANN mode (Artificial Neural Network) is |
designed to provide the multi echo data in a way that is easier to input to a |
neural network, at least I hope it is - I've not actually done it yet. ANN mode |
provides a 32 byte buffer (locations 4 to 35 inclusive) where each byte |
represents the 65536uS maximum flight time divided into 32 chunks of 2048uS each |
- equivalent to about 352mm of range. If an echo is received within a bytes time |
slot then it will be set to no-zero, otherwise it will be zero. So if an echo is |
received from within the first 352mm, location 4 will be non-zero. If an object |
is detected 3m away the location 12 will be non-zero (3000/352 = 8) (8+4=12). |
Arranging the data like this should be better for a neural net than the other |
formats. The input to your network should be 0 if the byte is zero and 1 if its |
non-zero. I have a SOFM (Self Organizing Feature Map) in mind for the neural |
net, but will hopefully be useful for any type. </P> |
<DIV align=center> |
<CENTER> |
<TABLE cellSpacing=0 cellPadding=0 width="71%" bgColor=#ffffcc border=1> |
<TBODY> |
<TR> |
<TD align=middle width="20%">Location 4</TD> |
<TD align=middle width="20%">Location 5</TD> |
<TD align=middle width="20%">Location 6</TD> |
<TD align=middle width="20%">Location 7</TD> |
<TD align=middle width="20%">Locations 8 - 35</TD></TR> |
<TR> |
<TD align=middle width="20%">0 - 352mm</TD> |
<TD align=middle width="20%">353 - 705mm</TD> |
<TD align=middle width="20%">706 - 1057mm</TD> |
<TD align=middle width="20%">1058 - 1410mm</TD> |
<TD align=middle width="20%">and so on</TD></TR></TBODY></TABLE></CENTER></DIV> |
<P align=left>Locations 2,3 contain the range of the nearest object converted to |
inches, cm or uS and is the same as for Ranging Mode.</P> |
<P align=left><B>Checking for Completion of Ranging</B><BR>You do not have to |
use a timer on your own controller to wait for ranging to finish. You can take |
advantage of the fact that the SRF08 will not respond to any I2C activity whilst |
ranging. Therefore, if you try to read from the SRF08 (we use the software |
revision number a location 0) then you will get 255 (0xFF) whilst ranging. This |
is because the I2C data line (SDA) is pulled high if nothing is driving it. As |
soon as the ranging is complete the SRF08 will again respond to the I2C bus, so |
just keep reading the register until its not 255 (0xFF) anymore. You can then |
read the sonar data. Your controller can take advantage of this to perform other |
tasks while the SRF08 is ranging. </P> |
<P align=left><B>Changing the Range</B><BR>The maximum range of the SRF08 is set |
by an internal timer. By default, this is 65mS or the equivalent of 11 metres of |
range. This is much further than the 6 metres the SRF08 is actually |
capable of. It is possible to reduce the time the SRF08 listens for an echo, and |
hence the range, by writing to the range register at location 2. The range can |
be set in steps of about 43mm (0.043m or 1.68 inches) up to 11 |
metres. <BR>The range is ((Range Register x 43mm) + 43mm) so setting the |
Range Register to 0 (0x00) gives a maximum range of 43mm. Setting the Range |
Register to 1 (0x01) gives a maximum range of 86mm. More usefully, 24 (0x18) |
gives a range of 1 metre and 140 (0x8C) is 6 metres. Setting 255 (0xFF) gives |
the original 11 metres (255 x 43 + 43 is 11008mm). There are two reasons you may |
wish to reduce the range.<BR>1. To get at the range information quicker<BR>2. To |
be able to fire the SRF08 at a faster rate.<BR>If you only wish to get at the |
range information a bit sooner and will continue to fire the SRF08 at 65ms of |
slower, then all will be well. However if you wish to fire the SRF08 at a faster |
rate than 65mS, you will definitely need to reduce the gain - see next |
section.<BR>The range is set to maximum every time the SRF08 is powered-up. If |
you need a different range, change it once as part of your system initialization |
code.<BR></P> |
<P align=left><B>Analogue Gain</B><BR>The analogue gain register sets the |
<I>Maximum</I> gain of the analogue stages. To set the maximum gain, just write |
one of these values to the gain register at location 1. During a ranging, the |
analogue gain starts off at its minimum value of 94. This is increased at |
approx. 70uS intervals up to the maximum gain setting, set by register |
1. Maximum possible gain is reached after about 390mm of range. The purpose |
of providing a limit to the maximum gain is to allow you to fire the sonar more |
rapidly than 65mS. Since the ranging can be very short, a new ranging can be |
initiated as soon as the previous range data has been read. A potential hazard |
with this is that the second ranging may pick up a distant echo returning from |
the previous "ping", give a false result of a close by object when there is |
none. To reduce this possibility, the maximum gain can be reduced to limit the |
modules sensitivity to the weaker distant echo, whilst still able to detect |
close by objects. The maximum gain setting is stored only in the CPU's RAM and |
is initialized to maximum on power-up, so if you only want do a ranging every |
65mS, or longer, you can ignore the Range and Gain Registers.<BR><I><B><FONT |
color=#ff00ff>Note</FONT></B></I> - Effective in Ranging Mode only, in ANN mode, |
gain is controlled automatically. </P> |
<DIV align=center> |
<CENTER> |
<TABLE height=714 cellSpacing=0 cellPadding=0 width=428 bgColor=#ffffcc |
border=1> |
<TBODY> |
<TR> |
<TD align=middle width=157 colSpan=2 height=19>Gain Register</TD> |
<TD align=middle width=265 height=40 rowSpan=2>Maximum Analogue Gain</TD></TR> |
<TR> |
<TD align=middle width=77 height=19>Decimal</TD> |
<TD align=middle width=80 height=19>Hex</TD></TR> |
<TR> |
<TD align=middle width=74 height=19>0</TD> |
<TD align=middle width=81 height=19>0x00</TD> |
<TD align=middle width=265 height=19>Set Maximum Analogue Gain to 94</TD></TR> |
<TR> |
<TD align=middle width=74 height=19>1</TD> |
<TD align=middle width=81 height=19>0x01</TD> |
<TD align=middle width=265 height=19>Set Maximum Analogue Gain to 97</TD></TR> |
<TR> |
<TD align=middle width=74 height=19>2</TD> |
<TD align=middle width=81 height=19>0x02</TD> |
<TD align=middle width=265 height=19>Set Maximum Analogue Gain to |
100</TD></TR> |
<TR> |
<TD align=middle width=74 height=19>3</TD> |
<TD align=middle width=81 height=19>0x03</TD> |
<TD align=middle width=265 height=19>Set Maximum Analogue Gain to |
103</TD></TR> |
<TR> |
<TD align=middle width=74 height=19>4</TD> |
<TD align=middle width=81 height=19>0x04</TD> |
<TD align=middle width=265 height=19>Set Maximum Analogue Gain to |
107</TD></TR> |
<TR> |
<TD align=middle width=74 height=19>5</TD> |
<TD align=middle width=81 height=19>0x05</TD> |
<TD align=middle width=265 height=19>Set Maximum Analogue Gain to |
110</TD></TR> |
<TR> |
<TD align=middle width=74 height=19>6</TD> |
<TD align=middle width=81 height=19>0x06</TD> |
<TD align=middle width=265 height=19>Set Maximum Analogue Gain to |
114</TD></TR> |
<TR> |
<TD align=middle width=74 height=19>7</TD> |
<TD align=middle width=81 height=19>0x07</TD> |
<TD align=middle width=265 height=19>Set Maximum Analogue Gain to |
118</TD></TR> |
<TR> |
<TD align=middle width=74 height=19>8</TD> |
<TD align=middle width=81 height=19>0x08</TD> |
<TD align=middle width=265 height=19>Set Maximum Analogue Gain to |
123</TD></TR> |
<TR> |
<TD align=middle width=74 height=19>9</TD> |
<TD align=middle width=81 height=19>0x09</TD> |
<TD align=middle width=265 height=19>Set Maximum Analogue Gain to |
128</TD></TR> |
<TR> |
<TD align=middle width=74 height=19>10</TD> |
<TD align=middle width=81 height=19>0x0A</TD> |
<TD align=middle width=265 height=19>Set Maximum Analogue Gain to |
133</TD></TR> |
<TR> |
<TD align=middle width=74 height=19>11</TD> |
<TD align=middle width=81 height=19>0x0B</TD> |
<TD align=middle width=265 height=19>Set Maximum Analogue Gain to |
139</TD></TR> |
<TR> |
<TD align=middle width=74 height=19>12</TD> |
<TD align=middle width=81 height=19>0x0C</TD> |
<TD align=middle width=265 height=19>Set Maximum Analogue Gain to |
145</TD></TR> |
<TR> |
<TD align=middle width=74 height=19>13</TD> |
<TD align=middle width=81 height=19>0x0D</TD> |
<TD align=middle width=265 height=19>Set Maximum Analogue Gain to |
152</TD></TR> |
<TR> |
<TD align=middle width=74 height=19>14</TD> |
<TD align=middle width=81 height=19>0x0E</TD> |
<TD align=middle width=265 height=19>Set Maximum Analogue Gain to |
159</TD></TR> |
<TR> |
<TD align=middle width=74 height=19>15</TD> |
<TD align=middle width=81 height=19>0x0F</TD> |
<TD align=middle width=265 height=19>Set Maximum Analogue Gain to |
168</TD></TR> |
<TR> |
<TD align=middle width=74 height=19>16</TD> |
<TD align=middle width=81 height=19>0x10</TD> |
<TD align=middle width=265 height=19>Set Maximum Analogue Gain to |
177</TD></TR> |
<TR> |
<TD align=middle width=74 height=19>17</TD> |
<TD align=middle width=81 height=19>0x11</TD> |
<TD align=middle width=265 height=19>Set Maximum Analogue Gain to |
187</TD></TR> |
<TR> |
<TD align=middle width=74 height=19>18</TD> |
<TD align=middle width=81 height=19>0x12</TD> |
<TD align=middle width=265 height=19>Set Maximum Analogue Gain to |
199</TD></TR> |
<TR> |
<TD align=middle width=74 height=19>19</TD> |
<TD align=middle width=81 height=19>0x13</TD> |
<TD align=middle width=265 height=19>Set Maximum Analogue Gain to |
212</TD></TR> |
<TR> |
<TD align=middle width=74 height=19>20</TD> |
<TD align=middle width=81 height=19>0x14</TD> |
<TD align=middle width=265 height=19>Set Maximum Analogue Gain to |
227</TD></TR> |
<TR> |
<TD align=middle width=74 height=19>21</TD> |
<TD align=middle width=81 height=19>0x15</TD> |
<TD align=middle width=265 height=19>Set Maximum Analogue Gain to |
245</TD></TR> |
<TR> |
<TD align=middle width=74 height=19>22</TD> |
<TD align=middle width=81 height=19>0x16</TD> |
<TD align=middle width=265 height=19>Set Maximum Analogue Gain to |
265</TD></TR> |
<TR> |
<TD align=middle width=74 height=19>23</TD> |
<TD align=middle width=81 height=19>0x17</TD> |
<TD align=middle width=265 height=19>Set Maximum Analogue Gain to |
288</TD></TR> |
<TR> |
<TD align=middle width=74 height=19>24</TD> |
<TD align=middle width=81 height=19>0x18</TD> |
<TD align=middle width=265 height=19>Set Maximum Analogue Gain to |
317</TD></TR> |
<TR> |
<TD align=middle width=74 height=19>25</TD> |
<TD align=middle width=81 height=19>0x18</TD> |
<TD align=middle width=265 height=19>Set Maximum Analogue Gain to |
352</TD></TR> |
<TR> |
<TD align=middle width=74 height=19>26</TD> |
<TD align=middle width=81 height=19>0x20</TD> |
<TD align=middle width=265 height=19>Set Maximum Analogue Gain to |
395</TD></TR> |
<TR> |
<TD align=middle width=74 height=19>27</TD> |
<TD align=middle width=81 height=19>0x21</TD> |
<TD align=middle width=265 height=19>Set Maximum Analogue Gain to |
450</TD></TR> |
<TR> |
<TD align=middle width=74 height=19>28</TD> |
<TD align=middle width=81 height=19>0x22</TD> |
<TD align=middle width=265 height=19>Set Maximum Analogue Gain to |
524</TD></TR> |
<TR> |
<TD align=middle width=74 height=19>29</TD> |
<TD align=middle width=81 height=19>0x23</TD> |
<TD align=middle width=265 height=19>Set Maximum Analogue Gain to |
626</TD></TR> |
<TR> |
<TD align=middle width=74 height=19>30</TD> |
<TD align=middle width=81 height=19>0x24</TD> |
<TD align=middle width=265 height=19>Set Maximum Analogue Gain to |
777</TD></TR> |
<TR> |
<TD align=middle width=74 height=19>31</TD> |
<TD align=middle width=81 height=19>0x25</TD> |
<TD align=middle width=265 height=19>Set Maximum Analogue Gain to |
1025</TD></TR></TBODY></TABLE></CENTER></DIV> |
<P align=left>Note that the relationship between the Gain Register setting and |
the actual gain is not a linear one. Also there is no magic formula to say "use |
this gain setting with that range setting". It depends on the size, shape and |
material of the object and what else is around in the room. Try playing with |
different settings until you get the result you want. If you appear to get false |
readings, it may be echo's from previous "pings", try going back to firing the |
SRF08 every 65mS or longer (slower). <BR>If you are in any doubt about the |
Range and Gain Registers, remember they are automatically set by the SRF08 to |
their default values when it is powered-up. You can ignore and forget about them |
and the SRF08 will work fine, detecting objects up to 6 metres away every 65mS |
or slower.</P> |
<P align=left><B>Light Sensor</B><BR>The SRF08 has a light sensor on-board. A |
reading of the light intensity is made by the SRF08 each time a ranging takes |
place in either Ranging or ANN Modes ( The A/D conversion is actually done just |
before the "ping" whilst the +/- 10v generator is stabilizing). The reading |
increases as the brightness increases, so you will get a maximum value in bright |
light and minimum value in darkness. It should get close to 2-3 in complete |
darkness and up to about 248 (0xF8) in bright light. The light intensity can be |
read from the Light Sensor Register at location 1 at the same time that |
you are reading the range data.</P> |
<P align=left><B>LED</B><BR>The red LED is used to flash out a code for the I2C |
address on power-up (see below). It also gives a brief flash during the "ping" |
whilst ranging.</P> |
<P align=left><B>Changing the I2C Bus Address</B><BR>To change the I2C address |
of the SRF08 you must have only one sonar on the bus. Write the 3 sequence |
commands in the correct order followed by the address. Example; to change the |
address of a sonar currently at 0xE0 (the default shipped address) to 0xF2, |
write the following to address 0xE0; (0xA0, 0xAA, 0xA5, 0xF2 ). These commands |
must be sent in the correct sequence to change the I2C address, additionally, No |
other command may be issued in the middle of the sequence. The sequence must be |
sent to the command register at location 0, which means 4 separate write |
transactions on the I2C bus. When done, you should label the sonar with its |
address, however if you do forget, just power it up without sending any |
commands. The SRF08 will flash its address out on the LED. One long flash |
followed by a number of shorter flashes indicating its address. The flashing is |
terminated immediately on sending a command the SRF08.</P> |
<DIV align=center> |
<CENTER> |
<TABLE cellSpacing=0 cellPadding=0 width="45%" bgColor=#ffffcc border=1> |
<TBODY> |
<TR> |
<TD align=middle width="45%" colSpan=2>Address</TD> |
<TD align=middle width="25%" rowSpan=2>Long Flash</TD> |
<TD align=middle width="30%" rowSpan=2>Short flashes</TD></TR> |
<TR> |
<TD align=middle width="23%">Decimal</TD> |
<TD align=middle width="22%">Hex</TD></TR> |
<TR> |
<TD align=middle width="23%">224</TD> |
<TD align=middle width="22%">E0</TD> |
<TD align=middle width="25%">1</TD> |
<TD align=middle width="30%">0</TD></TR> |
<TR> |
<TD align=middle width="23%">226</TD> |
<TD align=middle width="22%">E2</TD> |
<TD align=middle width="25%">1</TD> |
<TD align=middle width="30%">1</TD></TR> |
<TR> |
<TD align=middle width="23%">228</TD> |
<TD align=middle width="22%">E4</TD> |
<TD align=middle width="25%">1</TD> |
<TD align=middle width="30%">2</TD></TR> |
<TR> |
<TD align=middle width="23%">230</TD> |
<TD align=middle width="22%">E6</TD> |
<TD align=middle width="25%">1</TD> |
<TD align=middle width="30%">3</TD></TR> |
<TR> |
<TD align=middle width="23%">232</TD> |
<TD align=middle width="22%">E8</TD> |
<TD align=middle width="25%">1</TD> |
<TD align=middle width="30%">4</TD></TR> |
<TR> |
<TD align=middle width="23%">234</TD> |
<TD align=middle width="22%">EA</TD> |
<TD align=middle width="25%">1</TD> |
<TD align=middle width="30%">5</TD></TR> |
<TR> |
<TD align=middle width="23%">236</TD> |
<TD align=middle width="22%">EC</TD> |
<TD align=middle width="25%">1</TD> |
<TD align=middle width="30%">6</TD></TR> |
<TR> |
<TD align=middle width="23%">238</TD> |
<TD align=middle width="22%">EE</TD> |
<TD align=middle width="25%">1</TD> |
<TD align=middle width="30%">7</TD></TR> |
<TR> |
<TD align=middle width="23%">240</TD> |
<TD align=middle width="22%">F0</TD> |
<TD align=middle width="25%">1</TD> |
<TD align=middle width="30%">8</TD></TR> |
<TR> |
<TD align=middle width="23%">242</TD> |
<TD align=middle width="22%">F2</TD> |
<TD align=middle width="25%">1</TD> |
<TD align=middle width="30%">9</TD></TR> |
<TR> |
<TD align=middle width="23%">244</TD> |
<TD align=middle width="22%">F4</TD> |
<TD align=middle width="25%">1</TD> |
<TD align=middle width="30%">10</TD></TR> |
<TR> |
<TD align=middle width="23%">246</TD> |
<TD align=middle width="22%">F6</TD> |
<TD align=middle width="25%">1</TD> |
<TD align=middle width="30%">11</TD></TR> |
<TR> |
<TD align=middle width="23%">248</TD> |
<TD align=middle width="22%">F8</TD> |
<TD align=middle width="25%">1</TD> |
<TD align=middle width="30%">12</TD></TR> |
<TR> |
<TD align=middle width="23%">250</TD> |
<TD align=middle width="22%">FA</TD> |
<TD align=middle width="25%">1</TD> |
<TD align=middle width="30%">13</TD></TR> |
<TR> |
<TD align=middle width="23%">252</TD> |
<TD align=middle width="22%">FC</TD> |
<TD align=middle width="25%">1</TD> |
<TD align=middle width="30%">14</TD></TR> |
<TR> |
<TD align=middle width="23%">254</TD> |
<TD align=middle width="22%">FE</TD> |
<TD align=middle width="25%">1</TD> |
<TD align=middle width="30%">15</TD></TR></TBODY></TABLE></CENTER></DIV> |
<P align=left>Take care not to set more than one sonar to the same address, |
there will be a bus collision and very unpredictable results.</P> |
<P align=left><B>Current Consumption</B><BR>Average current consumption measured |
on our prototype is around 12mA during ranging, and 3mA standby. The module will |
automatically go to standby mode after a ranging, whilst waiting for a new |
command on the I2C bus. The actual measured current profile is as follows; </P> |
<DIV align=center> |
<CENTER> |
<TABLE cellSpacing=0 width=400 bgColor=#ffffcc border=1> |
<TBODY> |
<TR> |
<TD align=middle width=253>Operation</TD> |
<TD align=middle width=62>Current</TD> |
<TD align=middle width=65>Duration</TD></TR> |
<TR> |
<TD align=middle width=253>Ranging command received - Power on</TD> |
<TD align=middle width=62>275mA</TD> |
<TD align=middle width=65>3uS</TD></TR> |
<TR> |
<TD align=middle width=253>+/- 10v generator Stabilization</TD> |
<TD align=middle width=62> |
<P align=center>25mA</P></TD> |
<TD align=middle width=65>600uS</TD></TR> |
<TR> |
<TD align=middle width=253>8 cycles of 40kHz "ping"</TD> |
<TD align=middle width=62>40mA</TD> |
<TD align=middle width=65>200uS</TD></TR> |
<TR> |
<TD align=middle width=253>Ranging</TD> |
<TD align=middle width=62>11mA</TD> |
<TD align=middle width=65>65mS max</TD></TR> |
<TR> |
<TD align=middle width=253>Standby</TD> |
<TD align=middle width=62>3mA</TD> |
<TD align=middle width=65>indefinite</TD></TR></TBODY></TABLE></CENTER></DIV> |
<P align=left>The above values are for guidance only, they are not tested on |
production units. </P> |
<P align=left> You can have a look at the <A |
href="http://www.robot-electronics.co.uk/images/srf08schematic.gif">schematic</A> |
and <A href="http://www.robot-electronics.co.uk/files/srf08.c">software</A> </P> |
<P align=left>Your feedback/comments/criticisms and wish lists are very welcome, |
as always.<BR>Regards, Gerry. |
<BR>gerry@robot-electronics.co.uk</P></BODY></HTML> |
/programy/C/avr/SFR08/SRF08 Ultra sonic range finder_files/srf08con.jpg |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr/SFR08/i2c.c |
---|
0,0 → 1,172 |
/**************************************************************************** |
Title : C file for the I2C FUNCTIONS library (i2c.c) |
Author: Chris efstathiou hendrix@otenet.gr |
Date: 13/Jul/2002 |
Software: AVR-GCC with AVR-AS |
Target: any AVR device |
Comments: This software is FREE. |
*****************************************************************************/ |
#include <io.h> |
#include "i2c.h" |
#ifndef CONCAT1 |
#define CONCAT1(a, b) CONCAT2(a, b) |
#endif |
#ifndef CONCAT2 |
#define CONCAT2(a, b) a ## b |
#endif |
/* Conversion of microseconds to the right value for the delay function */ |
#define I2C_DELAY ( (I2C_DELAY_TIME*(F_CPU/60000))/100 ) |
#define I2C_TIMEOUT ( (I2C_TIMEOUT_TIME*(F_CPU/60000))/100 ) |
/* Register name forming */ |
#define I2C_SDA_OUT_REG CONCAT1(PORT, I2C_SDA_PORT) |
#define I2C_SCL_OUT_REG CONCAT1(PORT, I2C_SCL_PORT) |
#define I2C_SDA_DDR_REG CONCAT1(DDR, I2C_SDA_PORT) |
#define I2C_SCL_DDR_REG CONCAT1(DDR, I2C_SCL_PORT) |
#define I2C_SDA_PIN_REG CONCAT1(PIN, I2C_SDA_PORT) |
#define I2C_SCL_PIN_REG CONCAT1(PIN, I2C_SCL_PORT) |
/* Conversion of microseconds to the right value for the delay function */ |
#define I2C_DELAY ( (I2C_DELAY_TIME*(F_CPU/60000))/100 ) |
#define I2C_TIMEOUT ( (I2C_TIMEOUT_TIME*(F_CPU/60000))/100 ) |
/* Pin states */ |
#define SCL_1() cbi(I2C_SCL_DDR_REG, SCL_PIN) |
#define SCL_0() sbi(I2C_SCL_DDR_REG, SCL_PIN) |
#define SDA_1() cbi(I2C_SDA_DDR_REG, SDA_PIN) |
#define SDA_0() sbi(I2C_SDA_DDR_REG, SDA_PIN) |
#define RELEASE_I2C_BUS() { SCL_1(); SDA_1(); } |
/*#################################################################################################*/ |
static void delay(unsigned long us) |
{ |
while ( us ) { us--; } /* 6 cpu cycles per loop */ |
} |
/*#################################################################################################*/ |
void i2c_init(void) |
{ |
cbi(I2C_SDA_OUT_REG, SDA_PIN); |
cbi(I2C_SCL_OUT_REG, SCL_PIN); |
RELEASE_I2C_BUS(); |
delay(I2C_TIMEOUT); |
i2c_start(); |
delay(I2C_TIMEOUT); |
i2c_stop(); |
delay(I2C_TIMEOUT); |
return; |
} |
/*#################################################################################################*/ |
void i2c_start(void) |
{ |
RELEASE_I2C_BUS(); |
delay(I2C_DELAY); |
SDA_0(); |
delay(I2C_DELAY); |
SCL_0(); |
delay(I2C_DELAY); |
return; |
} |
/*#################################################################################################*/ |
void i2c_stop(void) |
{ |
SDA_0(); |
SCL_1(); |
delay(I2C_DELAY); |
SDA_1(); |
delay(I2C_DELAY); |
SCL_0(); |
delay(I2C_DELAY); |
return; |
} |
/*#################################################################################################*/ |
unsigned char i2c_transmit(unsigned char data) |
{ |
register unsigned char bit=0; |
for(bit=0; bit<=7; bit++) |
{ |
if( data & 0x80 ) { SDA_1(); } else { SDA_0(); } |
SCL_1(); |
delay(I2C_DELAY); |
SCL_0(); |
delay(I2C_DELAY); |
data = (data<<1); |
} |
/* Look for AKNOWLEDGE */ |
RELEASE_I2C_BUS(); |
delay(I2C_DELAY); |
if( bit_is_clear(I2C_SDA_PIN_REG, SDA_PIN) ) |
{ |
SCL_0(); |
delay(I2C_DELAY); |
} |
else{ |
delay(I2C_TIMEOUT); |
if( bit_is_clear(I2C_SDA_PIN_REG, SDA_PIN) ) |
{ |
SCL_0(); |
delay(I2C_DELAY); |
} |
else { return(I2C_ERROR_DEVICE_NOT_RESPONDING); } |
} |
if( bit_is_clear(I2C_SDA_PIN_REG, SDA_PIN) ) |
{ |
delay(I2C_TIMEOUT); |
if( bit_is_clear(I2C_SDA_PIN_REG, SDA_PIN) ) { return(I2C_ERROR_DEVICE_BUSY); } |
} |
return(I2C_NO_ERROR); |
} |
/*#################################################################################################*/ |
unsigned char i2c_receive(unsigned char ack) |
{ |
register unsigned char bit=0, data=0; |
SDA_1(); |
for(bit=0; bit<=7; bit++) |
{ |
SCL_1(); |
delay(I2C_DELAY); |
data = (data<<1); |
if( bit_is_set(I2C_SDA_PIN_REG, SDA_PIN) ) { data++; } |
SCL_0(); |
delay(I2C_DELAY); |
} |
/* if CONTINUE then send AKNOWLEDGE else if QUIT do not send AKNOWLEDGE (send Nack) */ |
if(ack==I2C_CONTINUE) { SDA_0(); } else { SDA_1(); } |
SCL_1(); |
delay(I2C_DELAY); |
SCL_0(); |
delay(I2C_DELAY); |
return data; |
} |
/*#################################################################################################*/ |
/programy/C/avr/SFR08/i2c.h |
---|
0,0 → 1,76 |
/**************************************************************************** |
Title : C include file for the I2C FUNCTIONS library (i2c.h) |
Author: Chris efstathiou hendrix@otenet.gr |
Date: 13/Jul/2002 |
Software: AVR-GCC with AVR-AS |
Target: any AVR device |
Comments: This software is FREE. |
*****************************************************************************/ |
#ifndef I2C_H |
#define I2C_H 1 |
/*##############################################################################################*/ |
/* START OF CONFIGURATION BLOCK */ |
/*##############################################################################################*/ |
#ifndef F_CPU |
#define F_CPU 3686400L /* The cpu clock frequency in Hertz (used to calculate time)*/ |
#endif |
#define I2C_SDA_PORT D /* The SDA port. Use capital letter (A,B,C,D... etc.) */ |
#define SDA_PIN 4 /* The SDA port pin */ |
#define I2C_SCL_PORT D /* The SCL port. Use capital letter (A,B,C,D... etc.) */ |
#define SCL_PIN 5 /* The SCL port pin */ |
/* |
The I2C_DELAY_TIME normally is 5 microseconds for a 100 Khz I2C bus ( (1/100000)/2 ). |
but due to bus capacitance and device responce time in my application i use 50 microseconds. |
The I2C_TIMEOUT_TIME is set to whatever is the maximum time you think your device will take |
to perform the requested task. After that time the i2c_transmit function will return |
a "I2C_ERROR_DEVICE_NOT_RESPONDING" or "I2C_ERROR_DEVICE_BUSY" error code. |
*/ |
#define I2C_DELAY_TIME 50 /* in microseconds (max over 1 second) */ |
#define I2C_TIMEOUT_TIME 1000 /* in microseconds (max over 1 second) */ |
/*##############################################################################################*/ |
/* END OF CONFIGURATION BLOCK */ |
/*##############################################################################################*/ |
/* Keyword definitions */ |
#define I2C_READ 1 |
#define I2C_WRITE 0 |
#define I2C_QUIT 0 |
#define I2C_CONTINUE 1 |
#define I2C_NO_ERROR 0 |
#define I2C_ERROR_DEVICE_BUSY 1 |
#define I2C_ERROR_DEVICE_NOT_RESPONDING 2 |
/* Function Declaration */ |
extern void i2c_init(void); |
extern void i2c_start(void); |
extern void i2c_stop(void); |
extern unsigned char i2c_transmit(unsigned char data); |
extern unsigned char i2c_receive(unsigned char ack); |
/* Macro definitions */ |
#define I2C_START(ADDRESS) { i2c_start(); i2c_transmit(ADDRESS); } |
#define I2C_START_TX(ADDRESS) I2C_START(ADDRESS) |
#define I2C_START_RX(ADDRESS) I2C_START(ADDRESS | I2C_READ) |
#endif /* #ifndef I2C_H */ |
/*######################################################################################################*/ |
/* T H E E N D */ |
/*######################################################################################################*/ |
/programy/C/avr/SFR08/lcd_io.c |
---|
0,0 → 1,1040 |
/**************************************************************************** |
Title : C file for the HD44780U LCD library (lcd_io.c) |
Author: Chris efstathiou hendrix@otenet.gr |
Date: 1/Jul/2002 |
Software: AVR-GCC with AVR-AS |
Target: any AVR device |
Comments: This software is FREE. |
*****************************************************************************/ |
#ifndef _IO_REG_MACRO_MODE_ |
#define _IO_REG_MACRO_MODE_ 1 /* In case you have the new assignment mode io headers */ |
#endif |
#ifndef _SFR_ASM_COMPAT |
#define _SFR_ASM_COMPAT 1 /* This is for GCC 3.2 */ |
#endif |
#include <io.h> |
#include <progmem.h> |
#include <eeprom.h> |
#include "lcd_io.h" |
/* constants/macros */ |
#ifndef CONCAT1 |
#define CONCAT1(a, b) CONCAT2(a, b) |
#endif |
#ifndef CONCAT2 |
#define CONCAT2(a, b) a ## b |
#endif |
#define LCD_POWER_ON_DELAY ( (20000*(F_CPU/60000))/100 ) /* 20 milliseconds */ |
#define LCD_INIT_DELAY ( (5000*(F_CPU/60000))/100 ) /* 5 milliseconds */ |
#define INIT_MODE 2 |
#define DATA_MODE 1 |
#define CMD_MODE 0 |
/* CONVERSION OF LCD_DELAY_TIME TO TRUE MICROSECONDS */ |
#if LCD_READ_REQUIRED == 0 || LCD_IO_MODE == 2 || LCD_IO_MODE == 7 |
#define LCD_DELAY_SHORT ( (LCD_DELAY_TIME*(F_CPU/60000))/100 ) |
#define LCD_DELAY_LONG ( LCD_DELAY_SHORT*40 ) |
#endif |
/*######################################################################################################*/ |
#if LCD_IO_MODE == 2 |
/*######################################################################################################*/ |
#define LCD_DATA_PORT_IS_IO 1 |
#define LCD_CLOCK_PORT_IS_IO 1 |
#define LCD_DATA_PORT CONCAT1(PORT,LCD_DATA_SIGNAL_PORT) |
#define LCD_DATA_DDR_REG CONCAT1(DDR,LCD_DATA_SIGNAL_PORT) |
#define LCD_CLOCK_PORT CONCAT1(PORT,LCD_CLOCK_SIGNAL_PORT) |
#define LCD_CLOCK_DDR_REG CONCAT1(DDR,LCD_CLOCK_SIGNAL_PORT) |
#define LCD_READ_REQUIRED 0 |
#if defined(__AVR_ATmega103__) |
#if LCD_DATA_PORT == PORTC |
#undef LCD_DATA_PORT_IS_IO |
#undef LCD_DATA_DDR_REG |
#define LCD_DATA_PORT_IS_IO 0 |
#endif |
#if LCD_CLOCK_PORT == PORTC |
#undef LCD_CLOCK_PORT_IS_IO |
#undef LCD_CLOCK_DDR_REG |
#define LCD_CLOCK_PORT_IS_IO 0 |
#endif |
#endif /* #if defined(__AVR_ATmega103__) */ |
/*######################################################################################################*/ |
#elif LCD_IO_MODE == 6 |
/*######################################################################################################*/ |
#define lcd_toggle_e() ({ cbi(LCD_E_PORT, LCD_E_PIN); delay(F_CPU/6000000); \ |
sbi(LCD_E_PORT, LCD_E_PIN); }) |
#if LCD_READ_REQUIRED == 1 |
#undef LCD_MULTIPLEX_REQUIRED |
#define LCD_MULTIPLEX_REQUIRED 0 |
#define BUSY_FLAG 0 |
#define DATA 1 |
#endif |
#if LCD_LINES == 1 || LCD_LINES == 2 || LCD_LINES == 4 |
#else |
#error THE LCD LINES MUST BE 1 OR 2 OR 4 ! |
#endif |
#define LCD_D4_PORT_IS_IO 1 |
#define LCD_D5_PORT_IS_IO 1 |
#define LCD_D6_PORT_IS_IO 1 |
#define LCD_D7_PORT_IS_IO 1 |
#define LCD_RS_PORT_IS_IO 1 |
#define LCD_RW_PORT_IS_IO 1 |
#define LCD_E_PORT_IS_IO 1 |
#define LCD_D4_PORT CONCAT1(PORT, LCD_DATA4_PORT) |
#define LCD_D5_PORT CONCAT1(PORT, LCD_DATA5_PORT) |
#define LCD_D6_PORT CONCAT1(PORT, LCD_DATA6_PORT) |
#define LCD_D7_PORT CONCAT1(PORT, LCD_DATA7_PORT) |
#define LCD_RS_PORT CONCAT1(PORT, LCD_RS_SIGNAL_PORT) |
#define LCD_RW_PORT CONCAT1(PORT, LCD_RW_SIGNAL_PORT) |
#define LCD_E_PORT CONCAT1(PORT, LCD_E_SIGNAL_PORT) |
#define LCD_D4_DDR_REG CONCAT1(DDR, LCD_DATA4_PORT) |
#define LCD_D5_DDR_REG CONCAT1(DDR, LCD_DATA5_PORT) |
#define LCD_D6_DDR_REG CONCAT1(DDR, LCD_DATA6_PORT) |
#define LCD_D7_DDR_REG CONCAT1(DDR, LCD_DATA7_PORT) |
#define LCD_RS_DDR_REG CONCAT1(DDR, LCD_RS_SIGNAL_PORT) |
#define LCD_RW_DDR_REG CONCAT1(DDR, LCD_RW_SIGNAL_PORT) |
#define LCD_E_DDR_REG CONCAT1(DDR, LCD_E_SIGNAL_PORT) |
#if LCD_READ_REQUIRED == 1 |
#define LCD_D4_PIN_REG CONCAT1(PIN, LCD_DATA4_PORT) |
#define LCD_D5_PIN_REG CONCAT1(PIN, LCD_DATA5_PORT) |
#define LCD_D6_PIN_REG CONCAT1(PIN, LCD_DATA6_PORT) |
#define LCD_D7_PIN_REG CONCAT1(PIN, LCD_DATA7_PORT) |
#elif LCD_READ_REQUIRED == 0 |
#undef LCD_RW_PORT |
#undef LCD_RW_DDR_REG |
#undef LCD_RW_PORT_IS_IO |
#endif |
#if defined(__AVR_ATmega103__) |
#if LCD_D4_PORT == PORTC |
#if LCD_READ_REQUIRED == 1 |
#error THE PORT FOR LCD_D4 IS OUTPUT ONLY! |
#endif |
#undef LCD_D4_PORT_IS_IO |
#undef LCD_D4_DDR_REG |
#define LCD_D4_PORT_IS_IO 0 |
#endif |
#if LCD_D5_PORT == PORTC |
#if LCD_READ_REQUIRED == 1 |
#error THE PORT FOR LCD_D5 IS OUTPUT ONLY! |
#endif |
#undef LCD_D5_PORT_IS_IO |
#undef LCD_D5_DDR_REG |
#define LCD_D5_PORT_IS_IO 0 |
#endif |
#if LCD_D6_PORT == PORTC |
#if LCD_READ_REQUIRED == 1 |
#error THE PORT FOR LCD_D6 IS OUTPUT ONLY! |
#endif |
#undef LCD_D6_PORT_IS_IO |
#undef LCD_D6_DDR_REG |
#define LCD_D6_PORT_IS_IO 0 |
#endif |
#if LCD_D7_PORT == PORTC |
#if LCD_READ_REQUIRED == 1 |
#error THE PORT FOR LCD_D7 IS OUTPUT ONLY! |
#endif |
#undef LCD_D7_PORT_IS_IO |
#undef LCD_D7_DDR_REG |
#define LCD_D7_PORT_IS_IO 0 |
#endif |
#if LCD_RS_PORT == PORTC |
#undef LCD_RS_PORT_IS_IO |
#undef LCD_RS_DDR_REG |
#define LCD_RS_PORT_IS_IO 0 |
#endif |
#if LCD_READ_REQUIRED == 1 |
#if LCD_RW_PORT == PORTC |
#undef LCD_RW_PORT_IS_IO |
#undef LCD_RW_DDR_REG |
#define LCD_RW_PORT_IS_IO 0 |
#endif |
#endif |
#if LCD_E_PORT == PORTC |
#undef LCD_E_PORT_IS_IO |
#undef LCD_E_DDR_REG |
#define LCD_E_PORT_IS_IO 0 |
#endif |
#endif /* #if defined(__AVR_ATmega103__) */ |
/*######################################################################################################*/ |
#elif LCD_IO_MODE == 7 |
/*######################################################################################################*/ |
#define lcd_toggle_e() ({ cbivar(lcd_E_port, lcd_E_pin); delay(F_CPU/6000000); \ |
sbivar(lcd_E_port, lcd_E_pin); }) |
#if SREG > 0X3F |
#define IO_TO_MEM_OFFSET 0 |
#else |
#define IO_TO_MEM_OFFSET 0X20 |
#endif |
#define LCD_READ_REQUIRED 0 |
#if LCD_0_LINES == 1 || LCD_0_LINES == 2 || LCD_0_LINES == 4 |
#else |
#error THE LCD LINES MUST BE 1 OR 2 OR 4 ! |
#endif |
#if LCD_1_LINES == 1 || LCD_1_LINES == 2 || LCD_1_LINES == 4 |
#else |
#error THE LCD LINES MUST BE 1 OR 2 OR 4 ! |
#endif |
#if NUMBER_OF_LCD_UNITS >= 3 |
#if LCD_2_LINES == 1 || LCD_2_LINES == 2 || LCD_2_LINES == 4 |
#else |
#error THE LCD LINES MUST BE 1 OR 2 OR 4 ! |
#endif |
#endif |
#define LCD_D4_PORT_IS_IO 1 |
#define LCD_D5_PORT_IS_IO 1 |
#define LCD_D6_PORT_IS_IO 1 |
#define LCD_D7_PORT_IS_IO 1 |
#define LCD_RS_PORT_IS_IO 1 |
#define LCD_0_E_PORT_IS_IO 1 |
#define LCD_1_E_PORT_IS_IO 1 |
#if NUMBER_OF_LCD_UNITS >=3 |
#define LCD_2_E_PORT_IS_IO 1 |
#endif |
#define LCD_D4_PORT CONCAT1(PORT, LCD_DATA4_PORT) |
#define LCD_D5_PORT CONCAT1(PORT, LCD_DATA5_PORT) |
#define LCD_D6_PORT CONCAT1(PORT, LCD_DATA6_PORT) |
#define LCD_D7_PORT CONCAT1(PORT, LCD_DATA7_PORT) |
#define LCD_RS_PORT CONCAT1(PORT, LCD_RS_SIGNAL_PORT) |
#define LCD_0_E_PORT CONCAT1(PORT, LCD_0_E_SIGNAL_PORT) |
#define LCD_1_E_PORT CONCAT1(PORT, LCD_1_E_SIGNAL_PORT) |
#if NUMBER_OF_LCD_UNITS >=3 |
#define LCD_2_E_PORT CONCAT1(PORT, LCD_2_E_SIGNAL_PORT) |
#endif |
#define LCD_D4_DDR_REG CONCAT1(DDR, LCD_DATA4_PORT) |
#define LCD_D5_DDR_REG CONCAT1(DDR, LCD_DATA5_PORT) |
#define LCD_D6_DDR_REG CONCAT1(DDR, LCD_DATA6_PORT) |
#define LCD_D7_DDR_REG CONCAT1(DDR, LCD_DATA7_PORT) |
#define LCD_RS_DDR_REG CONCAT1(DDR, LCD_RS_SIGNAL_PORT) |
#define LCD_0_E_DDR_REG CONCAT1(DDR, LCD_0_E_SIGNAL_PORT) |
#define LCD_1_E_DDR_REG CONCAT1(DDR, LCD_1_E_SIGNAL_PORT) |
#if NUMBER_OF_LCD_UNITS >=3 |
#define LCD_2_E_DDR_REG CONCAT1(DDR, LCD_2_E_SIGNAL_PORT) |
#endif |
#if defined(__AVR_ATmega103__) |
#if LCD_D4_PORT == PORTC |
#undef LCD_D4_PORT_IS_IO |
#undef LCD_D4_DDR_REG |
#define LCD_D4_PORT_IS_IO 0 |
#endif |
#if LCD_D5_PORT == PORTC |
#undef LCD_D5_PORT_IS_IO |
#undef LCD_D5_DDR_REG |
#define LCD_D5_PORT_IS_IO 0 |
#endif |
#if LCD_D6_PORT == PORTC |
#undef LCD_D6_PORT_IS_IO |
#undef LCD_D6_DDR_REG |
#define LCD_D6_PORT_IS_IO 0 |
#endif |
#if LCD_D7_PORT == PORTC |
#undef LCD_D7_PORT_IS_IO |
#undef LCD_D7_DDR_REG |
#define LCD_D7_PORT_IS_IO 0 |
#endif |
#if LCD_RS_PORT == PORTC |
#undef LCD_RS_PORT_IS_IO |
#undef LCD_RS_DDR_REG |
#define LCD_RS_PORT_IS_IO 0 |
#endif |
#if LCD_0_E_PORT == PORTC |
#undef LCD_0_E_PORT_IS_IO |
#undef LCD_0_E_DDR_REG |
#define LCD_0_E_PORT_IS_IO 0 |
#endif |
#if LCD_1_E_PORT == PORTC |
#undef LCD_1_E_PORT_IS_IO |
#undef LCD_1_E_DDR_REG |
#define LCD_1_E_PORT_IS_IO 0 |
#endif |
#if NUMBER_OF_LCD_UNITS >=3 |
#if LCD_2_E_PORT == PORTC |
#undef LCD_2_E_PORT_IS_IO |
#undef LCD_2_E_DDR_REG |
#define LCD_2_E_PORT_IS_IO 0 |
#endif |
#endif /* #if NUMBER_OF_LCD_UNITS >=3 */ |
#endif /* #if defined(__AVR_ATmega103__) */ |
#endif /* #elif LCD_IO_MODE == 7 */ |
/*######################################################################################################*/ |
/* type definitions */ |
typedef unsigned char u08; |
typedef unsigned short u16; |
/*######################################################################################################*/ |
/* FUNCTION PROTOTYPES */ |
/*######################################################################################################*/ |
#if LCD_IO_MODE == 7 |
static void sbivar(unsigned char port, unsigned char bit); |
static void cbivar(unsigned char port, unsigned char bit); |
#endif |
#if LCD_READ_REQUIRED == 1 |
static unsigned char lcd_read(unsigned char rs); |
static inline unsigned char lcd_waitbusy(void); |
#endif |
static void delay(unsigned long int us); |
/*######################################################################################################*/ |
/* GLOBAL variables */ |
/*######################################################################################################*/ |
static unsigned char x,y, putc_lock=0; |
#if LCD_IO_MODE == 7 |
static unsigned char lcd_E_port=0, lcd_E_pin=0, lcd_chars_per_line=0, lcd_lines=0, current_lcd_unit=0; |
static struct xy { |
unsigned char x; |
unsigned char y; |
} xy_coordinates[NUMBER_OF_LCD_UNITS]; |
#endif |
/*######################################################################################################*/ |
/* local functions */ |
/*######################################################################################################*/ |
static void delay(unsigned long int us) |
/* delay for a minimum of <us> microseconds (with a 6 Mhz crystal, the resolution is 1 us) */ |
{ |
while ( us ) { us--; } /* 6 cpu cycles per loop */ |
} |
/*######################################################################################################*/ |
#if LCD_IO_MODE == 7 /* lcd_write() function for 6 bit i/o one lcd unit */ |
/*######################################################################################################*/ |
static void sbivar(unsigned char port, unsigned char bit) |
{ |
register unsigned char temp=0; |
temp=*((unsigned char*)(port+IO_TO_MEM_OFFSET)); |
temp|= (1<<bit); |
*((unsigned char*)(port+IO_TO_MEM_OFFSET))=temp; |
return; |
} |
/*######################################################################################################*/ |
static void cbivar(unsigned char port, unsigned char bit) |
{ |
register unsigned char temp=0; |
temp=*((unsigned char*)(port+IO_TO_MEM_OFFSET)); |
temp &= ~(1<<bit); |
*((unsigned char*)(port+IO_TO_MEM_OFFSET))=temp; |
return; |
} |
/*######################################################################################################*/ |
static void lcd_write(unsigned char data, unsigned char mode) |
{ |
register unsigned char rs=0; |
if(mode==DATA_MODE) rs=1; else rs=0; /* set the rs value */ |
/* output high nibble first */ |
if(data&0x10) sbi(LCD_D4_PORT, LCD_D4_PIN); else cbi(LCD_D4_PORT, LCD_D4_PIN); |
if(data&0x20) sbi(LCD_D5_PORT, LCD_D5_PIN); else cbi(LCD_D5_PORT, LCD_D5_PIN); |
if(data&0x40) sbi(LCD_D6_PORT, LCD_D6_PIN); else cbi(LCD_D6_PORT, LCD_D6_PIN); |
if(data&0x80) sbi(LCD_D7_PORT, LCD_D7_PIN); else cbi(LCD_D7_PORT, LCD_D7_PIN); |
if(rs) sbi(LCD_RS_PORT, LCD_RS_PIN); else cbi(LCD_RS_PORT, LCD_RS_PIN); |
lcd_toggle_e(); |
/* output low nibble */ |
/* if INIT_MODE skip this section else execute it */ |
if(mode!=INIT_MODE) |
{ |
if(data&0x01) sbi(LCD_D4_PORT, LCD_D4_PIN); else cbi(LCD_D4_PORT, LCD_D4_PIN); |
if(data&0x02) sbi(LCD_D5_PORT, LCD_D5_PIN); else cbi(LCD_D5_PORT, LCD_D5_PIN); |
if(data&0x04) sbi(LCD_D6_PORT, LCD_D6_PIN); else cbi(LCD_D6_PORT, LCD_D6_PIN); |
if(data&0x08) sbi(LCD_D7_PORT, LCD_D7_PIN); else cbi(LCD_D7_PORT, LCD_D7_PIN); |
if(rs) sbi(LCD_RS_PORT, LCD_RS_PIN); else cbi(LCD_RS_PORT, LCD_RS_PIN); |
lcd_toggle_e(); |
} |
delay(LCD_DELAY_SHORT); |
} |
/*------------------------------------------------------------------------------------------------------*/ |
void select_lcd(unsigned char lcd_unit) |
{ |
/* Save the current lcd unit x,y coordinates */ |
xy_coordinates[current_lcd_unit].x=x; |
xy_coordinates[current_lcd_unit].y=y; |
if(lcd_unit==0) |
{ |
lcd_E_port= LCD_0_E_PORT; |
lcd_E_pin = LCD_0_E_PIN; |
lcd_chars_per_line = LCD_0_CHARS_PER_LINE; |
lcd_lines = LCD_0_LINES; |
current_lcd_unit=lcd_unit; /* Make the requested lcd unit current (active) */ |
x=xy_coordinates[lcd_unit].x; /* Load the saved x,y coordinates of the specified lcd unit */ |
y=xy_coordinates[lcd_unit].y; |
} |
else if(lcd_unit==1) |
{ |
lcd_E_port= LCD_1_E_PORT; |
lcd_E_pin = LCD_1_E_PIN; |
lcd_chars_per_line = LCD_1_CHARS_PER_LINE; |
lcd_lines = LCD_1_LINES; |
current_lcd_unit=lcd_unit; |
x=xy_coordinates[lcd_unit].x; |
y=xy_coordinates[lcd_unit].y; |
} |
#if NUMBER_OF_LCD_UNITS >=3 |
else if(lcd_unit==2) |
{ |
lcd_E_port= LCD_2_E_PORT; |
lcd_E_pin = LCD_2_E_PIN; |
lcd_chars_per_line = LCD_2_CHARS_PER_LINE; |
lcd_lines = LCD_2_LINES; |
current_lcd_unit=lcd_unit; |
x=xy_coordinates[lcd_unit].x; |
y=xy_coordinates[lcd_unit].y; |
} |
#endif |
return; |
} |
/*######################################################################################################*/ |
#elif LCD_IO_MODE == 6 /* lcd_write() function for 6 bit i/o with multi lcd units */ |
/*######################################################################################################*/ |
#if LCD_READ_REQUIRED == 1 |
#define LCD_READ_DELAY ( (10*(F_CPU/60000))/100 ) |
static unsigned char lcd_read(unsigned char rs) |
{ |
register unsigned char data=0; |
/* RS=1: read data, RS=0: read busy flag, RW=1 read mode */ |
if (rs) sbi(LCD_RS_PORT, LCD_RS_PIN); else cbi(LCD_RS_PORT, LCD_RS_PIN); |
/* configure data pins as input */ |
cbi(LCD_D4_DDR_REG, LCD_D4_PIN ); |
cbi(LCD_D5_DDR_REG, LCD_D5_PIN ); |
cbi(LCD_D6_DDR_REG, LCD_D6_PIN ); |
cbi(LCD_D7_DDR_REG, LCD_D7_PIN ); |
/* set R/W pin for reading from LCD */ |
sbi(LCD_RW_PORT, LCD_RW_PIN); |
delay(LCD_READ_DELAY); |
if(bit_is_set(LCD_D7_PIN_REG, LCD_D7_PIN)) { data+=1; } |
data=(data<<1); |
if(bit_is_set(LCD_D6_PIN_REG, LCD_D6_PIN)) { data+=1; } |
data=(data<<1); |
if(bit_is_set(LCD_D5_PIN_REG, LCD_D5_PIN)) { data+=1; } |
data=(data<<1); |
if(bit_is_set(LCD_D4_PIN_REG, LCD_D4_PIN)) { data+=1; } |
data=(data<<1); |
lcd_toggle_e(); |
delay(LCD_READ_DELAY); |
if(bit_is_set(LCD_D7_PIN_REG, LCD_D7_PIN)) { data+=1; } |
data=(data<<1); |
if(bit_is_set(LCD_D6_PIN_REG, LCD_D6_PIN)) { data+=1; } |
data=(data<<1); |
if(bit_is_set(LCD_D5_PIN_REG, LCD_D5_PIN)) { data+=1; } |
data=(data<<1); |
if(bit_is_set(LCD_D4_PIN_REG, LCD_D4_PIN)) { data+=1; } |
lcd_toggle_e(); |
/* clear R/W pin for writting to LCD */ |
cbi(LCD_RW_PORT, LCD_RW_PIN); |
/* configure data pins as outputs */ |
sbi(LCD_D4_DDR_REG, LCD_D4_PIN ); |
sbi(LCD_D5_DDR_REG, LCD_D5_PIN ); |
sbi(LCD_D6_DDR_REG, LCD_D6_PIN ); |
sbi(LCD_D7_DDR_REG, LCD_D7_PIN ); |
return (data); |
} |
/*######################################################################################################*/ |
static inline unsigned char lcd_waitbusy(void) |
/* loops while lcd is busy, reads address counter */ |
{ |
register unsigned char c; |
while ( (c=lcd_read(BUSY_FLAG) & (1<<LCD_BUSY)) ); |
return (c); // return address counter |
} |
#endif /* #if LCD_READ_REQUIRED == 1 */ |
/*######################################################################################################*/ |
static void lcd_write(unsigned char data, unsigned char mode) |
{ |
register unsigned char rs=0; |
/* save and set DDR(X) register(s) in case another program altered those values */ |
#if LCD_MULTIPLEX_ENABLE == 1 |
#if LCD_D4_PORT_IS_IO==1 |
unsigned char d4_is_output=0; |
if(inp(LCD_D4_DDR_REG)&(1<<LCD_D4_PIN)) { d4_is_output=1; } |
sbi(LCD_D4_DDR_REG, LCD_D4_PIN ); |
#endif |
#if LCD_D5_PORT_IS_IO==1 |
unsigned char d5_is_output=0; |
if(inp(LCD_D5_DDR_REG)&(1<<LCD_D5_PIN)) { d5_is_output=1; } |
sbi(LCD_D5_DDR_REG, LCD_D5_PIN ); |
#endif |
#if LCD_D6_PORT_IS_IO==1 |
unsigned char d6_is_output=0; |
if(inp(LCD_D6_DDR_REG)&(1<<LCD_D6_PIN)) { d6_is_output=1; } |
sbi(LCD_D6_DDR_REG, LCD_D6_PIN ); |
#endif |
#if LCD_D7_PORT_IS_IO==1 |
unsigned char d7_is_output=0; |
if(inp(LCD_D7_DDR_REG)&(1<<LCD_D7_PIN)) { d7_is_output=1; } |
sbi(LCD_D7_DDR_REG, LCD_D7_PIN ); |
#endif |
#if LCD_RS_PORT_IS_IO==1 |
unsigned char rs_is_output=0; |
if(inp(LCD_RS_DDR_REG)&(1<<LCD_RS_PIN)) { rs_is_output=1; } |
sbi(LCD_RS_DDR_REG, LCD_RS_PIN ); |
#endif |
#endif /* LCD_MULTIPLEX_ENABLE == 1 */ |
if(mode==DATA_MODE) rs=1; else rs=0; /* set the rs value */ |
/* output high nibble first */ |
if(data&0x10) sbi(LCD_D4_PORT, LCD_D4_PIN); else cbi(LCD_D4_PORT, LCD_D4_PIN); |
if(data&0x20) sbi(LCD_D5_PORT, LCD_D5_PIN); else cbi(LCD_D5_PORT, LCD_D5_PIN); |
if(data&0x40) sbi(LCD_D6_PORT, LCD_D6_PIN); else cbi(LCD_D6_PORT, LCD_D6_PIN); |
if(data&0x80) sbi(LCD_D7_PORT, LCD_D7_PIN); else cbi(LCD_D7_PORT, LCD_D7_PIN); |
if(rs) sbi(LCD_RS_PORT, LCD_RS_PIN); else cbi(LCD_RS_PORT, LCD_RS_PIN); |
lcd_toggle_e(); |
/* output low nibble */ |
/* if INIT_MODE skip this section else execute it */ |
if(mode!=INIT_MODE) |
{ |
if(data&0x01) sbi(LCD_D4_PORT, LCD_D4_PIN); else cbi(LCD_D4_PORT, LCD_D4_PIN); |
if(data&0x02) sbi(LCD_D5_PORT, LCD_D5_PIN); else cbi(LCD_D5_PORT, LCD_D5_PIN); |
if(data&0x04) sbi(LCD_D6_PORT, LCD_D6_PIN); else cbi(LCD_D6_PORT, LCD_D6_PIN); |
if(data&0x08) sbi(LCD_D7_PORT, LCD_D7_PIN); else cbi(LCD_D7_PORT, LCD_D7_PIN); |
if(rs) sbi(LCD_RS_PORT, LCD_RS_PIN); else cbi(LCD_RS_PORT, LCD_RS_PIN); |
lcd_toggle_e(); |
} |
#if LCD_READ_REQUIRED == 0 |
delay(LCD_DELAY_SHORT); |
#elif LCD_READ_REQUIRED == 1 |
lcd_waitbusy(); |
#endif |
/* Restore the DDR registers, if multiplexing wanted */ |
#if LCD_MULTIPLEX_ENABLE == 1 |
#if LCD_D4_PORT_IS_IO==1 |
if(!d4_is_output) { cbi(LCD_D4_DDR_REG, LCD_D4_PIN ); } |
#endif |
#if LCD_D5_PORT_IS_IO==1 |
if(!d5_is_output) { cbi(LCD_D5_DDR_REG, LCD_D5_PIN ); } |
#endif |
#if LCD_D6_PORT_IS_IO==1 |
if(!d6_is_output) { cbi(LCD_D6_DDR_REG, LCD_D6_PIN ); } |
#endif |
#if LCD_D7_PORT_IS_IO==1 |
if(!d7_is_output) { cbi(LCD_D7_DDR_REG, LCD_D7_PIN ); } |
#endif |
#if LCD_RS_PORT_IS_IO==1 |
if(!rs_is_output) { cbi(LCD_RS_DDR_REG, LCD_RS_PIN ); } |
#endif |
#endif /* LCD_MULTIPLEX_ENABLE == 1 */ |
} |
/*######################################################################################################*/ |
#elif LCD_IO_MODE == 2 /* lcd_write() function for 2 bit i/o */ |
/*######################################################################################################*/ |
static void lcd_write(unsigned char lcd_data,unsigned char mode) |
{ |
#define toggle_clock() ({ sbi(LCD_CLOCK_PORT, LCD_CLOCK_PIN); cbi(LCD_CLOCK_PORT, LCD_CLOCK_PIN); }) |
#define data(x) ({ if(x) sbi(LCD_DATA_PORT, LCD_DATA_PIN); else cbi(LCD_DATA_PORT, LCD_DATA_PIN); }) |
#define toggle_data() ({ data(1); delay(F_CPU/6000000); data(0); }) |
register unsigned char x=0, rs=0; |
/* INITIALIZATION */ |
/* Set clock and data pins as outputs, at low state and set rs value */ |
#if LCD_CLOCK_PORT_IS_IO |
sbi(LCD_CLOCK_DDR_REG, LCD_CLOCK_PIN); |
#endif |
#if LCD_DATA_PORT_IS_IO |
sbi(LCD_DATA_DDR_REG, LCD_DATA_PIN); |
#endif |
cbi(LCD_CLOCK_PORT, LCD_CLOCK_PIN); cbi(LCD_DATA_PORT, LCD_DATA_PIN); |
if(mode==DATA_MODE) rs=1; else rs=0; |
/* send high nibble first */ |
x=6; while(x--) { toggle_clock(); } /* clear shift register */ |
data(1); toggle_clock(); /* send E "AND" signal */ |
data(rs); toggle_clock(); /* send RS signal */ |
x=0x80; while(x>=0x10) { data(lcd_data&x); toggle_clock(); x=(x>>1); } |
/* Strobe E pin making sure that the pulse is 450 ns min */ |
toggle_data(); |
/* send low nibble Clock and Data are already low */ |
x=6; while(x--) { toggle_clock(); } /* clear shift register */ |
data(1); toggle_clock(); /* send E "AND" signal */ |
data(rs); toggle_clock(); /* send RS signal */ |
x=0x08; while(x>=0x01) { data(lcd_data&x); toggle_clock(); x=(x>>1); } |
/* if INIT_MODE do NOT strobe the E pin else strobe it */ |
if(mode!=INIT_MODE) { toggle_data(); } |
delay(LCD_DELAY_SHORT); /* wait for command to execute */ |
} |
/*######################################################################################################*/ |
#endif /* #elif LCD_IO_MODE == 2 */ |
/*######################################################################################################*/ |
/*######################################################################################################*/ |
/* PUBLIC FUNCTIONS */ |
/*######################################################################################################*/ |
void lcd_command(unsigned char cmd) |
/* send command <cmd> to LCD */ |
{ |
lcd_write(cmd,CMD_MODE); |
} |
/*######################################################################################################*/ |
void lcd_gotoxy(unsigned char lcd_x, unsigned char lcd_y) |
/* goto position (x,y) */ |
{ |
#if LCD_IO_MODE == 7 |
if(lcd_x >= lcd_chars_per_line || lcd_y >= lcd_lines) { putc_lock=1; return; } |
else putc_lock=0; |
if (lcd_y==0 ) { lcd_command((1<<LCD_DDRAM)+LCD_START_LINE1+lcd_x); } |
else if(lcd_y==1) { lcd_command((1<<LCD_DDRAM)+LCD_START_LINE2+lcd_x); } |
else if(lcd_y==2) { lcd_command((1<<LCD_DDRAM)+LCD_START_LINE3+lcd_x); } |
else { lcd_command((1<<LCD_DDRAM)+LCD_START_LINE4+lcd_x); } |
/*------------------------------------------------------------------------------------------------------*/ |
#elif LCD_IO_MODE == 6 || LCD_IO_MODE == 2 |
/*------------------------------------------------------------------------------------------------------*/ |
if(lcd_x >= LCD_CHARS_PER_LINE || lcd_y >= LCD_LINES) { putc_lock=1; return; } |
else putc_lock=0; |
#if LCD_LINES==1 |
if (lcd_y==0 ) { lcd_command((1<<LCD_DDRAM)+LCD_START_LINE1+lcd_x); } |
#endif |
#if LCD_LINES==2 |
if (lcd_y==0 ) { lcd_command((1<<LCD_DDRAM)+LCD_START_LINE1+lcd_x); } |
else { lcd_command((1<<LCD_DDRAM)+LCD_START_LINE2+lcd_x); } |
#endif |
#if LCD_LINES==4 |
if (lcd_y==0 ) { lcd_command((1<<LCD_DDRAM)+LCD_START_LINE1+lcd_x); } |
else if(lcd_y==1) { lcd_command((1<<LCD_DDRAM)+LCD_START_LINE2+lcd_x); } |
else if(lcd_y==2) { lcd_command((1<<LCD_DDRAM)+LCD_START_LINE3+lcd_x); } |
else { lcd_command((1<<LCD_DDRAM)+LCD_START_LINE4+lcd_x); } |
#endif |
#endif |
x=lcd_x; |
y=lcd_y; |
}/* lcd_gotoxy */ |
/*######################################################################################################*/ |
unsigned int lcd_getxy(void) |
{ |
return((y*100)+x); |
} |
/*######################################################################################################*/ |
void lcd_clrscr(void) |
/* clear lcd and set cursor to home position */ |
{ |
lcd_command(1<<LCD_CLR); |
#if LCD_READ_REQUIRED == 0 || LCD_IO_MODE == 2 || LCD_IO_MODE == 7 |
delay(LCD_DELAY_LONG); /* this command needs more waiting time to execute */ |
#elif LCD_READ_REQUIRED == 1 && LCD_IO_MODE == 6 |
lcd_waitbusy(); |
#endif |
x=0; y=0; |
} |
/*######################################################################################################*/ |
void lcd_clrline(unsigned char line) |
/* clear a specific lcd line and set cursor at the start of the line */ |
{ |
#if LCD_IO_MODE == 7 |
if(lcd_lines==1) |
{ |
lcd_gotoxy(0, 0); |
while(x<lcd_chars_per_line) { lcd_putc(' '); } |
lcd_gotoxy(0, 0); |
} |
if(line<lcd_lines) |
{ |
lcd_gotoxy(0, line); |
while(x<lcd_chars_per_line) { lcd_putc(' '); } |
lcd_gotoxy(0, line); |
} |
#elif LCD_IO_MODE == 6 || LCD_IO_MODE == 2 |
#if LCD_LINES == 1 |
lcd_gotoxy(0, 0); |
while(x<LCD_CHARS_PER_LINE) { lcd_putc(' '); } |
lcd_gotoxy(0, 0); |
#else /* #if LCD_LINES == 1 */ |
if(line<LCD_LINES) |
{ |
lcd_gotoxy(0, line); |
while(x<LCD_CHARS_PER_LINE) { lcd_putc(' '); } |
lcd_gotoxy(0, line); |
} |
#endif /* #if LCD_LINES == 1 */ |
#endif /* #if LCD_IO_MODE == 7 */ |
} |
/*######################################################################################################*/ |
void lcd_home(void) |
/* set cursor to home position */ |
{ |
lcd_command(1<<LCD_HOME); |
#if LCD_READ_REQUIRED == 0 || LCD_IO_MODE == 2 || LCD_IO_MODE == 7 |
delay(LCD_DELAY_LONG); /* this command needs more waiting time to execute */ |
#elif LCD_READ_REQUIRED == 1 && LCD_IO_MODE == 6 |
lcd_waitbusy(); |
#endif |
x=0; y=0; |
} |
/*######################################################################################################*/ |
void lcd_putc(unsigned char c) |
/* print character at current cursor position */ |
{ |
if(!putc_lock) |
{ |
#if LCD_IO_MODE == 7 |
if(lcd_lines !=1) |
{ if(c=='\n') { if(y<lcd_lines-1) lcd_gotoxy(0,(y+1)); } |
else if(x<lcd_chars_per_line) { lcd_write(c, DATA_MODE); x++; } |
#if LCD_AUTO_LINE_FEED == 1 |
else if(y<lcd_lines-1) { lcd_gotoxy(0,(y+1)); lcd_write(c, DATA_MODE); x++; } |
else { lcd_gotoxy(0,0); lcd_write(c, DATA_MODE); x++; } |
#endif |
} |
else{ |
if(c=='\n') { return; } |
if(x<lcd_chars_per_line) { lcd_write(c, DATA_MODE); x++; } |
} |
#elif LCD_IO_MODE == 6 || LCD_IO_MODE == 2 |
#if LCD_LINES!=1 |
if(c=='\n') { if(y<LCD_LINES-1) lcd_gotoxy(0,(y+1)); } |
else if(x<LCD_CHARS_PER_LINE) { lcd_write(c, DATA_MODE); x++; } |
#if LCD_AUTO_LINE_FEED == 1 |
else if(y<LCD_LINES-1) { lcd_gotoxy(0,(y+1)); lcd_write(c, DATA_MODE); x++; } |
else { lcd_gotoxy(0,0); lcd_write(c, DATA_MODE); x++; } |
#endif |
#else |
if(c=='\n') { return; } |
if(x<LCD_CHARS_PER_LINE) { lcd_write(c, DATA_MODE); x++; } |
#endif |
#endif /* #if LCD_IO_MODE == 7 */ |
} |
} |
/*######################################################################################################*/ |
void lcd_puts(const unsigned char *s) |
/* print string on lcd (no auto linefeed) */ |
{ |
register unsigned char c; |
while ( (c = *s++) ) { lcd_putc(c); } |
} |
/*######################################################################################################*/ |
void lcd_puts_p(const unsigned char *progmem_s) |
/* print string from program memory on lcd (no auto linefeed) */ |
{ |
register unsigned char c; |
while ( (c = PRG_RDB(progmem_s++)) ) { lcd_putc(c); } |
} |
/*######################################################################################################*/ |
void lcd_puts_e(unsigned char *eeprom_s) |
/* print string from eeprom on lcd (no auto linefeed) */ |
{ |
register unsigned char c; |
while( (c=eeprom_rb((unsigned int)eeprom_s++))&& c!=0xFF ) { lcd_putc(c); } |
/*{ if(c==0xFF) break; lcd_putc(c); }*/ |
} |
/*######################################################################################################*/ |
void lcd_puti(int value, unsigned char dot_position) |
/* print signed integer on lcd with or without comma (no auto linefeed) */ |
{ |
unsigned char lcd_data[6]={'0','0','0','0','0','0' }, position=sizeof(lcd_data), radix=10; |
/* convert int to ascii */ |
if(value<0) { lcd_putc('-'); value=-value; } |
do { position--; *(lcd_data+position)=(value%radix)+'0'; value/=radix; } while(value); |
/* some fractional digit corrections */ |
if( dot_position>=sizeof(lcd_data) ) return; |
while( (sizeof(lcd_data)-dot_position)<=position ) position--; |
/* start displaying the number */ |
for(;position<=(sizeof(lcd_data)-1);position++) |
{ |
if( position==sizeof(lcd_data)-dot_position ) lcd_putc(','); |
lcd_putc(lcd_data[position]); |
} |
return; |
} |
/*######################################################################################################*/ |
#if LCD_IO_MODE == 6 || LCD_IO_MODE == 2 |
/*######################################################################################################*/ |
void lcd_init(void) |
{ |
/* initialize display and select type of cursor */ |
/* dispAttr: LCD_DISP_OFF, LCD_DISP_ON, LCD_DISP_ON_CURSOR, LCD_DISP_CURSOR_BLINK */ |
#if LCD_LINES==1 |
#define LCD_FUNCTION_DEFAULT LCD_FUNCTION_4BIT_1LINE |
#else |
#define LCD_FUNCTION_DEFAULT LCD_FUNCTION_4BIT_2LINES |
#endif |
#if LCD_IO_MODE == 6 |
#if LCD_E_PORT_IS_IO==1 |
sbi(LCD_E_DDR_REG, LCD_E_PIN ); |
#endif |
sbi(LCD_E_PORT, LCD_E_PIN ); |
#if LCD_MULTIPLEX_ENABLE == 0 |
#if LCD_D4_PORT_IS_IO==1 |
sbi(LCD_D4_DDR_REG, LCD_D4_PIN ); |
#endif |
#if LCD_D5_PORT_IS_IO==1 |
sbi(LCD_D5_DDR_REG, LCD_D5_PIN ); |
#endif |
#if LCD_D6_PORT_IS_IO==1 |
sbi(LCD_D6_DDR_REG, LCD_D6_PIN ); |
#endif |
#if LCD_D7_PORT_IS_IO==1 |
sbi(LCD_D7_DDR_REG, LCD_D7_PIN ); |
#endif |
#if LCD_RS_PORT_IS_IO==1 |
sbi(LCD_RS_DDR_REG, LCD_RS_PIN ); |
#endif |
#if LCD_READ_REQUIRED == 1 |
#if LCD_RW_PORT_IS_IO == 1 |
sbi(LCD_RW_DDR_REG, LCD_RW_PIN ); |
#endif |
cbi(LCD_RW_PORT, LCD_RW_PIN ); |
#endif |
#endif /* #if LCD_MULTIPLEX_ENABLE == 0 */ |
#endif /* #if LCD_IO_MODE == 6 */ |
/*------ Initialize lcd to 4 bit i/o mode -------*/ |
/* initial write to lcd is 8bit using delay since busy flag can't be checked here anyway */ |
delay(LCD_POWER_ON_DELAY); /* Wait 20 milliseconds */ |
lcd_write(LCD_FUNCTION_8BIT_1LINE, INIT_MODE); |
delay(LCD_INIT_DELAY); /* Wait 5 milliseconds */ |
lcd_write(LCD_FUNCTION_8BIT_1LINE, INIT_MODE); |
lcd_write(LCD_FUNCTION_8BIT_1LINE, INIT_MODE); |
lcd_write(LCD_FUNCTION_4BIT_1LINE, INIT_MODE); /* set IO mode to 4bit */ |
/* from now on the lcd accepts only 4 bit I/O, so we can use lcd_command() */ |
lcd_command(LCD_FUNCTION_DEFAULT); /* function set: display lines */ |
lcd_command(LCD_DISP_OFF); /* display off */ |
lcd_clrscr(); /* display clear */ |
lcd_command(LCD_MODE_DEFAULT); /* set entry mode */ |
lcd_command(LCD_DISP_ON); /* LCD DISPLAY ON (DEFAULT) */ |
}/* lcd_init */ |
/*######################################################################################################*/ |
#elif LCD_IO_MODE == 7 |
/*######################################################################################################*/ |
void lcd_init(void) |
{ |
unsigned char lcd_unit=0; |
/* initialize display and select type of cursor */ |
/* dispAttr: LCD_DISP_OFF, LCD_DISP_ON, LCD_DISP_ON_CURSOR, LCD_DISP_CURSOR_BLINK */ |
#if LCD_D4_PORT_IS_IO == 1 |
sbi(LCD_D4_DDR_REG, LCD_D4_PIN ); |
#endif |
#if LCD_D5_PORT_IS_IO == 1 |
sbi(LCD_D5_DDR_REG, LCD_D5_PIN ); |
#endif |
#if LCD_D6_PORT_IS_IO == 1 |
sbi(LCD_D6_DDR_REG, LCD_D6_PIN ); |
#endif |
#if LCD_D7_PORT_IS_IO == 1 |
sbi(LCD_D7_DDR_REG, LCD_D7_PIN ); |
#endif |
#if LCD_RS_PORT_IS_IO == 1 |
sbi(LCD_RS_DDR_REG, LCD_RS_PIN ); |
#endif |
#if LCD_0_E_PORT_IS_IO == 1 |
sbi(LCD_0_E_DDR_REG, LCD_0_E_PIN ); |
#endif |
sbi(LCD_0_E_PORT, LCD_0_E_PIN ); |
#if LCD_1_E_PORT_IS_IO == 1 |
sbi(LCD_1_E_DDR_REG, LCD_1_E_PIN ); |
#endif |
sbi(LCD_1_E_PORT, LCD_1_E_PIN ); |
#if NUMBER_OF_LCD_UNITS >= 3 |
#if LCD_2_E_PORT_IS_IO == 1 |
sbi(LCD_2_E_DDR_REG, LCD_2_E_PIN ); |
#endif |
sbi(LCD_2_E_PORT, LCD_2_E_PIN ); |
#endif |
/*------ Initialize lcd to 4 bit i/o mode -------*/ |
/* initial write to lcd is 8bit using delay since busy flag can't be checked here anyway */ |
xy_coordinates[LCD_0].x=0; |
xy_coordinates[LCD_0].y=0; |
xy_coordinates[LCD_1].x=0; |
xy_coordinates[LCD_1].y=0; |
#if NUMBER_OF_LCD_UNITS >=3 |
xy_coordinates[LCD_2].x=0; |
xy_coordinates[LCD_2].y=0; |
#endif |
for(lcd_unit=0; lcd_unit<NUMBER_OF_LCD_UNITS; lcd_unit++) |
{ |
select_lcd(lcd_unit); |
delay(LCD_POWER_ON_DELAY); /* Wait 20 milliseconds */ |
lcd_write(LCD_FUNCTION_8BIT_1LINE, INIT_MODE); |
delay(LCD_INIT_DELAY); /* Wait 5 milliseconds */ |
lcd_write(LCD_FUNCTION_8BIT_1LINE, INIT_MODE); |
lcd_write(LCD_FUNCTION_8BIT_1LINE, INIT_MODE); |
lcd_write(LCD_FUNCTION_4BIT_1LINE, INIT_MODE); /* set IO mode to 4bit */ |
/* from now on the lcd accepts only 4 bit I/O, so we can use lcd_command() */ |
/* function set: set how many lines the lcd unit has. */ |
if(lcd_lines==1) { lcd_command(LCD_FUNCTION_4BIT_1LINE); } |
else { lcd_command(LCD_FUNCTION_4BIT_2LINES); } |
lcd_command(LCD_DISP_OFF); /* display off */ |
lcd_clrscr(); /* display clear */ |
lcd_command(LCD_MODE_DEFAULT); /* set entry mode */ |
lcd_command(LCD_DISP_ON); /* Display on */ |
} |
select_lcd(0); |
return; |
}/* lcd_init */ |
#endif |
/*######################################################################################################*/ |
/* T H E E N D */ |
/*######################################################################################################*/ |
/programy/C/avr/SFR08/lcd_io.h |
---|
0,0 → 1,384 |
/******************************************************************************************************* |
Title : C include file for the HD44780U LCD library (lcd_io.c) |
Author: Chris efstathiou hendrix@otenet.gr |
Date: 1/Jul/2002 |
Software: AVR-GCC with AVR-AS |
Target: any AVR device |
Comments: This software is FREE. |
DESCRIPTION |
Basic routines for interfacing a HD44780U-based text lcd display |
Based on Volker Oth's lcd library (http://members.xoom.com/volkeroth), |
Peter Fleury's work <pfleury@gmx.ch> http://jump.to/fleury . |
and the very good lcd page at www.myke.com |
With this driver you can select from 2 different I/O modes. |
1) MODE 6 - 6 or 7 pin I/O mode |
2) MODE 2 - 2 pin I/O mode with an additional 74LS174 |
3) MODE 7 - multiple lcd unit mode |
MODE 6 INFORMATION |
mode 6 now needs only 6 pins as long the pins can function as output |
freeing two bits to be used as general i/o. |
R/W pin on the lcd must be connected to ground. |
Also the pins can be scattered all over the place (any pin in any port). |
( the other pins of the port(s) are not affected ) |
Be carefull not to change the status of the E lcd pin by using the outp() |
command (both in PORT(X) and DDR(X) ) elsewhere in your program otherwise |
your program will crash and you will have a lot of fun for the whole family. |
Use sbi() and cbi() commands instead. |
MODE 7 INFORMATION |
mode 7 supports up to 3 lcd units and all the characteristics of mode 6 |
except that lcd reading is not possible. |
The lcd diplays can be of different type. |
MODE 2 INFORMATION |
mode 2 uses only 2 pins in any combination you want as long the pin |
can function as output. |
You also need to make a very simple cirquit (really silly) with 74LS174. |
See the included JPG photo for the schematic. |
Also the pins can be scattered all over the place (any pin in any port). |
( the other pins of the port(s) are not affected ) |
YOU MAY NOT! MULTIPLEX THE DATA AND CLOCK PINS WITH OTHER DEVICES |
The pins are automatically set as outputs when you call an lcd function |
Be carefull not to change the status of the CLOCK and DATA pins by using the outp() |
command (both in PORT(X) and DDR(X) ) elsewhere in your program otherwise |
your program will crash and you will have a lot of fun for the whole family (again!). |
Use sbi() and cbi() commands instead. |
MEMORY MAPPED MODE IS NOT SUPPORTED BY THIS DRIVER !!! |
CAUTION!!! FOR SLOW LCD UNITS INCREASE THE "LCD_DELAY_TIME" VALUE!!! |
The driver does not read anything back from the lcd because that way i only need 6 |
I/O lines and furthermore i can use the output only port found in MEGA103. |
Since i dont read anything back, i just wait for commands to be executed |
so below i define the time to wait for the two categories of commands of HD44780 . |
The two CATEGORIES are: |
1) 2ms for clear screen and return home commands (nominal value=1,52 ms) |
and it is derived from "LCD_DELAY_TIME" . |
2) 50us for all other commands (nominal value=37 us) |
Even the slowest units will work reliably with LCD_DELAY_TIME=160. |
The Longer delay needed for CATEGORY 1 is calculated from the "LCD_DELAY_TIME" value. |
The specifications for HD44780 @ 270KHZ are 37 us for CATEGORY 2 and 1,52 ms for CATEGORY 1 |
LCD MODULE INFORMATION! |
The maximum time required by each instruction for the slowest lcd units is |
4.1 msecs for clearing the display or moving the cursor/display to the "home position", |
160 usecs for all other commands. (i use 50 because i use good units) |
Usual HD44780 Pins connections |
1 = Ground |
2 = Vcc |
3 = Contrast Voltage |
4 = "R/S" _Instruction/Register Select |
5 = "R/W" _Read/Write LCD Registers (Connected to GND for this driver to work!) |
6 = "E" Clock |
7 - 14 = Data I/O Pins 0 to 7 (0=7, 1=8,... 7=14 ) |
15 - GND for the BACKLIGHTING (Check to be sure because some units have it for VCC) |
16 - VCC for the BACKLIGHTING (Check to be sure because some units have it for GND) |
CONNECTION TABLE AS USED IN THIS lcd_io.h FILE |
|^^^^^^^^^^^^^^^^^^^^^^^^^^| |
| port_pin0->lcd_D4_pin11 | |
| port_pin1->lcd_D5_pin12 | |
| port_pin2->lcd_D6_pin13 | |
| port_pin3->lcd_D7_pin14 | |
| port_pin4->lcd_RS_pin4 | |
| port_pin5->lcd_E_pin6 | |
| lcd_E_pin5->GND | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
*******************************************************************************************************/ |
#ifndef LCD_IO_H |
#define LCD_IO_H |
/*############################################################################################*/ |
/* CONFIGURATION BLOCK STARTS HERE. Change these definitions to adapt setting */ |
/*############################################################################################*/ |
/* GLOBAL SETTINGS (settings described here are aplyied everywhere) */ |
#ifndef F_CPU |
#define F_CPU 3686400L /* CPU CLOCK FREQUENCY */ |
#endif |
#define LCD_IO_MODE 6 /* 6 = 6 PIN I/O, 2 = 2 PIN I/O, 7 = multi lcd mode */ |
#define LCD_AUTO_LINE_FEED 0 /* 1 = Auto line feed, 0 = no Auto line feed */ |
#define LCD_DELAY_TIME 100 /* Read the INTRO about this */ |
/***********************************************************************************************/ |
#if LCD_IO_MODE == 2 |
/* |
CONFIGURATION OF BELOW LINES ONLY NECESSARY IN 2 PIN MODE |
If you plan to use just one port for all pins then just edit "LCD_PORT" |
otherwise you must specify the port of each lcd signal. the port(s) must be able |
to function as output. It can be any combination! |
USE CAPITAL LETTER FOR PORT DESIGNATION! (A,B,C,D...etc.) |
*/ |
#define LCD_CHARS_PER_LINE 20 /* visible chars per lcd line */ |
#define LCD_LINES 4 /* visible lines */ |
#define LCD_PORT B |
#define LCD_CLOCK_SIGNAL_PORT LCD_PORT /* Put your lcd clock port here (A,B,C...etc.) */ |
#define LCD_CLOCK_PIN 0 /* Put your lcd clock pin here */ |
#define LCD_DATA_SIGNAL_PORT LCD_PORT /* Put your lcd data port here (A,B,C...etc.) */ |
#define LCD_DATA_PIN 1 /* Put your lcd data pin here */ |
#endif |
/***********************************************************************************************/ |
/* END OF 2 PIN CONFIGURATION BLOCK */ |
/***********************************************************************************************/ |
#if LCD_IO_MODE == 6 |
/* |
CONFIGURATION OF BELOW LINES ONLY NECESSARY IN MODE 6 |
If you plan to use just one port for all pins then just edit "LCD_PORT" |
otherwise you must specify the port of each lcd signal. the port(s) must be able |
to function as output. It can be any combination! |
PUT YOUR LCD PORT LETTER HERE USING CAPITAL LETTER (A,B,C,D...etc) |
*/ |
#define LCD_CHARS_PER_LINE 20 /* visible chars per lcd line */ |
#define LCD_LINES 4 /* visible lines */ |
#define LCD_MULTIPLEX_ENABLE 0 /* 1= the DDR's used are saved and restored */ |
#define LCD_READ_REQUIRED 0 /* 0=use delay, 1=read busy flag (7 pins needed) */ |
#define LCD_PORT B |
#define LCD_DATA4_PORT LCD_PORT /* port for data 0 pin */ |
#define LCD_D4_PIN 0 /* AVR port pin number */ |
#define LCD_DATA5_PORT LCD_PORT /* port for data 1 pin */ |
#define LCD_D5_PIN 1 /* AVR port pin number */ |
#define LCD_DATA6_PORT LCD_PORT /* port for data 2 pin */ |
#define LCD_D6_PIN 2 /* AVR port pin number */ |
#define LCD_DATA7_PORT LCD_PORT /* port for data 3 pin */ |
#define LCD_D7_PIN 3 /* AVR port pin number */ |
#define LCD_RS_SIGNAL_PORT LCD_PORT /* port for RS line */ |
#define LCD_RS_PIN 4 /* AVR port pin number */ |
#define LCD_E_SIGNAL_PORT LCD_PORT /* port for Enable line */ |
#define LCD_E_PIN 5 /* AVR port pin number */ |
/* YOU NEED TO EDIT "LCD_RW_SIGNAL_PORT" AND "LCD_RW_PIN" ONLY IF "LCD_READ_REQUIRED == 1" */ |
#if LCD_READ_REQUIRED == 1 |
#define LCD_RW_SIGNAL_PORT LCD_PORT /* port for R/W line */ |
#define LCD_RW_PIN 6 /* AVR port pin number */ |
#endif |
#endif |
/***********************************************************************************************/ |
/* END OF 6 PIN CONFIGURATION BLOCK */ |
/***********************************************************************************************/ |
#if LCD_IO_MODE == 7 |
/* |
CONFIGURATION OF BELOW LINES ONLY NECESSARY IN MODE 7 |
If you plan to use just one port for all pins then just edit "LCD_PORT" |
otherwise you must specify the port of each lcd signal. the port(s) must be able |
to function as output. It can be any combination! |
PUT YOUR LCD PORT LETTER HERE USING CAPITAL LETTER (A,B,C,D...etc) |
*/ |
#define NUMBER_OF_LCD_UNITS 2 /* 2 or 3. if you set it to 1, mode 6 will be selected */ |
#define LCD_0_CHARS_PER_LINE 20 /* visible chars per lcd line */ |
#define LCD_0_LINES 4 /* visible lines */ |
#define LCD_1_CHARS_PER_LINE 20 /* visible chars per lcd line */ |
#define LCD_1_LINES 4 /* visible lines */ |
#if NUMBER_OF_LCD_UNITS >=3 |
#define LCD_2_CHARS_PER_LINE 20 /* visible chars per lcd line */ |
#define LCD_2_LINES 4 /* visible lines */ |
#endif |
#define LCD_PORT B |
#define LCD_DATA4_PORT LCD_PORT /* port for data 0 pin */ |
#define LCD_D4_PIN 0 /* AVR port pin number */ |
#define LCD_DATA5_PORT LCD_PORT /* port for data 1 pin */ |
#define LCD_D5_PIN 1 /* AVR port pin number */ |
#define LCD_DATA6_PORT LCD_PORT /* port for data 2 pin */ |
#define LCD_D6_PIN 2 /* AVR port pin number */ |
#define LCD_DATA7_PORT LCD_PORT /* port for data 3 pin */ |
#define LCD_D7_PIN 3 /* AVR port pin number */ |
#define LCD_RS_SIGNAL_PORT LCD_PORT /* port for RS line */ |
#define LCD_RS_PIN 4 /* AVR port pin number */ |
#define LCD_0_E_SIGNAL_PORT LCD_PORT /* port for Enable line */ |
#define LCD_0_E_PIN 5 /* AVR port pin number */ |
#define LCD_1_E_SIGNAL_PORT LCD_PORT /* port for Enable line */ |
#define LCD_1_E_PIN 6 /* AVR port pin number */ |
/* EDIT THE BELOW LINES IF YOU USE 3 LCD UNITS */ |
#if NUMBER_OF_LCD_UNITS >=3 |
#define LCD_2_E_SIGNAL_PORT LCD_PORT /* port for Enable line */ |
#define LCD_2_E_PIN 7 /* AVR port pin number */ |
#endif |
#endif /* LCD_IO_MODE == 7 */ |
/*############################################################################################*/ |
/* CONFIGURATION BLOCK ENDS HERE. */ |
/*############################################################################################*/ |
/* you shouldn't need to change anything below this line */ |
/* Some clever thinking triks */ |
#if LCD_IO_MODE == 7 && NUMBER_OF_LCD_UNITS == 1 |
#undef LCD_IO_MODE |
#define LCD_IO_MODE 6 |
#define LCD_READ_REQUIRED 0 |
#define LCD_E_SIGNAL_PORT LCD_0_E_SIGNAL_PORT |
#define LCD_E_PIN LCD_0_E_PIN |
#define LCD_CHARS_PER_LINE LCD_0_CHARS_PER_LINE |
#define LCD_LINES LCD_0_LINES |
#undef LCD_MULTIPLEX_ENABLE |
#define LCD_MULTIPLEX_ENABLE 0 |
#undef LCD_READ_REQUIRED |
#define LCD_READ_REQUIRED 0 |
#undef LCD_1_CHARS_PER_LINE |
#undef LCD_1_LINES |
#undef LCD_1_E_SIGNAL_PORT |
#undef LCD_1_E_PIN |
#elif LCD_IO_MODE == 7 && NUMBER_OF_LCD_UNITS > 1 |
#define LCD_0 0 |
#define LCD_1 1 |
#define LCD_2 2 |
#endif /* #if LCD_IO_MODE == 7 && NUMBER_OF_LCD_UNITS == 1 */ |
/*-----------------------------------------------------------------------------------*/ |
/* HD44780 PARAMETERS */ |
/*-----------------------------------------------------------------------------------*/ |
#define LCD_LINE_LENGTH 0x40 /* internal line length */ |
#define LCD_START_LINE1 0x00 /* DDRAM address of first char of line 1 */ |
#define LCD_START_LINE2 0x40 /* DDRAM address of first char of line 2 */ |
#define LCD_START_LINE3 0x14 /* DDRAM address of first char of line 3 */ |
#define LCD_START_LINE4 0x54 /* DDRAM address of first char of line 4 */ |
/* instruction register bit positions */ |
#define LCD_CLR 0 /* DB0: clear display */ |
#define LCD_HOME 1 /* DB1: return to home position */ |
#define LCD_ENTRY_MODE 2 /* DB2: set entry mode */ |
#define LCD_ENTRY_INC 1 /* DB1: 1=increment, 0=decrement */ |
#define LCD_ENTRY_SHIFT 0 /* DB2: 1=display shift on */ |
#define LCD_ON 3 /* DB3: turn lcd/cursor on */ |
#define LCD_ON_DISPLAY 2 /* DB2: turn display on */ |
#define LCD_ON_CURSOR 1 /* DB1: turn cursor on */ |
#define LCD_ON_BLINK 0 /* DB0: blinking cursor ? */ |
#define LCD_MOVE 4 /* DB4: move cursor/display */ |
#define LCD_MOVE_DISP 3 /* DB3: move display (0-> cursor) ? */ |
#define LCD_MOVE_RIGHT 2 /* DB2: move right (0-> left) ? */ |
#define LCD_FUNCTION 5 /* DB5: function set */ |
#define LCD_FUNCTION_8BIT 4 /* DB4: set 8BIT mode (0->4BIT mode) */ |
#define LCD_FUNCTION_2LINES 3 /* DB3: two lines (0->one line) */ |
#define LCD_FUNCTION_10DOTS 2 /* DB2: 5x10 font (0->5x7 font) */ |
#define LCD_CGRAM 6 /* DB6: set CG RAM address */ |
#define LCD_DDRAM 7 /* DB7: set DD RAM address */ |
#define LCD_BUSY 7 /* DB7: LCD is busy */ |
/* set entry mode: display shift on/off, dec/inc cursor move direction */ |
#define LCD_ENTRY_DEC 0x04 /* display shift off, dec cursor move dir */ |
#define LCD_ENTRY_DEC_SHIFT 0x05 /* display shift on, dec cursor move dir */ |
#define LCD_ENTRY_INC_ 0x06 /* display shift off, inc cursor move dir */ |
#define LCD_ENTRY_INC_SHIFT 0x07 /* display shift on, inc cursor move dir */ |
/* display on/off, cursor on/off, blinking char at cursor position */ |
#define LCD_DISP_OFF 0x08 /* display off */ |
#define LCD_DISP_ON 0x0C /* display on, cursor off */ |
#define LCD_DISP_ON_BLINK 0x0D /* display on, cursor off, blink char */ |
#define LCD_DISP_ON_CURSOR 0x0E /* display on, cursor on */ |
#define LCD_DISP_ON_CURSOR_BLINK 0x0F /* display on, cursor on, blink char */ |
/* move cursor/shift display */ |
#define LCD_MOVE_CURSOR_LEFT 0x10 /* move cursor left (decrement) */ |
#define LCD_MOVE_CURSOR_RIGHT 0x14 /* move cursor right (increment) */ |
#define LCD_MOVE_DISP_LEFT 0x18 /* shift display left */ |
#define LCD_MOVE_DISP_RIGHT 0x1C /* shift display right */ |
/* function set: set interface data length and number of display lines */ |
#define LCD_FUNCTION_4BIT_1LINE 0x20 /* 4-bit interface, single line, 5x7 dots */ |
#define LCD_FUNCTION_4BIT_2LINES 0x28 /* 4-bit interface, dual line, 5x7 dots */ |
#define LCD_FUNCTION_8BIT_1LINE 0x30 /* 8-bit interface, single line, 5x7 dots */ |
#define LCD_FUNCTION_8BIT_2LINES 0x38 /* 8-bit interface, dual line, 5x7 dots */ |
#define LCD_MODE_DEFAULT ((1<<LCD_ENTRY_MODE) | (1<<LCD_ENTRY_INC) ) |
/*-----------------------------------------------------------------------------------*/ |
/* function prototypes */ |
/*-----------------------------------------------------------------------------------*/ |
extern void lcd_init(void); |
extern void lcd_command(unsigned char cmd); |
extern void lcd_gotoxy(unsigned char lcd_x, unsigned char lcd_y); |
extern void lcd_clrscr(void); |
extern void lcd_clrline(unsigned char line); |
extern void lcd_home(void); |
extern void lcd_putc(unsigned char c); |
extern void lcd_puts(const unsigned char *s); |
extern void lcd_puts_p(const unsigned char *progmem_s); |
extern void lcd_puts_e(unsigned char *eeprom_s); |
extern void lcd_puti(int value, unsigned char dot_position); |
extern unsigned int lcd_getxy(void); |
/* |
1) Suppose we want to display a 16 bit var with a rvalue 0f 325 |
2) We give the command lcd_puti(var_name, 0); were var=325 |
The display will show 325 |
3) alternatives: |
a) We give the command lcd_puti(var_name,1); |
The display will show 32,5 |
b) We give the command lcd_puti(var_name,2); |
The display will show 3,25 |
c) We give the command lcd_puti(var_name,3); |
The display will show 0,325 |
d) We give the command lcd_puti(var_name,4); |
The display will show 0,0325 |
e) We give the command lcd_puti(var_name,1); var=-325 |
The display will show -32,5 |
f) We give the command lcd_puti(var_name,3); var=-325 |
The display will show -0,325 |
*/ |
/* |
** macros for automatically storing string constant in program memory |
*/ |
#ifndef P |
#define P(s) ({static const char c[] __attribute__ ((progmem)) = s;c;}) |
#endif |
#define lcd_puts_P(__s) lcd_puts_p(P(__s)) |
#endif //LCD_IO_H |
/*######################################################################################################*/ |
/* T H E E N D */ |
/*######################################################################################################*/ |
/programy/C/avr/SFR08/makefile |
---|
0,0 → 1,43 |
# Simple Makefile |
# Volker Oth (c) 1999 |
########### change this lines according to your project ################## |
#put the name of the target mcu here (at90s8515, at90s8535, attiny22, atmega603 etc.) |
MCU = atmega103 |
#put the name of the target file here (without extension) |
TRG = test_srf08 |
#put your C sourcefiles here |
SRC = $(TRG).c lcd_io.c i2c.c srf08.c |
#put additional assembler source file here |
ASRC = |
#additional libraries and object files to link |
LIB = |
#additional includes to compile |
INC = |
#compiler flags |
CPFLAGS = -g -Os -Wall -Wstrict-prototypes -Wa,-ahlms=$(<:.c=.lst) |
#linker flags |
LDFLAGS = -Wl,-Map=$(TRG).map,--cref |
########### you should not need to change the following line ############# |
#include $(AVR)/include/avr_make |
###### dependecies, add any dependencies you need here ################### |
$(TRG).o : $(TRG).c lcd_io.h srf08.h |
srf08.o : srf08.c srf08.h i2c.h |
lcd_io.o : lcd_io.c lcd_io.h |
i2c.o : i2c.C i2c.h |
/programy/C/avr/SFR08/srf08.c |
---|
0,0 → 1,169 |
/**************************************************************************** |
Title : C file for the SRF08 FUNCTIONS library (srf08.c) |
Author: Chris efstathiou hendrix@otenet.gr |
Date: 13/Jul/2002 |
Software: AVR-GCC with AVR-AS |
Target: any AVR device |
Comments: This software is FREE. |
*****************************************************************************/ |
#include <io.h> |
#include <eeprom.h> |
#include "i2c.h" |
#include "srf08.h" |
/* Global Variables */ |
static unsigned char address=SRF08_UNIT_0; |
/*#################################################################################################*/ |
void srf08_init(void) |
{ |
unsigned int range=0; |
i2c_init(); |
I2C_START_TX(address); |
i2c_transmit(0); |
i2c_transmit(0x51); |
do{ |
i2c_start(); |
range=i2c_transmit(address); |
i2c_stop(); |
}while(range != I2C_NO_ERROR); |
return; |
} |
/*#################################################################################################*/ |
void srf08_set_gain(unsigned char gain) |
{ |
if(gain>31) { gain=31; } |
I2C_START_TX(address); |
i2c_transmit(1); |
i2c_transmit(gain); |
i2c_stop(); |
return; |
} |
/*#################################################################################################*/ |
void srf08_set_range(unsigned int millimeters) |
{ |
millimeters= (millimeters/43); |
if(millimeters > 0xff ) { millimeters=0xff; } |
I2C_START_TX(address); |
i2c_transmit(2); |
i2c_transmit(millimeters); |
i2c_stop(); |
return; |
} |
/*#################################################################################################*/ |
unsigned int srf08_ping(unsigned char metric_unit) |
{ |
union i2c_union { |
unsigned int rx_word; |
unsigned char rx_byte[2]; |
} i2c; |
I2C_START_TX(address); |
i2c_transmit(0); |
i2c_transmit(metric_unit); |
do{ |
i2c_start(); |
i2c.rx_byte[0]=i2c_transmit(address); |
i2c_stop(); |
}while(i2c.rx_byte[0] != I2C_NO_ERROR); |
I2C_START_TX(address); |
i2c_transmit(SRF08_ECHO_1); |
I2C_START_RX(address); |
i2c.rx_byte[1]=i2c_receive(I2C_CONTINUE); /* get high byte msb first */ |
i2c.rx_byte[0]=i2c_receive(I2C_QUIT); /* get low byte msb first */ |
i2c_stop(); |
return(i2c.rx_word); |
} |
/*#################################################################################################*/ |
unsigned int srf08_read_register(unsigned char srf08_register) |
{ |
union i2c_union { |
unsigned int rx_word; |
unsigned char rx_byte[2]; |
} i2c; |
I2C_START_TX(address); |
i2c_transmit(srf08_register); |
I2C_START_RX(address); |
/* get high byte msb first */ |
if(srf08_register>=2) { i2c.rx_byte[1]=i2c_receive(I2C_CONTINUE); } |
/* get low byte msb first */ |
i2c.rx_byte[0]=i2c_receive(I2C_QUIT); |
i2c_stop(); |
return(i2c.rx_word); |
} |
/*#################################################################################################*/ |
void srf08_change_i2c_address(unsigned char new_i2c_address) |
{ |
/* Start the I2C address changing procedure */ |
I2C_START_TX(address); |
i2c_transmit(SRF08_COMMAND); |
i2c_transmit(0XA0); |
i2c_stop(); |
I2C_START_TX(address); |
i2c_transmit(SRF08_COMMAND); |
i2c_transmit(0XAA); |
i2c_stop(); |
I2C_START_TX(address); |
i2c_transmit(SRF08_COMMAND); |
i2c_transmit(0XA5); |
i2c_stop(); |
I2C_START_TX(address); |
i2c_transmit(SRF08_COMMAND); |
i2c_transmit(new_i2c_address); |
i2c_stop(); |
/* Make the new i2c address the active one. */ |
address=new_i2c_address; |
return; |
} |
/*#################################################################################################*/ |
void srf08_select_unit(unsigned char srf08_address) |
{ |
/* New address validity check */ |
if( (srf08_address<0xE0 || srf08_address>0XFE) && srf08_address != 0 ) { return; } |
if(srf08_address%2) { return; } |
/* Make the new i2c address the active one. */ |
address=srf08_address; |
return; |
} |
/*######################################################################################################*/ |
/* T H E E N D */ |
/*######################################################################################################*/ |
/programy/C/avr/SFR08/srf08.h |
---|
0,0 → 1,91 |
/**************************************************************************** |
Title : C include file for the SRF08 FUNCTIONS library (srf08.h) |
Author: Chris efstathiou hendrix@otenet.gr |
Date: 13/Jul/2002 |
Software: AVR-GCC with AVR-AS |
Target: any AVR device |
Comments: This software is FREE. |
*****************************************************************************/ |
#ifndef SRF08_H |
#define SRF08_H 1 |
/*##############################################################################################*/ |
/* START OF CONFIGURATION BLOCK */ |
/*##############################################################################################*/ |
/* Normally you shouldn't need to change anything */ |
#define SRF08_UNIT_0 0xE0 /* the SRF08 MODULE I2C address */ |
#define SRF08_UNIT_1 0xE2 /* the SRF08 MODULE I2C address */ |
#define SRF08_UNIT_2 0xE4 /* the SRF08 MODULE I2C address */ |
#define SRF08_UNIT_3 0xE6 /* the SRF08 MODULE I2C address */ |
#define SRF08_UNIT_4 0xE8 /* the SRF08 MODULE I2C address */ |
#define SRF08_UNIT_5 0xEA /* the SRF08 MODULE I2C address */ |
#define SRF08_UNIT_6 0xEC /* the SRF08 MODULE I2C address */ |
#define SRF08_UNIT_7 0xEE /* the SRF08 MODULE I2C address */ |
#define SRF08_UNIT_8 0xF0 /* the SRF08 MODULE I2C address */ |
#define SRF08_UNIT_9 0xF2 /* the SRF08 MODULE I2C address */ |
#define SRF08_UNIT_10 0xF4 /* the SRF08 MODULE I2C address */ |
#define SRF08_UNIT_11 0xF6 /* the SRF08 MODULE I2C address */ |
#define SRF08_UNIT_12 0xF8 /* the SRF08 MODULE I2C address */ |
#define SRF08_UNIT_13 0xFA /* the SRF08 MODULE I2C address */ |
#define SRF08_UNIT_14 0xFC /* the SRF08 MODULE I2C address */ |
#define SRF08_UNIT_15 0xFE /* the SRF08 MODULE I2C address */ |
/*##############################################################################################*/ |
/* END OF CONFIGURATION BLOCK */ |
/*##############################################################################################*/ |
#define SRF08_I2C_BROADCAST_ADDRESS 0X00 |
#define SRF08_MIN_GAIN 0 /* sets gain to 94 */ |
#define SRF08_MAX_GAIN 31 /* sets gain to 1025 */ |
#define SRF08_MIN_RANGE 0 /* in millimeters */ |
#define SRF08_MAX_RANGE 11008 /* in millimeters */ |
#define SRF08_INCHES 0X50 |
#define SRF08_CENTIMETERS 0X51 |
#define SRF08_MICROSECONDS 0X52 |
/* register positions */ |
#define SRF08_COMMAND 0 |
#define SRF08_LIGHT 1 |
#define SRF08_ECHO_1 2 |
#define SRF08_ECHO_2 4 |
#define SRF08_ECHO_3 6 |
#define SRF08_ECHO_4 8 |
#define SRF08_ECHO_5 10 |
#define SRF08_ECHO_6 12 |
#define SRF08_ECHO_7 14 |
#define SRF08_ECHO_8 16 |
#define SRF08_ECHO_9 18 |
#define SRF08_ECHO_10 20 |
#define SRF08_ECHO_11 22 |
#define SRF08_ECHO_12 24 |
#define SRF08_ECHO_13 26 |
#define SRF08_ECHO_14 28 |
#define SRF08_ECHO_15 30 |
#define SRF08_ECHO_16 32 |
#define SRF08_ECHO_17 34 |
/* Function Declaration */ |
extern void srf08_select_unit(unsigned char srf08_address); |
extern void srf08_init(void); |
extern void srf08_set_gain(unsigned char gain); |
extern void srf08_set_range(unsigned int millimeters); |
extern unsigned int srf08_ping(unsigned char metric_unit); |
extern unsigned int srf08_read_register(unsigned char srf08_register); |
extern void srf08_change_i2c_address(unsigned char new_i2c_address); |
#endif /* #ifndef SRF08_H */ |
/*######################################################################################################*/ |
/* T H E E N D */ |
/*######################################################################################################*/ |
/programy/C/avr/SFR08/test_lcd.c |
---|
0,0 → 1,59 |
/**************************************************************************** |
Title : C Test program for the LCD FUNCTIONS library (test_lcd.c) |
Author: Chris efstathiou hendrix@otenet.gr |
Date: 1/Jul/2002 |
Software: AVR-GCC with AVR-AS |
Target: any AVR device |
Comments: This software is FREE. |
*****************************************************************************/ |
#define F_CPU 3686400L |
#include <io.h> |
#include "lcd_io.h" |
void main(void) |
{ |
/* Since we also test the eeprom DONT! forget to write the test_lcd.eep to AVR's eeprom |
otherwise the lcd will not show the eeprom_string */ |
static unsigned char eeprom_string[]__attribute__((section(".eeprom")))={"lcd_puts_e testing"}; |
unsigned char ram_string[]={"DONE TESTING..."}; |
unsigned int pos=0; |
lcd_init(); /* lcd(s) is(are) initialized and if more than 1, lcd unit 0 gets active */ |
lcd_clrscr(); |
lcd_gotoxy(0,0); lcd_puts_P("NOT VISIBLE LINE"); |
lcd_clrline(0); lcd_puts_P( "Hello World\nthis is line 2" ); |
#if LCD_AUTO_LINE_FEED == 1 |
lcd_gotoxy(0,2); lcd_puts_e(eeprom_string); lcd_puts(ram_string); |
#elif LCD_AUTO_LINE_FEED == 0 |
/*---------------------------------------------------------------------------------------------------*/ |
/* |
I puted this command here to test the correct saving of the lcd x,y coordinates |
between lcd unit switching, if you select mode 7 |
*/ |
lcd_gotoxy(0,2); |
/*---------------------------------------------------------------------------------------------------*/ |
#if LCD_IO_MODE == 7 |
select_lcd(LCD_1); |
lcd_clrscr(); |
lcd_clrline(0); lcd_puts_P( "This is display #2" ); |
select_lcd(LCD_0); |
#endif |
/*---------------------------------------------------------------------------------------------------*/ |
lcd_puts_e(eeprom_string); |
lcd_gotoxy(0,3); lcd_puts(ram_string); |
#endif /* #elif LCD_AUTO_LINE_FEED == 0 */ |
lcd_gotoxy(16,3); lcd_puti(pos,2); pos=lcd_getxy(); |
lcd_gotoxy(16,3); lcd_puti(pos,2); |
} |
/*######################################################################################################*/ |
/* T H E E N D */ |
/*######################################################################################################*/ |
/programy/C/avr/SFR08/test_srf08.c |
---|
0,0 → 1,90 |
/**************************************************************************** |
Title : C test file for the SRF08 FUNCTIONS library (test_srf08.c) |
Author: Chris efstathiou hendrix@otenet.gr |
Date: 13/Jul/2002 |
Software: AVR-GCC with AVR-AS |
Target: any AVR device |
Comments: This software is FREE. |
*****************************************************************************/ |
#define F_CPU 3686400L |
#include <io.h> |
#include "lcd_io.h" |
#include "srf08.h" |
#define AVG_FLT_SAMPLES 3 |
/*#################################################################################################*/ |
void delay(unsigned long us) |
{ |
while ( us ) { us--; } /* 6 cpu cycles per loop */ |
} |
/*#################################################################################################*/ |
void main(void) |
{ |
unsigned int range=0; |
unsigned char counter1=0, gain=0; |
/* Delay is there to ensure that SRF08 is out of reset and operational */ |
/* |
delay(1000000); |
srf08_change_i2c_address(SRF08_UNIT_1); |
delay(100000); |
*/ |
/* |
By default SRF_UNIT_0 is selected so the below command shows that the change of i2c address |
by the above "srf08_change_i2c_address(SRF08_UNIT_1);" command was succesfull. |
All commands after this, refer to that unit only! |
*/ |
srf08_select_unit(SRF08_UNIT_1); |
srf08_init(); /* Only the selected SRF08 unit will be initialized! */ |
gain=SRF08_MAX_GAIN; |
srf08_set_gain(gain); |
srf08_set_range(SRF08_MAX_RANGE); /* Set range to 11008 mm */ |
lcd_init(); |
lcd_clrscr(); |
lcd_gotoxy(0,0); lcd_puts_P("RANGE (E1) = "); |
lcd_gotoxy(0,1); lcd_puts_P("RANGE (E2) = "); |
lcd_gotoxy(0,2); lcd_puts_P("RANGE (E5) = "); |
lcd_gotoxy(0,3); lcd_puts_P("LIGHT sensor= "); |
while(1) |
{ |
/* AVERAGING FILTER */ |
for(counter1=0,range=0; counter1<AVG_FLT_SAMPLES; counter1++) |
{ |
range+=srf08_ping(SRF08_CENTIMETERS); |
} |
range /= AVG_FLT_SAMPLES; |
/* AUTOMATIC GAIN CONTROL */ |
if(srf08_read_register(SRF08_ECHO_5)!=0 ) |
{ |
if(gain>=5) { srf08_set_gain(gain-=5); } else { srf08_set_gain(gain=0); } |
} |
else if(srf08_read_register(SRF08_ECHO_2)<=0 && gain!=31) { srf08_set_gain(++gain); } |
/* DISPLAY TO LCD */ |
lcd_gotoxy(14,0); lcd_puti(range,2); |
lcd_gotoxy(14,1); lcd_puti(srf08_read_register(SRF08_ECHO_2), 2); |
lcd_gotoxy(14,2); lcd_puti(srf08_read_register(SRF08_ECHO_5), 2); |
lcd_gotoxy(14,3); lcd_puti(srf08_read_register(SRF08_LIGHT), 2); |
} |
return; |
} |
/*#################################################################################################*/ |
/programy/C/avr/RS232toRS485/P232.c |
---|
0,0 → 1,140 |
// 1.6.2007 |
//---------------------------------------------------------------------------------- |
// Prevodnik RS232 <--> RS485 |
// pri startbitu na RS232 zapne okamzite vysilac pokud nejsou detekovana data z RS485. |
//---------------------------------------------------------------------------------- |
//Program je urcen k rizeni toku dat v prevodniku RS232 na RS485. S cilem eliminovat jakekoliv prvky nastavovene uzivatelem |
//bez nutnosti pouziti hardwaroveho rizeni toku. Program tedy dokaze detekovat prenosovou rychlost, paritni bit a stopbit. |
// |
// |
//Algoritmus: |
// Princip je zalozen na mereni nejkratsiho casoveho useku v osmi vzorcich, delka vzorku |
// se odviji od velikosti prave nejmensiho zmereneho vzorku. |
// Vzorek se meri pomoci 8mi bitoveho casovace a interruptu od zmeny vstupu. casovac je osetren |
// proti pretekani (pocet preteceni se uklada, do promenne s ktere se zpetne vypocita 16bitove cislo, |
// casovac se tedy virtualne chova jako 16ti bitovy.) |
// Mereni delky bitu |
// |
// Aktualni implementace teto metody se chova tak, ze pokud je vyslan bajt ktery po startbitu obsahuje N |
// stejnych bitu, tak je tato sekvence detekovana jako jeden bit to zpusobi ze detekovana rychlost je N krat |
// mensi, nez skutecna. Dusledkem je, ze pokud se jeste pred stopbitem neobjevi samostatny bit s jinou hodnotou, |
// nez predchozi sekvence. Tak bude vysÃlánà povoleno po dubu osminásobku zmìøené délky "bitu" plus dalšà dva bity jako stopbity. |
// |
// |
//Vlastnosti: |
// Tento program je shopen detekovat pararitnà bit, ale neni shopen detekovat poèet stopbitù. |
// To znamená že když bude parita logická jedna, tak bude rozpoznána jako stop bit. |
// Tato vlastnost ale pøÃliš nevadÃ, protože chovánà algoritmu lze upravit tak, že bude predpokládat dva nebo tøi stopbity. |
// V takovém pøÃpadì se packet pøenese korektnì i když parita bude jedna, i nula. |
// |
// Tento zpusob detekce neni imuni proti nahodnym chybovim spickam vzniklych v dusledku ruseni. |
// Proto je nutene napajeni kvalitne stbilizovat, pouzivat blokovaci kondenzatory a |
// zabezpecit, aby nedochazelo ke zvedani zeme. |
//////////////////////////////////////////////////////////////////////////////////////// |
// |
//Autor: Jakub Kakona (kaklik@mlab.cz) |
// |
//////////////////////////////////////////////////////////////////////////////////////// |
//TODO: |
// Optimalizovat kod, (hlavne najit casove vyhodnejsi umisteni pro nastavovani defaultnich hodnot promennych) |
// Bylo bydobre zavest uspavani pred prijetim bajtu. |
// Vykouset program na ATtiny13 |
// Pri rychlostech mensich nez 9600kbps dochazi k pretekani promennych a algoritmus se nechova korektne. |
// Neni vyzkousen break, byly testovany pouze ASCII znaky vysilane pres terminal z klavesnice. |
// Aktivovat WatchDog timer. |
// Neni vyzkouseno na vyssÃm taktu CPU jak 3,7MHz |
////////////////////////////////////////////////////////////////////////////////////// |
// |
#include <avr/io.h> |
#include <avr/interrupt.h> |
#include <stdlib.h> |
#include <ctype.h> |
#include <avr/eeprom.h> |
#include <avr/pgmspace.h> |
#define POVOLOVAK_LOW PORTB &= ~(1<<PB3) // nastaveni nuly na vystup, krery zapina povoleni vysilani RS485 |
#define POVOLOVAK_HIGH PORTB |= (1<<PB3) // nastaveni jednicky na tentyz vystup |
#define DATA (PIND & (1<<PD3)) // nastaveni vstupu, na kterem se budou detekovat data, musi byt stejny jako vstup pouziteho interruptu |
volatile unsigned int preteceni; // promenna na ukladani poctu preteceni casovace |
volatile unsigned int bit; // promena pro pocitani bitu v bajtu |
volatile unsigned long int bitdelay; // obsahuje aktualni zmereny cas delky bitu |
volatile unsigned long int cas; // urcuje nejkratsi nalezeny cas delky bitu |
ISR(TIMER0_OVF_vect) // interrupt od preteceni casovace |
{ |
preteceni++; // kdyz pretece, poznamenej to. |
} |
ISR(INT1_vect) // interrupt od zmeny vstupu na datech |
{ |
if ((bitdelay=(TCNT0+preteceni*0x0100)) < cas) cas = bitdelay; // provnani jestli zrovna zmereny cas je kratsi nez nejmensi znamy cas |
TCNT0 = 0; // zacni znova merit cas zacatku stopbitu |
preteceni=0; // vynuluj vsechny casove promenne |
bit++; // posun pocitadlo bitu o jednicku |
} |
// ------------------------------------------------------------------ |
// Main |
// ------------------------------------------------------------------ |
int main(void) |
{ |
int stopbit; |
int ctvrtbit; |
/*typedef struct { // struktura pro celoèÃselné dìlenà |
int quot; |
int rem; |
} div_t;*/ |
DDRB |= (1<<DDB3); // povoleni vystupu na povolovak |
TIMSK |= (1 << TOIE0); // Enable timer overflow interrupt |
MCUCR |= (1 << ISC10); // nastaveni preruseni od zmeny vstupu pro interrupt INT0 |
GIMSK |= (1 << INT1); // povoleni interruptu INT0 |
TCCR0B |= (1 << CS00); // Set up timer |
sei(); // enable interrupts |
while(1) |
{ |
if(!DATA) // kdyz je 0 na datech |
{ |
POVOLOVAK_HIGH; // zapni vysilani |
TCNT0=0; |
preteceni=0; |
bit=0; // vynuluj vsechny promenne pro mereni casu a pocitani bitu |
cas = 0xFFFF; // nastav cas delky bitu na nejvetsi mozny |
while (bit <= 8) // odpocitej dobu 8mi bitu |
{ |
if ((TCNT0+preteceni*0x0100) >= (cas + (ctvrtbit = cas >> 2))) // zkontroluj jestli necekame na dalsi bit dele nez je nekratsi znema delka bitu |
// v kontrole je rezerva delky ctvrt bitu |
{ |
bit++; // pokud jsme cekali dele, tak bit uz ubehl, to znamena, ze muzeme pocitadlo bitu posunout o jednicku |
// div(ctvrtbit,0x0100); // funkce pro implementaci celociselneho deleni zustava ale nepouzita kvuli nutnosti zavest datove struktury, bude ji nutno pouzit pro vetsi rychlosti |
TCNT0 = ctvrtbit % 0x0100; //reminder; // zacni znova merit cas do dalsiho mozneho bitu |
preteceni = ctvrtbit/0x0100; //quota; |
} |
} |
while (!DATA); // cekani na stop bit (detekce pripadneho paritniho bitu) |
for (stopbit=2;stopbit >= 0;stopbit--) // odpocitej dva stopbity |
{ |
while ((TCNT0+preteceni*0x0100) <= cas) |
{ |
if(!DATA) break; |
} |
} |
} |
else POVOLOVAK_LOW; // kdyz je 1 prepni na prijem |
} |
return(0); |
} |
/programy/C/avr/RS232toRS485/default/rs485.elf |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr/RS232toRS485/default/rs485.hex |
---|
0,0 → 1,49 |
:1000000012C02AC041C028C027C026C026C024C0B4 |
:1000100023C022C021C020C01FC01EC01DC01CC0E4 |
:100020001BC01AC019C011241FBECFEDCDBF10E0F8 |
:10003000A0E6B0E0ECEFF2E003C0C89531960D9277 |
:10004000A036B107D1F710E0A0E6B0E001C01D92E4 |
:10005000AC36B107E1F778C0D3CF1F920F920FB63D |
:100060000F9211248F939F9380916400909165006B |
:10007000019690936500809364009F918F910F90FB |
:100080000FBE0F901F9018951F920F920FB60F92F0 |
:1000900011242F933F934F935F938F939F93AF932D |
:1000A000BF9322B78091640090916500982F8827B4 |
:1000B000820F911DAA27BB27809360009093610057 |
:1000C000A0936200B09363002091600030916100C2 |
:1000D00040916200509163008091660090916700AA |
:1000E000A0916800B0916900281739074A075B079B |
:1000F00080F48091600090916100A0916200B091C5 |
:1001000063008093660090936700A0936800B093AB |
:10011000690012BE109265001092640080916A001E |
:1001200090916B00019690936B0080936A00BF9151 |
:10013000AF919F918F915F914F913F912F910F9030 |
:100140000FBE0F901F901895AF92BF92CF92DF9283 |
:10015000EF92FF920F931F93BB9A89B7826089BF7A |
:1001600085B7846085BF8BB780688BBF83B781609C |
:1001700083BF7894839994C0C39A12BE109265008D |
:100180001092640010926B0010926A008FEF9FEF44 |
:10019000A0E0B0E08093660090936700A0936800B1 |
:1001A000B093690080916A0090916B00099708F004 |
:1001B00053C082B72091640030916500A090660022 |
:1001C000B0906700C0906800D0906900D694C79442 |
:1001D000B794A794D694C794B794A794E090660078 |
:1001E000F09067000091680010916900322F22277B |
:1001F000280F311D442755278A2D9B2DAA2797FDAF |
:10020000A095BA2F8E0D9F1DA01FB11F281739076B |
:100210004A075B0738F280916A0090916B00019663 |
:1002200090936B0080936A009B2D8A2D60E071E0B3 |
:100230003CD082BF9B2D8A2DB7FC34C0892F990FEB |
:10024000990B909365008093640080916A0090916F |
:100250006B00099708F4ADCF839BFECF62E070E09E |
:1002600082B72091640030916500E0906600F090C4 |
:1002700067000091680010916900322F2227280F33 |
:10028000311D44275527E216F3060407150710F021 |
:100290008399E6CF6150704077FFE2CF839B6CCFAC |
:1002A000C39868CF81509F4FC9CF97FB092E07266F |
:1002B0000AD077FD04D00CD006D000201AF4709537 |
:1002C00061957F4F0895F6F7909581959F4F08951A |
:1002D000AA1BBB1B51E107C0AA1FBB1FA617B7076C |
:1002E00010F0A61BB70B881F991F5A95A9F7809588 |
:0C02F0009095682F792F8A2F9B2F08957E |
:00000001FF |
/programy/C/avr/RS232toRS485/default/Makefile |
---|
0,0 → 1,77 |
############################################################################### |
# Makefile for the project rs485 |
############################################################################### |
## General Flags |
PROJECT = rs485 |
MCU = attiny2313 |
TARGET = rs485.elf |
CC = avr-gcc.exe |
## Options common to compile, link and assembly rules |
COMMON = -mmcu=$(MCU) |
## Compile options common for all C compilation units. |
CFLAGS = $(COMMON) |
CFLAGS += -Wall -gdwarf-2 -DF_CPU=3686400UL -O3 -funsigned-char -funsigned-bitfields |
CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d |
## Assembly specific flags |
ASMFLAGS = $(COMMON) |
ASMFLAGS += $(CFLAGS) |
ASMFLAGS += -x assembler-with-cpp -Wa,-gdwarf2 |
## Linker flags |
LDFLAGS = $(COMMON) |
LDFLAGS += |
## Intel Hex file production flags |
HEX_FLASH_FLAGS = -R .eeprom |
HEX_EEPROM_FLAGS = -j .eeprom |
HEX_EEPROM_FLAGS += --set-section-flags=.eeprom="alloc,load" |
HEX_EEPROM_FLAGS += --change-section-lma .eeprom=0 --no-change-warnings |
## Libraries |
LIBS = -lc -lm -lprintf_flt -lprintf_min -lscanf_flt -lscanf_min |
## Objects that must be built in order to link |
OBJECTS = P232.o |
## Objects explicitly added by the user |
LINKONLYOBJECTS = |
## Build |
all: $(TARGET) rs485.hex rs485.eep size |
## Compile |
P232.o: ../P232.c |
$(CC) $(INCLUDES) $(CFLAGS) -c $< |
##Link |
$(TARGET): $(OBJECTS) |
$(CC) $(LDFLAGS) $(OBJECTS) $(LINKONLYOBJECTS) $(LIBDIRS) $(LIBS) -o $(TARGET) |
%.hex: $(TARGET) |
avr-objcopy -O ihex $(HEX_FLASH_FLAGS) $< $@ |
%.eep: $(TARGET) |
-avr-objcopy $(HEX_EEPROM_FLAGS) -O ihex $< $@ || exit 0 |
%.lss: $(TARGET) |
avr-objdump -h -S $< > $@ |
size: ${TARGET} |
@echo |
@avr-size -C --mcu=${MCU} ${TARGET} |
## Clean target |
.PHONY: clean |
clean: |
-rm -rf $(OBJECTS) rs485.elf dep/* rs485.hex rs485.eep |
## Other dependencies |
-include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*) |
/programy/C/avr/RS232toRS485/rs485.aps |
---|
0,0 → 1,0 |
<AVRStudio><MANAGEMENT><ProjectName>rs485</ProjectName><Created>22-May-2007 10:20:14</Created><LastEdit>01-Jun-2007 15:37:20</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>22-May-2007 10:20:14</Created><Version>4</Version><Build>4, 13, 0, 528</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile>default\rs485.elf</ObjectFile><EntryFile></EntryFile><SaveFolder>C:\E240\ass3\RS232toRS485\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET>AVR Simulator</CURRENT_TARGET><CURRENT_PART>ATtiny2313</CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0><Variables>preteceni</Variables><Variables>bit</Variables><Variables>bitdelay</Variables><Variables>cas</Variables></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><modules><module></module></modules><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>P232.c</SOURCEFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>NO</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE></EXTERNALMAKEFILE><PART>attiny2313</PART><HEX>1</HEX><LIST>0</LIST><MAP>0</MAP><OUTPUTFILENAME>rs485.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>0</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS><LIB>libc.a</LIB><LIB>libm.a</LIB><LIB>libprintf_flt.a</LIB><LIB>libprintf_min.a</LIB><LIB>libscanf_flt.a</LIB><LIB>libscanf_min.a</LIB></LIBS><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -DF_CPU=3686400UL -O3 -funsigned-char -funsigned-bitfields</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\Program Files\WinAVR\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\Program Files\WinAVR\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><ProjectFiles><Files><Name>C:\E240\ass3\RS232toRS485\P232.c</Name></Files></ProjectFiles><IOView><usergroups/></IOView><Files><File00000><FileId>00000</FileId><FileName>P232.c</FileName><Status>259</Status></File00000></Files><Workspace><File00000><Position>156 71 914 523</Position><LineCol>2 2</LineCol><State>Maximized</State></File00000></Workspace><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio> |
/programy/C/avr/RS232toRS485/rs485.aws |
---|
0,0 → 1,0 |
<AVRWorkspace><IOSettings><CurrentRegisters/></IOSettings><part name="ATTINY2313"/><Files><File00000 Name="C:\E240\ass3\RS232toRS485\P232.c" Position="156 71 914 523" LineCol="2 2" State="Maximized"/></Files></AVRWorkspace> |
/programy/C/avr32/SFR08/SFR08.cpp |
---|
0,0 → 1,129 |
/*****************************************************************************/ |
/* |
* Zmena I2C adresy |
* |
* Copyright (C) 2007 KAKL, KAKLIK |
* |
* This program is free software; you can redistribute it and/or modify |
* it under the terms of the GNU General Public License as published by |
* the Free Software Foundation; either version 2 of the License, or |
* (at your option) any later version. |
* |
* This program is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU General Public License for more details. |
* |
*/ |
/*****************************************************************************/ |
#include <iostream> |
#include <getopt.h> |
#include <errno.h> |
#include <string.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <unistd.h> |
#include "linux/i2c-dev.h" |
#include "linux/i2c.h" |
#include <sys/ioctl.h> |
#include <sys/types.h> |
#include <sys/stat.h> |
#include <fcntl.h> |
using namespace std; |
#define BC_Addr 0x0B |
int file; |
void I2C_addr (int Addr) |
{ |
if (ioctl(file, I2C_SLAVE, Addr) == -1) |
{ |
fprintf(stderr, "Failed to set address to 0x%02x.\n", Addr); |
exit(-5); |
} |
} |
unsigned int echo(int Addr) // precte vzdalenost z US cidla |
{ |
char Buf[3]; |
I2C_addr(Addr); |
Buf[0]=0x0; |
Buf[1]=0x51; |
write(file, Buf, 2); |
usleep(80000); |
read(file, Buf, 3); |
return (Buf[1]*256+Buf[2]); |
} |
int i2c_init() // zinicializuje i2c |
{ |
file = open("/dev/i2c-0", O_RDWR); |
if (file < 0) |
{ |
cerr << "Could not open /dev/i2c-0." << endl; |
return -1; |
} |
return 0; |
} |
int main(int argc, char *argv[], char *envp[]) |
{ |
unsigned int OldAddress, NewAddress; |
char Buf[10]; |
fprintf(stdout, "\n **** Change I2C Address **** \n \r"); |
if (argc<2) |
{ |
printf("Use:\n%s OldAddress NewAddress - for change address\nOR\n%s Address - for echo\n\n\r",argv[0],argv[0]); |
return 0; |
} |
i2c_init(); |
sscanf(argv[1],"%x",&OldAddress); |
if (argc==2) |
{ |
printf("Vzdalenost: %d\n", echo(OldAddress>>1)); |
close(file); |
return 0; |
} |
sscanf(argv[2],"%x",&NewAddress); |
printf("Old: %x New: %x\n", OldAddress, NewAddress); |
printf("Vzdalenost: %d\n", echo(OldAddress>>1)); |
I2C_addr(OldAddress>>1); |
Buf[0]=0x0; |
Buf[1]=0xA0; |
write(file, Buf, 2); |
I2C_addr(OldAddress>>1); |
Buf[0]=0x0; |
Buf[1]=0xAA; |
write(file, Buf, 2); |
I2C_addr(OldAddress>>1); |
Buf[0]=0x0; |
Buf[1]=0xA5; |
write(file, Buf, 2); |
I2C_addr(OldAddress>>1); |
Buf[0]=0x0; |
Buf[1]=NewAddress; |
write(file, Buf, 2); |
usleep(100000); |
printf("Vzdalenost: %d\n", echo(NewAddress>>1)); |
close(file); |
return 0; |
} |
/programy/C/avr32/cmps03/compass.c |
---|
0,0 → 1,140 |
/* compass.c |
* |
* Software to read from the CMPS03 magnetic compass. |
* |
#include <errno.h> |
#include <string.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <unistd.h> |
#include <fcntl.h> |
#include <linux/i2c-dev.h> |
/* Note that the documentation for the compass states its address as 0xC0. |
* However, this includes the low bit which specifies read or write. |
* Linux i2c does not include this bit in this address, so the actual |
* address is 0xC0 shifted down, 0x60. |
*/ |
#define CMPS_Addr (0xC0>>1) |
#define I2C_SLAVE 0x0B /* Change slave address |
/* The important registers on the compass. Internal/test registers omitted. */ |
#define CMPS03_SOFTWARE_REVISION 0x0 |
#define CMPS03_BEARING_BYTE 0x1 |
#define CMPS03_BEARING_WORD_HIGH 0x2 |
#define CMPS03_BEARING_WORD_LOW 0x3 |
#define CMPS03_CALIBRATE_CMD 0xF |
void I2C_addr (int Addr) // vybere adresu cidla se kterym se bude komunikovat |
{ |
if (ioctl(file, I2C_SLAVE, Addr) == -1) |
{ |
fprintf(stderr, "Failed to set address to 0x%02x.\n", Addr); |
exit(-5); |
} |
} |
int i2c_init() // zinicializuje i2c |
{ |
file = open("/dev/i2c-0", O_RDWR); |
if (file < 0) |
{ |
cerr << "Could not open /dev/i2c-0." << endl; |
return -1; |
} |
return 0; |
} |
unsigned char read_azimut_mag() // precte azimut z kompasu |
{ |
char Buf[3]; // promena pro manipulaci s i2c |
I2C_addr(CMPS_Addr); |
Buf[0]=1; |
write(file,Buf,1); |
read(file, Buf,1); |
return (Buf[0]-SEVER); |
} |
void calib() // kalibrace kompasu |
{ |
char Buf[3]; // promena pro manipulaci s i2c |
I2C_addr(CMPS_Addr); |
Buf[0]=15; |
Buf[1]=0xFF; |
write(file,Buf,2); |
} |
int main(int argc, char *argv[]) |
{ |
char *end; |
int res,file; |
int error; |
char filename[20] ; |
long funcs; |
int heading_byte, heading_word_h, heading_word_l; |
int bearing_long, bearing_degrees; |
sprintf(filename,"/dev/i2c-0"); |
file = open(filename,O_RDWR); |
if (errno != 0) |
{ |
switch (errno) |
{ |
case EACCES: |
fprintf(stderr,"Run as root? \n"); |
break; |
default: |
fprintf(stderr,"Error: Could not open file '%s' : %s \n", filename, strerror(errno)); |
break; |
} |
} |
if (ioctl(file,I2C_SLAVE,CMPS03_ADDR) < 0) { |
switch (errno) |
{ |
case EBUSY: |
printf("device is busy \n"); |
break; |
default: |
printf("Got error: %s \n", strerror(errno)); |
exit(0); |
} |
} |
/* Get software revision number */ |
res = read(file, CMPS03_SOFTWARE_REVISION,1); |
if (res < 0) { |
printf("Cannot read software revision level \n"); |
} else { |
printf("Software revision level: %02x \n", res); |
} |
/* Loop and read from the compass. */ |
while (1) { |
/* The heading byte is 0-255 for the 360 degrees. */ |
heading_byte = read(file, CMPS03_BEARING_BYTE,1); |
if (heading_byte < 0) { printf("Error reading from compass. \n"); exit(1);} |
/* The high resolution heading is given in two registers, and is 10 * the |
* heading in degrees, ie 359.9 degrees reads as 3599. */ |
heading_word_h = read(file, CMPS03_BEARING_WORD_HIGH,1); |
if (heading_word_h < 0) { printf("Error reading from compass. \n"); exit(1);} |
heading_word_l = read(file, CMPS03_BEARING_WORD_LOW,1); |
if (heading_word_l < 0) { printf("Error reading from compass. \n"); exit(1);} |
/* Combine the two bytes, and get the heading in degrees. */ |
bearing_long = heading_word_h * 256 + heading_word_l; |
bearing_degrees = bearing_long / 10; |
printf("Bearing: %d \n", bearing_degrees); |
/* Wait for a while. */ |
usleep(200000); |
} |
} |
/programy/C/avr32/cmps03/main.cpp |
---|
0,0 → 1,155 |
/*****************************************************************************/ |
/* |
* Zmena I2C adresy |
* |
* Copyright (C) 2007 KAKL |
* |
* This program is free software; you can redistribute it and/or modify |
* it under the terms of the GNU General Public License as published by |
* the Free Software Foundation; either version 2 of the License, or |
* (at your option) any later version. |
* |
* This program is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU General Public License for more details. |
* |
*/ |
/*****************************************************************************/ |
#include <iostream> |
#include <getopt.h> |
#include <errno.h> |
#include <string.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <unistd.h> |
#include "linux/i2c-dev.h" |
#include "linux/i2c.h" |
#include <sys/ioctl.h> |
#include <sys/types.h> |
#include <sys/stat.h> |
#include <fcntl.h> |
using namespace std; |
#define BC_Addr 0x0B |
#define US3_Addr 0x70 // 0xE0 in fact; Sonar na doprovod |
#define CMPS_Addr 0x60 // 0xC0 |
#define M1 0x50 // 0xA0 in fact |
#define M2 0x51 // 0xA2 in fact |
int file; |
void I2C_addr (int Addr) |
{ |
if (ioctl(file, I2C_SLAVE, Addr) == -1) |
{ |
fprintf(stderr, "Failed to set address to 0x%02x.\n", Addr); |
exit(-5); |
} |
} |
unsigned int echo(int Addr) // precte vzdalenost z US cidla |
{ |
char Buf[3]; |
I2C_addr(Addr); |
Buf[0]=0x0; |
Buf[1]=0x51; |
write(file, Buf, 2); |
usleep(80000); |
read(file, Buf, 3); |
return (Buf[1]*256+Buf[2]); |
} |
unsigned char read_azimut_mag() // precte azimut z kompasu |
{ |
char Buf[3]; // promena pro manipulaci s i2c |
I2C_addr(CMPS_Addr); |
Buf[0]=1; |
write(file,Buf,1); |
read(file, Buf,1); |
return Buf[0]; |
} |
void calib() // kalibrace kompasu |
{ |
char Buf[3]; // promena pro manipulaci s i2c |
I2C_addr(CMPS_Addr); |
Buf[0]=15; |
Buf[1]=0xFF; |
write(file,Buf,2); |
} |
int i2c_init() // zinicializuje i2c |
{ |
file = open("/dev/i2c-0", O_RDWR); |
if (file < 0) |
{ |
cerr << "Could not open /dev/i2c-0." << endl; |
return -1; |
} |
return 0; |
} |
int main(int argc, char *argv[], char *envp[]) |
{ |
unsigned int OldAddress, NewAddress; |
char Buf[10]; |
fprintf(stdout, "\n **** Change I2C Address **** \n \r"); |
if (argc<2) |
{ |
printf("Use:\n%s OldAddress NewAddress - for change address\nOR\n%s Address - for echo\n\n\r",argv[0],argv[0]); |
return 0; |
} |
i2c_init(); |
sscanf(argv[1],"%x",&OldAddress); |
if (argc==2) |
{ |
printf("Vzdalenost: %d\n", echo(OldAddress>>1)); |
close(file); |
return 0; |
} |
sscanf(argv[2],"%x",&NewAddress); |
printf("Old: %x New: %x\n", OldAddress, NewAddress); |
printf("Vzdalenost: %d\n", echo(OldAddress>>1)); |
I2C_addr(OldAddress>>1); |
Buf[0]=0x0; |
Buf[1]=0xA0; |
write(file, Buf, 2); |
I2C_addr(OldAddress>>1); |
Buf[0]=0x0; |
Buf[1]=0xAA; |
write(file, Buf, 2); |
I2C_addr(OldAddress>>1); |
Buf[0]=0x0; |
Buf[1]=0xA5; |
write(file, Buf, 2); |
I2C_addr(OldAddress>>1); |
Buf[0]=0x0; |
Buf[1]=NewAddress; |
write(file, Buf, 2); |
usleep(100000); |
printf("Vzdalenost: %d\n", echo(NewAddress>>1)); |
close(file); |
return 0; |
} |
/programy/C/avr32/linux-kernel/rootfs/uImage |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/build |
---|
0,0 → 1,0 |
link /home/kaklik/projekty/programy/Atmel32_C/linux-kernel |
Property changes: |
Added: svn:special |
+* |
\ No newline at end of property |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/crypto/arc4.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/crypto/ecb.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/crypto/pcbc.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/block/loop.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/block/nbd.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/block/rd.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/bsd_comp.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/ppp_async.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/ppp_deflate.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/ppp_generic.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/ppp_mppe.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/pppoe.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/pppox.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/slhc.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/tun.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/spi/spidev.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/usb/gadget/g_ether.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/usb/gadget/g_file_storage.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/usb/gadget/g_serial.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/usb/gadget/g_zero.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/usb/gadget/gadgetfs.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/fs/cifs/cifs.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/fs/fat/fat.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/fs/fuse/fuse.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/fs/msdos/msdos.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/fs/smbfs/smbfs.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/fs/vfat/vfat.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/lib/crc-ccitt.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/sound/ac97_bus.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/sound/avr32/snd-atmel-ac97.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/kernel/sound/pci/ac97/snd-ac97-codec.ko |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/modules.alias |
---|
0,0 → 1,13 |
# Aliases extracted from modules themselves. |
alias block-major-7-* loop |
alias block-major-1-* rd |
alias net-pf-24 pppoe |
alias ppp-compress-18 ppp_mppe |
alias ppp-compress-21 bsd_comp |
alias char-major-10-200 tun |
alias tty-ldisc-3 ppp_async |
alias ppp-compress-24 ppp_deflate |
alias ppp-compress-26 ppp_deflate |
alias /dev/ppp ppp_generic |
alias char-major-108-* ppp_generic |
alias char-major-10-229 fuse |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/modules.ccwmap |
---|
0,0 → 1,0 |
# ccw module match_flags cu_type cu_model dev_type dev_model |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/modules.dep |
---|
0,0 → 1,31 |
/lib/modules/2.6.22.atmel.2-kaklik/kernel/lib/crc-ccitt.ko: |
/lib/modules/2.6.22.atmel.2-kaklik/kernel/crypto/pcbc.ko: |
/lib/modules/2.6.22.atmel.2-kaklik/kernel/crypto/arc4.ko: |
/lib/modules/2.6.22.atmel.2-kaklik/kernel/crypto/ecb.ko: |
/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/block/nbd.ko: |
/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/block/loop.ko: |
/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/block/rd.ko: |
/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/usb/gadget/g_ether.ko: |
/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/usb/gadget/gadgetfs.ko: |
/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/usb/gadget/g_file_storage.ko: |
/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/usb/gadget/g_zero.ko: |
/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/usb/gadget/g_serial.ko: |
/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/spi/spidev.ko: |
/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/pppoe.ko: /lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/pppox.ko /lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/ppp_generic.ko /lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/slhc.ko |
/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/ppp_mppe.ko: /lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/ppp_generic.ko /lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/slhc.ko |
/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/bsd_comp.ko: /lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/ppp_generic.ko /lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/slhc.ko |
/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/slhc.ko: |
/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/tun.ko: |
/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/pppox.ko: /lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/ppp_generic.ko /lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/slhc.ko |
/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/ppp_async.ko: /lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/ppp_generic.ko /lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/slhc.ko /lib/modules/2.6.22.atmel.2-kaklik/kernel/lib/crc-ccitt.ko |
/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/ppp_deflate.ko: /lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/ppp_generic.ko /lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/slhc.ko |
/lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/ppp_generic.ko: /lib/modules/2.6.22.atmel.2-kaklik/kernel/drivers/net/slhc.ko |
/lib/modules/2.6.22.atmel.2-kaklik/kernel/sound/avr32/snd-atmel-ac97.ko: /lib/modules/2.6.22.atmel.2-kaklik/kernel/sound/pci/ac97/snd-ac97-codec.ko /lib/modules/2.6.22.atmel.2-kaklik/kernel/sound/ac97_bus.ko |
/lib/modules/2.6.22.atmel.2-kaklik/kernel/sound/pci/ac97/snd-ac97-codec.ko: /lib/modules/2.6.22.atmel.2-kaklik/kernel/sound/ac97_bus.ko |
/lib/modules/2.6.22.atmel.2-kaklik/kernel/sound/ac97_bus.ko: |
/lib/modules/2.6.22.atmel.2-kaklik/kernel/fs/cifs/cifs.ko: |
/lib/modules/2.6.22.atmel.2-kaklik/kernel/fs/fat/fat.ko: |
/lib/modules/2.6.22.atmel.2-kaklik/kernel/fs/smbfs/smbfs.ko: |
/lib/modules/2.6.22.atmel.2-kaklik/kernel/fs/fuse/fuse.ko: |
/lib/modules/2.6.22.atmel.2-kaklik/kernel/fs/msdos/msdos.ko: /lib/modules/2.6.22.atmel.2-kaklik/kernel/fs/fat/fat.ko |
/lib/modules/2.6.22.atmel.2-kaklik/kernel/fs/vfat/vfat.ko: /lib/modules/2.6.22.atmel.2-kaklik/kernel/fs/fat/fat.ko |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/modules.ieee1394map |
---|
0,0 → 1,0 |
# ieee1394 module match_flags vendor_id model_id specifier_id version |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/modules.inputmap |
---|
0,0 → 1,0 |
# module matchBits bustype vendor product version evBits keyBits relBits absBits mscBits ledBits sndBits ffBits [swBits] driver_info |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/modules.isapnpmap |
---|
0,0 → 1,0 |
# isapnp module cardvendor carddevice driver_data vendor function ... |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/modules.ofmap |
---|
0,0 → 1,0 |
# of module name type compatible |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/modules.pcimap |
---|
0,0 → 1,0 |
# pci module vendor device subvendor subdevice class class_mask driver_data |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/modules.seriomap |
---|
0,0 → 1,0 |
# serio module type extra id proto |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/modules.symbols |
---|
0,0 → 1,57 |
# Aliases for symbols, used by symbol_request(). |
alias symbol:register_pppox_proto pppox |
alias symbol:snd_ac97_pcm_open snd_ac97_codec |
alias symbol:fat_sync_inode fat |
alias symbol:fat_date_unix2dos fat |
alias symbol:snd_ac97_pcm_assign snd_ac97_codec |
alias symbol:unregister_pppox_proto pppox |
alias symbol:snd_ac97_update snd_ac97_codec |
alias symbol:loop_unregister_transfer loop |
alias symbol:fat_dir_empty fat |
alias symbol:snd_ac97_pcm_close snd_ac97_codec |
alias symbol:snd_ac97_update_bits snd_ac97_codec |
alias symbol:ppp_output_wakeup ppp_generic |
alias symbol:slhc_remember slhc |
alias symbol:fat_detach fat |
alias symbol:crc_ccitt crc_ccitt |
alias symbol:fat_notify_change fat |
alias symbol:snd_ac97_set_rate snd_ac97_codec |
alias symbol:snd_ac97_read snd_ac97_codec |
alias symbol:crc_ccitt_table crc_ccitt |
alias symbol:ppp_unregister_compressor ppp_generic |
alias symbol:fat_build_inode fat |
alias symbol:fat_attach fat |
alias symbol:ppp_register_channel ppp_generic |
alias symbol:fat_add_entries fat |
alias symbol:ppp_channel_index ppp_generic |
alias symbol:fat_free_clusters fat |
alias symbol:slhc_compress slhc |
alias symbol:snd_ac97_write_cache snd_ac97_codec |
alias symbol:fat_get_dotdot_entry fat |
alias symbol:ppp_input ppp_generic |
alias symbol:slhc_toss slhc |
alias symbol:slhc_init slhc |
alias symbol:ppp_unregister_channel ppp_generic |
alias symbol:fat_search_long fat |
alias symbol:fat_alloc_new_dir fat |
alias symbol:snd_ac97_pcm_double_rate_rules snd_ac97_codec |
alias symbol:pppox_unbind_sock pppox |
alias symbol:snd_ac97_mixer snd_ac97_codec |
alias symbol:fat_fill_super fat |
alias symbol:ac97_bus_type ac97_bus |
alias symbol:slhc_free slhc |
alias symbol:snd_ac97_bus snd_ac97_codec |
alias symbol:fat_scan fat |
alias symbol:ppp_unit_number ppp_generic |
alias symbol:ppp_input_error ppp_generic |
alias symbol:snd_ac97_get_short_name snd_ac97_codec |
alias symbol:snd_ac97_write snd_ac97_codec |
alias symbol:loop_register_transfer loop |
alias symbol:pppox_ioctl pppox |
alias symbol:fat_fs_panic fat |
alias symbol:ppp_register_compressor ppp_generic |
alias symbol:fat_remove_entries fat |
alias symbol:slhc_uncompress slhc |
alias symbol:snd_ac97_tune_hardware snd_ac97_codec |
alias symbol:fat_flush_inodes fat |
alias symbol:fat_getattr fat |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/modules.usbmap |
---|
0,0 → 1,0 |
# usb module match_flags idVendor idProduct bcdDevice_lo bcdDevice_hi bDeviceClass bDeviceSubClass bDeviceProtocol bInterfaceClass bInterfaceSubClass bInterfaceProtocol driver_info |
/programy/C/avr32/linux-kernel/rootfs/lib/modules/2.6.22.atmel.2-kaklik/source |
---|
0,0 → 1,0 |
link /home/kaklik/projekty/programy/Atmel32_C/linux-kernel |
Property changes: |
Added: svn:special |
+* |
\ No newline at end of property |
/programy/C/avr32/linux-kernel/kernel/arch/avr32/boards/atngw100/setup.c |
---|
0,0 → 1,186 |
/* |
* Board-specific setup code for the ATNGW100 Network Gateway |
* |
* Copyright (C) 2005-2006 Atmel Corporation |
* |
* This program is free software; you can redistribute it and/or modify |
* it under the terms of the GNU General Public License version 2 as |
* published by the Free Software Foundation. |
*/ |
#include <linux/clk.h> |
#include <linux/etherdevice.h> |
#include <linux/i2c-gpio.h> |
#include <linux/init.h> |
#include <linux/linkage.h> |
#include <linux/platform_device.h> |
#include <linux/types.h> |
#include <linux/leds.h> |
#include <linux/spi/spi.h> |
#include <asm/io.h> |
#include <asm/setup.h> |
#include <asm/arch/at32ap7000.h> |
#include <asm/arch/board.h> |
#include <asm/arch/init.h> |
#include <asm/arch/portmux.h> |
/* Initialized by bootloader-specific startup code. */ |
struct tag *bootloader_tags __initdata; |
struct eth_addr { |
u8 addr[6]; |
}; |
static struct eth_addr __initdata hw_addr[2]; |
static struct eth_platform_data __initdata eth_data[2]; |
static struct spi_board_info spi0_board_info[] __initdata = { |
{ |
.modalias = "mtd_dataflash", |
.max_speed_hz = 10000000, |
.chip_select = 0, |
}, |
}; |
static struct mci_platform_data __initdata mci0_data = { |
.detect_pin = GPIO_PIN_PC(25), |
.wp_pin = GPIO_PIN_PE(0), |
}; |
/* |
* The next two functions should go away as the boot loader is |
* supposed to initialize the macb address registers with a valid |
* ethernet address. But we need to keep it around for a while until |
* we can be reasonably sure the boot loader does this. |
* |
* The phy_id is ignored as the driver will probe for it. |
*/ |
static int __init parse_tag_ethernet(struct tag *tag) |
{ |
int i; |
i = tag->u.ethernet.mac_index; |
if (i < ARRAY_SIZE(hw_addr)) |
memcpy(hw_addr[i].addr, tag->u.ethernet.hw_address, |
sizeof(hw_addr[i].addr)); |
return 0; |
} |
__tagtable(ATAG_ETHERNET, parse_tag_ethernet); |
static void __init set_hw_addr(struct platform_device *pdev) |
{ |
struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
const u8 *addr; |
void __iomem *regs; |
struct clk *pclk; |
if (!res) |
return; |
if (pdev->id >= ARRAY_SIZE(hw_addr)) |
return; |
addr = hw_addr[pdev->id].addr; |
if (!is_valid_ether_addr(addr)) |
return; |
/* |
* Since this is board-specific code, we'll cheat and use the |
* physical address directly as we happen to know that it's |
* the same as the virtual address. |
*/ |
regs = (void __iomem __force *)res->start; |
pclk = clk_get(&pdev->dev, "pclk"); |
if (!pclk) |
return; |
clk_enable(pclk); |
__raw_writel((addr[3] << 24) | (addr[2] << 16) |
| (addr[1] << 8) | addr[0], regs + 0x98); |
__raw_writel((addr[5] << 8) | addr[4], regs + 0x9c); |
clk_disable(pclk); |
clk_put(pclk); |
} |
void __init setup_board(void) |
{ |
at32_map_usart(1, 0); /* USART 1: /dev/ttyS0, DB9 */ |
at32_map_usart(3, 1); /* USART 3: /dev/ttyS1 */ |
at32_setup_serial_console(0); |
} |
static const struct gpio_led ngw_leds[] = { |
{ .name = "sys", .gpio = GPIO_PIN_PA(16), .active_low = 1, |
.default_trigger = "heartbeat", |
}, |
{ .name = "a", .gpio = GPIO_PIN_PA(19), .active_low = 1, }, |
{ .name = "b", .gpio = GPIO_PIN_PE(19), .active_low = 1, }, |
}; |
static const struct gpio_led_platform_data ngw_led_data = { |
.num_leds = ARRAY_SIZE(ngw_leds), |
.leds = (void *) ngw_leds, |
}; |
static struct platform_device ngw_gpio_leds = { |
.name = "leds-gpio", |
.id = -1, |
.dev = { |
.platform_data = (void *) &ngw_led_data, |
} |
}; |
#ifdef CONFIG_BOARD_ATNGW100_I2C_GPIO |
static struct i2c_gpio_platform_data i2c_gpio_data = { |
.sda_pin = GPIO_PIN_PA(6), |
.scl_pin = GPIO_PIN_PA(7), |
}; |
static struct platform_device i2c_gpio_device = { |
.name = "i2c-gpio", |
.id = 0, |
.dev = { |
.platform_data = &i2c_gpio_data, |
}, |
}; |
#endif |
static int __init atngw100_init(void) |
{ |
unsigned i; |
/* |
* ATNGW100 uses 16-bit SDRAM interface, so we don't need to |
* reserve any pins for it. |
*/ |
at32_add_system_devices(); |
at32_add_device_usart(0); |
at32_add_device_usart(1); |
set_hw_addr(at32_add_device_eth(0, ð_data[0])); |
set_hw_addr(at32_add_device_eth(1, ð_data[1])); |
at32_add_device_spi(0, spi0_board_info, ARRAY_SIZE(spi0_board_info)); |
at32_add_device_mci(0, &mci0_data); |
at32_add_device_usba(0, NULL); |
for (i = 0; i < ARRAY_SIZE(ngw_leds); i++) { |
at32_select_gpio(ngw_leds[i].gpio, |
AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH); |
} |
platform_device_register(&ngw_gpio_leds); |
#ifdef CONFIG_BOARD_ATNGW100_I2C_GPIO |
at32_select_gpio(i2c_gpio_data.sda_pin, 0); |
at32_select_gpio(i2c_gpio_data.scl_pin, 0); |
platform_device_register(&i2c_gpio_device); |
#else |
at32_add_device_twi(0); |
#endif |
at32_add_device_ac97c (0); |
return 0; |
} |
postcore_initcall(atngw100_init); |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/programy/C/avr32/linux-kernel/config |
---|
0,0 → 1,1052 |
# |
# Automatically generated make config: don't edit |
# Linux kernel version: 2.6.22.atmel.2 |
# Wed Aug 8 23:52:11 2007 |
# |
CONFIG_AVR32=y |
CONFIG_GENERIC_GPIO=y |
CONFIG_GENERIC_HARDIRQS=y |
CONFIG_HARDIRQS_SW_RESEND=y |
CONFIG_GENERIC_IRQ_PROBE=y |
CONFIG_RWSEM_GENERIC_SPINLOCK=y |
CONFIG_GENERIC_TIME=y |
# CONFIG_ARCH_HAS_ILOG2_U32 is not set |
# CONFIG_ARCH_HAS_ILOG2_U64 is not set |
CONFIG_GENERIC_HWEIGHT=y |
CONFIG_GENERIC_CALIBRATE_DELAY=y |
CONFIG_GENERIC_BUG=y |
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" |
# |
# Code maturity level options |
# |
CONFIG_EXPERIMENTAL=y |
CONFIG_BROKEN_ON_SMP=y |
CONFIG_INIT_ENV_ARG_LIMIT=32 |
# |
# General setup |
# |
CONFIG_LOCALVERSION="-kaklik" |
# CONFIG_LOCALVERSION_AUTO is not set |
CONFIG_SWAP=y |
CONFIG_SYSVIPC=y |
# CONFIG_IPC_NS is not set |
CONFIG_SYSVIPC_SYSCTL=y |
CONFIG_POSIX_MQUEUE=y |
CONFIG_BSD_PROCESS_ACCT=y |
CONFIG_BSD_PROCESS_ACCT_V3=y |
# CONFIG_TASKSTATS is not set |
# CONFIG_UTS_NS is not set |
# CONFIG_AUDIT is not set |
# CONFIG_IKCONFIG is not set |
CONFIG_LOG_BUF_SHIFT=14 |
CONFIG_SYSFS_DEPRECATED=y |
# CONFIG_RELAY is not set |
CONFIG_BLK_DEV_INITRD=y |
CONFIG_INITRAMFS_SOURCE="" |
CONFIG_CC_OPTIMIZE_FOR_SIZE=y |
CONFIG_SYSCTL=y |
CONFIG_EMBEDDED=y |
# CONFIG_SYSCTL_SYSCALL is not set |
CONFIG_KALLSYMS=y |
# CONFIG_KALLSYMS_EXTRA_PASS is not set |
CONFIG_HOTPLUG=y |
CONFIG_PRINTK=y |
CONFIG_BUG=y |
CONFIG_ELF_CORE=y |
# CONFIG_BASE_FULL is not set |
CONFIG_FUTEX=y |
CONFIG_ANON_INODES=y |
CONFIG_EPOLL=y |
CONFIG_SIGNALFD=y |
CONFIG_TIMERFD=y |
CONFIG_EVENTFD=y |
CONFIG_SHMEM=y |
CONFIG_VM_EVENT_COUNTERS=y |
# CONFIG_SLUB_DEBUG is not set |
# CONFIG_SLAB is not set |
CONFIG_SLUB=y |
# CONFIG_SLOB is not set |
CONFIG_RT_MUTEXES=y |
# CONFIG_TINY_SHMEM is not set |
CONFIG_BASE_SMALL=1 |
# |
# Loadable module support |
# |
CONFIG_MODULES=y |
CONFIG_MODULE_UNLOAD=y |
CONFIG_MODULE_FORCE_UNLOAD=y |
# CONFIG_MODVERSIONS is not set |
# CONFIG_MODULE_SRCVERSION_ALL is not set |
CONFIG_KMOD=y |
# |
# Block layer |
# |
CONFIG_BLOCK=y |
# CONFIG_LBD is not set |
# CONFIG_BLK_DEV_IO_TRACE is not set |
# CONFIG_LSF is not set |
# |
# IO Schedulers |
# |
CONFIG_IOSCHED_NOOP=y |
# CONFIG_IOSCHED_AS is not set |
# CONFIG_IOSCHED_DEADLINE is not set |
CONFIG_IOSCHED_CFQ=y |
# CONFIG_DEFAULT_AS is not set |
# CONFIG_DEFAULT_DEADLINE is not set |
CONFIG_DEFAULT_CFQ=y |
# CONFIG_DEFAULT_NOOP is not set |
CONFIG_DEFAULT_IOSCHED="cfq" |
# |
# System Type and features |
# |
CONFIG_SUBARCH_AVR32B=y |
CONFIG_MMU=y |
CONFIG_PERFORMANCE_COUNTERS=y |
CONFIG_PLATFORM_AT32AP=y |
CONFIG_CPU_AT32AP7000=y |
# CONFIG_BOARD_ATSTK1000 is not set |
CONFIG_BOARD_ATNGW100=y |
# CONFIG_BOARD_ATNGW100_I2C_GPIO is not set |
CONFIG_LOADER_U_BOOT=y |
# |
# Atmel AVR32 AP options |
# |
# CONFIG_AP7000_32_BIT_SMC is not set |
CONFIG_AP7000_16_BIT_SMC=y |
# CONFIG_AP7000_8_BIT_SMC is not set |
CONFIG_GPIO_DEV=y |
CONFIG_LOAD_ADDRESS=0x10000000 |
CONFIG_ENTRY_ADDRESS=0x90000000 |
CONFIG_PHYS_OFFSET=0x10000000 |
CONFIG_PREEMPT_NONE=y |
# CONFIG_PREEMPT_VOLUNTARY is not set |
# CONFIG_PREEMPT is not set |
# CONFIG_HAVE_ARCH_BOOTMEM_NODE is not set |
# CONFIG_ARCH_HAVE_MEMORY_PRESENT is not set |
# CONFIG_NEED_NODE_MEMMAP_SIZE is not set |
CONFIG_ARCH_FLATMEM_ENABLE=y |
# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set |
# CONFIG_ARCH_SPARSEMEM_ENABLE is not set |
CONFIG_SELECT_MEMORY_MODEL=y |
CONFIG_FLATMEM_MANUAL=y |
# CONFIG_DISCONTIGMEM_MANUAL is not set |
# CONFIG_SPARSEMEM_MANUAL is not set |
CONFIG_FLATMEM=y |
CONFIG_FLAT_NODE_MEM_MAP=y |
# CONFIG_SPARSEMEM_STATIC is not set |
CONFIG_SPLIT_PTLOCK_CPUS=4 |
# CONFIG_RESOURCES_64BIT is not set |
CONFIG_ZONE_DMA_FLAG=0 |
# CONFIG_OWNERSHIP_TRACE is not set |
CONFIG_DW_DMAC=y |
# CONFIG_HZ_100 is not set |
CONFIG_HZ_250=y |
# CONFIG_HZ_300 is not set |
# CONFIG_HZ_1000 is not set |
CONFIG_HZ=250 |
CONFIG_CMDLINE="" |
# |
# Power managment options |
# |
# |
# CPU Frequency scaling |
# |
# CONFIG_CPU_FREQ is not set |
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set |
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set |
# |
# Bus options |
# |
# CONFIG_ARCH_SUPPORTS_MSI is not set |
# |
# PCCARD (PCMCIA/CardBus) support |
# |
# CONFIG_PCCARD is not set |
# |
# Executable file formats |
# |
CONFIG_BINFMT_ELF=y |
# CONFIG_BINFMT_MISC is not set |
# |
# Networking |
# |
CONFIG_NET=y |
# |
# Networking options |
# |
CONFIG_PACKET=y |
CONFIG_PACKET_MMAP=y |
CONFIG_UNIX=y |
CONFIG_XFRM=y |
# CONFIG_XFRM_USER is not set |
# CONFIG_XFRM_SUB_POLICY is not set |
# CONFIG_XFRM_MIGRATE is not set |
CONFIG_NET_KEY=y |
# CONFIG_NET_KEY_MIGRATE is not set |
CONFIG_INET=y |
CONFIG_IP_MULTICAST=y |
# CONFIG_IP_ADVANCED_ROUTER is not set |
# CONFIG_ASK_IP_FIB_HASH is not set |
# CONFIG_IP_FIB_TRIE is not set |
CONFIG_IP_FIB_HASH=y |
CONFIG_IP_PNP=y |
CONFIG_IP_PNP_DHCP=y |
# CONFIG_IP_PNP_BOOTP is not set |
# CONFIG_IP_PNP_RARP is not set |
# CONFIG_NET_IPIP is not set |
# CONFIG_NET_IPGRE is not set |
# CONFIG_IP_MROUTE is not set |
# CONFIG_ARPD is not set |
# CONFIG_SYN_COOKIES is not set |
# CONFIG_INET_AH is not set |
# CONFIG_INET_ESP is not set |
# CONFIG_INET_IPCOMP is not set |
# CONFIG_INET_XFRM_TUNNEL is not set |
# CONFIG_INET_TUNNEL is not set |
# CONFIG_INET_XFRM_MODE_TRANSPORT is not set |
# CONFIG_INET_XFRM_MODE_TUNNEL is not set |
# CONFIG_INET_XFRM_MODE_BEET is not set |
CONFIG_INET_DIAG=y |
CONFIG_INET_TCP_DIAG=y |
# CONFIG_TCP_CONG_ADVANCED is not set |
CONFIG_TCP_CONG_CUBIC=y |
CONFIG_DEFAULT_TCP_CONG="cubic" |
# CONFIG_TCP_MD5SIG is not set |
# CONFIG_IPV6 is not set |
# CONFIG_INET6_XFRM_TUNNEL is not set |
# CONFIG_INET6_TUNNEL is not set |
# CONFIG_NETWORK_SECMARK is not set |
# CONFIG_NETFILTER is not set |
# CONFIG_IP_DCCP is not set |
# CONFIG_IP_SCTP is not set |
# CONFIG_SCTP_HMAC_NONE is not set |
# CONFIG_SCTP_HMAC_SHA1 is not set |
# CONFIG_SCTP_HMAC_MD5 is not set |
# CONFIG_TIPC is not set |
# CONFIG_ATM is not set |
# CONFIG_BRIDGE is not set |
# CONFIG_VLAN_8021Q is not set |
# CONFIG_DECNET is not set |
# CONFIG_LLC2 is not set |
# CONFIG_IPX is not set |
# CONFIG_ATALK is not set |
# CONFIG_X25 is not set |
# CONFIG_LAPB is not set |
# CONFIG_ECONET is not set |
# CONFIG_WAN_ROUTER is not set |
# |
# QoS and/or fair queueing |
# |
# CONFIG_NET_SCHED is not set |
# |
# Network testing |
# |
# CONFIG_NET_PKTGEN is not set |
# CONFIG_HAMRADIO is not set |
# CONFIG_IRDA is not set |
# CONFIG_BT is not set |
# CONFIG_AF_RXRPC is not set |
# |
# Wireless |
# |
# CONFIG_CFG80211 is not set |
# CONFIG_WIRELESS_EXT is not set |
# CONFIG_MAC80211 is not set |
# CONFIG_IEEE80211 is not set |
# CONFIG_RFKILL is not set |
# |
# Device Drivers |
# |
# |
# Generic Driver Options |
# |
CONFIG_STANDALONE=y |
# CONFIG_PREVENT_FIRMWARE_BUILD is not set |
# CONFIG_FW_LOADER is not set |
# CONFIG_SYS_HYPERVISOR is not set |
# |
# Connector - unified userspace <-> kernelspace linker |
# |
# CONFIG_CONNECTOR is not set |
CONFIG_MTD=y |
# CONFIG_MTD_DEBUG is not set |
# CONFIG_MTD_CONCAT is not set |
CONFIG_MTD_PARTITIONS=y |
# CONFIG_MTD_REDBOOT_PARTS is not set |
CONFIG_MTD_CMDLINE_PARTS=y |
# |
# User Modules And Translation Layers |
# |
CONFIG_MTD_CHAR=y |
CONFIG_MTD_BLKDEVS=y |
CONFIG_MTD_BLOCK=y |
# CONFIG_FTL is not set |
# CONFIG_NFTL is not set |
# CONFIG_INFTL is not set |
# CONFIG_RFD_FTL is not set |
# CONFIG_SSFDC is not set |
# |
# RAM/ROM/Flash chip drivers |
# |
CONFIG_MTD_CFI=y |
# CONFIG_MTD_JEDECPROBE is not set |
CONFIG_MTD_GEN_PROBE=y |
# CONFIG_MTD_CFI_ADV_OPTIONS is not set |
CONFIG_MTD_MAP_BANK_WIDTH_1=y |
CONFIG_MTD_MAP_BANK_WIDTH_2=y |
CONFIG_MTD_MAP_BANK_WIDTH_4=y |
# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set |
# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set |
# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set |
CONFIG_MTD_CFI_I1=y |
CONFIG_MTD_CFI_I2=y |
# CONFIG_MTD_CFI_I4 is not set |
# CONFIG_MTD_CFI_I8 is not set |
# CONFIG_MTD_CFI_INTELEXT is not set |
CONFIG_MTD_CFI_AMDSTD=y |
# CONFIG_MTD_CFI_STAA is not set |
CONFIG_MTD_CFI_UTIL=y |
# CONFIG_MTD_RAM is not set |
# CONFIG_MTD_ROM is not set |
# CONFIG_MTD_ABSENT is not set |
# |
# Mapping drivers for chip access |
# |
# CONFIG_MTD_COMPLEX_MAPPINGS is not set |
CONFIG_MTD_PHYSMAP=y |
CONFIG_MTD_PHYSMAP_START=0x80000000 |
CONFIG_MTD_PHYSMAP_LEN=0x0 |
CONFIG_MTD_PHYSMAP_BANKWIDTH=2 |
# CONFIG_MTD_PLATRAM is not set |
# |
# Self-contained MTD device drivers |
# |
CONFIG_MTD_DATAFLASH=y |
# CONFIG_MTD_M25P80 is not set |
# CONFIG_MTD_SLRAM is not set |
# CONFIG_MTD_PHRAM is not set |
# CONFIG_MTD_MTDRAM is not set |
# CONFIG_MTD_BLOCK2MTD is not set |
# |
# Disk-On-Chip Device Drivers |
# |
# CONFIG_MTD_DOC2000 is not set |
# CONFIG_MTD_DOC2001 is not set |
# CONFIG_MTD_DOC2001PLUS is not set |
# CONFIG_MTD_NAND is not set |
# CONFIG_MTD_ONENAND is not set |
# |
# UBI - Unsorted block images |
# |
# CONFIG_MTD_UBI is not set |
# |
# Parallel port support |
# |
# CONFIG_PARPORT is not set |
# |
# Plug and Play support |
# |
# CONFIG_PNPACPI is not set |
# |
# Block devices |
# |
# CONFIG_BLK_DEV_COW_COMMON is not set |
CONFIG_BLK_DEV_LOOP=m |
# CONFIG_BLK_DEV_CRYPTOLOOP is not set |
CONFIG_BLK_DEV_NBD=m |
CONFIG_BLK_DEV_RAM=m |
CONFIG_BLK_DEV_RAM_COUNT=16 |
CONFIG_BLK_DEV_RAM_SIZE=4096 |
CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 |
# CONFIG_CDROM_PKTCDVD is not set |
# CONFIG_ATA_OVER_ETH is not set |
# |
# Misc devices |
# |
# CONFIG_IDE is not set |
# |
# SCSI device support |
# |
# CONFIG_RAID_ATTRS is not set |
# CONFIG_SCSI is not set |
# CONFIG_SCSI_NETLINK is not set |
# CONFIG_ATA is not set |
# |
# Multi-device support (RAID and LVM) |
# |
# CONFIG_MD is not set |
# |
# Network device support |
# |
CONFIG_NETDEVICES=y |
# CONFIG_DUMMY is not set |
# CONFIG_BONDING is not set |
# CONFIG_EQUALIZER is not set |
CONFIG_TUN=m |
CONFIG_PHYLIB=y |
# |
# MII PHY device drivers |
# |
# CONFIG_MARVELL_PHY is not set |
# CONFIG_DAVICOM_PHY is not set |
# CONFIG_QSEMI_PHY is not set |
# CONFIG_LXT_PHY is not set |
# CONFIG_CICADA_PHY is not set |
# CONFIG_VITESSE_PHY is not set |
# CONFIG_SMSC_PHY is not set |
# CONFIG_BROADCOM_PHY is not set |
# CONFIG_FIXED_PHY is not set |
# |
# Ethernet (10 or 100Mbit) |
# |
CONFIG_NET_ETHERNET=y |
# CONFIG_MII is not set |
CONFIG_MACB=y |
# CONFIG_NETDEV_1000 is not set |
# CONFIG_NETDEV_10000 is not set |
# |
# Wireless LAN |
# |
# CONFIG_WLAN_PRE80211 is not set |
# CONFIG_WLAN_80211 is not set |
# CONFIG_WAN is not set |
CONFIG_PPP=m |
# CONFIG_PPP_MULTILINK is not set |
CONFIG_PPP_FILTER=y |
CONFIG_PPP_ASYNC=m |
# CONFIG_PPP_SYNC_TTY is not set |
CONFIG_PPP_DEFLATE=m |
CONFIG_PPP_BSDCOMP=m |
CONFIG_PPP_MPPE=m |
CONFIG_PPPOE=m |
# CONFIG_SLIP is not set |
CONFIG_SLHC=m |
# CONFIG_SHAPER is not set |
# CONFIG_NETCONSOLE is not set |
# CONFIG_NETPOLL is not set |
# CONFIG_NET_POLL_CONTROLLER is not set |
# |
# ISDN subsystem |
# |
# CONFIG_ISDN is not set |
# |
# Telephony Support |
# |
# CONFIG_PHONE is not set |
# |
# Input device support |
# |
# CONFIG_INPUT is not set |
# |
# Hardware I/O ports |
# |
# CONFIG_SERIO is not set |
# CONFIG_GAMEPORT is not set |
# |
# Character devices |
# |
# CONFIG_VT is not set |
# CONFIG_SERIAL_NONSTANDARD is not set |
# |
# Serial drivers |
# |
# CONFIG_SERIAL_8250 is not set |
# |
# Non-8250 serial port support |
# |
CONFIG_SERIAL_ATMEL=y |
CONFIG_SERIAL_ATMEL_CONSOLE=y |
# CONFIG_SERIAL_ATMEL_TTYAT is not set |
CONFIG_SERIAL_CORE=y |
CONFIG_SERIAL_CORE_CONSOLE=y |
CONFIG_UNIX98_PTYS=y |
# CONFIG_LEGACY_PTYS is not set |
# |
# IPMI |
# |
# CONFIG_IPMI_HANDLER is not set |
CONFIG_WATCHDOG=y |
# CONFIG_WATCHDOG_NOWAYOUT is not set |
# |
# Watchdog Device Drivers |
# |
# CONFIG_SOFT_WATCHDOG is not set |
CONFIG_AT32AP700X_WDT=y |
CONFIG_AT32AP700X_WDT_TIMEOUT=2 |
# CONFIG_HW_RANDOM is not set |
# CONFIG_RTC is not set |
# CONFIG_GEN_RTC is not set |
# CONFIG_R3964 is not set |
# CONFIG_RAW_DRIVER is not set |
# |
# TPM devices |
# |
# CONFIG_TCG_TPM is not set |
CONFIG_I2C=y |
CONFIG_I2C_BOARDINFO=y |
CONFIG_I2C_CHARDEV=y |
# |
# I2C Algorithms |
# |
CONFIG_I2C_ALGOBIT=y |
# CONFIG_I2C_ALGOPCF is not set |
# CONFIG_I2C_ALGOPCA is not set |
# |
# I2C Hardware Bus support |
# |
CONFIG_I2C_ATMELTWI=y |
CONFIG_I2C_ATMELTWI_BAUDRATE=100000 |
# CONFIG_I2C_GPIO is not set |
# CONFIG_I2C_OCORES is not set |
# CONFIG_I2C_PARPORT_LIGHT is not set |
# CONFIG_I2C_SIMTEC is not set |
# CONFIG_I2C_STUB is not set |
# |
# Miscellaneous I2C Chip support |
# |
# CONFIG_SENSORS_DS1337 is not set |
# CONFIG_SENSORS_DS1374 is not set |
# CONFIG_SENSORS_EEPROM is not set |
# CONFIG_SENSORS_PCF8574 is not set |
# CONFIG_SENSORS_PCA9539 is not set |
# CONFIG_SENSORS_PCF8591 is not set |
# CONFIG_SENSORS_MAX6875 is not set |
CONFIG_I2C_DEBUG_CORE=y |
CONFIG_I2C_DEBUG_ALGO=y |
CONFIG_I2C_DEBUG_BUS=y |
CONFIG_I2C_DEBUG_CHIP=y |
# |
# SPI support |
# |
CONFIG_SPI=y |
CONFIG_SPI_MASTER=y |
# |
# SPI Master Controller Drivers |
# |
CONFIG_SPI_ATMEL=y |
# CONFIG_SPI_BITBANG is not set |
# |
# SPI Protocol Masters |
# |
# CONFIG_SPI_AT25 is not set |
CONFIG_SPI_SPIDEV=m |
# |
# Dallas's 1-wire bus |
# |
# CONFIG_W1 is not set |
# CONFIG_HWMON is not set |
# |
# Multifunction device drivers |
# |
# CONFIG_MFD_SM501 is not set |
# |
# Multimedia devices |
# |
# CONFIG_VIDEO_DEV is not set |
# CONFIG_DVB_CORE is not set |
# CONFIG_DAB is not set |
# |
# Graphics support |
# |
# CONFIG_BACKLIGHT_LCD_SUPPORT is not set |
# |
# Display device support |
# |
# CONFIG_DISPLAY_SUPPORT is not set |
# CONFIG_VGASTATE is not set |
# CONFIG_FB is not set |
# |
# Sound |
# |
CONFIG_SOUND=y |
# |
# Advanced Linux Sound Architecture |
# |
CONFIG_SND=y |
CONFIG_SND_TIMER=y |
CONFIG_SND_PCM=y |
# CONFIG_SND_SEQUENCER is not set |
CONFIG_SND_OSSEMUL=y |
CONFIG_SND_MIXER_OSS=y |
CONFIG_SND_PCM_OSS=y |
CONFIG_SND_PCM_OSS_PLUGINS=y |
# CONFIG_SND_DYNAMIC_MINORS is not set |
CONFIG_SND_SUPPORT_OLD_API=y |
CONFIG_SND_VERBOSE_PROCFS=y |
CONFIG_SND_VERBOSE_PRINTK=y |
CONFIG_SND_DEBUG=y |
CONFIG_SND_DEBUG_DETECT=y |
# CONFIG_SND_PCM_XRUN_DEBUG is not set |
# |
# Generic devices |
# |
CONFIG_SND_AC97_CODEC=m |
# CONFIG_SND_DUMMY is not set |
# CONFIG_SND_MTPAV is not set |
# CONFIG_SND_SERIAL_U16550 is not set |
# CONFIG_SND_MPU401 is not set |
# |
# ALSA AVR32 devices |
# |
CONFIG_SND_ATMEL_AC97=m |
# CONFIG_SND_ATMEL_AC97_USE_ALSA_MALLOC_CALLS is not set |
# CONFIG_SND_ATMEL_AC97C_USE_PDC is not set |
# |
# System on Chip audio support |
# |
# CONFIG_SND_SOC is not set |
# |
# Open Sound System |
# |
# CONFIG_SOUND_PRIME is not set |
CONFIG_AC97_BUS=m |
# |
# USB support |
# |
# CONFIG_USB_ARCH_HAS_HCD is not set |
# CONFIG_USB_ARCH_HAS_OHCI is not set |
# CONFIG_USB_ARCH_HAS_EHCI is not set |
# |
# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' |
# |
# |
# USB Gadget Support |
# |
CONFIG_USB_GADGET=y |
# CONFIG_USB_GADGET_DEBUG_FILES is not set |
CONFIG_USB_GADGET_SELECTED=y |
# CONFIG_USB_GADGET_FSL_USB2 is not set |
# CONFIG_USB_GADGET_NET2280 is not set |
# CONFIG_USB_GADGET_PXA2XX is not set |
# CONFIG_USB_GADGET_GOKU is not set |
# CONFIG_USB_GADGET_LH7A40X is not set |
CONFIG_USB_GADGET_ATMEL_USBA=y |
CONFIG_USB_ATMEL_USBA=y |
# CONFIG_USB_GADGET_OMAP is not set |
# CONFIG_USB_GADGET_AT91 is not set |
# CONFIG_USB_GADGET_DUMMY_HCD is not set |
CONFIG_USB_GADGET_DUALSPEED=y |
CONFIG_USB_ZERO=m |
CONFIG_USB_ETH=m |
CONFIG_USB_ETH_RNDIS=y |
CONFIG_USB_GADGETFS=m |
CONFIG_USB_FILE_STORAGE=m |
# CONFIG_USB_FILE_STORAGE_TEST is not set |
CONFIG_USB_G_SERIAL=m |
# CONFIG_USB_MIDI_GADGET is not set |
CONFIG_MMC=y |
# CONFIG_MMC_DEBUG is not set |
# CONFIG_MMC_UNSAFE_RESUME is not set |
# |
# MMC/SD Card Drivers |
# |
CONFIG_MMC_BLOCK=y |
# |
# MMC/SD Host Controller Drivers |
# |
CONFIG_MMC_ATMELMCI=y |
# |
# LED devices |
# |
CONFIG_NEW_LEDS=y |
CONFIG_LEDS_CLASS=y |
# |
# LED drivers |
# |
CONFIG_LEDS_GPIO=y |
# |
# LED Triggers |
# |
CONFIG_LEDS_TRIGGERS=y |
CONFIG_LEDS_TRIGGER_TIMER=y |
CONFIG_LEDS_TRIGGER_HEARTBEAT=y |
# |
# InfiniBand support |
# |
# |
# EDAC - error detection and reporting (RAS) (EXPERIMENTAL) |
# |
# |
# Real Time Clock |
# |
CONFIG_RTC_LIB=y |
CONFIG_RTC_CLASS=y |
CONFIG_RTC_HCTOSYS=y |
CONFIG_RTC_HCTOSYS_DEVICE="rtc0" |
# CONFIG_RTC_DEBUG is not set |
# |
# RTC interfaces |
# |
CONFIG_RTC_INTF_SYSFS=y |
CONFIG_RTC_INTF_PROC=y |
CONFIG_RTC_INTF_DEV=y |
# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set |
# CONFIG_RTC_DRV_TEST is not set |
# |
# I2C RTC drivers |
# |
# CONFIG_RTC_DRV_DS1307 is not set |
# CONFIG_RTC_DRV_DS1672 is not set |
# CONFIG_RTC_DRV_MAX6900 is not set |
# CONFIG_RTC_DRV_RS5C372 is not set |
# CONFIG_RTC_DRV_ISL1208 is not set |
# CONFIG_RTC_DRV_X1205 is not set |
# CONFIG_RTC_DRV_PCF8563 is not set |
# CONFIG_RTC_DRV_PCF8583 is not set |
# |
# SPI RTC drivers |
# |
# CONFIG_RTC_DRV_RS5C348 is not set |
# CONFIG_RTC_DRV_MAX6902 is not set |
# |
# Platform RTC drivers |
# |
# CONFIG_RTC_DRV_DS1553 is not set |
# CONFIG_RTC_DRV_DS1742 is not set |
# CONFIG_RTC_DRV_M48T86 is not set |
# CONFIG_RTC_DRV_V3020 is not set |
# |
# on-CPU RTC drivers |
# |
CONFIG_RTC_DRV_AT32AP700X=y |
# |
# DMA Engine support |
# |
# CONFIG_DMA_ENGINE is not set |
# |
# DMA Clients |
# |
# |
# DMA Devices |
# |
# |
# File systems |
# |
CONFIG_EXT2_FS=y |
# CONFIG_EXT2_FS_XATTR is not set |
# CONFIG_EXT2_FS_XIP is not set |
CONFIG_EXT3_FS=y |
# CONFIG_EXT3_FS_XATTR is not set |
# CONFIG_EXT4DEV_FS is not set |
CONFIG_JBD=y |
# CONFIG_JBD_DEBUG is not set |
# CONFIG_REISERFS_FS is not set |
# CONFIG_JFS_FS is not set |
# CONFIG_FS_POSIX_ACL is not set |
# CONFIG_XFS_FS is not set |
# CONFIG_GFS2_FS is not set |
# CONFIG_OCFS2_FS is not set |
# CONFIG_MINIX_FS is not set |
# CONFIG_ROMFS_FS is not set |
CONFIG_INOTIFY=y |
CONFIG_INOTIFY_USER=y |
# CONFIG_QUOTA is not set |
# CONFIG_DNOTIFY is not set |
# CONFIG_AUTOFS_FS is not set |
# CONFIG_AUTOFS4_FS is not set |
CONFIG_FUSE_FS=m |
# |
# CD-ROM/DVD Filesystems |
# |
# CONFIG_ISO9660_FS is not set |
# CONFIG_UDF_FS is not set |
# |
# DOS/FAT/NT Filesystems |
# |
CONFIG_FAT_FS=m |
CONFIG_MSDOS_FS=m |
CONFIG_VFAT_FS=m |
CONFIG_FAT_DEFAULT_CODEPAGE=850 |
CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" |
# CONFIG_NTFS_FS is not set |
# |
# Pseudo filesystems |
# |
CONFIG_PROC_FS=y |
# CONFIG_PROC_KCORE is not set |
CONFIG_PROC_SYSCTL=y |
CONFIG_SYSFS=y |
CONFIG_TMPFS=y |
# CONFIG_TMPFS_POSIX_ACL is not set |
# CONFIG_HUGETLB_PAGE is not set |
CONFIG_RAMFS=y |
CONFIG_CONFIGFS_FS=y |
# |
# Miscellaneous filesystems |
# |
# CONFIG_ADFS_FS is not set |
# CONFIG_AFFS_FS is not set |
# CONFIG_HFS_FS is not set |
# CONFIG_HFSPLUS_FS is not set |
# CONFIG_BEFS_FS is not set |
# CONFIG_BFS_FS is not set |
# CONFIG_EFS_FS is not set |
CONFIG_JFFS2_FS=y |
CONFIG_JFFS2_FS_DEBUG=0 |
CONFIG_JFFS2_FS_WRITEBUFFER=y |
# CONFIG_JFFS2_SUMMARY is not set |
# CONFIG_JFFS2_FS_XATTR is not set |
# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set |
CONFIG_JFFS2_ZLIB=y |
CONFIG_JFFS2_RTIME=y |
# CONFIG_JFFS2_RUBIN is not set |
# CONFIG_CRAMFS is not set |
# CONFIG_VXFS_FS is not set |
# CONFIG_HPFS_FS is not set |
# CONFIG_QNX4FS_FS is not set |
# CONFIG_SYSV_FS is not set |
# CONFIG_UFS_FS is not set |
# |
# Network File Systems |
# |
CONFIG_NFS_FS=y |
CONFIG_NFS_V3=y |
# CONFIG_NFS_V3_ACL is not set |
# CONFIG_NFS_V4 is not set |
# CONFIG_NFS_DIRECTIO is not set |
# CONFIG_NFSD is not set |
CONFIG_ROOT_NFS=y |
CONFIG_LOCKD=y |
CONFIG_LOCKD_V4=y |
CONFIG_NFS_COMMON=y |
CONFIG_SUNRPC=y |
# CONFIG_SUNRPC_BIND34 is not set |
# CONFIG_RPCSEC_GSS_KRB5 is not set |
# CONFIG_RPCSEC_GSS_SPKM3 is not set |
CONFIG_SMB_FS=m |
# CONFIG_SMB_NLS_DEFAULT is not set |
CONFIG_CIFS=m |
# CONFIG_CIFS_STATS is not set |
# CONFIG_CIFS_WEAK_PW_HASH is not set |
# CONFIG_CIFS_XATTR is not set |
# CONFIG_CIFS_DEBUG2 is not set |
# CONFIG_CIFS_EXPERIMENTAL is not set |
# CONFIG_NCP_FS is not set |
# CONFIG_CODA_FS is not set |
# CONFIG_AFS_FS is not set |
# CONFIG_9P_FS is not set |
# |
# Partition Types |
# |
# CONFIG_PARTITION_ADVANCED is not set |
CONFIG_MSDOS_PARTITION=y |
# |
# Native Language Support |
# |
CONFIG_NLS=y |
CONFIG_NLS_DEFAULT="iso8859-1" |
# CONFIG_NLS_CODEPAGE_437 is not set |
# CONFIG_NLS_CODEPAGE_737 is not set |
# CONFIG_NLS_CODEPAGE_775 is not set |
CONFIG_NLS_CODEPAGE_850=y |
# CONFIG_NLS_CODEPAGE_852 is not set |
# CONFIG_NLS_CODEPAGE_855 is not set |
# CONFIG_NLS_CODEPAGE_857 is not set |
# CONFIG_NLS_CODEPAGE_860 is not set |
# CONFIG_NLS_CODEPAGE_861 is not set |
# CONFIG_NLS_CODEPAGE_862 is not set |
# CONFIG_NLS_CODEPAGE_863 is not set |
# CONFIG_NLS_CODEPAGE_864 is not set |
# CONFIG_NLS_CODEPAGE_865 is not set |
# CONFIG_NLS_CODEPAGE_866 is not set |
# CONFIG_NLS_CODEPAGE_869 is not set |
# CONFIG_NLS_CODEPAGE_936 is not set |
# CONFIG_NLS_CODEPAGE_950 is not set |
# CONFIG_NLS_CODEPAGE_932 is not set |
# CONFIG_NLS_CODEPAGE_949 is not set |
# CONFIG_NLS_CODEPAGE_874 is not set |
# CONFIG_NLS_ISO8859_8 is not set |
# CONFIG_NLS_CODEPAGE_1250 is not set |
# CONFIG_NLS_CODEPAGE_1251 is not set |
# CONFIG_NLS_ASCII is not set |
CONFIG_NLS_ISO8859_1=y |
# CONFIG_NLS_ISO8859_2 is not set |
# CONFIG_NLS_ISO8859_3 is not set |
# CONFIG_NLS_ISO8859_4 is not set |
# CONFIG_NLS_ISO8859_5 is not set |
# CONFIG_NLS_ISO8859_6 is not set |
# CONFIG_NLS_ISO8859_7 is not set |
# CONFIG_NLS_ISO8859_9 is not set |
# CONFIG_NLS_ISO8859_13 is not set |
# CONFIG_NLS_ISO8859_14 is not set |
# CONFIG_NLS_ISO8859_15 is not set |
# CONFIG_NLS_KOI8_R is not set |
# CONFIG_NLS_KOI8_U is not set |
CONFIG_NLS_UTF8=y |
# |
# Distributed Lock Manager |
# |
# CONFIG_DLM is not set |
# |
# Kernel hacking |
# |
CONFIG_TRACE_IRQFLAGS_SUPPORT=y |
# CONFIG_PRINTK_TIME is not set |
CONFIG_ENABLE_MUST_CHECK=y |
# CONFIG_MAGIC_SYSRQ is not set |
# CONFIG_UNUSED_SYMBOLS is not set |
# CONFIG_DEBUG_FS is not set |
# CONFIG_HEADERS_CHECK is not set |
# CONFIG_DEBUG_KERNEL is not set |
# CONFIG_DEBUG_BUGVERBOSE is not set |
# |
# Security options |
# |
# CONFIG_KEYS is not set |
# CONFIG_SECURITY is not set |
# |
# Cryptographic options |
# |
CONFIG_CRYPTO=y |
CONFIG_CRYPTO_ALGAPI=y |
CONFIG_CRYPTO_BLKCIPHER=y |
CONFIG_CRYPTO_HASH=y |
CONFIG_CRYPTO_MANAGER=y |
CONFIG_CRYPTO_HMAC=y |
# CONFIG_CRYPTO_XCBC is not set |
# CONFIG_CRYPTO_NULL is not set |
# CONFIG_CRYPTO_MD4 is not set |
CONFIG_CRYPTO_MD5=y |
CONFIG_CRYPTO_SHA1=y |
# CONFIG_CRYPTO_SHA256 is not set |
# CONFIG_CRYPTO_SHA512 is not set |
# CONFIG_CRYPTO_WP512 is not set |
# CONFIG_CRYPTO_TGR192 is not set |
# CONFIG_CRYPTO_GF128MUL is not set |
CONFIG_CRYPTO_ECB=m |
CONFIG_CRYPTO_CBC=y |
CONFIG_CRYPTO_PCBC=m |
# CONFIG_CRYPTO_LRW is not set |
# CONFIG_CRYPTO_CRYPTD is not set |
CONFIG_CRYPTO_DES=y |
# CONFIG_CRYPTO_FCRYPT is not set |
# CONFIG_CRYPTO_BLOWFISH is not set |
# CONFIG_CRYPTO_TWOFISH is not set |
# CONFIG_CRYPTO_SERPENT is not set |
# CONFIG_CRYPTO_AES is not set |
# CONFIG_CRYPTO_CAST5 is not set |
# CONFIG_CRYPTO_CAST6 is not set |
# CONFIG_CRYPTO_TEA is not set |
CONFIG_CRYPTO_ARC4=m |
# CONFIG_CRYPTO_KHAZAD is not set |
# CONFIG_CRYPTO_ANUBIS is not set |
CONFIG_CRYPTO_DEFLATE=y |
# CONFIG_CRYPTO_MICHAEL_MIC is not set |
# CONFIG_CRYPTO_CRC32C is not set |
# CONFIG_CRYPTO_CAMELLIA is not set |
# CONFIG_CRYPTO_TEST is not set |
# |
# Hardware crypto devices |
# |
# |
# Library routines |
# |
CONFIG_BITREVERSE=y |
CONFIG_CRC_CCITT=m |
# CONFIG_CRC16 is not set |
# CONFIG_CRC_ITU_T is not set |
CONFIG_CRC32=y |
# CONFIG_LIBCRC32C is not set |
CONFIG_ZLIB_INFLATE=y |
CONFIG_ZLIB_DEFLATE=y |
CONFIG_PLIST=y |
CONFIG_HAS_IOMEM=y |
CONFIG_HAS_IOPORT=y |
CONFIG_HAS_DMA=y |
/programy/C/avr32/SID/fftw3/compile |
---|
0,0 → 1,0 |
$ ./configure CC=avr32-linux-gcc --host=avr32 --with-gcc-arch=ap --disable-fortran --prefix=/usr/avr32-linux/ |
/programy/C/avr32/SID/sidd |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr32/SID/README |
---|
0,0 → 1,155 |
Installation and setup notes for sidd-0.93, 15th March 2005. |
------------------------------------------------------------ |
You have unpacked the tgz file and have 3 files:- |
* README - this one |
* sidd.c - source code |
* sidd.conf - a sample configuration file. |
Installation steps |
------------------ |
* 1/ |
You will need FFTW3 from www.fftw.org, if not already installed. |
* 2/ |
Compile the sidd source with |
gcc -Wall -O4 -ffast-math -DPENTIUM -Wall -o sidd sidd.c -lfftw3 -lm |
which produces an executable sidd in the current directory. |
* 3/ |
Edit sidd.conf to suit your requirements. |
* 4/ |
Start sidd in verbose foreground mode with the command |
./sidd -vf |
* 5/ |
Examine the log file - it should look something like |
2005/03/15 20:03:17 logfile /root/sidd.log |
2005/03/15 20:03:17 los threshold 0.060, timeout 5 seconds |
2005/03/15 20:03:17 band LB 18200 18400 |
2005/03/15 20:03:17 band AN 19480 19680 |
2005/03/15 20:03:17 band SK 22050 22150 |
2005/03/15 20:03:17 band BG 23300 23500 |
2005/03/15 20:03:17 band TV 20190 20340 |
2005/03/15 20:03:17 band NV 16300 16500 |
2005/03/15 20:03:17 band B1 20800 21000 |
2005/03/15 20:03:17 band B2 22650 22850 |
2005/03/15 20:03:17 requesting line input gains left=77 right=100 |
2005/03/15 20:03:17 line input gains set to: left=77 right=100 |
2005/03/15 20:03:17 taking data from [/dev/dsp] |
2005/03/15 20:03:17 requesting rate 48000 |
2005/03/15 20:03:17 actual rate set: 48662 samples/sec |
2005/03/15 20:03:17 soundcard channels: 1 bits: 16 |
2005/03/15 20:03:17 resolution: bins=2048 fftwid=4096 df=11.880371 |
2005/03/15 20:03:17 spectrum file: /tmp/sidspec |
2005/03/15 20:03:17 using SCHED_FIFO priority 1 |
2005/03/15 20:03:17 sidd version 0.93: starting work |
2005/03/15 20:03:17 using output file [./050315.dat] |
* 6/ |
Now tail the output file (in my example, ./050315.dat). The first |
three columns are the timestamp (seconds from 01/01/1970), peak signal |
level (range 0 to 1), and rms signal level (also range 0 to 1). |
Adjust your mixer gain settings so that the peak hovers around the |
range 0.1 to 0.5 (the rms will be around 1/2 or 1/3 of the peak, depending |
on your level of impulsive noise and sferics). |
* 7/ |
Plot the spectrum file, in my case /tmp/sidspec. This file is two columns, |
bin centre frequency in Hz, and relative power. The file is re-written by |
sidd every 10 seconds or so, depending on your sidd.conf settings. Adjust |
antennas, receivers, etc to obtain desired signal to noise ratios. You |
may want to reconsider the band settings in sidd.conf at this point too. |
* 8/ |
Once you're happy with the gain settings, stop sidd and run it again with |
the command |
./sidd -m |
This will read and display the applicable mixer gain settings. Now edit |
your sidd.conf, commenting in the gain commands and putting in your gain |
settings. Then, whenever sidd starts, it will setup the mixer with these |
settings. All mixers will have a line input gain control, but only some |
will have an overall input gain control and/or a record level control. |
The -m option will report what you need to put in the config file. |
* 9/ |
Set your PC clock and activate your favourite time synchronisation |
software. Make sure it slews the clock rather than stepping the time. |
* 10/ |
Restart sidd in background with |
./sidd -v |
Inspect the log file to make sure your mixer settings have been applied. |
* 11/ |
After a period of time, plot some of the data from the output file. |
Output file columns 4 onwards correspond to the 'band' commands in the |
order they appear in sidd.conf. Each column is a total relative power, |
so you will need to apply a square root function during plotting if you |
want to display relative amplitudes. |
* 12/ |
After a midnight crossing, make sure sidd has switched to the next |
output file. |
Command line options |
-------------------- |
There are just a few command line options - most controls are |
in the config file. |
-v Be a little more verbose with log messages. |
-f Run in foreground. By default, sidd detaches from the process |
group and terminal and becomes a daemon. In foreground mode, |
log messages are duplicated to stderr. |
-m Interrogate the soundcard mixer and report settings, then exit. |
This option overrides any others. |
Miscellaneous notes |
------------------- |
* |
sidd will set the soundcard to the nearest available sample rate to that |
specified in sidd.conf |
* |
Make sure you have enough disk space. The example sidd.conf with 8 bands |
generates files of about 100Mbytes per day, which compress down to about |
30Mbytes. Arrange scripts for plotting. Arrange scripts for compressing |
and archiving files that are a few days old. |
* |
You can specify an ordinary file or a pipe as the input 'device' instead |
of /dev/dsp. In this case, you must set the sample rate in sidd.conf |
to whatever the actual sample rate is. sidd is looking for unsigned bytes |
in 8 bit mode, or signed words in 16 bit mode. |
* |
Once sidd has started up and set the mixer gains, it no longer takes any |
notice of the mixer. Therefore once sidd is running, a rogue user can |
mess things up by twiddling the mixer settings with Xmixer or some other |
utility. Kill off any mixer control panels to avoid the risk of any upset. |
* |
If your PC is set to autoboot after a power outage, you might want to put |
a startup command for sidd into /etc/rc.d/rc.local or similar - but make |
sure the RTC setting commands are done first. |
Revisions |
--------- |
v0.9: Original. |
v0.91: Fixes a header file problem with some gcc. |
No longer produces a static binary. |
v0.93: Another bug fixed. |
Added control of mixer input and gains. |
Added stereo mode to make a 2 channel monitor. |
/programy/C/avr32/SID/sidd.c |
---|
0,0 → 1,928 |
// |
// sidd.c: A VLF signal monitor. |
// |
// author: Paul Nicholson, paul@abelian.demon.co.uk |
// |
#include <stdlib.h> |
#include <unistd.h> |
#include <math.h> |
#include <stdio.h> |
#include <sys/stat.h> |
#include <sys/ioctl.h> |
#include <sys/time.h> |
#include <sys/param.h> |
#include <fcntl.h> |
#include <errno.h> |
#include <stdarg.h> |
#include <ctype.h> |
#include <string.h> |
#include <signal.h> |
#include <time.h> |
#include <sched.h> |
#include <linux/soundcard.h> |
#include <fftw3.h> |
/////////////////////////////////////////////////////////////////////////////// |
// Tuneable Settings // |
/////////////////////////////////////////////////////////////////////////////// |
#define VERSION "0.93" |
// |
// Number of soundcard bytes to read at a time. |
#define NREAD 2048 |
// |
// Max number of bands which can be read from the config file. |
#define MAXBANDS 20 |
// |
// Name of the configuration file. |
#define CONFIG_FILE "sidd.conf" |
/////////////////////////////////////////////////////////////////////////////// |
// Globals and fixed definitions // |
/////////////////////////////////////////////////////////////////////////////// |
// |
// Default values here are over-ridden by the config file. |
int mode = 1; // 1 = mono, 2 = stereo |
int bits = 16; // Sample width, 8 or 16 bits |
int BINS = 2048; // Number of frequency bins |
#define FFTWID (2 * BINS) // Number of samples in FFT period |
int background = 1; // Set zero if running in foreground |
int fdi; // Input file handle |
int fdm; // Mixer file handle |
int VFLAG = 0; // Set non-zero by -v option |
int MFLAG = 0; // Set non-zero by -m option |
int spec_max = 100; // Issue a spectrum for every spec_max output records |
int spec_cnt = 0; |
int sample_rate = 100000; // Samples per second |
int chans = 1; |
int alert_on = 0; |
int priority = 0; // Set to 1 if high scheduling priority |
struct sigaction sa; |
char mailaddr[100]; |
double los_thresh = 0; // Threshold for loss of signal, 0..1 |
int los_timeout = 0; // Number of seconds before loss of signal declared |
double DF; // Frequency resolution of the FFT |
int bailout_flag = 0; // To prevent bailout() looping |
int grab_cnt = 0; // Count of samples into the FFT buffer |
// Mixer gain settings requested by config file. |
int req_lgain = -1; // Line gain |
int req_igain = -1; // Input gain |
int req_rgain = -1; // Record level |
// |
// Various filenames, contents set by config file. |
// |
char logfile[100] = ""; |
char device[100] = "/dev/dsp"; |
char mixer[100] = "/dev/mixer"; |
char spectrum_file[100] = "/tmp/sidspec"; |
char datadir[100] = "."; |
// |
// Table of frequency bands to monitor |
// |
struct BAND |
{ |
char ident[50]; |
int start; |
int end; |
} |
bands[MAXBANDS]; // Table of bands to be monitored |
int nbands = 0; |
// |
// Independent state variables and buffers for left and right channels |
// |
struct CHAN |
{ |
char *name; |
double *signal_avg; |
double *powspec; |
double *fft_inbuf; |
fftw_complex *fft_data; |
fftw_plan ffp; |
double peak; |
double sum_sq; |
int los_state; |
time_t los_time; |
FILE *fo; |
char fname[100]; |
} |
left = { "left" }, right = { "right" }; |
/////////////////////////////////////////////////////////////////////////////// |
// Various Utility Functions // |
/////////////////////////////////////////////////////////////////////////////// |
// |
// Issue a message to the log file, if the verbosity level is high enough... |
// |
void report( int level, char *format, ...) |
{ |
va_list ap; |
void bailout( char *format, ...); |
char temp[ 200]; |
if( VFLAG < level) return; |
va_start( ap, format); |
vsprintf( temp, format, ap); |
va_end( ap); |
if( !logfile[0] || !background) |
if( background != 2) fprintf( stderr, "%s\n", temp); |
if( logfile[0]) |
{ |
time_t now = time( NULL); |
struct tm *tm = gmtime( &now); |
FILE *flog = NULL; |
if( (flog = fopen( logfile, "a+")) == NULL) |
bailout( "cannot open logfile [%s]: %s", logfile, strerror( errno)); |
fprintf( flog, "%04d/%02d/%02d %02d:%02d:%02d %s\n", |
tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday, |
tm->tm_hour, tm->tm_min, tm->tm_sec, temp); |
fclose( flog); |
} |
} |
void alert( char *format, ...) |
{ |
FILE *f; |
va_list( ap); |
char cmd[100], temp[100]; |
va_start( ap, format); |
vsprintf( temp, format, ap); |
va_end( ap); |
report( -1, "%s", temp); |
if( !alert_on || !mailaddr[0]) return; |
sprintf( cmd, "mail -s 'sidd alert' '%s'", mailaddr); |
if( (f=popen( cmd, "w")) == NULL) |
{ |
report( 0, "cannot exec [%s]: %s", cmd, strerror( errno)); |
return; |
} |
fprintf( f, "sidd: %s\n", temp); |
fclose( f); |
} |
// |
// We try to exit the program through here, if possible. |
// |
void bailout( char *format, ...) |
{ |
va_list ap; |
char temp[ 200]; |
if( bailout_flag) exit( 1); |
bailout_flag = 1; |
va_start( ap, format); |
vsprintf( temp, format, ap); |
va_end( ap); |
alert( "terminating: %s", temp); |
exit( 1); |
} |
// |
// Exit with a message if we get any signals. |
// |
void handle_sigs( int signum) |
{ |
bailout( "got signal %d", signum); |
} |
/////////////////////////////////////////////////////////////////////////////// |
// Soundcard Setup // |
/////////////////////////////////////////////////////////////////////////////// |
// |
// Prepare the input stream, setting up the soundcard if the input |
// is a character device. |
// |
void setup_input_stream( void) |
{ |
struct stat st; |
report( 1, "taking data from [%s]", device); |
if( (fdi = open( device, O_RDONLY)) < 0) |
bailout( "cannot open [%s]: %s", strerror( errno)); |
if( fstat( fdi, &st) < 0) |
bailout( "cannot stat input stream: %s", strerror( errno)); |
if( S_ISCHR( st.st_mode)) |
{ |
int blksize; |
int fragreq = 0x7fff000a; |
unsigned int format; |
unsigned int req_format = AFMT_S16_LE; |
if( bits == 8) req_format = AFMT_U8; |
if (ioctl( fdi, SNDCTL_DSP_SETFRAGMENT, &fragreq)) |
report( 01, "cannot set fragment size"); |
if( ioctl( fdi, SNDCTL_DSP_RESET, NULL) < 0) |
bailout( "cannot reset input device"); |
chans = mode; |
if( ioctl( fdi, SNDCTL_DSP_CHANNELS, &chans) < 0) |
bailout( "cannot set channels on input device"); |
if( ioctl( fdi, SNDCTL_DSP_GETFMTS, &format) < 0) |
bailout( "cannot get formats from input device"); |
report( 2, "formats available: %08X", format); |
if( (format & req_format) == 0) |
{ |
report( 0, "available dsp modes are %08X", format); |
bailout( "unable to set %d bit dsp mode", bits); |
} |
format = req_format; |
if( ioctl( fdi, SNDCTL_DSP_SETFMT, &format) < 0) |
bailout( "cannot set dsp format on input device"); |
if( ioctl( fdi, SNDCTL_DSP_GETBLKSIZE, &blksize) < 0) |
bailout( "cannot get block size from input device"); |
report( 2, "dsp block size: %d", blksize); |
if( ioctl( fdi, SNDCTL_DSP_CHANNELS, &chans) < 0) |
bailout( "cannot get channels from input device"); |
report( 1, "requesting rate %d", sample_rate); |
if( ioctl( fdi, SNDCTL_DSP_SPEED, &sample_rate) < 0) |
bailout( "cannot set sample rate of input device"); |
report( 1, "actual rate set: %d samples/sec", sample_rate); |
report( 1, "soundcard channels: %d bits: %d", chans, bits); |
} |
} |
/////////////////////////////////////////////////////////////////////////////// |
// Output Functions // |
/////////////////////////////////////////////////////////////////////////////// |
void maybe_output_spectrum( void) |
{ |
FILE *f; |
int i; |
if( ++spec_cnt < spec_max) return; // Wait for spec_max records |
spec_cnt = 0; |
if( !spectrum_file[0]) return; // Spectrum file not wanted. |
if( (f=fopen( spectrum_file, "w+")) == NULL) |
bailout( "cannot open spectrum file %s, %s", strerror( errno)); |
if( mode == 1){ |
fprintf( f, "Frequency PowerL \n"); |
for( i=0; i<BINS; i++) fprintf( f, "%.5e %.5e\n", |
(i+0.5) * DF, left.signal_avg[i]/spec_max);} |
else{ |
fprintf( f, "Frequncy PowerL PowerR \n"); |
for( i=0; i<BINS; i++) fprintf( f, "%.5e %.5e %.5e\n", |
(i+0.5) * DF, left.signal_avg[i]/spec_max, |
right.signal_avg[i]/spec_max);} |
fclose( f); |
for( i=0; i<BINS; i++) left.signal_avg[i] = 0; |
if( mode == 2) for( i=0; i<BINS; i++) right.signal_avg[i] = 0; |
} |
void output_record( struct CHAN *c, char *prefix, double fsecs) |
{ |
int i, j; |
char test[100]; |
if( mode == 1) |
sprintf( test, "%s.dat", prefix); |
else |
sprintf( test, "%s.%s.dat", prefix, c->name); |
if( !c->fo || strcmp( test, c->fname)) |
{ |
if( c->fo) fclose( c->fo); |
strcpy( c->fname, test); |
report( 0, "using output file [%s]", c->fname); |
if( (c->fo=fopen( c->fname, "a+")) == NULL) |
bailout( "cannot open [%s], %s", c->fname, strerror( errno)); |
} |
fprintf( c->fo, "%.3f %.3f %.3f", fsecs, c->peak, sqrt( c->sum_sq/FFTWID)); |
for( i=0; i<nbands; i++) |
{ |
double e = 0; |
int n1 = bands[i].start/DF; |
int n2 = bands[i].end/DF; |
for( j=n1; j<= n2; j++) e += c->powspec[j]; |
e /= n2 - n1 + 1; |
fprintf( c->fo, " %.2e", e); |
} |
fprintf( c->fo, "\n"); |
fflush( c->fo); |
c->peak = c->sum_sq = 0; |
} |
void output_records( void) |
{ |
struct timeval tv; |
struct tm *tm; |
double fsecs; |
time_t ud; |
char prefix[100]; |
gettimeofday( &tv, NULL); |
fsecs = tv.tv_sec + 1e-6 * tv.tv_usec; |
ud = tv.tv_sec - tv.tv_sec % 86400; |
tm = gmtime( &ud); |
sprintf( prefix, "%s/%02d%02d%02d", datadir, |
tm->tm_year - 100, tm->tm_mon+1, tm->tm_mday); |
output_record( &left, prefix, fsecs); |
if( mode == 2) output_record( &right, prefix, fsecs); |
} |
void check_los( struct CHAN *c) |
{ |
if( !c->los_state) |
{ |
if( !c->los_time && c->peak < los_thresh) time( &c->los_time); |
if( c->los_time && c->peak > los_thresh) c->los_time = 0; |
if( c->los_time && c->los_time + los_timeout < time( NULL)) |
{ |
c->los_state = 1; |
c->los_time = 0; |
if( mode == 1) alert( "loss of signal"); |
else alert( "loss of signal on %s", c->name); |
} |
} |
else |
{ |
if( !c->los_time && c->peak > los_thresh) time( &c->los_time); |
if( c->los_time && c->peak < los_thresh) c->los_time = 0; |
if( c->los_time && c->los_time + los_timeout < time( NULL)) |
{ |
c->los_state = 0; |
c->los_time = 0; |
if( mode == 1) alert( "signal restored"); |
else alert( "signal restored on %s", c->name); |
} |
} |
} |
/////////////////////////////////////////////////////////////////////////////// |
// Signal Processing // |
/////////////////////////////////////////////////////////////////////////////// |
void process_fft( struct CHAN *c) |
{ |
int i; |
// |
// Do the FFT. First time through, initialise the fft plan. |
// |
if( !c->ffp) |
c->ffp = fftw_plan_dft_r2c_1d( FFTWID, c->fft_inbuf, c->fft_data, |
FFTW_ESTIMATE | FFTW_DESTROY_INPUT); |
fftw_execute( c->ffp); |
// |
// Obtain squared amplitude of each bin. |
// |
c->powspec[ 0] = 0.0; // Zero the DC component |
for( i=1; i<BINS; i++) |
{ |
double t1 = c->fft_data[ i][0]; |
double t2 = c->fft_data[ i][1]; |
c->powspec[ i] = t1*t1 + t2*t2; |
} |
// |
// Accumulate average signal levels in each bin. signal_avg is used |
// only for the spectrum file output. |
// |
for( i=0; i<BINS; i++) c->signal_avg[ i] += c->powspec[i]; |
check_los( c); |
} |
void insert_sample( struct CHAN *c, double f) |
{ |
c->sum_sq += f * f; |
if( f > c->peak) c->peak = f; |
if( f < -c->peak) c->peak = -f; |
c->fft_inbuf[ grab_cnt] = f * sin( grab_cnt/(double) FFTWID * M_PI); |
} |
void maybe_do_fft( void) |
{ |
if( ++grab_cnt < FFTWID) return; |
grab_cnt = 0; |
process_fft( &left); |
if( mode == 2) process_fft( &right); |
output_records(); |
maybe_output_spectrum(); |
} |
// |
// Main signal processing loop. Never returns. |
// |
void process_signal( void) |
{ |
unsigned char buff[ NREAD]; |
while( 1) |
{ |
int i, q; |
if( (q=read( fdi, buff, NREAD)) <= 0) |
{ |
if( !q || errno == ENOENT || errno == 0) |
{ |
sched_yield(); |
usleep( 50000); |
continue; |
} |
report( 0, "input file: read error, count=%d errno=%d", q, errno); |
exit( 1); |
} |
// Unpack the input buffer into signed 16 bit words. |
// then scale to -1..+1 for further processing. |
// We use 'chans' to decide if the soundcard is giving stereo or |
// mono samples, rather than 'mode', because some cards will refuse |
// to do mono. |
if( bits == 16) |
{ |
if( chans == 1) |
{ |
for( i=0; i<q; i += 2) |
{ |
int fh = *(short *)(buff + i); |
insert_sample( &left, fh/32768.0); |
maybe_do_fft(); |
} |
} |
else // chans must be 2 |
{ |
if( mode == 1) |
for( i=0; i<q; i += 4) |
{ |
int fh = *(short *)(buff + i); |
insert_sample( &left, fh/32768.0); |
maybe_do_fft(); |
} |
else // mode == 2 |
for( i=0; i<q; i += 4) |
{ |
int fh = *(short *)(buff + i); |
insert_sample( &left, fh/32768.0); |
fh = *(short *)(buff + i + 2); |
insert_sample( &right, fh/32768.0); |
maybe_do_fft(); |
} |
} |
} |
else // bits must be 8 |
{ |
if( chans == 1) |
{ |
for( i=0; i<q; i++) |
{ |
int fh = ((short)buff[i] - 128)*256; |
insert_sample( &left, fh/32768.0); |
maybe_do_fft(); |
} |
} |
else // chans must be 2 |
{ |
if( mode == 1) |
for( i=0; i<q; i += 2) |
{ |
int fh = ((short)buff[i] - 128)*256; |
insert_sample( &left, fh/32768.0); |
maybe_do_fft(); |
} |
else // mode == 2 |
for( i=0; i<q; i += 2) |
{ |
int fh = ((short)buff[i] - 128)*256; |
insert_sample( &left, fh/32768.0); |
fh = ((short)buff[i+1] - 128)*256; |
insert_sample( &right, fh/32768.0); |
maybe_do_fft(); |
} |
} |
} |
} |
} |
/////////////////////////////////////////////////////////////////////////////// |
// Configuration File Stuff // |
/////////////////////////////////////////////////////////////////////////////// |
void config_band( char *ident, char *start, char *end) |
{ |
struct BAND *b = bands + nbands++; |
if( nbands == MAXBANDS) bailout( "too many bands specified in config file"); |
strcpy( b->ident, ident); |
b->start = atoi( start); |
b->end = atoi( end); |
report( 1, "band %s %d %d", b->ident, b->start, b->end); |
} |
void load_config( void) |
{ |
int lino = 0, nf; |
FILE *f; |
char buff[100], *p, *fields[20]; |
if( (f=fopen( CONFIG_FILE, "r")) == NULL) |
bailout( "no config file found"); |
while( fgets( buff, 99, f)) |
{ |
lino++; |
if( (p=strchr( buff, '\r')) != NULL) *p = 0; |
if( (p=strchr( buff, '\n')) != NULL) *p = 0; |
if( (p=strchr( buff, ';')) != NULL) *p = 0; |
p = buff; nf = 0; |
while( 1) |
{ |
while( *p && isspace( *p)) p++; |
if( !*p) break; |
fields[nf++] = p; |
while( *p && !isspace( *p)) p++; |
if( *p) *p++ = 0; |
} |
if( !nf) continue; |
if( nf == 4 && !strcasecmp( fields[0], "band")) |
config_band( fields[1], fields[2], fields[3]); |
else |
if( nf == 2 && !strcasecmp( fields[0], "logfile")) |
{ |
strcpy( logfile, fields[1]); |
report( 1, "logfile %s", logfile); |
} |
else |
if( nf == 3 && !strcasecmp( fields[0], "los")) |
{ |
los_thresh = atof( fields[1]); |
los_timeout = atoi( fields[2]); |
report( 1, "los threshold %.3f, timeout %d seconds", |
los_thresh, los_timeout); |
} |
else |
if( nf == 2 && !strcasecmp( fields[0], "device")) |
strcpy( device, fields[1]); |
else |
if( nf == 2 && !strcasecmp( fields[0], "mixer")) |
strcpy( mixer, fields[1]); |
else |
if( nf == 2 && !strcasecmp( fields[0], "mode")) |
{ |
if( !strcasecmp( fields[1], "mono")) mode = 1; |
else |
if( !strcasecmp( fields[1], "stereo")) mode = 2; |
else |
bailout( "error in config file, line %d", lino); |
} |
else |
if( nf == 2 && !strcasecmp( fields[0], "bits")) |
{ |
bits = atoi( fields[1]); |
if( bits != 8 && bits != 16) |
bailout( "can only do 8 or 16 bits, config file line %d", lino); |
} |
else |
if( nf == 3 && !strcasecmp( fields[0], "spectrum")) |
{ |
strcpy( spectrum_file, fields[1]); |
spec_max = atoi( fields[2]); |
} |
else |
if( nf == 2 && !strcasecmp( fields[0], "sched") |
&& !strcasecmp( fields[1], "high")) |
{ |
priority = 1; |
} |
else |
if( nf == 4 && !strcasecmp( fields[0], "gain")) |
{ |
int left = atoi( fields[2]); |
int right = atoi( fields[3]); |
int gain = (right << 8) | left; |
if( !strcasecmp( fields[1], "line")) req_lgain = gain; |
else |
if( !strcasecmp( fields[1], "overall")) req_igain = gain; |
else |
if( !strcasecmp( fields[1], "record")) req_rgain = gain; |
else |
bailout( "unknown gain control [%s]", fields[1]); |
} |
else |
if( nf == 2 && !strcasecmp( fields[0], "rate")) |
sample_rate = atoi( fields[1]); |
else |
if( nf == 2 && !strcasecmp( fields[0], "bins")) |
BINS = atoi( fields[1]); |
else |
if( nf == 2 && !strcasecmp( fields[0], "datadir")) |
{ |
struct stat st; |
strcpy( datadir, fields[1]); |
if( stat( datadir, &st) < 0 || !S_ISDIR( st.st_mode)) |
bailout( "no data directory, %s", datadir); |
} |
else |
bailout( "error in config file, line %d", lino); |
} |
fclose( f); |
} |
/////////////////////////////////////////////////////////////////////////////// |
// Mixer Stuff // |
/////////////////////////////////////////////////////////////////////////////// |
// Actual mixer values, read by open_mixer() |
int mixer_recmask; // Recording device mask |
int mixer_stereo; // Stereo device mask |
int mixer_line; // Line input gain setting |
int mixer_igain; // Overall input gain setting |
int mixer_reclev; // Recording level setting |
int mixer_recsrc; // Mask indicating which inputs are set to record |
void open_mixer( void) |
{ |
if( (fdm = open( mixer, O_RDWR)) < 0) |
bailout( "cannot open [%s]: %s", mixer, strerror( errno)); |
// Determine the available mixer recording gain controls. |
// We must at least have a line input. |
if( ioctl( fdm, SOUND_MIXER_READ_RECMASK, &mixer_recmask) < 0) |
bailout( "cannot read mixer devmask"); |
if( (mixer_recmask & SOUND_MASK_LINE) == 0) |
bailout( "mixer has no line device"); |
if( ioctl( fdm, SOUND_MIXER_READ_STEREODEVS, &mixer_stereo) < 0) |
bailout( "cannot read mixer stereodevs"); |
if( ioctl( fdm, SOUND_MIXER_READ_RECSRC, &mixer_recsrc) < 0) |
bailout( "cannot read mixer recsrc"); |
// Read the line input gain. |
if( ioctl( fdm, SOUND_MIXER_READ_LINE, &mixer_line) < 0) |
bailout( "cannot read mixer line"); |
// Read overall input gain? Optional. |
if( (mixer_recmask & SOUND_MASK_IGAIN) && |
ioctl( fdm, SOUND_MIXER_READ_IGAIN, &mixer_igain) < 0) |
bailout( "cannot read mixer igain"); |
// Read overall recording level? Optional. |
if( (mixer_recmask & SOUND_MASK_RECLEV) && |
ioctl( fdm, SOUND_MIXER_READ_RECLEV, &mixer_reclev) < 0) |
bailout( "cannot read mixer reclev"); |
} |
void report_mixer_settings( void) |
{ |
report( 1, "mixer: line input is %s", |
mixer_stereo & SOUND_MASK_LINE ? "stereo" : "mono"); |
report( 1, "mixer: line input is %s", |
mixer_recsrc & SOUND_MASK_LINE ? "on" : "off"); |
report( 1, "mixer: line input gain: left=%d right=%d", |
mixer_line & 0xff, (mixer_line >> 8) & 0xff); |
// Overall input gain? Optional. |
if( mixer_recmask & SOUND_MASK_IGAIN) |
{ |
report( 1, "mixer: igain: left=%d right=%d", |
mixer_igain & 0xff, (mixer_igain >> 8) & 0xff); |
} |
else report( 1, "mixer: igain: n/a"); |
// Overall recording level? Optional. |
if( mixer_recmask & SOUND_MASK_RECLEV) |
{ |
report( 1, "mixer: reclev: left=%d right=%d", |
mixer_reclev & 0xff, (mixer_reclev >> 8) & 0xff); |
} |
else report( 1, "mixer: reclev: n/a"); |
} |
void setup_mixer( void) |
{ |
if( req_lgain >= 0) |
{ |
report( 1, "requesting line input gains left=%d right=%d", |
req_lgain & 0xff, (req_lgain >> 8) & 0xff); |
if( ioctl( fdm, SOUND_MIXER_WRITE_LINE, &req_lgain) < 0 || |
ioctl( fdm, SOUND_MIXER_READ_LINE, &mixer_line) < 0) |
bailout( "error setting mixer line gain"); |
report( 1, "line input gains set to: left=%d right=%d", |
mixer_line & 0xff, (mixer_line >> 8) & 0xff); |
} |
if( req_igain >= 0 && |
(mixer_recmask & SOUND_MASK_IGAIN)) |
{ |
report( 1, "requesting overall input gains left=%d right=%d", |
req_igain & 0xff, (req_igain >> 8) & 0xff); |
if( ioctl( fdm, SOUND_MIXER_WRITE_IGAIN, &req_igain) < 0 || |
ioctl( fdm, SOUND_MIXER_READ_IGAIN, &mixer_igain) < 0) |
bailout( "error setting mixer overall input gain"); |
report( 1, "overall input gains set to: left=%d right=%d", |
mixer_igain & 0xff, (mixer_igain >> 8) & 0xff); |
} |
if( req_rgain >= 0 && |
(mixer_recmask & SOUND_MASK_RECLEV)) |
{ |
report( 1, "requesting overall record levels left=%d right=%d", |
req_rgain & 0xff, (req_rgain >> 8) & 0xff); |
if( ioctl( fdm, SOUND_MIXER_WRITE_RECLEV, &req_rgain) < 0 || |
ioctl( fdm, SOUND_MIXER_READ_RECLEV, &mixer_reclev) < 0) |
bailout( "error setting mixer record level"); |
report( 1, "mixer record levels set to: left=%d right=%d", |
mixer_reclev & 0xff, (mixer_reclev >> 8) & 0xff); |
} |
mixer_recsrc = SOUND_MASK_LINE; |
if( ioctl( fdm, SOUND_MIXER_WRITE_RECSRC, &mixer_recsrc) < 0) |
bailout( "cannot set mixer recsrc to line"); |
} |
/////////////////////////////////////////////////////////////////////////////// |
// Main // |
/////////////////////////////////////////////////////////////////////////////// |
void make_daemon( void) |
{ |
int childpid, fd; |
if( (childpid = fork()) < 0) |
bailout( "cannot fork: %s", strerror( errno)); |
else if( childpid > 0) exit( 0); |
if( setpgrp() == -1) bailout( "cannot setpgrp"); |
if( (childpid = fork()) < 0) |
bailout( "cannot fork: %s", strerror( errno)); |
else if( childpid > 0) exit( 0); |
for( fd = 0; fd <NOFILE; fd++) if( fd != fdi) close( fd); |
errno = 0; |
background = 2; |
} |
void initialise_channel( struct CHAN *c) |
{ |
int i; |
c->fft_inbuf = (double *) malloc( BINS * 2 * sizeof( double)); |
c->fft_data = fftw_malloc( sizeof( fftw_complex) * FFTWID); |
c->powspec = (double *) malloc( BINS * sizeof( double)); |
c->signal_avg = (double *) malloc( BINS * sizeof( double)); |
for( i=0; i<BINS; i++) c->signal_avg[i] = 0; |
} |
void setup_signal_handling( void) |
{ |
sa.sa_handler = handle_sigs; |
sigemptyset( &sa.sa_mask); |
sa.sa_flags = 0; |
sigaction( SIGINT, &sa, NULL); |
sigaction( SIGTERM, &sa, NULL); |
sigaction( SIGHUP, &sa, NULL); |
sigaction( SIGQUIT, &sa, NULL); |
sigaction( SIGFPE, &sa, NULL); |
sigaction( SIGBUS, &sa, NULL); |
sigaction( SIGSEGV, &sa, NULL); |
} |
// Set scheduling priority to the minimum SCHED_FIFO value. |
void set_scheduling( void) |
{ |
struct sched_param pa; |
int min = sched_get_priority_min( SCHED_FIFO); |
pa.sched_priority = min; |
if( sched_setscheduler( 0, SCHED_FIFO, &pa) < 0) |
report( -1, "cannot set scheduling priority: %s", strerror( errno)); |
else |
report( 0, "using SCHED_FIFO priority %d", min); |
} |
int main( int argc, char *argv[]) |
{ |
while( 1) |
{ |
int c = getopt( argc, argv, "vfm"); |
if( c == 'v') VFLAG++; |
else |
if( c == 'm') MFLAG++; |
else |
if( c == 'f') background = 0; |
else if( c == -1) break; |
else bailout( "unknown option [%c]", c); |
} |
setup_signal_handling(); |
load_config(); |
open_mixer(); |
if( MFLAG) |
{ |
VFLAG = 1; |
background = 0; |
report_mixer_settings(); |
exit( 0); |
} |
setup_mixer(); |
if( background && !logfile[0]) |
report( -1, "warning: no logfile specified for daemon"); |
setup_input_stream(); |
DF = (double) sample_rate/(double) FFTWID; |
report( 1, "resolution: bins=%d fftwid=%d df=%f", BINS, FFTWID, DF); |
report( 1, "spectrum file: %s", spectrum_file); |
initialise_channel( &left); |
if( mode == 2) initialise_channel( &right); |
if( background) make_daemon(); |
if( priority) set_scheduling(); |
report( 0, "sidd version %s: starting work", VERSION); |
alert_on = 1; |
process_signal(); |
return 0; |
} |
/programy/C/avr32/SID/sidd.conf |
---|
0,0 → 1,75 |
; Specify a file into which sidd will write messages. |
logfile ./sidd.log |
; The input device and mixer |
device /dev/dsp |
mixer /dev/mixer |
; Specify the mode of operation - stereo or mono. In stereo mode, |
; sidd will run two independent monitors, each with its own output file. |
mode stereo |
; The requested sample rate. The software will use the closest |
; setting available from the soundcard. |
rate 48000 |
; Sample size, 8 or 16 bits. 16 bits is strongly recommended, 8 bit is |
; provided in case your soundcard or driver doesn't do 16. |
bits 16 |
; Number of frequency bins to use. The FFT size is 2*bins and the program |
; will issue an output record every (2*bins)/rate seconds. |
bins 2048 |
; Line input gains, left and right. If using mono, set them both the same. |
; Range is 0 to 100. The logfile will report the actual values set, which |
; may differ a little. |
gain line 77 100 |
; Overall input gains, comments as above. |
gain overall 86 100 |
; Overall record level, comments as above. |
;; gain record 100 100 |
; Specify a directory to contain daily data files. Use '.' for the |
; current directory. Output files will be datadir/yymmdd.dat when running |
; in mono, otherwise datadir/yymmdd.left.dat and datadir/yymmdd.right.dat |
datadir . |
; Enable real time scheduling of sidd. Recommended so that soundcard buffers |
; are read promptly, which means minimum latency before each fft buffer is |
; timestamped. You have to be running as root for this to work. |
sched high |
; Specify the email address of whoever is to get any bad news. |
; mail someone@someplace |
; The loss-of-signal warning threshold and time delay. If the input |
; signal peak level (0-1.0) falls below the given threshold for more than |
; the delay time, a warning will be issued. The threshold applies to both |
; left and right in stereo mode, on the assumption that you've set the gains |
; so that the signal levels are about the same anyway. |
los 0.06 5 |
; Specify a file into which spectrum data will regularly be written. |
; This file is overwritten with a fresh spectrum roughly every |
; 100 * 2 * bins/rate seconds. The spectrum file contains three space |
; separated columns: bin centre frequency (Hz) and the average power |
; in the bin (relative), for the left and right channels. In mono mode, |
; there are just two columns |
spectrum /tmp/sidspec 100 |
; Specify the channels to monitor. The ident field is not actually used by |
; sidd. |
; |
; ident from to |
band 18k3HWU 18200 18400 ; Le Blanc, France, 46:37N 001:05E 162.8 deg 508.6 miles |
band 19k6GBZ 19480 19680 ; Anthorn, UK 54:54n 003:18W 329.6 deg 96.4 miles |
band 22k1GBZ 22050 22150 ; Skelton, UK, 54:42:24N 2:53:06W 335.0 deg 76.7 miles |
band 20k3ICV 20190 20340 ; Tavolara, Italy, 40:55N 009:45E 143.4 deg 1038.8 miles |
band B1 20800 21000 ; Background channel |
band B2 22650 22850 ; Background channel |
/programy/C/avr32/hello/hello.elf |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr32/hello/Makefile |
---|
0,0 → 1,17 |
TARGET=hello.elf |
OBJECTS=hello.o |
CC=avr32-linux-gcc |
CFLAGS=-Wall -g # warnings, debugging symbols |
LDFLAGS= |
LIBS= |
.PHONY: all |
all: $(TARGET) |
$(TARGET): $(OBJECTS) |
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS) |
.PHONY: clean |
clean: |
-$(RM) $(TARGET) $(OBJECTS) |
/programy/C/avr32/hello/hello.c |
---|
0,0 → 1,8 |
#include <stdio.h> |
int main(void) |
{ |
printf("Hello World!\n"); |
return 0; |
} |
/programy/C/avr32/BoardController/BoardController |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr32/BoardController/BoardController.cpp |
---|
0,0 → 1,176 |
/*****************************************************************************/ |
/* |
* BoardController.cpp - communication with NGW100 Board controller |
* |
* Copyright (C) 2007 Karel Hojdar |
* |
* This program is free software; you can redistribute it and/or modify |
* it under the terms of the GNU General Public License as published by |
* the Free Software Foundation; either version 2 of the License, or |
* (at your option) any later version. |
* |
* This program is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU General Public License for more details. |
* |
* |
* |
* Revision history |
* 15.06.2007 1.0 Initial release |
*/ |
/*****************************************************************************/ |
#include <iostream> |
#include <getopt.h> |
#include <errno.h> |
#include <string.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <unistd.h> |
#include "linux/i2c-dev.h" |
#include <sys/ioctl.h> |
#include <sys/types.h> |
#include <sys/stat.h> |
#include <fcntl.h> |
using namespace std; |
static char* version = "BoardController, version 0.1"; |
static char* help = "Usage: BoardController [OPTION]\n -I\t\tshow ID\n -M\t\tshow model\n -R\t\tshow revision\n -S\t\tshow serial no.\n -T\t\tshow temperature\n\n"; |
#define I2C_SLAVE 0x0703 /* Change slave address */ |
#define I2C_RDWR 0x0707 /* Combined R/W transfer (one stop only)*/ |
#define BC_Addr 0x0B |
void DoExit(int ex) |
{ |
exit(ex); |
} |
unsigned char xfunc[5] = {0x99, 0x9A, 0x9B, 0x9E, 0x8D}; |
unsigned char xlen[5] = {8, 6, 1, 15, 2}; |
int main(int argc, char *argv[], char *envp[]) |
{ |
char *progname; |
int c, func = 0, Len; |
int i2cbus = 0; |
char filename[20], Buf[64]; |
int file; |
progname = strrchr(argv[0], '/'); |
progname = progname ? progname + 1 : argv[0]; |
while ((c = getopt (argc, argv, "IiMmRrSsTth")) != -1) |
switch (c) |
{ |
case 'I': |
case 'i': |
func = 0; |
break; |
case 'M': |
case 'm': |
func = 1; |
break; |
case 'R': |
case 'r': |
func = 2; |
break; |
case 'S': |
case 's': |
func = 3; |
break; |
case 'T': |
case 't': |
func = 4; |
break; |
case 'h': |
printf ("%s\n%s", version, help); |
return 1; |
case '?': |
printf ("Unknown option `-%c', try %s -h.\n", optopt,progname); |
return 1; |
} |
sprintf(filename, "/dev/i2c-%d", i2cbus); |
file = open(filename, O_RDWR); |
if (file < 0) |
{ |
cerr << "Could not open /dev/i2c-0." << endl; |
return -1; |
} |
if (ioctl(file, I2C_SLAVE, BC_Addr) == -1) |
{ |
fprintf(stderr, "Failed to set address to 0x%02x.\n", BC_Addr); |
DoExit(-2); |
} |
int Loops = 0; |
do |
{ |
Buf[0] = xfunc[func]; |
if ( write(file, Buf, 1) != 1) |
{ |
fprintf(stderr, "Failed to write byte to address to 0x%02x, errno %i.\n", BC_Addr, errno); |
DoExit(-3); |
} |
if (read(file, Buf, 1) != 1) |
{ |
fprintf(stderr, "Failed to read response length, errno %i.\n", errno); |
DoExit(-4); |
} |
Len = Buf[0]; |
if (read(file, Buf, Len) != Len) |
{ |
fprintf(stderr, "Failed to read response, errno %i.\n", errno); |
DoExit(-5); |
} |
Loops++; |
} while (Len != xlen[func]); |
if (Loops > 1) |
fprintf(stderr, "After %i attempts got: \n", Loops); |
switch (func) |
{ |
case 0: |
Buf[Len] = 0x00; |
fprintf(stdout, "Board ID is %s.\n", Buf); |
break; |
case 1: |
Buf[Len] = 0x00; |
fprintf(stdout, "Model of the board is %s.\n", Buf); |
break; |
case 2: |
fprintf(stdout, "Revision of the board is 0x%02X.\n", Buf[0]); |
break; |
case 3: |
Buf[Len] = 0x00; |
fprintf(stdout, "Serial number of the board is %s.\n", Buf); |
break; |
case 4: |
fprintf(stdout, "Temperature is %i or %i.\n", (Buf[0] << 8) + Buf[1], (Buf[1] << 8) + Buf[0]); |
break; |
} |
close(file); |
return 0; |
} |
/programy/C/avr32/BoardController/Makefile |
---|
0,0 → 1,17 |
TARGET=BoardController.elf |
#OBJECTS=BoardController.o |
CC=avr32-linux-c++ |
CFLAGS=-Wall -g # warnings, debugging symbols |
LDFLAGS= |
LIBS= |
.PHONY: all |
all: $(TARGET) |
$(TARGET): $(OBJECTS) |
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS) |
.PHONY: clean |
clean: |
-$(RM) $(TARGET) $(OBJECTS) |
/programy/C/mips/indi/Makefile |
---|
0,0 → 1,60 |
# $Id: Makefile 1146 2005-06-05 13:32:28Z nbd $ |
include $(TOPDIR)/rules.mk |
PKG_NAME:=indiserver |
PKG_VERSION:=0.5 |
PKG_RELEASE:=1 |
PKG_MD5SUM:= |
PKG_SOURCE_URL:=http://download.sourceforge.net/indi |
PKG_SOURCE:=indilib-0.5.tar.gz |
PKG_CAT:=zcat |
PKG_BUILD_DIR:=$(BUILD_DIR)/indi |
include $(TOPDIR)/package/rules.mk |
$(eval $(call PKG_template,INDISERVER,$(PKG_NAME),$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH))) |
$(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared |
(cd $(PKG_BUILD_DIR); \ |
$(TARGET_CONFIGURE_OPTS) \ |
CFLAGS="$(TARGET_CFLAGS)" \ |
CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \ |
LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \ |
./configure \ |
CXXFLAGS="$(TARGET_CFLAGS) -fno-builtin -fno-rtti -nostdinc++" \ |
CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \ |
LDFLAGS="-nodefaultlibs -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \ |
LIBS="-luClibc++ -lc -lm -lgcc" \ |
--target=$(GNU_TARGET_NAME) \ |
--host=$(GNU_TARGET_NAME) \ |
--build=$(GNU_HOST_NAME) \ |
--prefix=/usr \ |
--without-libiconv-prefix \ |
--without-libintl-prefix \ |
--disable-v4l2 \ |
--disable-nls \ |
); |
touch $@ |
$(PKG_BUILD_DIR)/.built: |
$(MAKE) -C $(PKG_BUILD_DIR)/src \ |
CC=$(TARGET_CC) |
touch $@ |
$(IPKG_INDISERVER): |
mkdir -p $(IDIR_INDISERVER)/usr/sbin |
cp $(PKG_BUILD_DIR)/src/indiserver $(IDIR_INDISERVER)/usr/sbin/ |
cp $(PKG_BUILD_DIR)/src/lx200basic $(IDIR_INDISERVER)/usr/sbin/ |
cp $(PKG_BUILD_DIR)/src/lx200generic $(IDIR_INDISERVER)/usr/sbin/ |
cp $(PKG_BUILD_DIR)/src/v4ldriver $(IDIR_INDISERVER)/usr/sbin/ |
cp $(PKG_BUILD_DIR)/src/v4lphilips $(IDIR_INDISERVER)/usr/sbin/ |
$(STRIP) $(IDIR_INDISERVER)/usr/sbin/* |
$(IPKG_BUILD) $(IDIR_INDISERVER) $(PACKAGE_DIR) |
mostlyclean: |
$(MAKE) -C $(PKG_BUILD_DIR) clean |
rm -f $(PKG_BUILD_DIR)/.built |
/programy/C/mips/indi/patches/indiserver-0.5.patch |
---|
0,0 → 1,50 |
diff -ruN indi/src/apogee/ApogeeUsbLinux.cpp indi.new/src/apogee/ApogeeUsbLinux.cpp |
--- indi/src/apogee/ApogeeUsbLinux.cpp 2007-04-15 21:14:46.000000000 +0200 |
+++ indi.new/src/apogee/ApogeeUsbLinux.cpp 2007-10-13 12:15:14.000000000 +0200 |
@@ -21,7 +21,7 @@ |
// |
#include <assert.h> |
-#include <sys/io.h> |
+//#include <sys/io.h> |
#include <sys/time.h> |
#include <sys/resource.h> |
#include <sys/ioctl.h> |
diff -ruN indi/src/apogee/CameraIO_LinuxISA.cpp indi.new/src/apogee/CameraIO_LinuxISA.cpp |
--- indi/src/apogee/CameraIO_LinuxISA.cpp 2007-04-15 21:14:46.000000000 +0200 |
+++ indi.new/src/apogee/CameraIO_LinuxISA.cpp 2007-10-13 12:11:04.000000000 +0200 |
@@ -22,7 +22,7 @@ |
////////////////////////////////////////////////////////////////////// |
#include <assert.h> |
-#include <sys/io.h> |
+//#include <sys/io.h> |
#include <sys/time.h> |
#include <sys/resource.h> |
#include <sys/ioctl.h> |
diff -ruN indi/src/apogee/CameraIO_LinuxPCI.cpp indi.new/src/apogee/CameraIO_LinuxPCI.cpp |
--- indi/src/apogee/CameraIO_LinuxPCI.cpp 2007-04-15 21:14:46.000000000 +0200 |
+++ indi.new/src/apogee/CameraIO_LinuxPCI.cpp 2007-10-13 12:12:30.000000000 +0200 |
@@ -22,7 +22,7 @@ |
////////////////////////////////////////////////////////////////////// |
#include <assert.h> |
-#include <sys/io.h> |
+//#include <sys/io.h> |
#include <sys/time.h> |
#include <sys/resource.h> |
#include <sys/ioctl.h> |
diff -ruN indi/src/indicom.c indi.new/src/indicom.c |
--- indi/src/indicom.c 2007-04-15 23:06:20.000000000 +0200 |
+++ indi.new/src/indicom.c 2007-10-13 12:25:38.000000000 +0200 |
@@ -236,10 +236,6 @@ |
#if defined(__GLIBC__) && (__GLIBC_MINOR__ >=1 && !defined(__UCLIBC__)) |
/* GNU version */ |
sincos( DegToRad(Degrees), &Sin, &Cos ); |
- #else |
- /* For older GLIBC versions */ |
- Sin = ::sin( DegToRad(Degrees) ); |
- Cos = ::cos( DegToRad(Degrees) ); |
#endif |
#else |
/* ANSI-compliant version */ |
/programy/C/mips/indi/Config.in |
---|
0,0 → 1,11 |
config BR2_PACKAGE_INDISERVER |
tristate "INDISERVER - Instrument Neutral Distributed Interface server" |
default m if CONFIG_DEVEL |
help |
INDI is a distributed control protocol designed to operate |
astronomical instrumentation. INDI is small, flexible, easy to parse, |
and scalable. It supports common DCS functions |
such as remote control, data acquisition, monitoring, and a lot more. |
http://indi.sourceforge.net/ |
/programy/C/mips/indi/ipkg/indiserver.control |
---|
0,0 → 1,4 |
Package: indiserver |
Priority: optional |
Section: science |
Description: program designed to operate astronomical instrumentation. |
/programy/C/mips/hello/Makefile |
---|
0,0 → 1,52 |
include $(TOPDIR)/rules.mk |
PKG_NAME:=hello |
PKG_VERSION:=2.1.1 |
PKG_RELEASE:=1 |
PKG_MD5SUM:=70c9ccf9fac07f762c24f2df2290784d |
PKG_SOURCE_URL:=ftp://ftp.cs.tu-berlin.de/pub/gnu/hello \ |
http://mirrors.sunsite.dk/gnu/hello \ |
http://ftp.gnu.org/gnu/hello |
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz |
PKG_CAT:=zcat |
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) |
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install |
include $(TOPDIR)/package/rules.mk |
$(eval $(call PKG_template,HELLO,$(PKG_NAME),$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH))) |
$(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared |
(cd $(PKG_BUILD_DIR); \ |
$(TARGET_CONFIGURE_OPTS) \ |
CFLAGS="$(TARGET_CFLAGS)" \ |
CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \ |
LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \ |
./configure \ |
CXXFLAGS="$(TARGET_CFLAGS) -fno-builtin -fno-rtti -nostdinc++" \ |
CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \ |
LDFLAGS="-nodefaultlibs -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \ |
LIBS="-luClibc++ -lc -lm -lgcc" \ |
--target=$(GNU_TARGET_NAME) \ |
--host=$(GNU_TARGET_NAME) \ |
--build=$(GNU_HOST_NAME) \ |
--prefix=/usr \ |
--without-libiconv-prefix \ |
--without-libintl-prefix \ |
--disable-nls \ |
); |
## Add software specific configurable options above |
## See : ./configure --help |
touch $@ |
$(PKG_BUILD_DIR)/.built: |
rm -rf $(PKG_INSTALL_DIR) |
mkdir -p $(PKG_INSTALL_DIR)/usr/bin |
$(MAKE) -C $(PKG_BUILD_DIR)/src \ |
$(TARGET_CONFIGURE_OPTS) \ |
prefix="$(PKG_INSTALL_DIR)/usr" |
$(CC) $(PKG_BUILD_DIR)/src/hello $(PKG_INSTALL_DIR)/usr/bin |
touch $@ |
$(IPKG_HELLO): |
install -d -m0755 $(IDIR_HELLO)/usr/bin |
$(CP) $(PKG_INSTALL_DIR)/usr/bin/hello $(IDIR_HELLO)/usr/bin |
$(RSTRIP) $(IDIR_HELLO) |
$(IPKG_BUILD) $(IDIR_HELLO) $(PACKAGE_DIR) |
mostlyclean: |
make -C $(PKG_BUILD_DIR) clean |
rm $(PKG_BUILD_DIR)/.built |
/programy/C/mips/hello/main.c |
---|
0,0 → 1,7 |
#include <stdio.h> |
int main() |
{ |
printf("Hello World\n"); |
return 0; |
} |