chiark / gitweb /
Send HELLO as a result of all slaves being online. Do not crash if slave is slow...
[trains.git] / cebpic / flow-control-test.asm
1 ; UNFINISHED
2
3 ; pin 21 (per-pic-led, RD2/PSP2/C1IN) states: high H = green, low L = red, float Z = black
4
5         include         /usr/share/gputils/header/p18f458.inc
6         include         ../iwjpictest/clockvaries.inc
7
8         code
9 start
10 ; initial config
11         bcf     TXSTA,6,0       ; p181, set 8-bit mode
12         bsf     TXSTA,5,0       ; transmit enable
13         bcf     TXSTA,4,0       ; asynchronous mode
14         bsf     RCSTA,7,0       ; serial port enable (p182)
15         bsc_txsta_brgh          ; set high or low baud rate
16
17 ; set SPBRG to get correct baud rate
18         movlw_movwf_spbrg
19
20 ; set pin 24 to low (transmission allowed from computer)
21
22
23
24 main
25 ; set current letter to a
26 loop
27 ; check whether allowed to transmit (check pin 27 low)
28 ; add current letter to TXREG
29 ; check current letter - if z, go to main; if <z, increment
30
31
32
33
34
35
36
37
38
39
40
41
42         end