Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Reputation Activity

  1. Like
    GeekDoc reacted to OCY in Timer_A2 in '2231 Datasheet?   
    The pin assignments are different on different packages of the same chip. See the "Device Pinout" near the beginning of the data-sheet. PW, N, and RSA are package names.
  2. Like
    GeekDoc reacted to JMLB in $125 off the Evalbot - ARM Cortex M3 - Only $25   
    My blog has some tutorials but its not edited yet. It goes right up to building polarssl for https to fit under 32k. Though for now it just connects to a program on the PC via serial and it forwards it to the net (included in the blog). I am also writing up on the random number generator so that should be done soon. Its my first write up of any thing though so go easy on me lol. I am planning on using a wifi chip rather than programing an IP stack but I am waiting for pay day to buy it. ST has the firm ware for IP stack if you want it. I don't have the url now but I can find it if you need it. Finally, I don't have a place to upload any of the source codes yet so if you want them just let me know and I can send them.
  3. Like
    GeekDoc reacted to cde in LCD-I2C For HD44780 LCDs and PCF8574 Expanders   
    Chip Enable leads me to believe SPI. But then I'd be wrong, er, partly.
    Found the full datasheet at http://www.princeton.com.tw/downloadpro ... PT6523.pdf
    The IC is a LCD Segment Driver. Not a character or graphic lcd, but essentially an lcd with set shapes and sizes for the different segments. More like a alphanumeric led works. Nothing like a hd44780 or the nokia spi lcds.
    That send, it uses three pins in a semi SPI receive only mode (like mixed I2C and SPI. Umm, 2.5wire? Ha). Actually 4 pins, as /INH (Pin 57) allows you to disable display output, when tied to ground.
    Chip Enable is used to tell the chip to read the last 8 bits clocked in, as the address. If it matches the IC's address, it should listen to the rest of the bits clocked in as data, until Chip Enabled is pulled down again.
    CLK and DI work just like SPI does. (toggle DI, toggle clk high, wait a usec, toggle clk low, toggle DI, adnusium).
    Stick with condition 1 for the Chip Enable (Toggle while clock is low, then wait a couple of usec before continuing to clock in data).
    Basically, stick with SPI mode for the MSP430's USI. SPI is more flexible than i2c, as i2c is 8 bit only, and requires certain things for the USI. Issue the first 8 bits (0x41) to the USI, then toggle Chip enable high like a normal output, then issue the x amount of segment data you need, and the last 4 control bits, then finally toggle chip enable low.
    One thing of note. The chip's inputs don't seem to be open drain inputs. And the chip is designed for a 5v power level, and the minimum voltage to recognize a "high/1" compared to ground when is 4v. If you run the chip at it's minimum of 4.5v, you might get away with 3.6, but then again, the LCD itself might not work at less than 5v. You might need transistors to drive the chip's data lines (Not too hard, since it is input only).
    All that you display, will depend on what the LCD was designed to display. You won't be able to add completely arbitrary data display, though the center of the LCD, where the Station and Source (Cd/Radio/Aux, if it displays them as words) display might go, might be like alphanumeric led displays, if your lucky.
    All of the above is educated conjecture based on the datasheet though. YMMV.
  4. Like
    GeekDoc got a reaction from markey1979 in Cheap C2000 Piccolo: F2806x MCU - $11   
    That was bluehash (on first page).
    There's a little "thumbs-up" you can click in each post (top right) to help show how helpful someone is. The total shows up with their name and icon on the right of their posts.
  5. Like
    GeekDoc reacted to bluehash in Another DS1821+ project   
    That is correct,a "." Probably as RobG said, its hard to notice a . on small parts.
  6. Like
    GeekDoc reacted to michaelwei in Cheap C2000 Piccolo: F2806x MCU - $11   
    Actually, CCSv4 can be use for free, without code size limitations, with the controlSTICK and all of C2000's tools.
    CCSv4 can be used for free under any of the below conditions:
    - First 30 days
    - Code size limited (32KB for C2000, 16KB for MSP430)
    - Used with development kits
    - Used with XDS100-class emulators
    This means there's a small loophole for C2000 customers! C2000 primarily uses XDS100 emulators because of our DSP heritage.
    For your designs, as long as you use an XDS100-class emulator (like the ones made by Spectrum Digital or Blackhawk), CCSv4 can be used for free.
    The XDS100 is the lowest class of emulators for DSPs and C2000, and it can get painful trying to use it for the faster, 300MHZ+ DSPs (and for our C2834x family). But for all other C2000 devices, it's more than sufficient.
    The CCSv4 install that comes on the DVD should automatically recognize this. If you don't have the DVD, simply download CCSv4 at http://www.ti.com/ccs
    -Michael Wei
    C2000 MCUs
    Texas Instruments
  7. Like
    GeekDoc reacted to zeke in Best information for those new to the MSP430?   
    If you are new to the MSP430 then you're probably drowning in information right now.

    It's true that there are a zillion configurations to make before the 430 will do what you want it do do.

    So I'm betting that you are asking yourself "Where do I start?"

    I humbly suggest the following TI application notes and books that will get you going in the right direction:

    1. slaa294: MSP430 Software Coding Techniques

    This application report covers software techniques and topics of interest to all MSP430
    programmers. The first part of the document discusses the MSP430 standard
    interrupt-based code flow model, recommended for the vast majority of applications.
    The next part discusses a handful of techniques that should be considered by any
    developer that sets out to develop an MSP430 application. Using these methods can
    greatly reduce debug time and/or provide additional robustness in the field. They
    include initialization procedures, validation of supply rails before performing
    voltage-sensitive operations, and use of special functions. Code examples are

    2. : MSP430 32-kHz Crystal Oscillators

    Selection of the right crystal, correct load circuit, and proper board layout are important
    for a stable crystal oscillator. This application report summarizes crystal oscillator
    function and explains the parameters to select the correct crystal for MSP430
    ultralow-power operation. In addition, hints and examples for correct board layout are
    given. The document also contains detailed information on the possible oscillator tests
    to ensure stable oscillator operation in mass production.

    3. MSP430 Microcontroller Basics by John H. Davies

    The best thing I can say about this book at this time is that it describes well how to make use of the clocking system of the MSP430. This book should be in your personal library or at least on your wishlist.

    Once you digest the information above then you will be in good shape for success in working with the msp430.

    Have something to add?
    Then post up your valuable sources of knowledge.
  8. Like
    GeekDoc reacted to RobG in Are MSP430 wake up times clock source dependent?   
    Right on the money Doc. In addition to those external influences, crystals can be made of different materials (typically quartz,) material itself can be cut different ways, and in case of 32kHz crystal, material is also cut in to a tuning fork shape. All of those can affect wake-up time. 32kHz crystals are the ones that take longest.
    And here's a quote from the book mentioned earlier (pg 34):
  9. Like
    GeekDoc reacted to zeke in Are MSP430 wake up times clock source dependent?   
    If you do happen to use a 32kHz crystal, check out TI's App Note slaa322b.
    It goes into detail about how a crystal works, what will make it fail and how to design your circuit for optimal operation.
    It's a good one to bookmark.
  10. Like
    GeekDoc reacted to zeke in Are MSP430 wake up times clock source dependent?   
    In this datasheet on page 33, it gives a table of startup times based upon the DCO configuration. The slowest time is 2us when the DCO is set to 1MHz.
    What the datasheet doesn't tell you is the startup times for any other configurations - only when MCLK = DCO.
    I can tell you that if you use an external crystal (ie 16MHz) then the startup time is completely dependent upon the accuracy of that crystal.
    Here's another quote from John H. Davies in MSP430 Microcontroller Basics, page 165:
    Crystal Oscillators, LFXT1 and XT2
    Crystals are used when an accurate, stable frequency is needed:
  11. Like
    GeekDoc got a reaction from NJC in MSP430F2274 TSSOP 38 Breakout board?   
    If you end up designing your own board, I highly recommend The Dorkbot/PDX order. I had some made, and they are excellent quality and cheap! (Do be sure to double-check your designs, though. :oops: )
  12. Like
    GeekDoc reacted to markey1979 in 50% off from Ti e-store............   
    Ti sent me an email for 50% off a cc2591 evaluation module. The Promo code is LRG5-SA02RK. I thought I would throw that out there if anyone is interested. Its only $50us instead of $100. The cc2591 is a 2.4Ghz range extender that compliments their other CC wireless offerings.
    They said this offer was for today ( 01/27/2010) but, at the bottom it implies longer.
  13. Like
    GeekDoc reacted to OCY in Where's the Simulator?   
    The IAR KickStart has simulator for all MSP430, including G2xx1 and G2xx2.
  14. Like
    GeekDoc reacted to JMLB in Electricity monitor - need some help   
    The linker will not include the full library but only sections that you use and will not include functions that are never called. However you will need to set compiler optimization though. If you are using the compiler provided by TI (code composer i think) try the switches -O4 or -O3. Keep in mind this some times does not debug as well. This will also do more optimization and reduce the code size. also --opt_for_speed=0 will optimize your code for size rather than speed.
    a few switches to help up debug fully optimized code
    --symdebug:dwarf --optimize_with_debug option.
    Also I found this which has a few good tips on how to reduce your code space
  15. Like
    GeekDoc reacted to zeke in Flashing the missing DCO calibration constants   
    Hi Guys,
    I wanted to tack on my calibration code that I successfully used to calibrate my G2231 device.
    It's almost exactly like naturetm's code. The only difference is the setDCO() function has a little more fine tuning in it.
    Take a look and notice that the setDCO() function is slightly different. I stole the idea from a post aBUGSworstnightmare made on the ti.com website. Here's the link.

    //****************************************************************************** // MSP430F20xx Demo - DCO Calibration Constants Programmer // // NOTE: THIS CODE REPLACES THE TI FACTORY-PROGRAMMED DCO CALIBRATION // CONSTANTS LOCATED IN INFOA WITH NEW VALUES. USE ONLY IF THE ORIGINAL // CONSTANTS ACCIDENTALLY GOT CORRUPTED OR ERASED. // // Description: This code re-programs the F2xx DCO calibration constants. // A software FLL mechanism is used to set the DCO based on an external // 32kHz reference clock. After each calibration, the values from the // clock system are read out and stored in a temporary variable. The final // frequency the DCO is set to is 1MHz, and this frequency is also used // during Flash programming of the constants. The program end is indicated // by the blinking LED. // ACLK = LFXT1/8 = 32768/8, MCLK = SMCLK = target DCO // //* External watch crystal installed on XIN XOUT is required for ACLK *// // // MSP430F20xx // --------------- // /|\| XIN|- // | | | 32kHz // --|RST XOUT|- // | | // | P1.0|--> LED // | P1.4|--> SMLCK = target DCO // // A. Dannenberg // Texas Instruments Inc. // May 2007 // Built with CCE Version: 3.2.0 and IAR Embedded Workbench Version: 3.42A //****************************************************************************** //#include "msp430x20x1.h" // do not forget to change this according to the device you're using #include #define DELTA_1MHZ 244 // 244 x 4096Hz = 999.4Hz #define DELTA_8MHZ 1953 // 1953 x 4096Hz = 7.99MHz #define DELTA_12MHZ 2930 // 2930 x 4096Hz = 12.00MHz #define DELTA_16MHZ 3906 // 3906 x 4096Hz = 15.99MHz unsigned char CAL_DATA[8]; // Temp. storage for constants volatile unsigned int i; int j; char *Flash_ptrA; // Segment A pointer void Set_DCO(unsigned int Delta); void main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop WDT BCSCTL3 |= XCAP_3; // Launchpad watch crystals need ~12.5 pF for (i = 0; i < 0xfffe; i++); // Delay for XTAL stabilization P1OUT = 0x00; // Clear P1 output latches P1SEL = 0x10; // P1.4 SMCLK output P1DIR = 0x11; // P1.0,4 output j = 0; // Reset pointer Set_DCO(DELTA_16MHZ); // Set DCO and obtain constants CAL_DATA[j++] = DCOCTL; CAL_DATA[j++] = BCSCTL1; Set_DCO(DELTA_12MHZ); // Set DCO and obtain constants CAL_DATA[j++] = DCOCTL; CAL_DATA[j++] = BCSCTL1; Set_DCO(DELTA_8MHZ); // Set DCO and obtain constants CAL_DATA[j++] = DCOCTL; CAL_DATA[j++] = BCSCTL1; Set_DCO(DELTA_1MHZ); // Set DCO and obtain constants CAL_DATA[j++] = DCOCTL; CAL_DATA[j++] = BCSCTL1; Flash_ptrA = (char *)0x10C0; // Point to beginning of seg A FCTL2 = FWKEY + FSSEL0 + FN1; // MCLK/3 for Flash Timing Generator FCTL1 = FWKEY + ERASE; // Set Erase bit FCTL3 = FWKEY + LOCKA; // Clear LOCK & LOCKA bits *Flash_ptrA = 0x00; // Dummy write to erase Flash seg A FCTL1 = FWKEY + WRT; // Set WRT bit for write operation Flash_ptrA = (char *)0x10F8; // Point to beginning of cal consts for (j = 0; j < 8; j++) *Flash_ptrA++ = CAL_DATA[j]; // re-flash DCO calibration data FCTL1 = FWKEY; // Clear WRT bit FCTL3 = FWKEY + LOCKA + LOCK; // Set LOCK & LOCKA bit while (1) { P1OUT ^= 0x01; // Toggle LED for (i = 0; i < 0x4000; i++); // SW Delay } } void Set_DCO(unsigned int Delta) // Set DCO to selected frequency { unsigned int Compare, Oldcapture = 0; BCSCTL1 |= DIVA_3; // ACLK = LFXT1CLK/8 TACCTL0 = CM_1 + CCIS_1 + CAP; // CAP, ACLK TACTL = TASSEL_2 + MC_2 + TACLR; // SMCLK, cont-mode, clear while (1) { while (!(CCIFG & TACCTL0)); // Wait until capture occured TACCTL0 &= ~CCIFG; // Capture occured, clear flag Compare = TACCR0; // Get current captured SMCLK Compare = Compare - Oldcapture; // SMCLK difference Oldcapture = TACCR0; // Save current captured SMCLK if (Delta == Compare) break; // If equal, leave "while(1)" else if (Delta < Compare) { DCOCTL--; // DCO is too fast, slow it down if (DCOCTL == 0xFF) // Did DCO roll under? if (BCSCTL1 & 0x0f) BCSCTL1--; // Select lower RSEL } else { DCOCTL++; // DCO is too slow, speed it up if (DCOCTL == 0x00) // Did DCO roll over? if ((BCSCTL1 & 0x0f) != 0x0f) BCSCTL1++; // Sel higher RSEL } } TACCTL0 = 0; // Stop TACCR0 TACTL = 0; // Stop Timer_A BCSCTL1 &= ~DIVA_3; // ACLK = LFXT1CLK }
    Concerning the mods that were made to the cmd file, I just threw them into the default files because I know that I'm going to forget to made the project edits that are suggested in the first post above.
    Just calibrate the g2231 first then use the code after.
  16. Like
    GeekDoc reacted to RobG in Plugging LaunchPad to breadboard   
    Here's my version of expanding LP to breadboard

  17. Like
    GeekDoc got a reaction from juani_c in MSP430F2274 TSSOP 38 Breakout board?   
    Looks like it would be US $16 for US orders ($4 shipping charge). Not bad for a quick-and-dirty.
    I have to stand behind Dorkbot if you need high quality, though. 5x5cm is approximately 2x2 inches; at Dorkbot, that's US$20 (shipped) for three pieces, but you only pay for the size of your board. If it's 1x1 inch, it's only $5.
    The 'service' through Dokbot is a big reason I stand behind them. Laen (the guy who does the order) is very helpful, and you can submit an Eagle file (if you use Eagle, like I do), rather than generating in the multi-file Gerber format (though Laen will take those, too). Laen kept in great contact, and helped me with several revisions to my designs. The quality of the boards was absolutely top-notch (see photos in my blog post).
    I might try the itead studio service at some point, but until I'm proven wrong, if I need top quality, I'll go back to Dorkbot.
  18. Like
    GeekDoc got a reaction from bluehash in Electricity monitor - need some help   
    cde and Google to the rescue! Turns out that this (sprintf()) is not strictly in the C/C++ language, but is widely implemented in stdio libraries. Also, adding a couple of global char arrays (strings) made things a lot easier.
    Easy, 4-line solution:

    char* int_to_str(unsigned int i, char* the_str) { //sprintf() returns # chars, but this does not currently use the info int total_chars; total_chars=sprintf(the_str, "%d", i); return the_str; }

    On to capturing and working with the inputs!
    EDIT: Just noticed I'm up to 1.8K! Going to have to a) hope the rest of the code doesn't add much, b)find ways to trim size, or c) wait for newer, higher capacity value-line chips (still waiting on samples). Probably will go with combo of a) and c).
  19. Like
    GeekDoc got a reaction from gatesphere in Launchpad as external programmer   
    And don't forget, you probably have pin 10 (RST) on the MSP430 tied high in your circuit. You'll have to "untie" that so you can reprogram the chip.
  20. Like
    GeekDoc reacted to juani_c in MSP430F2274 TSSOP 38 Breakout board?   
    I don't if anybody know about the PCB service that seeestudio has, well there is another place called itead studio that has the same service but is cheaper, 12 U$S for 5x5cm boards and shipping is quite cheap if you don't mind waiting. You can order max. 10 boards and the minimum is 3 boards but as you are paying anyway the 12 U$S you should order 10.
    I haven't used the service but i've heard good things about it.
  21. Like
    GeekDoc reacted to nobody in Launchpad Pin1.3 problem   
    Small warning for those who do not read manuals:
    TI produces for us a very good kit at a very competitive price. But no thing is not entirely perfect.
    Into this kit is pin P1.3 connected to button S2. OK, no problem. But for debouncing button, RC combination C34/R24 is also attached to P1.3.
    And here's the problem. C34/R24 is not detachable. Still not problem to us? Look to the simple sample code:

    #include "io430.h" #include "intrinsics.h" const unsigned char FONT[] = { 0x00, 0x06, 0x22, 0x00, 0x6D, 0x00, 0x00, 0x20, 0x39, 0x0F, 0x00, 0x70, 0x08, 0x40, 0x00, 0x52, 0x3F, 0x06, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x07, 0x7F, 0x6F, 0x48, 0x48, 0x39, 0x48, 0x0F, 0x53, 0x00, 0x77, 0x7C, 0x39, 0x5E, 0x79, 0x71, 0x6F, 0x76, 0x30, 0x1E, 0x76, 0x38, 0x15, 0x54, 0x3F, 0x73, 0x67, 0x50, 0x6D, 0x78, 0x3E, 0x1C, 0x2A, 0x76, 0x6E, 0x5B, 0x39, 0x64, 0x0F, 0x23, 0x08, 0x20, 0x77, 0x7C, 0x58, 0x5E, 0x79, 0x71, 0x6F, 0x74, 0x04, 0x1E, 0x76, 0x18, 0x15, 0x54, 0x5C, 0x73, 0x67, 0x50, 0x6D, 0x78, 0x3E, 0x1C, 0x2A, 0x76, 0x6E, 0x5B, 0x39, 0x30, 0x0F, 0x40, 0x00 }; // ASCII table [0x20 - 0xFF] /********************************************************************************************/ /* Test - minimalize power consumption of MSP430G2211 */ /* */ /* I use one character from the display LCD-S301C31TR, connected to port 1 */ /* P1.0 = Seg.A1, P1.1 = Seg.B1, P1.2 = Seg.C1, P1.3 = Seg.D1, */ /* P1.4 = Seg.E1, P1.5 = Seg.F1, P1.6 = Seg.G1, P1.7 = COM */ /* */ /* Power consumption is 76uA/3.5V, 65uA/3V, 33uA/1.5V (problem is RC of P1.3) */ /* Without P1.3 power consumption is 3.2uA/3.5V, 2.7uA/3V, 1.35uA/1.5V */ /********************************************************************************************/ int main( void ) { unsigned int i, j; WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer to prevent time out reset BCSCTL3 |= LFXT1S1; // VLOCLK enable (my VLOCLK worked at ~~10kHz) TACCR0 = 50u - 1u; // 10kHz/200Hz = 50 - interrupt every 5msec (200Hz) TACTL |= TASSEL_1 + ID_0 + MC_1; // Timer A clock source select: 1 - ACLK = VLOCLK // Timer A input divider: 0 - /1 // Timer A mode control: 1 - Up to CCR0 TACCTL0 = CCIE; // Capture/compare interrupt enable __enable_interrupt(); //P1DIR = 0xFF; // Set all P1 to output direction // - alternative - P1DIR = 0xFF - BIT3; // Set all P1 to output direction (without P1.3) for(; // Never ending story { for(i=0; i<(128-32); i++) // Browse ASCII table chars [0x20 - 0xFF] { for(j=0; j<100; j++) // Any character displayed 0.5 sec { if(P1IN & BIT7) P1OUT = FONT[i]; else P1OUT = ~FONT[i]; __bis_SR_register(LPM3_bits); // ZZZZZZZZZzzzzzzz.......... // CPU, MCLK, SMCLK, DCO are disabled, ACLK are active } } } } #pragma vector = TIMERA0_VECTOR // Timer A CC0 __interrupt void DELAY(void) { __bic_SR_register_on_exit(LPM3_bits); // WAKE UP, BABY !!! }
    OK. The problem is here, what is the solution?
    1) Do not use P1.3 (not good, this small cheap chips have a few pins ...)
    2) Move your lovely chip out of the Launchpad to Breadboard. Thanks to SpyBiWire you need only four wires ...
    3) Simply ignore this problem
    4) Modify your Launchpad to fix this issue
    Modify. But how?
    My suggestion is: break the route from C34/R24 to pin P1.3 of IC1 socket. Remove pinheader J5. Drill two new holes between S2 and J5. Solder a new, six-pin header at location J5. Use two new pins on the pinheader for detachable connection from C34/R24 to button S2. Route S2 to P1.3.
    And that is all. End of story.
  22. Like
    GeekDoc reacted to JMLB in MSPhere documentation updated-20100925   
    I made a quick list of all the functions. I was going to put it on the wiki and have the functions follow to the description on the link kinda like what arduino does but i could not figure out how to edit the wiki.
    void pinMode(char pin, char mode)
    void pinFunction(char pin, char mode)
    char digitalRead(char pin)
    void digitalWrite(char pin, char data)
    void digitalToggle(char pin)
    void resistorMode(char pin, char mode)
    void init()
    void setup()
    void loop()
    void main()
    void mapPin(char *pin, char *port)
    inline void wdtHold()
    int min(int val1, int val2)
    int max(int val1, int val2)
    int abs(int val)
    int constrain(int val, int low, int high)
    long map(long x, long in_min, long in_max, long out_min, long out_max)
    inline void enableMaskableInterrupts()
    void gpioInterruptMode(char pin, char mode)
    char gpioFlagCheck(char pin)
    void gpioFlagClear(char pin)
    inline char gpioFlagCheckAndClear(char pin)
    void shiftOut(char dataPin, char clockPin, char bitOrder, char value)
    void tlv5620_updateMode(unsigned char mode, char ldacPin)
    void tlv5620_simultaneousUpdate(char ldacPin)
    void tlv5620_sendData(unsigned char dacSel, unsigned char gainSel, unsigned char value, char clockPin, char dataPin, char loadPin)
  23. Like
    GeekDoc reacted to nobody in Electricity monitor - need some help   
    Copy Your code into an old, fully functioning project. You may have accidentally overwritten something in the default settings ...
  24. Like
    GeekDoc reacted to nobody in Electricity monitor - need some help   
    In IAR Embedded Workbench this code working too without any problems...
  25. Like
    GeekDoc reacted to RobG in Electricity monitor - need some help   
    It does work on my board, I am using CCS. Must be debugger.
  • Create New...