Hello I am working at a sonar sistem . When the sensor detects something, a response is sent to the mirocontroller on PORTC.2 I have enabled PCINT10 which works on that pin. I send some pulses on PORTC.0 and I start TIMER0 and after that ,I wait for response on PORTC.2 I have an oscilloscope and I monitor the signal sent to PORTC.2 The sensor sends the right response on that PIN. When the respons comes, PCINT0 interrupt routine is served and the timer is stopped. The problem is that the timer does not report the right value. I use Timer0 at 2Mhz on Atmega162 at 16Mhz. The time needed to be counted, between sending and response is about 700 us. In timer0 interrupt routine I increment a counter that counts timer overflows. I have also tried with Timer1 [16 bit mode] Any ideea --------------------------------- Now that's room service! Choose from over 150,000 hotels in 45,000 destinations on Yahoo! Travel to find your fit. [Non-text portions of this message have been removed]
Message
Atmega162 shared interrupt PCINT10 and timer
2007-06-11 by Sandu Teo
Attachments
- No local attachments were found for this message.