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.

TMS470MF06607: tms470 gio interrupt

Part Number: TMS470MF06607
Other Parts Discussed in Thread: HALCOGEN

hi sir,

i am using TMS470MF06607  microcontroller. (TMS470MHDK).

i want to count the number of rising edges in a given signal.      so i make one gio pin(pin-4) as a input pin. i  can read the num of rising edges , but i didn't get the proper count value.

i want to make the gio pin as a input pin with interrupt base. i tried to make interrupt base, but its not work.

i mentioned below what ever the changes i did it in halcogen & in my software side. 

HALCOGEN CODE GENERATOR: (what changes i did)

1) In Bit-4  

a) pull down is enabled

b) Rising edge is enabled

c) interrupt is enabled

d) high priority is enabled

2) In VIM channel 0-31

a) i enabled the 11th channel.

after this changes i generate the code.

CODE COMPOSER STUDIO : (in software side what i did it)

program:  sys_main.c

#include "system.h"
#include "rti.h"
#include "het.h"
#include "gio.h"
#include "sci.h"
#include "sys_vim.h"
#include "esm.h"

void main(void)
{

_enable_interrupts();
gioInit();

gioEnableNotification(4);        // gio pin-4  

gioSetDirection(gioPORTA, 0x00000000);       // make the direction is a gio input.

}

notification.c:

void gioNotification(sint32 bit)
{

if(bit == 4)
{
temp_counter++;            // i try to increase the counter.  this counter variable i declared globally.

}

}

i am not sure that on my code.

can you please tell me that configuration from HALCOGEN side and give some example code for simple gio read with interrupt .

i attached the images also.

vimchannel image:

regards

Arun Kumar.N

  • arun kumar93 said:
    i want to count the number of rising edges in a given signal.      so i make one gio pin(pin-4) as a input pin. i  can read the num of rising edges , but i didn't get the proper count value.

    Did you count any interrupts, or did the count stay 0?

  • Hi Kumar,

    It should work if the frequency of the input signal is not too high. The period of the input signal should bigger than the processing time of your ISR.

    I did a quick test using GIO6 and GIO4, it works.

    GIO6 outputs 1 and 0, and GIO4 counts the rising edge.

       //Test GIO6 output to GIO4 input

       {

        gio4EdgeCount = 0;

           gioInit();

           for (i=0; i<20; i++){

             gioToggleBit(gioPORTA, 6);  //GIOA pin6 output

                 wait(200);

            }

       }

    #pragma WEAK(gioNotification)

    void gioNotification(gioPORT_t *port, uint32 bit)

    {

    /*  enter user code between the USER CODE BEGIN and USER CODE END. */

    /* USER CODE BEGIN (19) */

    if(bit == 4)

    {

       gio4EdgeCount++;            // i try to increase the counter.  this counter variable i declared globally.

    }

    /* USER CODE END */

    }


    Regards,

    QJ

  • hi sir,

    sorry for this delayed response.
    actually i did one change in my code. it's working properly.
    now i can count the num of rising edges.
    but i have one doubt regarding that rising edge.
    rising edge means form 0-5v or, when ever 5v will come then only my it will come in to the interrupt handler.

    regards
    Arun Kumar.N
  • A rising edge is defined as a transition from Vil (0.8v or less) to Vih (2.0V or more). The pin must have been at Vil or lower for a minimum period of 1 Vclk+10ns and then at Vih or higher the same minimum period to assure detection of the rising edge.
  • Hello Arun,

    Not to detract from the primary topic here, but do you really mean 5V? The IO on the TMS470M devices are not 5V tolerant (recommended max = 3.6V and absolute max of 4.6V) and continued exposure to that voltage could damage the silicon. Certainly, over the life of the product, voltages in this range will reduce the reliability.
  • hi sir,

    actually i try to read he PWM signal. i make a one complete signal in 0.8ms (here i am using 5v).
    here i generate the signal some more fast. so my board will not get complete 5v.
    what i understand is, my program will come in to the interrupt handler when my gio pin read from 0 - 3.5v . is it correct or not ??? or when my gio pin will get 3.5v then only my code will come in to the interrupt handler.


    regards
    Arun Kumar.N
  • hi sir,

    thank you for your valuable suggestion sir.
    so, when my gio pin read low to high voltage means it will go in to the interrupt handler am i right sir ??

    regards
    Arun Kumar.N
  • That is correct, the interrupt can be configured to occur on the low to high transition. Also, please take note of Chuck's warning, 5V is too high for the TMS470MF06607 input pin. You must limit the voltage/current. You might find this application note helpful:
    www.ti.com/.../spna201
  • hi sir,

    ok thank you sir. thank you for your valuable suggestion's.

    regards
    Arun Kumar.N