delphy_boy
Joined: 15 Sep 2008 Posts: 8
|
I2C hardware module issue |
Posted: Mon Sep 15, 2008 4:29 am |
|
|
Hi,
Does anyone know why my program hangs when using the I2C harware functions on a PIC18F6722?
When I try to do an I2C start the program just hangs.
Here is the code
Code: |
#use delay(clock=3684000)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8,stream=GUI,errors)
#use i2c(master, sda=PIN_C4, scl=PIN_C3, stream=ONE, FORCE_HW)
#use i2c(master, sda=PIN_D5, scl=PIN_D6, stream=OTHER, FORCE_HW)
void initialise_ADC()
{
i2c_start(ONE);//initiate a start condition
output_low(PIN_C0);
i2c_write(ADC_WRITE_ADDR);//send device write address
i2c_write(ADC_SET_CONVERT);//set ADC configuration
i2c_stop();//terminate comms
} |
|
|