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.
Hi again, I am using C167. I am using PEC for AD-conversion. I configure PEC as follows: ADCIC = 0x007B; PECC3 = 0x00FF; SRCP3 = (int) (&ADDAT); DSTP3 = (int) (&P3); ADCON = 0x0090; I works fine to transfer values to from ADDAT to port P3. . Now I want to determine how many times AD-conversion has taken place. In PECCx there are 8-LSB are: COUNT (PEC Transfer Count) Now I wonder if I am on right track or there are other way to do what I want. Even if I use the 8-LSB of PECCx I can have the max value 2 raised to power 8 i.e. 256, what happens if the nr of AD-conversion exceed 256? Can someone help me in this regard? Send me mail if something is not clear. thanks in advance regards /M
Hi Mohammad, Read the microcontroller manual, Interrupt and Trap Functions, Operation of the PEC Channels. According to the manual, if you put the PEC channel in continuous mode (as you did in your example by setting the COUNT field of PECC3 to 0xFF,) there will be no way to find out how many transfers have taken place. It will go on forever, unless you modify control registers or trigger a reset or cut the power... Regards, - Mike