ahmet2004
Member level 3

hi!!!
The only changes i made are as below
#define RTC_SDA PIN_B0
#define RTC_SCL PIN_B1
and this is codes
#include <18F4550.h>
#fuses HSPLL,USBDIV,PLL5,CPUDIV1,VREGEN,NOWDT,NOPROTECT,NOLVP
#use delay(clock=48000000) //,RESTART_WDT
#include <ds1307.c>
#include <lcd.c>
#define LCD_RS PIN_D0
#define LCD_RW PIN_D1
#define LCD_E PIN_D2
#define LCD_DB4 PIN_D4
#define LCD_DB5 PIN_D5
#define LCD_DB6 PIN_D6
#define LCD_DB7 PIN_D7
void main()
{
BYTE sec;
BYTE min;
BYTE hrs;
BYTE day;
BYTE month;
BYTE yr;
BYTE dow;
lcd_init();
ds1307_init();
// Set date for -> 29 June 2008 Sunday
// Set time for -> 17:36:09
ds1307_set_date_time(29,6,8,7,17,36,9);
while(1)
{
delay_ms(1000);
ds1307_get_date(day,month,yr,dow);
ds1307_get_time(hrs,min,sec);
lcd_putc(sec);
}
}
i want to display sec on LCD. but i couldnt get number. instead i have a black block blinking on my LCD screen. i saw the original codes. it uses #device adc=8 but i didnt use it because when i compile the code, that line caused error.
anybody has any idea why it's not working?
thanks ?
The only changes i made are as below
#define RTC_SDA PIN_B0
#define RTC_SCL PIN_B1
and this is codes
#include <18F4550.h>
#fuses HSPLL,USBDIV,PLL5,CPUDIV1,VREGEN,NOWDT,NOPROTECT,NOLVP
#use delay(clock=48000000) //,RESTART_WDT
#include <ds1307.c>
#include <lcd.c>
#define LCD_RS PIN_D0
#define LCD_RW PIN_D1
#define LCD_E PIN_D2
#define LCD_DB4 PIN_D4
#define LCD_DB5 PIN_D5
#define LCD_DB6 PIN_D6
#define LCD_DB7 PIN_D7
void main()
{
BYTE sec;
BYTE min;
BYTE hrs;
BYTE day;
BYTE month;
BYTE yr;
BYTE dow;
lcd_init();
ds1307_init();
// Set date for -> 29 June 2008 Sunday
// Set time for -> 17:36:09
ds1307_set_date_time(29,6,8,7,17,36,9);
while(1)
{
delay_ms(1000);
ds1307_get_date(day,month,yr,dow);
ds1307_get_time(hrs,min,sec);
lcd_putc(sec);
}
}
i want to display sec on LCD. but i couldnt get number. instead i have a black block blinking on my LCD screen. i saw the original codes. it uses #device adc=8 but i didnt use it because when i compile the code, that line caused error.
anybody has any idea why it's not working?
thanks ?