Author Topic: TI Launchpad with HalCoGen: how to configure it to react on pushing user button  (Read 9965 times)

0 Members and 1 Guest are viewing this topic.

Offline jancumpsTopic starter

  • Supporter
  • ****
  • Posts: 1273
  • Country: be
  • New Low
I have a TI Hercules LaunchPad and I'm trying to get familiar with the HAL Code Generator.
The Launchpad has a pushbutton linked to GIOA7.
I am trying to react on pushing that button and as a test have set a breakpoint on these handlers
  • gio.c method gioHighLevelInterrupt();
  • notificon.c  method gioNotification();

In HALCoGen, I
  • chose TMS570LS0432PZ as device (the right one for my LHercules Launchpad)
  • on Driver Enable enabled the gio driver,
  • on GIO checked that the pin PORT A 7 is input enabled (default)
  • on GIO also enabled the VIM route for that pin(default)
  • on the INTERRUPT tab I left all as default (IRQ despach mode = vector mode)
  • on the VIM channel 0-32 tab I enabled 9: GIO intA
  • I initialized the GIO (and later also the VIM) in my sys_main.c


My code does not break on the handlers. That makes me think I have not set all parameters inb HalCoGen properly.
Puzzled in what are the minimum settings in HALCoGen to catch interrupt of that button on pin GIOA7.

Disclaimer:
I was able to create examples to drive the Pin A2 as an output,
I have a working example of reacting to that pin in c code, but not with HALCoGen
and I was enable to break on notifications on the Safety example from TI.
« Last Edit: October 27, 2013, 02:00:26 pm by jancumps »
 

Offline jancumpsTopic starter

  • Supporter
  • ****
  • Posts: 1273
  • Country: be
  • New Low
I got it working, so I'm answering my own question:

What I had to do is add this line of code to my main, to enable interrupts:
_enable_IRQ();

How did I do it:
In HALCoGen, I did these changes
  • on the driver tab: enable GIO
  • on the GIO tab: for BIT7, set rising edge and enable VIM, high priority
  • on the VIM Channel 0-31 tab: enable 9 GIO int A, IRQ
  • generate code
  • in the CCStudio, in the sys_main.c main function, add these 3 lines
            _enable_IRQ();
            gioInit();
            while(1);
  • set breakpoint in gio.c gioHighLevelInterrupt()
  • start debug and push the button

So the main thing was calling _enable_IRQ().
I did not find doco for this function, just copied it from an example and that what's making it work.
I'll be looking on the web and in source...
 

Offline jancumpsTopic starter

  • Supporter
  • ****
  • Posts: 1273
  • Country: be
  • New Low
I got a confirmation on the TI e2e forum that HALCoGen does not have a setting to enable interrupts, and that the way to do it is to call _enable_IRQ() at the right time in your code.
 

Offline MrAureliusR

  • Supporter
  • ****
  • Posts: 373
  • Country: ca
Hey, did you also get yours through element14 RoadTest? That's where I got mine, I've had it for like 4 days and I'm loving it so far. I've never used TI products before but I really like the power of HALCoGen.

I'm mraureliusr on the E2E forum.
--------------------------------------
Canadian hacker
 

Online Monkeh

  • Super Contributor
  • ***
  • Posts: 8879
  • Country: gb
Hey, did you also get yours through element14 RoadTest? That's where I got mine, I've had it for like 4 days and I'm loving it so far. I've never used TI products before but I really like the power of HALCoGen.

I'm mraureliusr on the E2E forum.

A $20 Launchpad and a free tool, via E14?
 

Offline MrAureliusR

  • Supporter
  • ****
  • Posts: 373
  • Country: ca
@ Monkeh I don't understand your comment .. ?
--------------------------------------
Canadian hacker
 

Online Monkeh

  • Super Contributor
  • ***
  • Posts: 8879
  • Country: gb
@ Monkeh I don't understand your comment .. ?

I don't understand why anybody would choose such a route to obtain a $20 board.
 

Offline MrAureliusR

  • Supporter
  • ****
  • Posts: 373
  • Country: ca
When I applied to it, I didn't realize it was such a cheap board or I probably would have just bought it. I also missed the fact that it was meant for 'safety' applications but it's turned out to be a great board anyway. I basically just look through the RoadTests and enroll in anything that looks interesting.

Is there something wrong with that?
--------------------------------------
Canadian hacker
 

Online Monkeh

  • Super Contributor
  • ***
  • Posts: 8879
  • Country: gb
When I applied to it, I didn't realize it was such a cheap board or I probably would have just bought it. I also missed the fact that it was meant for 'safety' applications but it's turned out to be a great board anyway. I basically just look through the RoadTests and enroll in anything that looks interesting.

Is there something wrong with that?

No, nothing wrong with that, just didn't realise they were even doing Roadtests for such low value boards.
 

Offline jancumpsTopic starter

  • Supporter
  • ****
  • Posts: 1273
  • Country: be
  • New Low
I might be missing part of the conversation because I don't know what the RoadTest is. I got mine from the TI eShop directly.
I didn't look anywhere else.
 

Offline Crazy Ape

  • Regular Contributor
  • *
  • Posts: 181
I might be missing part of the conversation because I don't know what the RoadTest is. I got mine from the TI eShop directly.
I didn't look anywhere else.

This:
http://www.element14.com/community/groups/roadtest
 

Offline baljemmett

  • Supporter
  • ****
  • Posts: 665
  • Country: gb
No, nothing wrong with that, just didn't realise they were even doing Roadtests for such low value boards.

It happens occasionally -- I suspect at the behest of manufacturers wanting some 'community cred' or suchlike.  ISTR there was a Roadtest of a cheap TI board a year or so back (perhaps even the first $4.30 Launchpad but don't quote me on it) where after umpteen hundred people had chucked their names in the hat, e14 announced everybody was getting a board.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->