Hi, i'm making a project with mc9so8sh8 and my hardwere makes me need to read one analog value on ptc3 and, other time, send a digital output form pct3. How i disable the adc and make the output? (After i need enable that, again)
tks!
Solved! Go to Solution.
Hi Oliveria,
You need to rewrite Pin Control Registers during the switching, please refer to section 9.3.8-9.3.10 of the datasheet. If one port is used as analop inputs, the corresponding bit in APCTLx should be cleared, otherwise it should be set.
Take PTC3 as an example, the corresponding control bit is ADPC11(take a look at Table 9-1 in page 121, you can see relationship between AD Cpins and IO pins), Setting ADPC11 when PTC3 is used be ADC and Clearing it when it is used as Digital IO.
B.R
XWP
Hi Oliveria,
You need to rewrite Pin Control Registers during the switching, please refer to section 9.3.8-9.3.10 of the datasheet. If one port is used as analop inputs, the corresponding bit in APCTLx should be cleared, otherwise it should be set.
Take PTC3 as an example, the corresponding control bit is ADPC11(take a look at Table 9-1 in page 121, you can see relationship between AD Cpins and IO pins), Setting ADPC11 when PTC3 is used be ADC and Clearing it when it is used as Digital IO.
B.R
XWP