Mercurial > public > mk2
comparison 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 |
comparison
equal
deleted
inserted
replaced
330:447390289f47 | 331:469f4861c7c1 |
---|---|
50 ; Dump screen contains to the UART | 50 ; Dump screen contains to the UART |
51 | 51 |
52 dump_screen_0: | 52 dump_screen_0: |
53 | 53 |
54 ;---- Send OLED box command for the full screen window ------------------- | 54 ;---- Send OLED box command for the full screen window ------------------- |
55 mullw 0 ; PRODH:L <- 0 | 55 mullw 0 ; PRODH:L <- 0 |
56 | 56 |
57 AA_CMD_WRITE 0x35 ; VerticalStartAddress HIGH:LOW | 57 AA_CMD_WRITE 0x35 ; VerticalStartAddress HIGH:LOW |
58 AA_DATA_WRITE_PROD ; 00:00 | 58 AA_DATA_WRITE_PROD ; 00:00 |
59 | 59 |
60 AA_CMD_WRITE 0x36 ; VerticalEndAddress HIGH:LOW | 60 AA_CMD_WRITE 0x36 ; VerticalEndAddress HIGH:LOW |
74 AA_CMD_WRITE 0x22 ; Start reading. | 74 AA_CMD_WRITE 0x22 ; Start reading. |
75 rcall PLED_DataRead ; Dummy pixel to skip. | 75 rcall PLED_DataRead ; Dummy pixel to skip. |
76 rcall PLED_DataRead ; Dummy pixel to skip. | 76 rcall PLED_DataRead ; Dummy pixel to skip. |
77 | 77 |
78 movlw .160 ; 160x2 columns | 78 movlw .160 ; 160x2 columns |
79 movwf PRODH | 79 movwf uart1_temp |
80 dump_screen_1: | 80 dump_screen_1: |
81 btg LED_red ; LEDactivity toggle | 81 btg LED_red ; LEDactivity toggle |
82 | 82 |
83 AA_CMD_WRITE 0x22 ; Re-sync data. | |
84 | |
83 movlw .240 ; 240 lines | 85 movlw .240 ; 240 lines |
84 movwf PRODL | 86 movwf uart2_temp |
87 | |
88 setf TRISD ; PortD as input. | |
89 clrf PORTD | |
85 | 90 |
86 dump_screen_2: | 91 dump_screen_2: |
87 setf TRISD ; PortD as input. | |
88 | 92 |
89 rcall PLED_DataRead ; read first pixel-low byte | 93 rcall PLED_DataRead ; read first pixel-low byte |
90 movwf TXREG ; send | 94 movwf TXREG ; send |
91 call rs232_wait_tx ; wait for UART | 95 call rs232_wait_tx ; wait for UART |
92 | 96 |
93 rcall PLED_DataRead ; read first pixel-high byte | 97 rcall PLED_DataRead ; read first pixel-high byte |
94 movwf TXREG ; send | 98 movwf TXREG ; send |
95 call rs232_wait_tx ; wait for UART | 99 call rs232_wait_tx ; wait for UART |
96 | 100 |
97 rcall PLED_DataRead ; read second pixel-low byte | 101 rcall PLED_DataRead ; read second pixel-low byte |
98 movwf TXREG ; send | 102 movwf TXREG ; send |
99 call rs232_wait_tx ; wait for UART | 103 call rs232_wait_tx ; wait for UART |
100 | 104 |
101 rcall PLED_DataRead ; read second pixel-high byte | 105 rcall PLED_DataRead ; read second pixel-high byte |
102 movwf TXREG ; send | 106 movwf TXREG ; send |
103 call rs232_wait_tx ; wait for UART | 107 call rs232_wait_tx ; wait for UART |
108 | |
109 | |
110 decfsz uart2_temp,F | |
111 bra dump_screen_2 | |
104 | 112 |
105 clrf TRISD ; Back to normal (PortD as output) | 113 clrf TRISD ; Back to normal (PortD as output) |
106 | 114 |
107 decfsz PRODL,F | 115 decfsz uart1_temp,F |
108 bra dump_screen_2 | 116 bra dump_screen_1 |
109 | |
110 AA_CMD_WRITE 0x22 ; Sync high/low byte, again. | |
111 | |
112 decfsz PRODH,F | |
113 bra dump_screen_1 | |
114 | 117 |
115 AA_CMD_WRITE 0x00 ; NOP, to stop Address Update Counter | 118 AA_CMD_WRITE 0x00 ; NOP, to stop Address Update Counter |
116 return | 119 return |
117 | 120 |