555 Astable timer integration to MCU pic18f4550 need help..

ErnieM

Joined Apr 24, 2011
8,377
I use MPLAB (non X) and several of the free Microchip compilers, mostly XC8, C18, and C32. I've uses some other too, but these are my current choices.
 

THE_RB

Joined Feb 11, 2008
5,438
Considering the OP has not worked with I2C interfacing why not just use the PIC to generate the real time clock data? It's much simpler and there's no reason you are forced touse a separate RTC IC.

All you need is a xtal for the PIC and generate exact seconds in software;
http://www.romanblack.com/one_sec.htm

it does not matter what speed the xtal is, so this type of RTC can be added to any PIC project that uses any value xtal.
 

ErnieM

Joined Apr 24, 2011
8,377
Thank you very much for your suggestions! i really appreciate it! ok then ill give it a try with the RTC..i was already planning to use it but my teacher said that it is hard to integrate this rtc with the mcu?? so i decided to use a simple 555 timer..i was not so familiar with RTC so i dont have any idea..what i knew was the built in clock inside the mcu,but it is very hard to configure..so ill give it a try with the RTC..thanks for suggestiions! Appreciate much! ill update again soon.
OK, so it seems you ordered a RTC... they are not the worst thing to integrate into your app. MC has several software libraries to use them (perhaps too many!).

Which RTC device did you pick? I may have a routine to read it out you could use.
 

Thread Starter

daiza

Joined Dec 18, 2012
15
I've used the DS1307..actually i've been able to display the time of rtc in an lcd..the problem is,it's displaying the time on my pc when i use my pickit2 in supplying voltage but when i use a separate voltage supply, it does not display any time and date..it seems like the time on my rtc was synchronized with the time in my pc..hope you could help me..thanks.
 

ErnieM

Joined Apr 24, 2011
8,377
Sorry, I don't have any code on hand for the DS1307.

If your program works only when the PICkit is attached see if you have a pull up resistor on the MCLR line.

Also check you didn't program it with a debug build.
 

Thread Starter

daiza

Joined Dec 18, 2012
15
thanks anyway..i dont have any pull up resistor in my MCLR..but i do have 2 pull up resistors on the ports where i connect my SCL and SDA of my RTC and 3 other pull up resistors connected along with my 3 buttons (for setting time)..i'll try to debug again my code later..i'll update again my results. thanks.
 

thatoneguy

Joined Feb 19, 2009
6,359
I've used the DS1307..actually i've been able to display the time of rtc in an lcd..the problem is,it's displaying the time on my pc when i use my pickit2 in supplying voltage but when i use a separate voltage supply, it does not display any time and date..it seems like the time on my rtc was synchronized with the time in my pc..hope you could help me..thanks.
Do you have a coin battery to supply power to the DS1307 while external power is removed connected properly?
 

Thread Starter

daiza

Joined Dec 18, 2012
15
Yes sir..i do have a battery..actually the ds1307 i bought was already a ready made module..everything was in there including the xtal and the backup battery..
 

THE_RB

Joined Feb 11, 2008
5,438
The ready-made modules normally come with source code in C. Did you get that?

Sometimes you have to ask the supplier for a link and download the source code.
 

Thread Starter

daiza

Joined Dec 18, 2012
15
i already did..i just had a manual of the module..i'll try fixing again my code..by the way anyone here any info about interfacing pic18f4550 with gsm module (sim340dz) i'm using mikroC pro in coding..hope anyone could help me.thanks.
 
Top