Skip to content

Instantly share code, notes, and snippets.

@gresan-gits
Last active February 2, 2020 11:09
Show Gist options
  • Save gresan-gits/815ccd1cd05ad6c3ae96dcbf16d3643b to your computer and use it in GitHub Desktop.
Save gresan-gits/815ccd1cd05ad6c3ae96dcbf16d3643b to your computer and use it in GitHub Desktop.
CCS C LCD16x2
#include <main.h>
#define LCD_ENABLE_PIN  PIN_B0                       
#define LCD_RS_PIN PIN_B1 
#define LCD_RW_PIN PIN_B2
#define LCD_DATA4 PIN_B4
#define LCD_DATA5 PIN_B5
#define LCD_DATA6 PIN_B6
#define LCD_DATA7 PIN_B7
#include <lcd.c>
void main()
{
lcd_init ();
lcd_putc("\fChao ban den voi\n  MCU+ Blog");
WHILE (TRUE)
  {}
}
#include <18F4520.h>
#device adc=16
#FUSES NOWDT //No Watch Dog Timer
#FUSES WDT128 //Watch Dog Timer uses 1:128 Postscale
#FUSES HS //High speed Osc (> 4mhz for PCM/PCH) (>10mhz for PCD)
#FUSES NOBROWNOUT //No brownout reset
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOXINST //Extended set extension and Indexed Addressing mode disabled (Legacy mode)
#use delay(clock=20000000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment