📄 main_quick_tx.lst
字号:
162 ;/* - added work-around for bug in Romeo2 receiver,
where its SPI corrupts */
163 ;/* the last bit of data in the frame. Simply
transmit one more useless */
164 ;/* byte, that will be corrupted instead of the
useful data. */
165 ;/**************************************************
***************************/
166
167 ; Flash handler variables
168
0088 169 CTRLBYT ds 1 ; byte of control
of the size of erasure
0089 170 CPUSPD ds 1 ; frequency of the
pump of load
008A 171 LADDR ds 2 ; address last byte
has to write
008C 172 BUMPS ds 1 ; a number of
attempts at writing maximum :
173 ; 10 per 12 ms max
with Fcpu = 2MHz
008D 174 DERASE ds 2 ; time of erasure
(in us/24)
008F 175 Data ds 8 ; buffer of
transfer of RAM/flash data
176
177 ; transmit variables
178 ; Preamble (2 bytes) - Device ID (4 bytes) -
daytona data (2 bytes) -
179 ; Status (1 byte) - CRC (1 byte) - Junk (1 byte)
180
0097 181 nb_tx_byte EQU !11
0097 182 Tx_Byte ds nb_tx_byte
183
main_quick_tx.asm Assembled with CASM08Z 3/18/2003 3:17:57 PM PAGE 5
00A2 184 Current_Tx_Bit ds 1
00A3 185 Next_Tx_Bit ds 1
00A4 186 current_tx_byte ds 1
00A5 187 nb_1 ds 2
00A7 188 Last_byte EQU {Tx_byte+nb_tx_byte}
189
190 ; Checksum
191
00A7 192 Chk_count ds 1
00A8 193 $Include 'daytona_ram_variables_avg.h'
194 ;/* hardware variables for Daytona */
195 ;/* v0.1 Ador Reodique 4/20/00
196 ;/* Modified by Jeff Burgess for 8x oversampling */
197
198 ; variables for Daytona Serial and SAR routines
199
00A8 200 T2 ds 1 ; temporary
variable 2
00A9 201 T3 ds 1
00AA 202 T4 ds 1
00AB 203 T5 ds 1
00AC 204 AVGCOUNT ds 1 ; Averaging counter
00AD 205 SAR ds 1 ; SAR result
Register
00AE 206 BITCOUNT ds 1 ; bit count
00AF 207 DATABUFF ds 1 ; DATA buffer
00B0 208 TEMPERATURE ds 1 ; converted
temperature
00B1 209 PRESSURE ds 1 ; converted pressure
210
00B2 211 COUNTER ds 1 ; counter to count
every 6 secs
00B3 212 STATUS ds 1
00B4 213 Random_Number ds 1 ; Pseudo-random
number (from timer counter low register)
00B5 214 Tx_count ds 1 ; Measure pressure
every 3 sec, tx every 54 sec.
00B6 215 Max_Pres ds 1 ; Holds the maximum
pressure
00B7 216 Min_Pres ds 1 ; Holds the minimum
pressure
217 ; Daytona
Serial and SAR variables
218
7880 219 org RomStart
7880 220 $Include 'util.asm'
221 ;/**************************************************
***************************/
222 ;/* PROJECT : RF key demonstrator (ASK or FSK)
*/
223 ;/* Functions: tempo
*/
224 ;/**************************************************
***************************/
225
226 ;/**************************************************
***************************/
227 ;/* tempo
main_quick_tx.asm Assembled with CASM08Z 3/18/2003 3:17:57 PM PAGE 6
*/
228 ;/* Description : it waits for n cpu cycles
*/
229 ;/* In : H:X
*/
230 ;/* Out : TMOD, TSC
*/
231 ;/* local variables :
*/
232 ;/**************************************************
***************************/
233
234 Tempo:
235
7880 [02] 87 236 psha
237
7881 [03] B620 238 lda TSC ;
7883 [02] A47F 239 and #%01111111 ; clear tof
7885 [02] AA30 240 ora #%00110000 ; stop the counter,
7887 [03] B720 241 sta TSC ; while keeping
prescaler same
242
7889 [04] 3523 243 sthx tmodh
788B [04] 1B20 244 bclr 5,TSC ; start the timer
788D [05] 0F20FD 245 brclr 7,TSC,* ; wait until the
tempo is expired
246
7890 [02] 86 247 pula
248
7891 [04] 81 249 rts
7892 250 $Include 'emis1.asm'
251 ;/**************************************************
***************************/
252 ;/* PROJECT : RF key demonstrator (FSK)
*/
253 ;/* Functions: Wake_up_Rx
*/
254 ;/* Transmit_1
*/
255 ;/* Init_timer0
*/
256 ;/* tempo
*/
257 ;/* Transmit
*/
258 ;/* Tx_Uhf_ISR
*/
259 ;/**************************************************
***************************/
260
261
262 ;/**************************************************
***************************/
263 ;/* Transmit_1
*/
264 ;/* Description : it transmits a tone at 9600 bauds
for 64 ms */
265 ;/* In :
main_quick_tx.asm Assembled with CASM08Z 3/18/2003 3:17:57 PM PAGE 7
*/
266 ;/* Out : nb_1
*/
267 ;/* local variables :
*/
268 ;/**************************************************
***************************/
269
270 Transmit_1:
271
7892 [03] B625 272 lda TSC0 ; initial output = H
7894 [02] A4E3 273 and #%11100011
274 ; \\\_______;Pin under port
control,
275 ; \________;Initial output =
High
7896 [03] B725 276 sta TSC0
7898 [04] AD01 277 bsr Init_Timer0
278
789A [04] 81 279 rts
280
281 ;/**************************************************
***************************/
282 ;/* Init_timer0:
*/
283 ;/* Description : it initializes the timer for PWM
output at 9600 bauds */
284 ;/* with uPclk as Tclk
*/
285 ;/* In :
*/
286 ;/* Out : TSC, TSC0, TMOD, TCH0
*/
287 ;/* local variables : H:X
*/
288 ;/**************************************************
***************************/
289
290 Init_Timer0:
291
789B [02] 8B 292 pshh ; save h & x
789C [02] 89 293 pshx
294
789D [04] 6E01A2 295 mov #1,current_tx_bit
78A0 [04] 6E01A3 296 mov #1,next_tx_bit
297
78A3 [03] B620 298 lda TSC
78A5 [04] 6E3720 299 mov #$37,TSC ; counter stopped &
cleared, tof clear, TOF_ISR disabled
300 ; DATACLK = Timer
clk
301
302 ; mov #$30,TSC ; Use this if you
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -