Assessment 3
5 points each, total 100
1 Write a C statement that sets up the PIC ADC so that only RA0 is used as an analog input. Deduce the resolution per bit for a 10-bit conversion, assuming a 5 V supply.
2 If a single 4.096V reference voltage is connected to Vref+ and 10-bit conversion completed, write a C statement (a) to declare suitable variables and (b) to convert the input value to the actual voltage for display.
3 List the statements required to set up an ADC interrupt and outline the related ISR initialization if it is called “isrADC.”
4 Explain the advantages of using an interrupt to read the data from an analog input conversion, compared with simply checking it on a regular basis (polling) within the program loop.
5 A 16-bit timer is preloaded ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access