This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28069M: Read the ADCRESULTSx registers - Read my ADC channel data

Part Number: TMS320F28069M
Other Parts Discussed in Thread: CONTROLSUITE, MOTORWARE

Hello.

The Question:

What is the line of code I have to write to proj_lab10c.c (I am using Instaspin FOC) to read the line of ADC B0? (I mean get the value that lives in ADCRESULT8 I guess)

--)) Analysis of the question:

I am using DRV8301-HC-EVM, and in this configuration, ADC B0 (else ADCRESULT8 I think) is wired to a potentiometer that is not used for the FOC, and also A4 is open, and not used at all in general. My study shows that the code (scattered on .c and .h files) does the conversion to all 16 channels, and does not discriminate excluding B0 and A4. Thus the value of B0 must be in the Result Registers. Somewhere ! I don't know where. I am hardware EE, with a small knowledge of advanced C programing, I usually write small easy code. With Instaspin some things are a mountain to me.

--)) Attempts:

I tried to use AdcResult.ADCRESULT8 and many more code with no success. Really tried hard to make a line of code so I can go to the handle and get the value, or descypher the "adc.c", "hal.c", "hal.h" etc files but sometimes it made sense, and sometimes it didn't. In controlSUITE, there are standalone examples of Interrupt and sampling ADC channels, but from what I can decode in the .c files, I think this will mess up the FOC code (as I said it is proj_lab10c.c) and/or kill my real time processing for my motor.

--)) Need:

Just want to assign the ADCRESULT8 (if I am right here) to an integer and use that to make some easy things with my code (e.g. adjust the "gMotorVars.SpeedRef_krpm" that lives in 0x89CA.

Thats all.

Help.