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.
I have the following problem, P0.23 and P0.24 are Select as AD0.0 and AD0.1, when I read of the channels, they have the same Voltage as AD0.2 on P0.25, but nothing stands in the schematics of P0.23 and P0.24, they are not connected or am I wrong?
1) You didn't read the posting instructions so very carefully. You forgot to pick up how to post source code.
2) DAC != ADC.
3) Try to use just a single language for variable names and comments. English is normally a good choice. Helps if you want help. And many companies have english as official language. Besides - much easier when you cut/paste code from projects and examples you find on the net.
4) You read out a value into variable dac_Vin. Then you compute DACin based on adc_Ain, before returning DACin. So DACin doesn't seem to be based on any value you read out from the ADC, but from a variable you don't show us where it gets its value from.
I checked the source code again with debuging, and its correct!
I work on a MCB1760 evaluation board, and on the schematic pdf of MCB1760, the P0.23 and P0.24 are not connected to anything, but if I have the pins as described above as AD0.0 and AD0.1 select, they get the same voltage as AD0.2 select???
"I checked the source code again with debuging, and its correct!"
Are you saying that the code you checked is not the same as the code you posted?
Because the code you posted assigns the ADC value to one variable (dac_Vin). But uses a completely different variable (adc_Ain) for converting from ADC ticks into voltage.
If you never assign a new value to adc_Ain - how can you then use it to represent the new ADC value?
I checked the source code with debuging, after i correct the source code!
and so must it be the connecting that are not be writen in the schematics!
etc.:
Don't try to measure voltages for unconnected pins.
When used as digital inputs, they normally have a weak pull-up enabled (unless you disable the pull-up or switches it to pull-down).
But what holds the pins at a known state when you change them to ADC inputs, if you haven't connected any external signals to the pins?
Nonsense!