Jump to content

bluehash

Administrators
  • Content Count

    7,290
  • Joined

  • Last visited

  • Days Won

    193

Reputation Activity

  1. Like
    bluehash got a reaction from mavis311 in ez430 case removal   
    Its tough to pull apart, yes.. Try a screwdriver or a knife wedged in the edge and lever it out.
  2. Like
    bluehash reacted to cde in I2C & SPI at the same time on MSP430-RF2500T board?   
    Aside from the software i2c that are available here and on TI's code examples, you could, depending on your project, share the USCI B pins between spi and i2c. As long as the SPI enable pin is not driven low, then the spi chip on the pins will ignore any data being passed on it (You might want to make sure that the spi chip has high impedance inputs when spi enable is not enabled). The i2c chip should also ignore any data until it sees a i2c start (or stop) condition, which is defined as rising or falling edges on the data line while the clock line is kept high.
     
    The i2c's sda and scl share the spi's data out and data in pins, respectfully. So the SPI chip, even if you are not using an enable signal, should not act on any i2c data, as its clock line should be inactive. The SPI chip should also ignore anything on its data out (the msp430's data in) line, which from a cursory look at some SPI chips datasheets, leave the data out pin as output logic only.
    Physically, i2c is open collector, only driven low, with weak pullups for a high/1 signal, while SPI drives both directly. As long as the SPI chip is disabled, i2c should work fine. And the pullups will just be overwritten by the SPI.
     
    Basically, with careful coding, making sure that i2c is only used when spi is not enabled, you can have both (not at the same time), on the same pins, using USCI B. But it can be a hassle.
    http://www.i2cchip.com/mix_spi_i2c.html
    http://www.a-wit.com/web_c-stamp/forums ... t1072.html
    http://www.embeddedrelated.com/groups/m ... /24203.php
    BEST Response (TI Engineer Answer):
    http://e2e.ti.com/support/microcontroll ... 19712.aspx
     
    For the most part, I'm assuming single master only setup. I have no idea for multi-master or slave setups.
     
    Another alternative, is that there are spi-to-i2c and i2c-to-spi chips out there. NXP/Phillips has them. I think TI has them, and Maxim(Blah) has them. I have a spi/i2c-to-uart chip myself.
    Here's a Silicon Labs one. SPI to I2c and 8bit Port Expander:
    http://www.silabs.com/products/interfac ... fault.aspx
     
    TLDR: Possible, with careful coding and not using both at the same time.
  3. Like
    bluehash reacted to RobG in MSP430 LaunchPad, 74HC595, 16 LEDs   
    What is it?
    4 digit BCD counter using LaunchPad and two 74HC595 shift registers.
     
    Note: One important thing that I forgot to add is that since I am powering this from LP, I am using here 74HC595 and not HCT.
    LP provides 3.6V, HCT needs 5V.
     
    See it in action:


     

    #include unsigned int counter = 0; // Counter variable void main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop WDT P1OUT |= 0x01; // Port P1.0 will be used to latch P1DIR |= 0x01; USICTL0 |= USIPE6 + USIPE5 + USIMST + USIOE; // Out & clk enable, SPI Master USICTL1 |= USICKPH + USIIE; // Counter interrupt USICKCTL = USIDIV_7 + USISSEL_2; // /2 SMCLK USICTL0 &= ~USISWRST; // Enable USI USICNT = USI16B; // Enable 16 bit CCTL0 = CCIE; // CCR0 interrupt enabled CCR0 = 10000; // Duration TACTL = TASSEL_2 + MC_1 + ID_3; // SMCLK, upmode _bis_SR_register(LPM0_bits + GIE); // Enter LPM0 w/ interrupt } // Timer A0 interrupt service routine #pragma vector = TIMERA0_VECTOR __interrupt void Timer_A (void) { counter = _bcd_add_short(counter, 0x01); // Decimally increase counter's value USISR = counter; USICNT |= 16; // Start USI } // USI interrupt service routine #pragma vector = USI_VECTOR __interrupt void USI_TXRX (void) { USICTL1 &= ~USIIFG; // Clear pending flag P1OUT &= ~0x01; // Latch data P1OUT |= 0x01; }
     
    In the coming parts, I will be increasing the number of digits to 8 and changing LEDs to 7-segment displays, maybe throw in a keyboard.

  4. Like
    bluehash reacted to NatureTM in Ninjanee   
    Blue, hit up to walk through the door. Didn't you ever have a NES?
     
    On a side note, I wish TI's people were working on improving the estore and their website instead of spending time on viral marketing. I guess it does, however, show they're interested in us hobbyist types.
  5. Like
    bluehash reacted to NatureTM in CCS is coming to linux   
    http://e2e.ti.com/support/development_t ... 61266.aspx
  6. Like
    bluehash reacted to simpleavr in Value Line series easy DCO setting library   
    it was the crystal all along.
     
    the c example msp430x20xx_dco_flashcal.c (from slau80) has been working all right.
     
    i finally solder a 32khz crystal onto my launchpad, result became better but still give inconsistent result, result looks ok, but if i run the calibration continuously for a few times, they are always off a bit.
     
    i then remove and solder the ti supplied crystal and i can get very good results.
    . i don't need to tweak the code for tolerance on expected values as before.
    . i get consistent results if i run it many times in a row.
    . and the time to get it calibrated is like what NatureTM found from the assembler code, < 5 secs.
     
    so it's reliable to use this. for CCS/IAR users, u may need to add the missing range pointers via an include file, like what NatureTM suggested. mspgcc users already have them as we are just treating the G2231 as a F2012.
     
    if u had more than one launchpad, u can make one of them as a calibration stations, and solder in the ti supplied crystal and use it to calibrated all your chips. you should do it in the normal environment (temperature) that your project will run, as crystals are affected by temperatures.
     
    i had, though, no idea why my hello-kitty watch crystal did not work w/ the device. they work well on the toy. :? . could be the capacitor matching is not for the average clock crystal. anyway i am not going to try and find out.
  7. Like
    bluehash got a reaction from gatesphere in [ ENDED ] Dec 2010 - 43oh Project of the Month Contest   
    Entry to the December 2010 contest is open. This is an opportunity for you to show off what you can do with the MSP430. The 43oh community forum has been growing both with good discussions and members. The project section of the forum as well as the Blog has a lot of project ideas you can base your submission on. Feel free to ask questions about the project on the forum.
     
    Previous Contests
    November 2010 [ Announce] [ Winner]
     
    Now for the prize:
    Winner : A $20 Sparkfun gift certificate. You can finally get that thingy you were eyeing on.
    Runner up :[J]bremnant has been kind enough to donate a pristine unopened Launchpad kit. Although you may already have one, having another Launchpad can be quite handy like a project you may not want to take apart or recreate[J]oby's SPI Ninja. Thanks [J]bremnant for sponsoring this month's contest giveaway.
     
    To submit your entry, make an entry into this thread with the following:
    1 - A small description of your project.
    2 - A picture or video of your setup
    3 - Code.
    4 - Schematic(rough/hand drawn is fine as long its legible)
     
    About judging the winner :
    A week before the contest ends, a poll will be created with all the project entries. Only members of the forum will be allowed to vote.
    The contest will roll over to the next month if there are fewer than 5 projects(four or less).
     
    A few simple rules to follow:
    - You must be a member of the 43oh forum at least a week before your submission.
    - One entry from each member will be permitted.
    - Your project can be anything based around the MSP430. You may interface the MSP430 to another controller.
    - You may reuse code from anywhere as long as you give credit to the original author.
    - You must submit code and schematics of your project with a proper description.
    - You can submit your MSP430 project, if it was created before the annoucement of the contest.
    - You must have at least 5 posts in the forums, for your entry to be considered when the voting begins.
  8. Like
    bluehash got a reaction from gatesphere in Anyone looking forward for Dec POTM?   
    Yes, It's allowed. That will be in the rules.
  9. Like
    bluehash got a reaction from boseji in Grace, the graphical code generator for MSP430 CCS   
    I found it:
    When you are creating a new project, after the project settings - You will find it in Project Templates. Kind of hidden within layers.
     

  10. Like
    bluehash reacted to NatureTM in Flashing the missing DCO calibration constants   
    I submitted this to HaD too. It's not as flashy as the TV out I just submitted, but I know HaD readers who use Launchpad would find it useful. It will also be good press for 43oh, right?
  11. Like
    bluehash got a reaction from juani_c in Grace, the graphical code generator for MSP430 CCS   
    Did you guys see this:
    http://focus.ti.com/general/docs/video/ ... grace_em_v
     
    * GUI-based configuration tool for setting up ADCs, OpAmps, Timers, Clocks, GPIO, Comparators, Serial Communication, and other MSP430 peripherals.
    * Generates easy-to-understand C code that properly configures your device
    * Supports all MSP430 Value Line devices (MSP430G2xx) and select F2xx devices
    * Compatible with LaunchPad and most eZ430 tools
    * Grace tooltips offer helpful popups and hints for properly configuring your MSP430 device
    * Grace provides a Basic, Power User, and Register-level view offering different levels of abstraction for setting up your peripherals.
    * As a free CCS plug-in, Grace seamlessly integrates into the MSP430 tool chain and development process
    * Minimizes any configuration conflicts or collisions between multiple peripherals
     

  12. Like
    bluehash got a reaction from GeekDoc in Grace, the graphical code generator for MSP430 CCS   
    Did you guys see this:
    http://focus.ti.com/general/docs/video/ ... grace_em_v
     
    * GUI-based configuration tool for setting up ADCs, OpAmps, Timers, Clocks, GPIO, Comparators, Serial Communication, and other MSP430 peripherals.
    * Generates easy-to-understand C code that properly configures your device
    * Supports all MSP430 Value Line devices (MSP430G2xx) and select F2xx devices
    * Compatible with LaunchPad and most eZ430 tools
    * Grace tooltips offer helpful popups and hints for properly configuring your MSP430 device
    * Grace provides a Basic, Power User, and Register-level view offering different levels of abstraction for setting up your peripherals.
    * As a free CCS plug-in, Grace seamlessly integrates into the MSP430 tool chain and development process
    * Minimizes any configuration conflicts or collisions between multiple peripherals
     

  13. Like
    bluehash got a reaction from NatureTM in We are growing!   
    Hello Everyone,
     
    We owe this update to you, since you guys are the main drivers of this portal, submitting and discussing the MSP430 and everything else. We would also like to thank our sponsors - Texas Instruments for the TI Chronos watch and Geekdoc for the Launchpad
     
    1. The 43oh blog received ~16000 pageviews this month and has steadily grown. We get around 400 pageviews a day, still small but a big jump from last month.(~9000)

     
     
    2. The forum received ~26000 pageviews this month. The good part of the board is that we have a steadily growing Projects section with code and schematics. This helps new users to use them as reference projects and ramp up quickly.

     
    3. We added ~100 forum members this month to the board. We are now at 120 members.
     
    4. We were also surprised to get six good projects for the Project of the Month. All six were were submitted with code and related material. Thanks and keep building.
     
    5. This month's project will hopefully be announced by the 5th of Dec. We are in the process of arranging the prize.
     
    6. Big thanks to jbremnant who donated 5 Launchpads for future contests.
     
    All in all, a big thank you!
  14. Like
    bluehash got a reaction from GeekDoc in We are growing!   
    Hello Everyone,
     
    We owe this update to you, since you guys are the main drivers of this portal, submitting and discussing the MSP430 and everything else. We would also like to thank our sponsors - Texas Instruments for the TI Chronos watch and Geekdoc for the Launchpad
     
    1. The 43oh blog received ~16000 pageviews this month and has steadily grown. We get around 400 pageviews a day, still small but a big jump from last month.(~9000)

     
     
    2. The forum received ~26000 pageviews this month. The good part of the board is that we have a steadily growing Projects section with code and schematics. This helps new users to use them as reference projects and ramp up quickly.

     
    3. We added ~100 forum members this month to the board. We are now at 120 members.
     
    4. We were also surprised to get six good projects for the Project of the Month. All six were were submitted with code and related material. Thanks and keep building.
     
    5. This month's project will hopefully be announced by the 5th of Dec. We are in the process of arranging the prize.
     
    6. Big thanks to jbremnant who donated 5 Launchpads for future contests.
     
    All in all, a big thank you!
  15. Like
    bluehash got a reaction from gatesphere in We are growing!   
    Hello Everyone,
     
    We owe this update to you, since you guys are the main drivers of this portal, submitting and discussing the MSP430 and everything else. We would also like to thank our sponsors - Texas Instruments for the TI Chronos watch and Geekdoc for the Launchpad
     
    1. The 43oh blog received ~16000 pageviews this month and has steadily grown. We get around 400 pageviews a day, still small but a big jump from last month.(~9000)

     
     
    2. The forum received ~26000 pageviews this month. The good part of the board is that we have a steadily growing Projects section with code and schematics. This helps new users to use them as reference projects and ramp up quickly.

     
    3. We added ~100 forum members this month to the board. We are now at 120 members.
     
    4. We were also surprised to get six good projects for the Project of the Month. All six were were submitted with code and related material. Thanks and keep building.
     
    5. This month's project will hopefully be announced by the 5th of Dec. We are in the process of arranging the prize.
     
    6. Big thanks to jbremnant who donated 5 Launchpads for future contests.
     
    All in all, a big thank you!
  16. Like
    bluehash reacted to NatureTM in Flashing the missing DCO calibration constants   
    EDIT: Here's another really nice DCO calibration program. It's part of TinyOS-msp430. http://code.google.com/p/tinyos-msp430/ It's the file called calibrate-dco. As gordon, who discovered it said, "[it] appears to be a quite beefed-up DCO calibration app, with goodies on the side (taking silicon errata into account for various devices when calibrating)." It looks like it's built to be solid and reliable. I skimmed over the code and didn't see anything for calculating SegA checksum, but that usually isn't an issue for most non-critical applications.
     
    EDIT: maxpenna shared another version of the DCO calibration program. This is the one to use if you need a correct SegmentA checksum. It uses the C calibration function. You can get it here http://www.43oh.com/forum/download/file.php?id=292
     
    WARNING: Some of the programs in this thread will erase Segment A and only put back the DCO calibrations. They should not be used with chips that have an ADC12, as this process will destroy the ADC12 calibrations. Some of the programs do not calculate the Segment A checksum, so the integrity of Segment A cannot be verified during runtime after calibration. Still, I've been using it without any problems.
     
     
    There's been a bit of a discussion in another thread about an idea simpleavr had for adding the dco calibration constants to flash for the Value Line series. I've cobbled together some pieces of TI code and have it working. It seems to work great. Here's how I did it with CCS. I think the people on linux should be able to reproduce the result with a little adaptation.
     
    This requires the TI DCO library I modified in another thread and an external LF crystal like the one with Launchpad.
    http://naturetm.com/files/Launchpad%20setDCO%20lib.rar
     
    First, run this to calibrate the constants and write them to flash:
    EDIT: 43oh member zeke has made some changes to the code for finer tuning. Check page 2 for his code.

    //****************************************************************************** // 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" #include "DCO_Library.h" 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 setting); void main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop WDT for (i = 0; i < 0xfffe; i++); // Delay for XTAL stabilization P1OUT = 0x01; // Red LED on P1SEL = 0x10; // P1.4 SMCLK output P1DIR = 0x51; // P1.0,4,6 output j = 0; // Reset pointer Set_DCO(TI_DCO_16MHZ); // Set DCO and obtain constants CAL_DATA[j++] = DCOCTL; CAL_DATA[j++] = BCSCTL1; Set_DCO(TI_DCO_12MHZ); // Set DCO and obtain constants CAL_DATA[j++] = DCOCTL; CAL_DATA[j++] = BCSCTL1; Set_DCO(TI_DCO_8MHZ); // Set DCO and obtain constants CAL_DATA[j++] = DCOCTL; CAL_DATA[j++] = BCSCTL1; Set_DCO(TI_DCO_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 P1OUT = 0; while (1) { P1OUT ^= BIT6; // Toggle green LED for (i = 0; i < 0x4000; i++); // SW Delay } } void Set_DCO(unsigned int setting){ volatile unsigned int I; // P1DIR |= BIT0; // P1.0 output BCSCTL1 &= ~XTS; // external source is LF; BCSCTL3 &= ~(LFXT1S0 + LFXT1S1); // watch crystal mode BCSCTL3 |= XCAP0 + XCAP1; // ~12.5 pf cap on the watch crystal as recommended for( I = 0; I < 0xFFFF; I++){} // delay for ACLK startup if(TI_SetDCO(setting) == TI_DCO_NO_ERROR) // if setting the clock was successful, P1OUT |= BIT0; // bring P1.0 high (Launchpad red LED) else while(1); // trap if setting the clock isn't successful }
     
    The green light should start blinking in a few seconds, indicating success. Now we need to modify some linker and header files so CCS knows about the new calibrations.
     
    I'm using the MSP430G2231, so I duplicated the file C:\Program Files (x86)\Texas Instruments\ccsv4\msp430\include\msp430g2231.cmd in that directory, and renamed the duplicate as msp430g2231_mod.cmd. Now I can edit it without affecting the original. Edit msp430g2231_mod.cmd and change the calibration section at the bottom to this:
     

    /************************************************************ * Calibration Data in Info Mem ************************************************************/ CALDCO_16MHZ = 0x10F8; CALBC1_16MHZ = 0x10F9; CALDCO_12MHZ = 0x10FA; CALBC1_12MHZ = 0x10FB; CALDCO_8MHZ = 0x10FC; CALBC1_8MHZ = 0x10FD; CALDCO_1MHZ = 0x10FE; CALBC1_1MHZ = 0x10FF;
     
    Now the linker knows we have calibration data in that section when we use the modified file.
     
    When we create a new project in CCS or modify an existing one, CCS will want to use the default linking file, and the default header. Here's an example about how to configure a project to use the new constants.
    First create a new project. Within the project, there should be a file called something like lnk_msp430g2231.cmd. The last line of that file should be something like -l msp430g2231.cmd. Open it, and change the last line to reflect the new linker file so it reads -l msp430g2231_mod.cmd.
    Next, add the appropriate header file to the project. Right-click the project folder in the left pane of CCS and click "Add files to project..." In this example, I'm using C:\Program Files (x86)\Texas Instruments\ccsv4\msp430\include\msp430g2231.h. Now we have a copy of the file in the project we can safely edit. Edit the file so the calibration section looks like this:

    /************************************************************ * Calibration Data in Info Mem ************************************************************/ #ifndef __DisableCalData SFR_8BIT(CALDCO_16MHZ); /* DCOCTL Calibration Data for 16MHz */ SFR_8BIT(CALBC1_16MHZ); /* BCSCTL1 Calibration Data for 16MHz */ SFR_8BIT(CALDCO_12MHZ); /* DCOCTL Calibration Data for 12MHz */ SFR_8BIT(CALBC1_12MHZ); /* BCSCTL1 Calibration Data for 12MHz */ SFR_8BIT(CALDCO_8MHZ); /* DCOCTL Calibration Data for 8MHz */ SFR_8BIT(CALBC1_8MHZ); /* BCSCTL1 Calibration Data for 8MHz */ SFR_8BIT(CALDCO_1MHZ); /* DCOCTL Calibration Data for 1MHz */ SFR_8BIT(CALBC1_1MHZ); /* BCSCTL1 Calibration Data for 1MHz */ #endif /* #ifndef __DisableCalData */
     
    Now you can begin using the new calibration data in your program. When you #include the msp430g2231.h file, put it in quotes instead of <> to ensure it's loading the modified header local to the project directory.
     
    I tested the constants with a cheap oscilloscope and they seemed correct. My scope doesn't have great accuracy at high frequencies so they might be a little off, but nothing I can detect. It works with my composite video prog, so that's a pretty good sign.
     
    EDIT: Oops! I had an incorrectly named file in these instructions. Corrected.
  17. Like
    bluehash reacted to simpleavr in Value Line series easy DCO setting library   
    well, i tried again the 'c' based msp430x20xx_dco_flashcal.c (inside slau80 examples) and managed to get it to work after tweaking it a bit. here are some findings for anyone who is interested.
     
     
    i look at the code and see that for each frequency it is not giving the dco any initial value, i thought it will take forever for the timer to reach the require clock ticks one step at a time. so i add some "guess" values so the calibration start at a close clock rate.
     
    and it didn't help, i still did not see the end of calibration when the led should blink.
     
    i look at the code again and it struck me that the set_dco() function can go on forever if each timing iteration swings back and forth (i.e. this time slow, next time too fast, etc, etc), it won't exit the function if the timing is not exactly the value it wants.
     
    so i comment out the calibration block for 16,12,8 Mhz and just try 1Mhz, and after may be 1 minute i can get it to finish. but sometimes it never finishes. but for the other clock rates, it might take many hours to have it struck the exact value (if it ever does).
     
    to validate this theory, i add a counter to count the "swinging" condition and if it reaches 100 swings (too slow, too fast, too slow..) i will call it quit and use the last calibrated value.
     
    i am able to calibrate the 4 set of frequencies like so.
     
    but.... they look incorrect to me, the values looks too high, and i can't get consistent results.
     
    i am sure something is still wrong, may be whoever had tried this example before can give some input. it would be nice to have this working correctly.
     
     
    here is the code portion i changed in function Set_DCO(...) to get the calibration going and finish.
     

    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 unsigned char backnforth = 0; // added by me unsigned char dir = 0; // added by me 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 || backnforth > 100) // changed by me, added backnforth check break; // If equal, leave "while(1)" else if (Delta < Compare) { if (dir == 1) backnforth++; // add by me dir = 0; // add by me DCOCTL--; // DCO is too fast, slow it down if (DCOCTL == 0xFF) // Did DCO roll under? if (BCSCTL1 & 0x0f) BCSCTL1--; // Select lower RSEL } else { if (dir == 0) backnforth++; // add by me dir = 1; // add by me 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 }
  18. Like
    bluehash reacted to NatureTM in Launchpad TV output   
    Here's the writeup:
    http://naturetm.com/?p=47
     
    I've attached two versions of the code, one for use with an external 16MHz oscillator, and one for if you have your 16MHz DCO constant calibrated.
    Launchpad_TV_Out.rar
    Launchpad_TV_Out_for_calibrated.rar
  19. Like
    bluehash reacted to jbremnant in MSP430 and Nokia 6100 LCD   
    Here's a preview of my msp430 project.
     


     
    Just started mucking around with sparkfun lcd breakout board.
    Managed to take the code they had for arduino and made it work with msp430g2211 on mini breadboard.
     

     
    Next steps:
     
    - use simpleavr's i2c library to interface against wii nunchuck
    - make a simplegame that uses wii nunchuck for user input and lcd display for graphics
    - thinking about making the system modular by breaking functionality into 2 msp430g2211 chips:
    one handling lcd graphics and the other on game logic and wii nunchuck.
    the chips would communicate over SPI.
    - replace sparkfun's lcd breakout with low cost soloution: custom made pcb, and a few components.
     
    As time permits, I'll post the code, etc...
    I'll attempt to fit everything on a mini breadboard. (inspiration from simpleavr's projects)
    Let's see how this goes.
     
    EDIT: dang, you can hear my baby crying in the background in the video. what a nice dad. 8-)
  20. Like
    bluehash got a reaction from gatesphere in [ ENDED ] Nov 2010 - 43oh Project of the Month Contest   
    Congratulations!
    Results of the November 2010 Project of the Month contest:
    First Place: The "Strobr: High speed photography controller" by AMagill
    Runner up : The "Launchpad RFM12B RF spectrum analyzer" by simpleavr
     
    Thanks to the following members who participated:
    MSP430G2xxx Tea Timer by gatesphere
    Killing Zombies with the Launchpad by juani_c
    Motion Detection Wildlife Camera by paradug
    Digital LED Clock by mnpumar
     
    A big thanks to our prize sponsors:
    Texas Instruments
    Geekdoc.
     
    Also, a big thank you to all those who voted.
  21. Like
    bluehash reacted to simpleavr in Value Line series easy DCO setting library   
    if u dump out the stock flash portion where the calibrated values are defined.
     

    (mspdebug) dis 0x10f0 010f0: ff ff ff ff AND.B @R15+, 0xffff(R15) 010f4: ff ff ff ff AND.B @R15+, 0xffff(R15) 010f8: ff ff ff ff AND.B @R15+, 0xffff(R15) 010fc: 01 02 MOVA #0x4, SP 010fe: 6b 87 SUB.B @R7, R11
     
    the double word from 0x10fc (0x0102, 0x6b87) are the calibrated 1Mhz values from factory.
    the other 3 sets (8, 12, 16Mhz) are pre-allocated but blank for the value line (cheaper, so no calibration).
     
    [EDIT] correction, the 4 calibrated values should be double bytes, not double words according to header files.

    0x10ff, 0x10fe are 1Mhz BCSCTL1+DCOCTL values 0x10fd, 0x10fc are 8Mhz 0x10fb, 0x10fa are 12Mhz 0x10f9, 0x10f8 are 16Mhz
    value shown from my mspdebug session has been messed up (i guess) when i was trying the calibration code.
    too early to give "thank you"s to me,
    [END EDIT]
     
    typically u can modify NatureTMs example and "write" the calibrated values to those memory locations, after that u can use
     

    if (CALBC1_16MHZ != 0xff && CALDCO_16MHZ != 0xff) { BCSCTL1 = CALBC1_16MHZ; // Set DCO to 16MHz DCOCTL = CALDCO_16MHZ; }//if
     
    additional check for 0xff will ensure u only use it if it's set.
     
    there is also a c example msp430x20xx_dco_flashcal.c in the slau80 examples that also writes to the flash constant locations, but i never got it to work.
     
    this way u don't have to carry the library on all of your projects and u only need the crystal when doing calibration.
  22. Like
    bluehash reacted to NatureTM in Launchpad TV output   
    I got my Launchpad to output B/W composite video. It only displays one image without re-flashing though, so it's not extremely useful. The only external components are two resistors and a crystal oscillator. I plan on writing it up on my blog and releasing the source sometime this week, unless I get too busy with school. I wasn't sure if I'd be able to ever get this working, so I'm feelin' pretty good right now!
    Proof ;-)

     
    Code for use with an external oscillator:
    Launchpad_TV_Out.rar
     
    Code for if you have your DCO configuration constants calibrated:
    Launchpad_TV_Out_for_calibrated.rar
     
    EDIT: Here's the writeup!
    http://naturetm.com/?p=47
  23. Like
    bluehash reacted to Joby Taffey in Minimal CC111x OS   
    The Chronos watch is based on a CC430 - an MSP430/radio microcontroller.
     
    The pack also contains a CC1111 based USB dongle - an 8051/radio/usb microcontroller.
    I've written a minimal operating system for the CC111x, which should be capable of running on this device (without USB support).
     
    It's available here: http://code.google.com/p/pinkos/
    (note - to get at the serial console, you'll have to do some fiddly soldering)
     
    It should be possible to use the GirlTech IM-Me handset and dongle units to communicate with the Chronos watch, the IM-Me units both contain the CC1110 chip.
     
    If you don't know what an IM-Me is - this will explain everything.

  24. Like
    bluehash reacted to NatureTM in Value Line series easy DCO setting library   
    Here's an existing TI lib I modified to work with the Value Line series and CCS.
     
    Since the G series doesn't come with factory-calibrated DCO settings, I wanted an easy way to set the MCLK to 16MHz or some other arbitrary frequency. A TI library existed for setting the DCO using an external watch crystal as a reference, however it didn't work with the G series. It just took some minor editing.
    I think this should be nice for Launchpad owners especially, since the kit comes with an external crystal and a 16MHz rated chip.
     
    DCO Library: http://naturetm.com/files/Launchpad%20setDCO%20lib.rar
  25. Like
    bluehash reacted to simpleavr in Crack SimpleAvr's clock easter egg   
    well, i had kind of cleaned up the rtc extension for the 3p4w clock, now it's 8p9w.
     
    had stayed on my bedside for a week, using the alarm everyday, had not really measure the accuracy but does not need to adjust it for the week.
     

     
    there's also software i2c code (quite cleanly isolated) if anyone need to salvage a software i2c master.
     
    project here
     
    http://www.simpleavr.com/msp430-projects/rtc-clock
×
×
  • Create New...