FMOpt2000
Joined: 10 Jan 2008 Posts: 17
|
16f88 I2C (slave) and SCL line LOW |
Posted: Thu Jan 10, 2008 3:02 am |
|
|
Hi.
I'using a Cypress Microcontroller for communicate with a 16F88 (slave) over I2C.
I have written this simple program:
//I2C_Control.h
#include <16F88.h>
#fuses NOWDT,HS, NOPUT, MCLR, BROWNOUT, LVP, NOCPD, NOWRT, NODEBUG, NOPROTECT, FCMEN, IESO
#use delay(clock=12000000)
#use i2c(Slave,Slow,sda=PIN_B1,scl=PIN_B4,restart_wdt,force_hw,address=0x50)
//I2C_Control.c
#include "I2C_Control.h"
void main()
{
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
}
Is it simple?
Yes, but the problem is the SCL line (PIC) wired to the Cypress SCL line, goes LOW and block the Microcontroller USB.
This line (inactive in the software) must be high!
Is it a software mistake?
Someone can help me.
I use PCWH Compiler:
IDE version 3.221
PCB version 3.221
PCM version 3.221
PCH version 3.221
Bye
Franco |
|