Jump to content
Sign in to follow this  
teoah

Using the RST/NMI pin as input

Recommended Posts

I've been tryin to get the code posted there to work on my EXP430G2 board (rev 1.4) with the G2231 but to no avail (even a straight copy/paste doesn't work). The code compiles and runs, but pressing the switch does absolutely nothing.

Am I supposed to change something if I'm using the G2231?

 

One thing I thought was the problem was this line:

#define FLIP_HOLD (0x3300 | WDTHOLD) /* flip HOLD while preserving other bits */

Shouldn't the 0x3300 part be 0x5A00 (WDTPW)? (Although I tried that with no go).

 

I tried playing around with the code, but nothing seems to work. Also, many changes he makes to WDTCTL is missing WDTPW. Is that a mistake? I tried adding it, but didn't make a difference either.

Share this post


Link to post
Share on other sites

Shouldn't the 0x3300 part be 0x5A00 (WDTPW)? (Although I tried that with no go).

 

i think the 0x3300 is used instead of 0x5a00 when u do an xor to the register.

 

some suggestions.

 

did u try to short Vcc w/ the RESET pin to start the firmware? i.e. your NMI will not be configured if the code never reaches there, and u need RESET tie to high when u attach power to get your 1st line of code going.

 

are u connecting your tactile button between RESET and GND? or should it be RESET and Vcc?

 

[EDIT] ps. i did not try the code, just read it and blind guess

Share this post


Link to post
Share on other sites

some more suggestions

 

Please note that because nRST/NMI pin is also the SBWTDIO pin. Thus you should not press this push-button while you are using SBW.

 

should u remove the two jumpers (RST/SBWCLK) on the 5 jumper block? they may interfere.

and your had jumper on your led?

Share this post


Link to post
Share on other sites

Yup! That was the problem. I removed the RST jumper and it works fine now.

Thanks!

 

Edit: Actually I was wrong. The jumper isn't what makes the difference between working and not working.

What makes the difference is whether or not you're debugging it or not.

It only seems to work when you're not in debugging mode.

Share this post


Link to post
Share on other sites
Edit: Actually I was wrong. The jumper isn't what makes the difference between working and not working.

What makes the difference is whether or not you're debugging it or not.

It only seems to work when you're not in debugging mode.

Makes sense... The debugger requires access to the RST pin. So, I guess we can get an extra pin, but we can't debug to make sure it works. :D

Share this post


Link to post
Share on other sites

Sorry, I did not catch the conversation earlier and did not make my "Note" very clear. But you guy already figured it out.

 

Yes, the Launchpat uses SBW for Debugging. Thus the button on the nRST/NMI pin cannot be used during that. If you use other "4-wire JTAG" for Debugging, that button can be used while you are debugging. (No, do not rush out to buy a 4-wire JTAG tool just for this.)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...