How to write a program (Using C) to control an model ADC by testing an ascending (or descending) series of values via the DAC, stopping when the value corresponds to the input value. The finished program should print only the final value.
Please note that the file in the computer will allow me to interact with a simulated 8 bit (unsigned) ADC. This comprises an 8 bit DAC and a comparitor. There are three functions you need to call. Before you use the ADC, you must initialize it using function initadc(). Since this is only a model of an ADC, this initialize function will use the user to enter a value that simulates the analogue input to the ADC.
To send a value to the DAC part of the ADC you use the functionsetbyte (value). Note that the parameter value is an unsigned character.
To obtain the result of the comparison, you use the function getcompare(). This function returns an int, but only the least significant bit is valid, If the value you sent most recently to the DAC creates an analogue voltage that is smaller than that of the simulated input, then the least significant bit of the return value is cleared to 0, otherwise it is set to 1.
Many many thanksHow to write a program (Using C) to control an model ADC via DAC?
You have just copied that straight out of the question. Most of the help you need is in the question. It is a bit cheeky to expect us to help you with your homework though.How to write a program (Using C) to control an model ADC via DAC?
So you want us to do your homework?
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment