View previous topic :: View next topic |
Author |
Message |
Chill
Joined: 01 Jun 2010 Posts: 10
|
#use i2c (RESTART_WDT ) |
Posted: Wed Jul 21, 2010 6:42 am |
|
|
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
|
|
Posted: Wed Jul 21, 2010 11:36 am |
|
|
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
|
|
Posted: Wed Jul 21, 2010 8:05 pm |
|
|
understood. In the case of FORCE_HW, i will add the "restart_wdt()" manually.
Thanks. |
|
|
cheehow
Joined: 15 Sep 2010 Posts: 28
|
hi !! ned ur help ... |
Posted: Tue Sep 21, 2010 3:11 am |
|
|
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
|
Re: #use i2c (RESTART_WDT ) |
Posted: Tue Sep 21, 2010 7:00 am |
|
|
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 |
|
|
|