Advertisement
Tims125

Bios S2 v1 602 MA

Dec 17th, 2018
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.07 KB | None | 0 0
  1. ' {$STAMP BS2P}
  2. ' {$PBASIC 2.5}
  3. ' {$PORT COM4}
  4.  
  5.  
  6. version CON 1602
  7.  
  8. '**********************
  9. ' Slot 2
  10. '**********************
  11.  
  12. '
  13. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  14. 'XXXXXXXX >> Start Here to Copy Header entries << XXXXXXXXXXXXXXXXXX
  15. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  16. '
  17. 'S0 contains the timing loop
  18. 'S2 contains the event table AND actions.
  19. 'S1 contains test code placeholder
  20. '
  21. ' 2012
  22. ' 1. added test for payload interface boards
  23. ' 2. clean slot 0, added time 0,1,2 for clock speed
  24. '
  25. '****************** Start of System Global lables *******************
  26. ' Conditional Assemblies
  27. '
  28. #DEFINE FlyConfig = 0 '1=Set to Flight Configuration, 0=Test Configuration
  29. #DEFINE fastclock = 0 '0=Normal Time X1, 1=Medium Time ~X17 2=Fast Time ~X60
  30. #DEFINE testreset = 1 '1=test reset and reset count
  31. #DEFINE SaySlot = 1 '1=Say Slot with vector
  32. #DEFINE Sayit = 1 '1=Say what is happening
  33. #DEFINE nodebug = 1 '1= nodebug outputs
  34. #DEFINE MasterEnabled = 1 '1= enable checking for master input
  35. '
  36. '
  37. '***************************************************************************************
  38. '********* EEPROM Data Storage Area ****************************************************
  39. 'Start storage at top of slot6 and work downwards, code can go in slot 4, but be carful
  40. 'not to overwrite the data storage. Programs go from botton to top, Data storage, and
  41. 'our data storage allocations are from the top down. MUST BE CHECKED MANUALLY, program
  42. 'does not know any better.
  43. '***************************************************************************************
  44. '
  45. DataStorage CON 4 'EEROM data is storaged in Slot 4
  46. '
  47. '
  48. 'Data storage is defined at the end of this slot (slot 4), the spaces and address must match up with
  49. 'the lables defined here which will be used across all slots, be careful in defining this
  50. '
  51. Cstatus CON 0 '00 See data at data storage area
  52. TestNumber CON Cstatus+1 'Test Sequence Counter 1112
  53. ResetNumber CON TestNumber+2 '00 Number of times reset sence downloaded
  54. IDcodefile CON ResetNumber+1 'MicroLab alpha ID 2 ascii values
  55. LastPhoto CON IDcodefile+2 '00000 Photo number 5 ascii values
  56. LastBKupload CON LastPhoto+5 'Number of the last command file uploaded
  57. NextBktoLoad CON LastBKupload+1 'NextBktoLoad next bank to load
  58. LastuploadCommand CON NextBktoLoad+1 'LastuploadCommand Number of the last command file uploaded
  59. Missionsec CON LastuploadCommand+2 'Missionsec clock sec count here 0-59
  60. Missionmin CON Missionsec+1 'Missionmin clock min count here 0-59
  61. Missionhour CON Missionmin+1 'Missionhour lock hour count here 0-23
  62. Missionday CON Missionhour+1 'Missionday lock day count here 0-xx
  63. TempStatus CON Missionday+1 'Temp storage for test status routines
  64. '
  65. ' 'ETC....
  66. '
  67. '**********************************************************************
  68. '******** Scrathpad Ram Defined Ram location across all slots *********
  69. '**********************************************************************
  70. '
  71. ScratchRam CON 0 'start of Scratch ram locations bytes
  72. '
  73. '----- Bios and User Scratch pad memory locations -----------------------------
  74. '
  75. Resetverify CON ScratchRam 'location is 0 on Power on Reset or not Zero for slot return
  76. VectorFromSlot CON Resetverify+1 'Slot to return to - who called the program vector
  77. VectorFromNum CON VectorFromSlot+1 'From Vector number within slot place to Return to
  78. SlotErrReturn CON VectorFromNum+1 'Error code return from Slot program run
  79. '
  80. sMissionday CON SlotErrReturn+1 'BIOS Mission clock day count here 0-xx
  81. sMissionhour CON sMissionday+1 'BIOS Mission clock hour count here 0-23
  82. sMissionmin CON sMissionhour+1 'BIOS Mission clock min count here 0-59
  83. sMissionsec CON sMissionmin+1 'BIOS Mission clock sec count here 0-59
  84. '
  85. '---------- Bios provided data for user -----------------------------------------
  86. '
  87. RTCsec CON sMissionsec+1 'BIOS Real Time clock sec count here 0-59
  88. RTCmin CON RTCsec+1 'BIOS Real Time clock min count here 0- 59
  89. RTChour CON RTCmin+1 'BIOS Real Time Clock hour count here 0-23
  90. RTCday CON RTChour+1 'BIOS Real Time clock day count here 1-31
  91. RTCmonth CON RTCday+1 'BIOS Real Time clock month count here 1-12
  92. RTCyear CON RTCmonth+1 'BIOS Real Time clock year count here 0-99
  93. '
  94. AmbTemperature CON RTCyear+1 'BIOS Ambient temperature in celcius (8 low bits of 10 bits)
  95. AmbTemperaturehigh CON AmbTemperature+1 'BIOS Ambient temperature in celcius (2 high bits of 10 bits)
  96. AmbHumidity CON AmbTemperaturehigh+1 'BIOS Ambient Humidity (8 low bits of 10 bits)
  97. AmbHumidityhigh CON AmbHumidity+1 'BIOS Ambient Humidity (2 high bits of 10 bits)
  98. '
  99. A2Dchannel0 CON AmbHumidityhigh+1 'BIOS Analog channel 0, (8 bits 0f 0v to 2.5v low-> high)
  100. A2Dchannel0high CON A2Dchannel0+1 'BIOS Analog channel 0, (2 bits 0f 0v to 2.5v low-> high)
  101. A2Dchannel1 CON A2Dchannel0high+1 'BIOS Analog channel 1, (8 bits 0f 0v to 2.5v low-> high)
  102. A2Dchannel1high CON A2Dchannel1+1 'BIOS Analog channel 1, (2 bits 0f 0v to 2.5v low-> high)
  103. A2Dchannel2 CON A2Dchannel1high+1 'BIOS Analog channel 2, (8 bits 0f 0v to 2.5v low-> high)
  104. A2Dchannel2high CON A2Dchannel2+1 'BIOS Analog channel 2, (2 bits 0f 0v to 2.5v low-> high)
  105. A2Dchannel3 CON A2Dchannel2high+1 'BIOS Analog channel 3, (8 bits 0f 0v to 2.5v low-> high)
  106. A2Dchannel3high CON A2Dchannel3+1 'BIOS Analog channel 3, (2 bits 0f 0v to 2.5v low-> high)
  107. InternTemp CON A2Dchannel3high+1 'Bios internal temp of msp430- Needs Calibration
  108. InternTemphigh CON InternTemp+1 'Bios internal temp of msp430- Needs Calibration
  109. VCCby2 CON InternTemphigh+1 'Bios VCC/2 for calabration - Regulator check
  110. VCCby2high CON VCCby2+1 'Bios VCC/2 for calabration - Regulator check
  111. '
  112. '----------- Bios Reserved working registers ----------------------------------------
  113. '
  114. CameraRes CON VCCby2high+1 'Name this Bios Register (camera Resolution 320 $05 640 $07)
  115. CameraQua CON CameraRes+1 'Name this Bios Register (Camera quality $02 normal, $01 Better, $00 Best)
  116. SlaveErr CON CameraQua+1 'slave MSP430 status byte (Local Slave Status)
  117. ActiveBank CON SlaveErr+1 'Name this Bios Register (Active bank)
  118. TextPointer CON ActiveBank+1 'Name 16 bit pointer to text in active bank
  119. '
  120. 'MicroLab Bios Status Byte given to Master on Status Request
  121. ' Location and Bits defined
  122. '
  123. MLabStatus CON TextPointer+2 'Current Status of MicroLab
  124. HighPower CON $80 ' Bit 7=high power request
  125. ExComplete CON $40 ' Bit 6 = execution of upload command completed
  126. ' Bit 5,4,3, don't care
  127. B2ready CON $04 ' Bit 2 = bank 2 ready for upload
  128. B1ready CON $02 ' Bit 1 = bank 1 ready for upload
  129. B0ready CON $01 ' Bit 0 = bank 0 ready for upload
  130. '
  131. 'MicroLab Power Status Registers
  132. ' '
  133. PowerStatus CON MLabStatus+1 'Power control value
  134. P300ma CON $80 'enable high power 300ma mode
  135. P75ma CON $40 'set to 75ma power usage
  136. P50ma CON $20 'set to low power 50ma
  137. P100ma CON $00 'default value of power 100ma
  138. '
  139. 'Reserved Bios Working Registers
  140. '
  141. BiosWord0 CON PowerStatus+1 'BIOS Reserved Word for Bios operations
  142. BiosWord0h CON BiosWord0+1 '
  143. BiosWord1 CON BiosWord0h+1 'BIOS Reserved Word for Bios operations
  144. BiosWord1h CON BiosWord1+1 '
  145. BiosWord2 CON BiosWord1h+1 'BIOS Reserved Word for Bios operations
  146. BiosWord2h CON BiosWord2+1 'BIOS Reserved Word for Bios operations
  147. BiosWord3 CON BiosWord2h+1 'BIOS Reserved Word for Bios operations
  148. BiosWord3h CON BiosWord3+1 'BIOS Reserved Word for Bios operations
  149. '
  150. '-----------General Purpose registers across Slots--------------------------------------
  151. '
  152. scr_Register0 CON BiosWord3h+1 'General use Scratchpad Ram location across all slots
  153. scr_Register1 CON scr_Register0+1 'General use Scratchpad Ram location across all slots
  154. scr_Register2 CON scr_Register1+1 'General use Scratchpad Ram location across all slots
  155. scr_Register3 CON scr_Register2+1 'General use Scratchpad Ram location across all slots
  156. scr_Register4 CON scr_Register3+1 'General use Scratchpad Ram location across all slots
  157. scr_Register5 CON scr_Register4+1 'General use Scratchpad Ram location across all slots
  158. scr_Register6 CON scr_Register5+1 'General use Scratchpad Ram location across all slots
  159. scr_Register7 CON scr_Register6+1 'General use Scratchpad Ram location across all slots
  160. '
  161. '--------- Location for Saved User Variables -----------------------------------------
  162. '
  163. Reg0low CON scr_Register7+1 'Storage of user variables during Bios operations
  164. Reg0high CON Reg0low+1 'Storage of user variables during Bios operations
  165. Reg1low CON Reg0high+1 'Storage of user variables during Bios operations
  166. Reg1high CON Reg1low+1 'Storage of user variables during Bios operations
  167. Reg2low CON Reg1high+1 'Storage of user variables during Bios operations
  168. Reg2high CON Reg2low+1 'Storage of user variables during Bios operations
  169. Reg3low CON Reg2high+1 'Storage of user variables during Bios operations
  170. Reg3high CON Reg3low+1 'Storage of user variables during Bios operations
  171. Reg4low CON Reg3high+1 'Storage of user variables during Bios operations
  172. Reg4high CON Reg4low+1 'Storage of user variables during Bios operations
  173. Reg5low CON Reg4high+1 'Storage of user variables during Bios operations
  174. Reg5high CON Reg5low+1 'Storage of user variables during Bios operations
  175. Reg6low CON Reg5high+1 'Storage of user variables during Bios operations
  176. Reg6high CON Reg6low+1 'Storage of user variables during Bios operations
  177. Reg7low CON Reg6high+1 'Storage of user variables during Bios operations
  178. Reg7high CON Reg7low+1 'Storage of user variables during Bios operations
  179. Reg8low CON Reg7high+1 'Storage of user variables during Bios operations
  180. Reg8high CON Reg8low+1 'Storage of user variables during Bios operations
  181. Reg9low CON Reg8high+1 'Storage of user variables during Bios operations
  182. Reg9high CON Reg9low+1 'Storage of user variables during Bios operations
  183. Reg10low CON Reg9high+1 'Storage of user variables during Bios operations
  184. Reg10high CON Reg10low+1 'Storage of user variables during Bios operations
  185. Reg11low CON Reg10high+1 'Storage of user variables during Bios operations
  186. Reg11high CON Reg11low+1 'Storage of user variables during Bios operations
  187. Reg12low CON Reg11high+1 'Storage of user variables during Bios operations
  188. Reg12high CON Reg12low+1 'Storage of user variables during Bios operations
  189. '
  190. '
  191. MoprClk0 CON Reg12high+1 'Mission Operations Clock0, fail safe operations
  192. MoprClk1 CON MoprClk0+2 'Mission Operations Clock1, fail safe operations
  193. MoprClk2 CON MoprClk1+2 'Mission Operations Clock1, fail safe operations
  194. MoprClk3 CON MoprClk2+2 'Mission Operations Clock1, fail safe operations
  195. '
  196. '
  197. NextAvailiable CON MoprClk3+2 'Next Availiable location for scratch pad ram storage
  198. '
  199. '------- User Scratchpad Locations open for use -------------
  200. '
  201. '
  202. '
  203. '------- User Scratchpad Locations open for use ------------- '
  204. '
  205. SlotInfo CON 127 'contains the current running slot.
  206. '
  207. 'location number 127 contains the number of the currently running program slot
  208. '
  209. '************* End of Scratchpad Ram Space difinations ****************
  210. '
  211. '**********************************************************************
  212. '----- MicroLab Pins and ports on the BS2p24 Defined for BIOS ------------
  213. '**********************************************************************
  214. internalscl CON 0 'BS2p24 interal I2c buss
  215. internalsda CON 1 'BS2p24 interal I2c buss
  216. cameraclk CON 2 'Camera Clock
  217. cameramiso CON 3 'Camera master in slave out
  218. cameramosi CON 4 'Camera msater out slave in
  219. camerahold CON 5 'Camera Hold
  220. masterin PIN 6 'Serial Input fm master
  221. 'masterin CON 6 'Serial Input fm master
  222. masterout CON 7 'Serial Output to master
  223. payloadsda CON 8 'SDA on payload expansion board
  224. payloadscl CON 9 'SCL on payload expansion board
  225. internawin CON 10 'Local slave A to D, watchdog serial in
  226. internawout CON 11 'Loacl slave A to D, watchdog serial out
  227. camerapower CON 12 'Camera on and off for recycle
  228. votedead CON 13 'AMicroLab vote that Master is dead
  229. payloadio14 CON 14 'I/O payload line
  230. cameraCS CON 15 'camrea chip select pin
  231. '
  232. '
  233. '---------------- Bios System General constants --------------------
  234. '
  235. ' Input terminal constants for test set to
  236. con_in CON 16 'Pin 16 is BS2P serial in from RS232 connector
  237. con_baud CON 240 'set to 9600 8bit true
  238. con_tout CON 250 'time out waiting for terminal input appx 100ms
  239. '
  240. '----------------- Bios General constants ---------------------------
  241. '
  242. InternI2c CON 0 'Internal I2C buss address control
  243. PLi2c CON 8 'Payload I2c BUSS address control
  244. PCF8574address CON $40 'internal I2C buss address of PFC8574
  245. Ebankaddress CON $A0 'Address of 256k eerom memory
  246. Ebank0 CON $00 'Ebank0 bank address 00000-0FFFF
  247. Ebank1 CON $02 'Ebank1 bank address 10000-1FFFF
  248. Ebank2 CON $04 'Ebank2 bank address 20000-2FFFF
  249. Ebank3 CON $06 'Ebank3 bank address 30000-3FFFF
  250. '
  251. TextBuffer CON $C000 'Text buffer in bank 0,1, and 2
  252. '
  253. Camera320 CON $05 'Camera Resolution 320X240
  254. Camera640 CON $07 'Camera Resolution 640X480
  255. CameraNormal CON $02 'Camera Quality Normal
  256. CameraBetter CON $01 'Camera Quality Better
  257. CameraBest CON $00 'Camera Quality Best
  258. '
  259. Baud9600T CON $00F0 'Baudrate of 9600 no parity True
  260. Baud2400T CON $03FD 'Baudrate of 2400 no parity true
  261. '
  262. Ack CON $5A 'Acknowledge response to McMek
  263. TimeOut CON 500 'input command timeout is .5 seconds
  264. Pace CON 1 'pace of output from MicroLab to System terminal
  265. ETX CON $03 'End of Text command
  266. EOF CON $FF 'end of file marker
  267. '
  268. '------------ Bios System Error and event codes for logging --------------------
  269. '
  270. NoError CON 0 'no error on return, all ok
  271. '
  272. '----------------- Variables Same for all program Slots ---------------
  273. ' Used By BIOS
  274. xcounter VAR Word 'General use 16 bit counter
  275. TempWord VAR Word 'General use Temp Word Register
  276. TempWord1 VAR Word 'General use Temp Word Register
  277. counter VAR Byte 'General use 8 bit counter
  278. TempReg0 VAR Byte 'General use location for values during processes
  279. TempReg1 VAR Byte 'General use location for values during processes
  280. TempReg2 VAR Byte 'General use location for values during processes
  281. TempReg3 VAR Byte 'General use location for values during processes
  282. Sdata VAR Byte 'data to send to uart
  283. text VAR Byte(8) 'make array for text
  284. '
  285. ' Variables open for use by User (9 Bytes)and not touched by the BIOS
  286. ' Note: above BIOS Variables can/may be used by the user, however
  287. ' the value may be destroyed by a Call to the BIOS or BIOS operation
  288. '
  289. UserVar0 VAR Byte 'user Varible space - Should be same across all slots
  290. UserVar1 VAR Byte 'user Varible space - Should be same across all slots
  291. UserVar2 VAR Byte 'user Varible space - Should be same across all slots
  292. UserVar3 VAR Byte 'user Varible space - Should be same across all slots
  293. UserVar4 VAR Byte 'user Varible space - Should be same across all slots
  294. UserVar5 VAR Byte 'user Varible space - Should be same across all slots
  295.  
  296. '
  297. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  298. ' Calibration values must be calculated and writen through the test system write eeram
  299. ' not automatically done, this is a one time event. Calibrate CPU temp, may be as
  300. ' much as 60 degrees C off from the factory.
  301. '
  302. SysCalBank CON Ebank3 'Bank for system calibration
  303. SysCPUcal CON $C002 'External E2RAM calibration locations
  304. '
  305. '
  306. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  307. 'XXXXXXXXXXXXXXXXXXXXX >> End of Header Copy Entries << XXXXXXXXXXXXXXXXXXXXXXX
  308. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  309. '
  310. '*************************************************************************
  311. ' Enter with TempReg1 containing the program index to run in this slot
  312. '*************************************************************************
  313. '
  314. #IF SaySlot = 1 #THEN
  315. DEBUG ">S2-V",DEC TempReg1,CR
  316. #ENDIF
  317. BRANCH TempReg1,[EventTable, '0 Event Table
  318. TakePhotoReturn, '1 vector to this program
  319. P2vector, '2 vector to this program
  320. P3vector] '3 vector to this program
  321. '
  322.  
  323. '*************************************************************************
  324. ' To Run program in another slot Set TempReg1 to the vector index of
  325. ' that program within the target slot then "RUN" that slot, If a return
  326. ' to originating slot is desired then the return vector index must be stored
  327. ' in the VectorFromNum location in the scratch pad memory, and the return
  328. ' slot is stored in the VectorFromSlot scratch pad memory. Then a general
  329. ' routine can be used to return to the originating program.
  330. '*************************************************************************
  331. '
  332. InSlot CON 2 'Define this slot, each slot is numbered
  333. '
  334. '***********************************************************************
  335. ' To go to a slot and set a return
  336. 'TempReg0 = Returning vector indes
  337. 'TempReg1 = vector index to run in next slot
  338. 'TempReg3 = the slot number to go to
  339. '**********************************************************************
  340. '
  341. GotoSlot:
  342. PUT VectorFromNum,TempReg0 'this is the vector when returning back to this slot
  343. PUT VectorFromSlot,InSlot 'To vector back to this Slot
  344. RUN TempReg3
  345. '
  346. '
  347. '***************************************************************************
  348. 'When returning back, Set TempReg1 to the return vector in the calling slot
  349. 'get the returning slot and RUN that slot
  350. '***************************************************************************
  351. '
  352. ReturnBack:
  353. GET VectorFromNum,TempReg1 'fetch the vector to run when returning to calling slot
  354. GET VectorFromSlot,TempReg0 'fetch the program slot where the routine was called
  355. RUN TempReg0 'RETURNback now....!!!!
  356. '
  357.  
  358. '
  359. '
  360. '
  361. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  362. 'XXXXXXXXXXXXXXXXXXXX Programs in this slot XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  363. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  364. '
  365. '======================================================================
  366. EventTable:
  367. TagCnt CON 0 'hard coded Slot 0 program memory data addresses
  368. DurMin CON 1
  369. DurHour CON 2
  370. DurDay CON 3
  371.  
  372. STORE 0
  373. READ DurMin,UserVar0
  374. READ DurHour,UserVar1
  375. READ DurDay,UserVar2
  376. DEBUG CR,"Event table received (H D M):",DEC uservar2," ",DEC uservar1," ",DEC uservar0,CR,CR
  377.  
  378. 'READ Missionmin,UserVar0 'Copy Mission Clock to RAM
  379. 'READ Missionhour,UserVar1
  380. 'READ Missionday,UserVar2
  381. UserVar3 = 0 'Set EventByte to default "no event"
  382.  
  383. STORE 2 'Event Table is stored in this slot
  384. FOR TempReg0 = 0 TO 10
  385. READ ETable+TempReg0*5+0,TempReg1 : IF TempReg1 <> UserVar2 THEN GOTO NextRow 'Check Day
  386. READ ETable+TempReg0*5+1,TempReg1 : IF TempReg1 <> UserVar1 THEN GOTO NextRow 'Check Hour
  387. READ ETable+TempReg0*5+2,TempReg1 : IF TempReg1 <> UserVar0 THEN GOTO NextRow 'Check Min
  388. READ ETable+TempReg0*5+3,TempReg1 : IF TempReg1 <> $ff THEN GOTO NextRow 'Execute if $ff
  389. READ ETable+TempReg0*5+4,UserVar3 'Write Event Number to UserVar3
  390.  
  391. 'STORE 4 : READ Missionsec,UserVar0 :STORE 2 'Read latest seconds
  392. 'DEBUG CR,"missionSec = ",DEC uservar0,CR
  393. WRITE ETable+TempReg0*5+3,UserVar0 : UserVar0=UserVar0+1 'Tag Event, increment tag count
  394. STORE 0 : WRITE TagCnt,UserVar0 'update TagCnt
  395. GOTO FoundEvent
  396. NextRow:NEXT
  397. STORE datastorage
  398. GOTO ReturnBack
  399.  
  400. FoundEvent:
  401.  
  402. 'DEBUG CR,"found event: ",DEC UserVar3
  403.  
  404. STORE DataStorage ' return storage pointer to Slot 4
  405. DEBUG CR, "Dump Etable FOR DEBUG "
  406. STORE 2
  407. FOR TempReg0 = 0 TO 40
  408. DEBUG CR,"Event Table Row ",DEC TempReg0,": "
  409. READ ETable+TempReg0*5+0,TempReg1 : DEBUG DEC TempReg1," "
  410. READ ETable+TempReg0*5+1,TempReg1 : DEBUG DEC TempReg1," "
  411. READ ETable+TempReg0*5+2,TempReg1 : DEBUG DEC TempReg1," "
  412. READ ETable+TempReg0*5+3,TempReg1 : DEBUG HEX TempReg1," "
  413. READ ETable+TempReg0*5+4,TempReg1 : DEBUG DEC TempReg1," "
  414. NEXT
  415. DEBUG CR,"End of Table",CR
  416.  
  417. STORE DataStorage
  418. BRANCH UserVar3,[Event0, 'Event 0 (do nothing)
  419. Event1, 'Event 1 (
  420. event2, 'Event 2 (
  421. event3, 'Event 3 (
  422. Event4, 'Event 4 (
  423. Event5] 'Event 5 (
  424.  
  425. UserVar3 = 0 'Error
  426. DEBUG CR,"Event Byte is out of range",CR
  427. GOTO ReturnBack 'back to calling routine
  428.  
  429. Event0: DEBUG CR,"received Event Byte 0",CR
  430. SEROUT 18, 9600, ["a"]
  431. tempReg0 = 4 'Destination Index (EventTableReturn)
  432. RUN 0 'Destination Slot
  433.  
  434. Event1: DEBUG CR,"received Event Byte 1",CR
  435. SEROUT 16, 9600, ["b"]
  436. tempReg0 = 4 'Destination Index (EventTableReturn)
  437. RUN 0 'Destination Slot
  438.  
  439.  
  440. Event2: DEBUG CR,"received Event Byte 2",CR
  441. SEROUT 16, 2400, ["c"]
  442. tempReg0 = 4 'Destination Index (EventTableReturn)
  443. RUN 0
  444.  
  445. Event3: DEBUG CR,"recieved Event byte 3",CR
  446. SEROUT 14, 9600, ["d"]
  447. tempReg0 = 4 'Destination Index (EventTableReturn)
  448. RUN 0 'Destination Slot
  449.  
  450. Event4: DEBUG CR,"Recieved event byte 4",CR
  451. SEROUT 11, 9600, ["e"]
  452. tempReg0 = 4 'Destination Index (EventTableReturn)
  453. RUN 0 'Destination Slot
  454.  
  455. Event5: DEBUG CR,"Recieved event byte 5",CR
  456. SEROUT 16, 9600, ["f"]
  457. PUT CameraRes,Camera320 'Template default
  458. PUT CameraQua,CameraNormal 'set to Normal
  459.  
  460. PUT VectorFromSlot,2 'Return Slot
  461. PUT VectorFromNum,1 'Return Index
  462. TempReg1 = 1 'Destination Index
  463. TempReg3 = 6 'Destination Slot
  464. RUN 6 'Execute a slot goto proceedure now doit
  465. TakePhotoReturn:
  466. 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
  467. '
  468. LOW 14 'Turns off the LED's
  469. ' Values in return back are lost when jumping to Slot 6
  470. tempReg0 = 4 'Destination Index (EventTableReturn)
  471. RUN 0 'Destination Slot
  472. 'Destination Slot
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.  
  485. '
  486. '======================================================================
  487. P1vector:
  488. '
  489. '
  490. GOTO ReturnBack 'back to calling routine
  491.  
  492. '
  493. '======================================================================
  494. P2vector:
  495. '
  496. '
  497. GOTO ReturnBack 'back to calling routine
  498. '
  499. '======================================================================
  500. P3vector:
  501. '
  502. '
  503. GOTO ReturnBack 'back to calling routine
  504.  
  505.  
  506.  
  507. ' Day Hour Min Tag EventByte
  508. ETable DATA 00, 00, 08, $FF, 00 'Row 0
  509. DATA 00, 00, 09, $FF, 01 'Row 1
  510. DATA 00, 00, 10, $FF, 02 'Row 2
  511. DATA 00, 00, 11, $FF, 03 'Row 3
  512. DATA 00, 00, 12, $FF, 04 'Row 4
  513. DATA 00, 00, 13, $FF, 00 'Row 5
  514. DATA 00, 00, 14, $FF, 01 'Row 6
  515. DATA 00, 00, 15, $FF, 02 'Row 7
  516. DATA 00, 00, 16, $FF, 03 'Row 8
  517. DATA 00, 00, 17, $FF, 04 'Row 9
  518. DATA 00, 00, 20, $FF, 02 'Row 10
  519. DATA 00, 00, 16, $FF, 03 'Row 11
  520. DATA 08, 00, 00, $FF, 01 'Row 12
  521. DATA 09, 00, 00, $FF, 01 'Row 13
  522. DATA 10, 00, 00, $FF, 01 'Row 14
  523. DATA 11, 00, 00, $FF, 01 'Row 15
  524. DATA 12, 00, 00, $FF, 01 'Row 16
  525. DATA 13, 00, 00, $FF, 01 'Row 17
  526. DATA 14, 00, 00, $FF, 01 'Row 18
  527. DATA 15, 00, 00, $FF, 01 'Row 19
  528. DATA 16, 00, 00, $FF, 01 'Row 20
  529. DATA 17, 00, 00, $FF, 01 'Row 21
  530. DATA 18, 00, 00, $FF, 01 'Row 22
  531. DATA 19, 00, 00, $FF, 01 'Row 23
  532. DATA 20, 00, 00, $FF, 01 'Row 24
  533. DATA 21, 00, 00, $FF, 01 'Row 25
  534. DATA 22, 00, 00, $FF, 01 'Row 26
  535. DATA 23, 00, 00, $FF, 01 'Row 27
  536. DATA 24, 00, 00, $FF, 01 'Row 28
  537. DATA 25, 00, 00, $FF, 01 'Row 29
  538. DATA 26, 00, 00, $FF, 01 'Row 30
  539. DATA 27, 00, 00, $FF, 01 'Row 31
  540. DATA 28, 00, 00, $FF, 01 'Row 32
  541. DATA 29, 00, 00, $FF, 01 'Row 33
  542. DATA 30, 00, 00, $FF, 01 'Row 34
  543. DATA 31, 00, 00, $FF, 01 'Row 35
  544. DATA 32, 00, 00, $FF, 01 'Row 36
  545. DATA 33, 00, 00, $FF, 01 'Row 37
  546. DATA 34, 00, 00, $FF, 01 'Row 38
  547. DATA 35, 00, 00, $FF, 01 'Row 39
  548. DATA 36, 00, 00, $FF, 01 'Row 40
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement