SHARE
TWEET

Untitled

a guest Jul 17th, 2017 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.  
  3. MSP4302553|         |LCDDriver
  4. |Pin 1 Boost Capacitor 1
  5. |Pin 2 Capacitor 2 N
  6. |Pin 3 Capacitor 2 P
  7. Vcc (3.5V) |---------|Pin 4 Vdd (Boost Capacitor 1)
  8. Gnd |---------|Pin 5 Gnd
  9. P1.7|---------|Pin 6 (SDA)
  10. P1.6|---------|Pin 7 (SCL)
  11. P2.5|---------|Pin 8 (RST)
  12. P2.4|---------| A (Backlight Anode)
  13. Gnd |---------| K (Backlight Cathode)
  14.  
  15. */
  16. .
  17. .
  18. .
  19.  
  20. char TxData[] =     // Table of LCD display initialization commands
  21. { 0x00,
  22.     0x38,
  23.     0x00,
  24.     0x39,
  25.     0x14,
  26.     0x74, //Contrast set
  27.     0x54,
  28.     0x6F, //Follower control
  29.     0x0C, //Display On, Cursor On, Cursor Blink On
  30.     0x01
  31. };
  32.    
  33. INITIALIZE: (3V)
  34.  MOV I2C_CONTROL,#00H ;WRITE COMMAND
  35.  MOV I2C_DATA,#38H ;Function Set
  36.  LCALL WRITE_CODE
  37.  MOV I2C_CONTROL,#00H ;WRITE COMMAND
  38.  MOV I2C_DATA,#39H ;Function Set
  39.  LCALL WRITE_CODE
  40.  
  41.  MOV I2C_DATA,#14H ;Internal OSC frequency
  42.  LCALL WRITE_CODE
  43.  MOV I2C_DATA,#74H ;Contrast set
  44.  LCALL WRITE_CODE
  45.  MOV I2C_DATA,#54H ;Power/ICON control/Contrast set
  46.  LCALL WRITE_CODE
  47.  MOV I2C_DATA,#6FH ;Follower control
  48.  LCALL WRITE_CODE
  49.  MOV I2C_DATA,#0CH ;Display ON/OFF
  50.  LCALL WRITE_CODE
  51.  MOV I2C_DATA,#01H ;Clear Display
  52.  LCALL WRITE_CODE
RAW Paste Data
Top