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.

TMS320F28379D: Setting up a software SOC trigger for an ADC in Simulink

Part Number: TMS320F28379D

Hi, I'd like to know how to set up a software SOC trigger for an ADC in Simulink. Page 1564 of the TI Delfino Technical Reference Manual (Rev. I) states that to trigger this interrupt, we should write bits to the ADCSOCFRC1 register. It seems fairly straightforward to do this in Code Composer Studio, however I am unable to find documentation for how to do this in Simulink.

Could you please advise me on how to set this up? 

For reference, here are the block parameters for the particular ADC in question, which I'd like to trigger using software. Note the "SOCx trigger source" parameter says "Software".

Thanks for your time!

  • Hi,

    Could you please refer to the MW resources provided in the following link and check if you get a resolution for your query?

    Thanks & Regards

    Pramod 

  • Thanks Pramod. Those resources are great for a general introduction, but they don't answer this specific question that I have. All I'd like to know is, after setting the trigger to be "Software" like I've done above, how do I then go about triggering this using software? What block do I need to use?

    Here are some additional steps I took:

    • Page 1412 of the TI Delfino Technical Reference Manual states that at any point, whether or not ADC SOCs have been configured to accept a specific trigger, a software trigger can be used to set the SOCs to be converted. This is done by writing bits in the ADCSOCFRC1 register.
    • Since I'm trying to configure ADC A1, this will be in the AdcaRegs group of registers as described on page 1438 and shown below. The start address is 0x0000_7400 as highlighted.

    • Page 1439 shows the offset address of the ADCSOCFRC1 register, which is 0x0D.

    • Hence, the address of the register I need to write to is 0x00007400 + 0xD = 0x0000740D.
    • I set the SOC trigger number for this ADC to SOC15 as shown below.

    • SOC15 corresponds to bit 15 of the ADCSOCFRC1 register.

    • Hence, I tried writing a 1 to bit 15 of address 0x0000740D using a Memory Copy block. Since the Memory Copy block wants a decimal input, the decimal value I used was 32768, which is the result of having a 1 in bit 15, and zeros everywhere else.
    • I set this up with a manual switch, meaning the ADC conversions should only be happening when I flick the switch to the "32768" value.

    • However, conversions seem to be happening all the time, even when this value is zero. In fact, conversions are happening even if I get rid of the Memory Copy block completely, despite the trigger being set to "Software".
    • The settings of this block are shown below.

    Please let me know if you can shed a light on this issue, or if you need any more info from me. Is there a better way to write values to a register using the Simulink interface?

  • Aryaman,

    Wanted to check in to see if you still needed some help with the above, or you were able to find a solution.  Let me know and we'll see if we can get this cleared up.

    Best,

    Matthew