Question RS232 and I2C component and interrupts
Posted: Mon Oct 31, 2011 9:18 am
Hey there,
I got a problem using RS232 and i2C component.
Short explain the situation:
A master/slave combination interchanges 10bytes with eachother.
The attached program is a slave (one of seven) that recieves RS485 Data from a Master (9,N,38400) via RS232 RX Interrupt.
Also in the slave is used a I2C bus component that read the the board temperature LM75.
Now the fault:
I´ve isolated the problem in fcf-file.
When I use the program without the i2c routines, then the slaves works free from error over days. That is detecting by the master, wich proofes the backsending slave adress.
Then I want to use the Flowcode routines “Start I2C “, “Transmit”, ”Read1”, ”Read2”, ”Stop” every second to read the temperature and then sometimes the RXINT seems to be done but there is no or a wrong value in the Rxread-component value what is given back. (This occours various times in a minute).
I checked the hardware
=> RS485 working over day => seems ok
=> I2C Pullups 4K7 an the picture seems ok to and the LM75 is working.
Is there a relationship between the both things. I don´t know how to solve this. I spend days to find out whats going on there. The I2C Signals are 72,57Khz (slowest).
Have you got any ideas?
PIC 16F876/20SP 18,432Mhz
Regards from the sunny
germany
Carsten
I got a problem using RS232 and i2C component.
Short explain the situation:
A master/slave combination interchanges 10bytes with eachother.
The attached program is a slave (one of seven) that recieves RS485 Data from a Master (9,N,38400) via RS232 RX Interrupt.
Also in the slave is used a I2C bus component that read the the board temperature LM75.
Now the fault:
I´ve isolated the problem in fcf-file.
When I use the program without the i2c routines, then the slaves works free from error over days. That is detecting by the master, wich proofes the backsending slave adress.
Then I want to use the Flowcode routines “Start I2C “, “Transmit”, ”Read1”, ”Read2”, ”Stop” every second to read the temperature and then sometimes the RXINT seems to be done but there is no or a wrong value in the Rxread-component value what is given back. (This occours various times in a minute).
I checked the hardware
=> RS485 working over day => seems ok
=> I2C Pullups 4K7 an the picture seems ok to and the LM75 is working.
Is there a relationship between the both things. I don´t know how to solve this. I spend days to find out whats going on there. The I2C Signals are 72,57Khz (slowest).
Have you got any ideas?
PIC 16F876/20SP 18,432Mhz
Regards from the sunny

Carsten