I have a Concerto controlcard with F28M35H52C1.
I'm trying to find an example project on this and figure out how to read ADC channel and send the result to UART.
Could someone please help?
Thanks,
Amin
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.
I have a Concerto controlcard with F28M35H52C1.
I'm trying to find an example project on this and figure out how to read ADC channel and send the result to UART.
Could someone please help?
Thanks,
Amin
Amin,
If you haven't already, please download controlSUITE from the TI website. This has all of the C2000 software and example projects for all of our microcontrollers. There is a project called adc_soc and uart_echo that you can use as a reference for what you want to do.
Regards,
Ricky
Ricky
I got both of these projects working seperatly.
I tried to combine these two codes, by combining adding their different sections including definition sections, main code, and functions. but it does not work. What modifications do I need to make to the combined code in order to make it work.
In parallel, I started to learn SYSBIOS, I got an example to work "sysbios_adc_concerto". But again, I'm missing how to implement a UART in that project.
I much appreciate your help. Those "adc_soc" and "uart_echo" are kinda of short. If you kindly can combine those two and send me a working file, I'm sure, I can pick up speed on this and figure out the rest.
Thanks,
Amin
Amin,
I would stay away from SYSBIOS at least until you can piece the ADC and UART examples together. This is a VERY simple task and if you are having trouble with it, you certainly don't want to jump into a real time operating system.
Because this is Concerto you don't need to combine the projects. You will have one project running on each core, you will actually just need to modify the UART project to read values from the ADC result registers which are readable by the M3 and put them in the UART transmit FIFO. Keep in mind if you want the data to actually be transmitted out of the pin, you will need to configure the GPIO mux and turn off the UARTs loopback mode.
Hope that helps,
Trey
ok, I figured out how to put a veriable in UART FIFO.
but i have problems in reading the ADC register. I'm defining "adc_temp_record" , and trying to get the ADC register of "Adc1Result.ADCRESULT0" by the following command:
adc_temp_record = Adc1Result.ADCRESULT0;
But it gives me the error of "identifier "Adc1Result" is undefined.
Do I need to "include" something? what is the line of code to access that register?
Thanks!
Amin
Amin,
Good to hear you were able to write to the UART.
I assume you are having trouble because you are trying to access the ADC result registers with the C28x style of structures. These structures do not exist for M3 projects and registers cannot be accessed this way on the M3. Instead you'll need to use the HWREG macro and the address offset definition found in MWare/inc. Include hw_memmap.h and hw_adc.h and access the result registers like this:
unsigned long result123;
result123 = HWREG(ADC1_BASE + ADC_O_RESULT0);
Keep in mind the C28x core will have to setup the ADC. The M3 can only read the ADC result registers.
Regards,
Trey