I have to interface TSic 206 zacwire digital output temperature sensor with STM32P103 board. I am not able to find any example programs related to this using interrrupts. can anyone please help me.
Hi,
the ZacWire interface that is used in that Chip is a bit weird (IMHO an SPI or even I2C interface would have been much more mcu-friendly).
Look at that document: http://www.ist-ag.ch/eh/ist-ag/resource … ire_EN.pdf, 1.4 describe a reading process.
What they say basically is that you connect the SIGNAL pin to a random GPIO (for example, on the P103, PC1 is free). Then you use an EXTI to have an interrupt on the falling edge of that signal.The ISR enters a counting loop incrementing a memory location (Tstrobe) until it
sees a rise on the ZACwireTM signal.
So at the beginning of the transmission, the EXTI1_IRQHandler is triggered. Then you start counting in a loop until the SIGNAL goes up, your Tstrobe is the counting index when that happen.
The following is what I would probably do, not what they say: You can then keep that Tstrobe somewhere, release the ISR. When the ISR is triggered again, it’s for the MSB, so you can start counting until the SIGNAL goes up again, and you can compare your current index with the TStrobe: since it’s duty cycle encoded, if it’s < : 0, if it’s > 1, then release the ISR and do that for the remaning 8 bits (the last one being a parity, you can probably just check the result of your current word and forget it after that). You need two packets in order to read one sample.
PS: I’m not a big fan of the counting loop in the ISR, but that’s quite simple to implement at least. Maybe a timer could be used to sample the signal ?