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

#use i2c (RESTART_WDT )

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



Joined: 01 Jun 2010
Posts: 10

View user's profile Send private message

#use i2c (RESTART_WDT )
PostPosted: Wed Jul 21, 2010 6:42 am     Reply with quote

All,

I have below code,
Code:

#use   i2c(Master,Fast=100000,sda=PIN_C4,scl=PIN_C3,restart_wdt,force_hw)

   i2c_start();    //start
   i2c_write(0xA2); //eerpom write addr.
   i2c_write(0x00); //high addr.
   i2c_write(0x00); //low addr.
   i2c_start();        //restart
   i2c_write(0xA3); //eerpom read addr.
   i8var_byte = i2c_read(0);
   i2c_stop();      //stop


After compilation, I can't find any instruction that clear the watch dog timer from disassembly list file.

But the defintion of RESTART_WDT is "Restart the WDT while waiting in I2C_READ".

Thanks
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Jul 21, 2010 11:36 am     Reply with quote

I made a test programs for the 16F877 and 18F452 with vs. 4.109, and
looked at the .LST files. They put CLRWDT instructions in the ASM code
if you specify software i2c, but not if you use FORCE_HW.
Chill



Joined: 01 Jun 2010
Posts: 10

View user's profile Send private message

PostPosted: Wed Jul 21, 2010 8:05 pm     Reply with quote

understood. In the case of FORCE_HW, i will add the "restart_wdt()" manually.

Thanks.
cheehow



Joined: 15 Sep 2010
Posts: 28

View user's profile Send private message

hi !! ned ur help ...
PostPosted: Tue Sep 21, 2010 3:11 am     Reply with quote

i m also using PIC C compiler (CCS C compiler) to write the codes. moreover, i used two pieces of PIC 16F877A mcu to communication wif each other by using i2c. so. chill, can u show me ur i2c communication between master and slave ?? i means ur code for i2c communication.

thxs for help =)
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

Re: #use i2c (RESTART_WDT )
PostPosted: Tue Sep 21, 2010 7:00 am     Reply with quote

Chill wrote:
All,

I have below code,
Code:

#use   i2c(Master,Fast=100000,sda=PIN_C4,scl=PIN_C3,restart_wdt,force_hw)




BTW, you're using the FAST=xxxx and then the number you supply is the speed of the SLOW specification.

What bit rate does it actually provide when you do that?

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
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