Jump to content
43oh

Set of noob questions !


Recommended Posts

Hi all, I just started with msp430. I am very noob !!!

 

First question: How do I set the Status Register bits in C?

 

slau144j.pdf assembly example, setting CPUOFF and GIE bit:

; Enter LPM0 Example
BIS #GIE+CPUOFF,SR ; Enter LPM0
 
; Exit LPM0 Interrupt Service Routine
BIC #CPUOFF,0(SP) ; Exit LPM0 on RETI
RETI
 
But if I need set just the GIE bit, how do I do that ?
 
I dont want to use functions like __enable_interrupts(), I
Link to post
Share on other sites

The intrinsics are used... e.g.

 

__bis_SR_register(GIE);  // set GIE bit

__bic_SR_register(GIE);  // clear GIE bit

 

Those work in MSPGCC, along with a few variations like _BIS_SR() and _BIC_SR() which might also work in TI's CCS IDE (not sure which one is supported by which though; I always use the __bic_SR_register() and __bis_SR_register() type of intrinsics since I use MSPGCC exclusively)

Link to post
Share on other sites
  • 2 weeks later...

You can supply 5v & ground to the test points TP1 and TP3 beside the USB socket. 

 

If you really don't want to power from the USB then you might have to doctor the micro-usb cable to remove the +5v pin (or cut the wire).  The only time I've had to do that was on a Raspberry pi - to prevent a badly regulated powered USB hub from back-powering the Pi.

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.

×
×
  • Create New...