TI Launchpad with HalCoGen: how to configure it to react on pushing user button - Page 1
Forum section: electronics / general

author: jancumps
author_rank: Unknown
timestamp: October 27, 2013, 01:48:06 pm
content: 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 handlersgio.c method gioHighLevelInterrupt();notificon.c method gioNotification();In HALCoGen, Ichose 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 intAI initialized the GIO (and later also the VIM) in my sys_main.cMy 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 HALCoGenand I was enable to break on notifications on the Safety example from TI.

author: jancumps
author_rank: Unknown
timestamp: October 27, 2013, 05:33:36 pm
content: 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 changeson the driver tab: enable GIOon the GIO tab: for BIT7, set rising edge and enable VIM, high priorityon the VIM Channel 0-31 tab: enable 9 GIO int A, IRQgenerate codein 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 buttonSo 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...

author: jancumps
author_rank: Unknown
timestamp: October 28, 2013, 11:33:15 pm
content: 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.

author: MrAureliusR
author_rank: Unknown
timestamp: October 30, 2013, 06:43:51 pm
content: 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.

author: Monkeh
author_rank: Super Contributor
timestamp: October 30, 2013, 06:49:02 pm
content: Quote from: MrAureliusR on October 30, 2013, 06:43:51 pmA $20 Launchpad and a free tool, via E14?

author: MrAureliusR
author_rank: Unknown
timestamp: October 30, 2013, 06:50:03 pm
content: @ Monkeh I don't understand your comment .. ?

author: Monkeh
author_rank: Super Contributor
timestamp: October 30, 2013, 06:52:06 pm
content: Quote from: MrAureliusR on October 30, 2013, 06:50:03 pmI don't understand why anybody would choose such a route to obtain a $20 board.

author: MrAureliusR
author_rank: Unknown
timestamp: October 30, 2013, 06:53:53 pm
content: 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?

author: Monkeh
author_rank: Super Contributor
timestamp: October 30, 2013, 06:55:12 pm
content: Quote from: MrAureliusR on October 30, 2013, 06:53:53 pmNo, nothing wrong with that, just didn't realise they were even doing Roadtests for such low value boards.

author: jancumps
author_rank: Unknown
timestamp: October 30, 2013, 08:36:32 pm
content: 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.

author: Crazy Ape
author_rank: Regular Contributor
timestamp: October 30, 2013, 09:14:09 pm
content: Quote from: jancumps on October 30, 2013, 08:36:32 pmThis:http://www.element14.com/community/groups/roadtest

author: baljemmett
author_rank: Unknown
timestamp: November 02, 2013, 02:04:55 am
content: Quote from: Monkeh on October 30, 2013, 06:55:12 pmIt 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.