I am using the M32C/83 and bit banging I2C out on port 9. Port 9 requires the data direction register to be unlocked via PRCR before writing to PD9. Occasionally, PD9 isn't getting set and one of my I2C pins does not go low when it should. Bad things happen after that.
The H/W manual states that no interrupts or DMA should occur between the unlocking of PD9 and the writing of PD9. I lock out all maskable interrupts and ensure the unlock and PD9 access were contiguous.
Any suggestions or clarifications welcome.
(I'm thinking of reading back and verifying PD9 after I write to it and rewrite if necessary. Feels dirty...)
John G.