We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I am having a problem with my I2C. I am using a 89C664 philips microcontroller. I have two of these chips talking to each other. I have my I2C implemented in such a way that if the state (S1STA) doesn't match the correct value, my program will just keep waiting. Since this only happen very rarely, I want to implement a timer so it will automatically be forced out of the subrountine after one or two second. The question can I implement this within an interrupt, because my I2C is called based on interrupt. Also, how would I implement this timer. I am new to this, so any help would be greatly appreciated. The whole point of this is so my chip can resend the data or receive the data again if I2C failed. thanks Tommy
The first thing that you can do: Find the datasheet of your µC. Read it and you will find how to configure all registers of your 8051 unit. for exemple: If you would like to use the Timer 1 of your µC, you must find some notes about TCON, TMOD, TH1, TL1 registers. The @B/B@nterrupt Enable register is IE