Jump to content
43oh

FredrikNyman

Members
  • Content Count

    16
  • Joined

  • Last visited

Reputation Activity

  1. Like
    FredrikNyman got a reaction from bobnova in MSP430FR5969 refuses to go to sleep. Code works on G2553   
    Digging through the Energia source code:
    (energia-0101E0012/hardware/tools/msp430/msp430/include/msp430fr5969.h)  #define LPM4_bits           (SCG1+SCG0+OSCOFF+CPUOFF) #define LPM4      _BIS_SR(LPM4_bits)     /* Enter Low Power Mode 4 */ Is this what you want to happen, or do you also want interrupts?
     
    If you look at this thread from two years ago (or look at msp430fr59xx_p1_03.c in MSP430ware), it looks like you also want to enable interrupts: _BIS_SR(LPM4_bits + GIE); // Enter LPM4 w/interrupt  
  2. Like
    FredrikNyman got a reaction from igor in Error in Energia Documentation? Current source/sink   
    You're right, this is looks like a documentation error.  How much each pin can source/sink is device dependent.  For the MSP430G2553, for example, under "Outputs, Ports Px" on page 24 in the datasheet, it specifies 6 mA per pin max (both for source and sink) and a maximum of 48 mA combined to hold the maximum voltage drop specified.
     
     
  3. Like
    FredrikNyman got a reaction from bluehash in MSP430G2553 P1.6 oddness   
    I have an EXP-430G2 launchpad with a 'G2553.  LEDs are connected (via transistors) to P1.4, P1.5, P1.6 and P1.7.
     
    When I ran the following code: 
    #include <msp430.h> int main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer P1DIR |= 0xF0; // Set P1.[4567] to output direction P1SEL = 0; // Set all P1's as GPIO for (; { volatile unsigned int i; P1OUT ^= 0xF0; // Toggle P1.[4567] using exclusive-OR i = 50000; // Delay do (i--); while (i != 0); } } I found a fun phenomenon: P1.4, P1.5 and P1.7 when light up, P1.6 goes dark and vice versa.
     
    Easy enough to fix: after the P1SEL line, add
    P1OUT = 0; to initialize the output pins.
     
    I noticed this while moving from a 'G2452 to the 'G2553, and thought it was a useful reminder to practice good coding hygiene and always explicitly initialize your outputs so they have a known state! :-)
  4. Like
    FredrikNyman reacted to spirilis in AnalogWrite only works on P1.6?   
    FYI- inspect the diagrams on this page, find your chip and look for which pins are listed in purple- http://energia.nu/pin-maps/guide_msp430g2launchpad/
     
    Sent from my Galaxy Note II with Tapatalk 4
  5. Like
    FredrikNyman reacted to spirilis in AnalogWrite only works on P1.6?   
    It's the chip. Energia only supports fine grained PWM with analogWrite for pins that have a timer output option, and I'm assuming the chip you're using doesn't have that on the P1.4/1.5/1.7 pins. So analogWrite does its best to "round" the value to 0 or 1 (off/on).
     
    Sent from my Galaxy Note II with Tapatalk 4
×
×
  • Create New...