annotate code_part1/OSTC_code_asm_part1/dump_screen.asm @ 331:469f4861c7c1 ScreenDump

Debug screen dump
author JeanDo
date Tue, 10 May 2011 09:49:18 +0200
parents 447390289f47
children 1828234369fc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
330
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
1 ;=============================================================================
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
2 ;
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
3 ; File dump_screen.asm
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
4 ;
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
5 ; Dump screen contains to the serial interface.
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
6 ;
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
7 ; This program is free software: you can redistribute it and/or modify
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
8 ; it under the terms of the GNU General Public License as published by
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
9 ; the Free Software Foundation, either version 3 of the License, or
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
10 ; (at your option) any later version.
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
11 ;
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
12 ; This program is distributed in the hope that it will be useful,
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
13 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
14 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
15 ; GNU General Public License for more details.
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
16 ;
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
17 ; You should have received a copy of the GNU General Public License
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
18 ; along with this program. If not, see <http://www.gnu.org/licenses/>.
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
19 ;
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
20 ; Copyright (c) 2011, JD Gascuel.
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
21 ;=============================================================================
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
22 ; HISTORY
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
23 ; 2011-05-08 : [jDG] Creation.
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
24 ;
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
25 ; BUGS :
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
26 ; * ...
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
27 ;=============================================================================
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
28
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
29 ; Manage interface to the OSTC platform:
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
30 dump_screen:
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
31 bcf uart_dump_screen ; clear flag!
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
32
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
33 movlw 'l'
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
34 movwf TXREG ; Send command echo.
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
35 bsf no_sensor_int ; No Sensor Interrupt
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
36 bcf PIE1,RCIE ; no interrupt for UART
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
37 bcf PIR1,RCIF ; clear flag
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
38 bsf LED_blue ; LEDusb ON
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
39 call rs232_wait_tx ; wait for UART
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
40
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
41 call dump_screen_0
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
42
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
43 bcf no_sensor_int ; Restore Sensor Interrupt
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
44 bcf LED_blue ; Clear led
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
45 bcf LED_red ; Clear led
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
46 bsf PIE1,RCIE ; Interrupt for RS232
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
47 return
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
48
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
49 ;=============================================================================
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
50 ; Dump screen contains to the UART
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
51
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
52 dump_screen_0:
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
53
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
54 ;---- Send OLED box command for the full screen window -------------------
331
469f4861c7c1 Debug screen dump
JeanDo
parents: 330
diff changeset
55 mullw 0 ; PRODH:L <- 0
330
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
56
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
57 AA_CMD_WRITE 0x35 ; VerticalStartAddress HIGH:LOW
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
58 AA_DATA_WRITE_PROD ; 00:00
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
59
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
60 AA_CMD_WRITE 0x36 ; VerticalEndAddress HIGH:LOW
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
61 AA_DATA_WRITE 0x01
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
62 AA_DATA_WRITE 0x3F
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
63
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
64 AA_CMD_WRITE 0x37 ; HorizontalAddress START:END
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
65 AA_DATA_WRITE 0x00
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
66 AA_DATA_WRITE 0xEF
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
67
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
68 AA_CMD_WRITE 0x20 ; Start Address Horizontal (.0 - .239)
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
69 AA_DATA_WRITE_PROD ; 00:00
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
70
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
71 AA_CMD_WRITE 0x21 ; Start Address Vertical (.0 - .319)
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
72 AA_DATA_WRITE_PROD ; 00:00
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
73
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
74 AA_CMD_WRITE 0x22 ; Start reading.
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
75 rcall PLED_DataRead ; Dummy pixel to skip.
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
76 rcall PLED_DataRead ; Dummy pixel to skip.
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
77
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
78 movlw .160 ; 160x2 columns
331
469f4861c7c1 Debug screen dump
JeanDo
parents: 330
diff changeset
79 movwf uart1_temp
330
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
80 dump_screen_1:
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
81 btg LED_red ; LEDactivity toggle
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
82
331
469f4861c7c1 Debug screen dump
JeanDo
parents: 330
diff changeset
83 AA_CMD_WRITE 0x22 ; Re-sync data.
469f4861c7c1 Debug screen dump
JeanDo
parents: 330
diff changeset
84
330
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
85 movlw .240 ; 240 lines
331
469f4861c7c1 Debug screen dump
JeanDo
parents: 330
diff changeset
86 movwf uart2_temp
469f4861c7c1 Debug screen dump
JeanDo
parents: 330
diff changeset
87
469f4861c7c1 Debug screen dump
JeanDo
parents: 330
diff changeset
88 setf TRISD ; PortD as input.
469f4861c7c1 Debug screen dump
JeanDo
parents: 330
diff changeset
89 clrf PORTD
330
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
90
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
91 dump_screen_2:
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
92
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
93 rcall PLED_DataRead ; read first pixel-low byte
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
94 movwf TXREG ; send
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
95 call rs232_wait_tx ; wait for UART
331
469f4861c7c1 Debug screen dump
JeanDo
parents: 330
diff changeset
96
330
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
97 rcall PLED_DataRead ; read first pixel-high byte
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
98 movwf TXREG ; send
331
469f4861c7c1 Debug screen dump
JeanDo
parents: 330
diff changeset
99 call rs232_wait_tx ; wait for UART
469f4861c7c1 Debug screen dump
JeanDo
parents: 330
diff changeset
100
330
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
101 rcall PLED_DataRead ; read second pixel-low byte
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
102 movwf TXREG ; send
331
469f4861c7c1 Debug screen dump
JeanDo
parents: 330
diff changeset
103 call rs232_wait_tx ; wait for UART
330
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
104
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
105 rcall PLED_DataRead ; read second pixel-high byte
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
106 movwf TXREG ; send
331
469f4861c7c1 Debug screen dump
JeanDo
parents: 330
diff changeset
107 call rs232_wait_tx ; wait for UART
469f4861c7c1 Debug screen dump
JeanDo
parents: 330
diff changeset
108
469f4861c7c1 Debug screen dump
JeanDo
parents: 330
diff changeset
109
469f4861c7c1 Debug screen dump
JeanDo
parents: 330
diff changeset
110 decfsz uart2_temp,F
469f4861c7c1 Debug screen dump
JeanDo
parents: 330
diff changeset
111 bra dump_screen_2
330
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
112
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
113 clrf TRISD ; Back to normal (PortD as output)
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
114
331
469f4861c7c1 Debug screen dump
JeanDo
parents: 330
diff changeset
115 decfsz uart1_temp,F
469f4861c7c1 Debug screen dump
JeanDo
parents: 330
diff changeset
116 bra dump_screen_1
330
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
117
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
118 AA_CMD_WRITE 0x00 ; NOP, to stop Address Update Counter
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
119 return
447390289f47 NEW screen_dump serial command (l)
JeanDo
parents:
diff changeset
120