Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
ctboard:peripherals:lcd_ascii [2016/02/25 13:31] – created feurctboard:peripherals:lcd_ascii [2022/12/23 12:20] (current) ruan
Line 1: Line 1:
 ====== LCD ASCII Interface ====== ====== LCD ASCII Interface ======
  
-The integrated LCD controller must allways be accessed with 16 bit half words! \\ \\+Every position on the LCD corresponds to an address. See below for the relation. \\ \\
  
-> {{ctboard:ctboard_mode_1.svg?48px }} {{ctboard:ctboard_mode_2.svg?48px }} {{ctboard:ctboard_mode_3.svg?48px }} Please make sure the CT Board is in the correct mode. +> {{ctboard:ctboard_mode_1.svg?48px }} {{ctboard:ctboard_mode_2.svg?48px }} {{ctboard:ctboard_mode_3.svg?48px }} {{ctboard:ctboard_mode_4.svg?48px }} Please make sure the CT Board is in the correct mode. 
-> Supported [[ctboard:mode_switch|modes]]: **1**, **2**, **3** +> Supported [[ctboard:mode_switch|modes]]: **1**, **2**, **3**, **4** 
 \\ \\
 +
 +===== Registers =====
 +
 +The registers are write only.
 +
 +\\ {{ctboard_lcd_ascii_reg_new.svg}} \\ \\
 +
 +===== Display Positions =====
 +
 +\\ {{ctboard_lcd_ascii_new.svg?700em}} \\ \\
 +
 +Base address: 0x6000'0300
  
 ===== Programming Example ===== ===== Programming Example =====
  
-The code snippet bellow shows how to use the ASCII interface of the LCD.+The code snippets below shows how to use the ASCII interface of the LCD.
  
 <code c> <code c>
 #include "reg_ctboard.h" #include "reg_ctboard.h"
 +const char text[] = "hello";
  
-CT_LCD->ASCII = (uint16_t) ((13u << 8u) | ascii_char)   /* Write ascii_char at position 13 on the LCD. */+CT_LCD->ASCII[13u] = 'c'        /* Write character 'c' at position 13 on the LCD. */ 
 +CT_LCD->ASCII[18u] = text[0u];    /* Write character 'h' from string "hello" at position 18 on the LCD. */
 </code> </code>
 \\ \\
  
 <code asm> <code asm>
-ADDR_LCD_ASCII  EQU      0x60000310+ADDR_LCD_ASCII  EQU      0x60000300
  
                 LDR      r0, =ADDR_LCD_ASCII                 LDR      r0, =ADDR_LCD_ASCII
-                LDR      r1, #13                          ; Load position on display into r1. +                LDR      r1, ="E"                         ; Load value of ASCII char 'E' into r1.                 
-                LDR      r2, "E"                          ; Load value of ASCII char 'E' into r2. +                STRB     r1, [r0, #12                   ; Write 'E' at position 13 on the LCD.
-                 +
-                ; Thumb instruction set +
-                LSLS     r1, #8                           ; Shift position 8 bits to the left +
-                ORRS     r2, r1                           ; Combine position with ASCII character +
-                 +
-                ; ARM instruction set +
-                ORRS     r2, r1, LSL #8                   ; Shift and combine position value with ASCII character +
-                 +
-                STRH     r2, [r0, #0                    ; Write ascii_char at position 13 on the LCD.+
 </code> </code>
 \\ \\
  
-===== Registers ===== 
- 
-The Registers are read / write. 
- 
-\\ {{ctboard_lcd_ascii_reg.svg}} \\ \\ 
- 
-===== Display Positions ===== 
- 
-\\ {{ctboard_lcd_ascii.svg?700em}} \\ \\ 
  • ctboard/peripherals/lcd_ascii.1456407082.txt.gz
  • Last modified: 2016/02/25 13:31
  • by feur