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.

Configuring ADC of Sitara AM3359 ICE board using SYS/BIOS

Other Parts Discussed in Thread: AM3359, SYSBIOS

Hi,

We are developing one application where in we are using TI-ICE for Sitara AM3359. In our project we need some digital inputs, PWM and analog inputs. We are developing the firmware using SYS/BIOS. We checked for sample application for all the above three but did not find anything using SYS/BIOS. In starterware we could find some reference codes which are developed with no OS. We took this as reference and tried to use the sample application and tried to convert them sys/bios. We could get success in configuring the GPIO and PWM. We have taken the reference from the starterware files "ehrpwm_haptics.c" for pwm, "adcVoltMeasure.c" for ADC.

The example in adcVoltMeasure.c file explains the ADC using interrupt based approach. Since we are using the SYS/BIOS and this sample code does not uses the SYS/BIOS, the interrupt initialization gets conflicted and as a result the our UART stops working (which is an interrupt based and using SYS/BIOS)

We need to use the ADC in polling mode as we would be configuring the ADC in s/w continuous mode. We checked in TRM for this processor and did not find any configuration for polling mode.

Does anybody has a reference code for ADC with SYS/BIOS and the PWM with SYS/BIOS? This would really help us to move fast.

  • Hi,

    Please take a look on this project: 4405.InOut_ICE.rar

    It's sensing AIN0 (temp sensor), one shot mode and using sys/bios interrupt manager.

    Regards,
    Paul

    -edit- please put the project in "C:\ti\am335x_sysbios_ind_sdk_1.0.0.8\sdk\examples" (or more generaly "${IA_SDK_HOME}\examples")

  • Thanks Paul for sharing the example code.

    I tried to refer your shared example. However,

    hwiADC = Hwi_create(SYS_INT_ADC_TSC_GENINT, ADCIsr, &hwiParams, &eb);

    returns NULL and then the program gets exited. The code for configuring the interrupt (shaerd in your sample application) was added before calling the Hwi_create function.

    Am I suppose to do more configurations aprat from those shared in your sample application?

    Thanks & Regards

    -Balwant

  • Balwant Godbole,

    Are you able to compile, generate the binary file (such as InOut_ICE_SPI.bin) and run the project I gave you ?

    Regards,
    Paul

  • Hi Paul,

    Thanks for your immediate reply. Yes I am able to generate the binary. I am also able to resolve the issue of getting NULL handle. I was not doing the Error_init. Thats why I was getting the NULL return.

    However, I do have the serial interface on UART5. When I do some data exchange from my serial terminal utility then the code gets crashed. May be because of some interrupt conflicts. When I block the ADC task then everything works fine. Can you suggest why the code gets crash when I send data on UART?

    Regards

    -Balwant

     

     

  • I made a quick try.

    I added this code in the main.c from previous project I gave you:

    Void DebugUartISR(UArg arg)
    {
        Char rxByte;
        UARTGetChar(uartInstance,&rxByte);
        UARTPutChar(uartInstance,rxByte);
    }

    And I replaced
    UartOpen(uartInstance, NULL);
    by
    UartOpen(uartInstance, DebugUartISR);

    I am able to send character through the UART (i am using Termite) and the board is sending it back.

    When you say that the program craches, do you mean you got an exception error or it is stuck somewhere in your code (in a loop).

    Cheers,
    Paul

  • hi Paul,

    I am also assigning an ISR to UARTOpen function. I do get an exception error when the ADC is interrupt is enabled and I try to send some data over serial. When the ADC is not in picture then everything goes smooth. I am able to send /receive data.

  • Balwant Godbole,

    Unfortunately, I don't know how to help you since I am able to do it with my example.

    Regards,
    Paul

  • Hi Paul,

    No issues. I would try to find the problem. One more query from me. Do you have a SYS/BIOS sample application for ePWM? I want to have a PWM output (EHRPWM0B) with changeable duty cycle. Currently I am referrring the example given in starterware but confused on how to change the duty cycle run time. The frequency of the PWM channel need to be around 100Hz.

    Regards,

    -Balwant

  • Hi Paul,

    I am working with ICE v2 and CCS 6.1.1. I too wanted an ADC project with SYSBIOS. I downloaded the project and put in the specified location and then imported in the CCS. I am getting an error during building the project. It shows that Inter- Processor Communication not installed. Can u please help me with this, I also

    Buildfile generation error occurred..
    Product 'Inter-processor Communication' v1.23.2.27 is not currently installed and no compatible version is available. Please install this product or a compatible version.
    Build stopped..
    
    tried searching it on TI site but couldn't find.

    I am attaching the console log.

    Thanks & Regards

    Rohan