Maxwell Guest
|
LCD WITH 18F4525 |
Posted: Wed Oct 18, 2006 11:55 am |
|
|
I made a code for 16f877A, this code is simulated with Proteus and assemble in protoboard and good run, but the same code for 18f4525, with the library changed the for family 18f, don´t run.
PIC 18F4525.H
---------------------------------------------------------------
---------------------------------------------------------------
#include <18f4525.h>
#fuses XT,NOWDT,NOPROTECT,PUT,NOLVP,nobrownout/
#use delay (clock=4000000) //Fosc=4Mhzç
#use fast_io (B)
#use fast_io (A)
#use fast_io (D)
#include<lcd18f.c>
void main()
{
setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_adc(ADC_OFF|ADC_TAD_MUL_0);
setup_psp(PSP_DISABLED);
setup_spi(FALSE);
setup_wdt(WDT_OFF);
setup_timer_0(RTCC_INTERNAL);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_timer_3(T3_DISABLED|T3_DIV_BY_1);
setup_comparator(NC_NC_NC_NC);
setup_vref(VREF_LOW|-2);
setup_low_volt_detect(FALSE);
setup_oscillator(False);
lcd_init();
printf(lcd_putc,"\Hello");
}
PIC 16f877a. This code run in protoboard
---------------------------------------------------------------
---------------------------------------------------------------
#include <16f877a.h>
#fuses XT,NOWDT,NOPROTECT,PUT,NOLVP,nobrownout/
#use delay (clock=4000000) //Fosc=4Mhzç
#use fast_io (B)
#use fast_io (A)
#use fast_io (D)
#include<lcd2.c>
void main()
{
setup_adc_ports(NO_ANALOGS);
setup_adc(ADC_OFF);
setup_psp(PSP_DISABLED);
setup_spi(FALSE);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
lcd_init();
printf(lcd_putc,"\Hello");
}
--------------------------------------------
----------------------------------------- |
|