CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Burst Transient and I2C bus

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Fabri



Joined: 22 Aug 2005
Posts: 275

View user's profile Send private message

Burst Transient and I2C bus
PostPosted: Thu Feb 22, 2007 11:29 am     Reply with quote

Hi,

I've a problem with RTC PCF8563 and Burst transient.

My micro read rtc every 100us and after a burst on power supply I found the date and time changed. The new date and time isn't bcd format and really strange.

I tryed to supply PCF with only battery but the problem remain.

The micro don't do any kind of reset during test and all seem work fine.

Some any idea about ?

Regards,
Fabri
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Feb 22, 2007 1:56 pm     Reply with quote

Put a 0.1 uF (100 nF) capacitor between the Vdd pin and ground
on both the PIC and the PCF8563 chip. Put the capacitors very
close to the Vdd pins.

Add at least a 10 uF (16v) Tantalum capacitor on the output of your
voltage regulator. Use Tantalum, not Aluminum Electrolytic.
Fabri



Joined: 22 Aug 2005
Posts: 275

View user's profile Send private message

PostPosted: Thu Feb 22, 2007 2:47 pm     Reply with quote

Hi PCM,

I did it, in my layout there's capacitors really near PIC18 and PCF8563.

Any other suggestion ?


Regards,
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Feb 22, 2007 2:56 pm     Reply with quote

Quote:
My micro read rtc every 100us


Are you really trying to read the date and time every 100 us ?

Try changing it to every 1 second.
Fabri



Joined: 22 Aug 2005
Posts: 275

View user's profile Send private message

PostPosted: Thu Feb 22, 2007 3:13 pm     Reply with quote

I'm sorry,

I read RTC every 100ms. I used the same way in other software with PIC16 in assembler without any problem. I read only one register at time.

Do you think I read many time the RTC ?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Feb 22, 2007 3:16 pm     Reply with quote

What driver program are you using to talk to the PCF8563 ?
Did you write it, or is it available on the net ?
Fabri



Joined: 22 Aug 2005
Posts: 275

View user's profile Send private message

PostPosted: Thu Feb 22, 2007 3:36 pm     Reply with quote

Hi,

I wrote the driver by myself using datasheet of PCF8563 and after wrote the assembler one.

I use this routine to read every single register of PCF8563
Code:


#use I2C(MASTER,sda=PIN_C4,scl=PIN_C3,FORCE_HW,slow,RESTART_WDT)

#define address_rtc_read   0b10100011
#define address_rtc_write   0b10100010

int read_rtc_register(int address_rtc){
int dato_locazione_rtc;
int mo;
   i2c_start();
   i2c_write(address_rtc_write);
   i2c_write(address_rtc);
   i2c_start();
   i2c_write(address_rtc_read);
   dato_locazione_rtc =i2c_read();
   mo=i2c_read(0);
   i2c_stop();
   return dato_locazione_rtc;
}
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group