Jump to content
43oh

gordon

Members
  • Content Count

    536
  • Joined

  • Last visited

  • Days Won

    13

Reputation Activity

  1. Like
    gordon got a reaction from bluehash in another launchpad programming question   
    slau138/slau157 table 2-1 (source).
  2. Like
    gordon got a reaction from AaronInSpace in Where to begin...What to buy   
    The 24-pin one is TSSOP. There is a DIP 20-pin variant, which is compatible with the LaunchPad. You can sample these (you can get 2, IIRC), but actually buying them is a bit of a problem as of now (TI probably hasn't ramped production up yet, these chips are fairly new).
  3. Like
    gordon reacted to oPossum in Precision 12 MHz clock for Launchpad MCU   
    The MSP430F1612 on the Launchpad provides a 12 MHz clock to the TUSB3410 chip. This clock can also be used by the MSP430 in the 20 pin socket.
     
    Clock on pin 49 of F1612

     
    Mask off pin 49 with Kapton tape and solder a 1k resistor to the pin.
    Connect the other end of the resistor to the lower pad of C21 using a short wire.
     

     
    This test program will flash the red LED five times with the DCO at ~1 MHz and then switch to the 12 MHz external clock.
     

    #include "msp430g2231.h" void main(void) { unsigned i; volatile unsigned n = 0; WDTCTL = WDTPW | WDTHOLD; P1DIR = 0x01; P1SEL = 0x00; i = 10; do { P1OUT ^= 1; while(--n); } while(--i); BCSCTL3 = LFXT1S0 | LFXT1S1; // - Set XT1 clock type as external do { // - Wait for MSP430 to detect clock is stable IFG1 &= ~OFIFG; // Clear OFIFG n = 250; while(--n); // Wait a while } while(IFG1 & OFIFG); // Loop until OFIFG remains cleared BCSCTL2 = SELM1 | SELM0 | SELS; // - Use LFXT1CLK as clock source do { P1OUT ^= 1; while(--n); } while(1); }
  4. Like
    gordon got a reaction from fj604 in Interfacing the Launchpad with MAX6957 SPI LED Driver   
    Might it be this? (Also the MAX6957 data sheet page 7, towards the bottom.)
  5. Like
    gordon reacted to oPossum in 16-bit USCI SPI transfers   
    The firmware must control the SS line(s). The hardware has no idea how long a packet is.
  6. Like
    gordon got a reaction from nuetron in Interfacing a YM3812 and LCD to 'G2231   
    Because you have an unconditional return on the line before that.
  7. Like
    gordon got a reaction from jsolarski in Where to begin...What to buy   
    Welcome on board!
     
    You will probably be right at home starting off with MSP430, especially if people around you already use it. I have no particular experience with robotics as such, but stick a ~$2 MSP430G2553 (currently the biggest MCU the LaunchPad supports) in the $4.30 LaunchPad, and you already have a pretty beefy setup to start with. At 6 bucks, you can't really go wrong .
     
    Olimex makes some nice starter kits at pretty reasonable prices, if kits are what tickle your fancy. However, the LP is all you need to interface with any MSP that supports being tackled with Spy-Bi-Wire (which is most of those you want, at least for starters), so if all else fails, you can just get an LP for programming, and any beefy MSP430 (where I believe even the bigger ones are under $10 or thereabouts) on a breakout board, and there you fly.
     
    All in all, even in the very unlikely event of you realizing this is not your keg of beer, the whole experiment will have cost you about $20. Whether or not you are willing to risk this is up to you, but I don't think you can go too wrong.
  8. Like
    gordon reacted to cde in New posts timeout   
    Use "View Active Topics" instead. Shows you every topic with a post in the last few days.
  9. Like
    gordon got a reaction from zborgerd in Where to begin...What to buy   
    Welcome on board!
     
    You will probably be right at home starting off with MSP430, especially if people around you already use it. I have no particular experience with robotics as such, but stick a ~$2 MSP430G2553 (currently the biggest MCU the LaunchPad supports) in the $4.30 LaunchPad, and you already have a pretty beefy setup to start with. At 6 bucks, you can't really go wrong .
     
    Olimex makes some nice starter kits at pretty reasonable prices, if kits are what tickle your fancy. However, the LP is all you need to interface with any MSP that supports being tackled with Spy-Bi-Wire (which is most of those you want, at least for starters), so if all else fails, you can just get an LP for programming, and any beefy MSP430 (where I believe even the bigger ones are under $10 or thereabouts) on a breakout board, and there you fly.
     
    All in all, even in the very unlikely event of you realizing this is not your keg of beer, the whole experiment will have cost you about $20. Whether or not you are willing to risk this is up to you, but I don't think you can go too wrong.
  10. Like
    gordon got a reaction from AaronInSpace in Where to begin...What to buy   
    Welcome on board!
     
    You will probably be right at home starting off with MSP430, especially if people around you already use it. I have no particular experience with robotics as such, but stick a ~$2 MSP430G2553 (currently the biggest MCU the LaunchPad supports) in the $4.30 LaunchPad, and you already have a pretty beefy setup to start with. At 6 bucks, you can't really go wrong .
     
    Olimex makes some nice starter kits at pretty reasonable prices, if kits are what tickle your fancy. However, the LP is all you need to interface with any MSP that supports being tackled with Spy-Bi-Wire (which is most of those you want, at least for starters), so if all else fails, you can just get an LP for programming, and any beefy MSP430 (where I believe even the bigger ones are under $10 or thereabouts) on a breakout board, and there you fly.
     
    All in all, even in the very unlikely event of you realizing this is not your keg of beer, the whole experiment will have cost you about $20. Whether or not you are willing to risk this is up to you, but I don't think you can go too wrong.
  11. Like
    gordon got a reaction from bluehash in Where to begin...What to buy   
    Welcome on board!
     
    You will probably be right at home starting off with MSP430, especially if people around you already use it. I have no particular experience with robotics as such, but stick a ~$2 MSP430G2553 (currently the biggest MCU the LaunchPad supports) in the $4.30 LaunchPad, and you already have a pretty beefy setup to start with. At 6 bucks, you can't really go wrong .
     
    Olimex makes some nice starter kits at pretty reasonable prices, if kits are what tickle your fancy. However, the LP is all you need to interface with any MSP that supports being tackled with Spy-Bi-Wire (which is most of those you want, at least for starters), so if all else fails, you can just get an LP for programming, and any beefy MSP430 (where I believe even the bigger ones are under $10 or thereabouts) on a breakout board, and there you fly.
     
    All in all, even in the very unlikely event of you realizing this is not your keg of beer, the whole experiment will have cost you about $20. Whether or not you are willing to risk this is up to you, but I don't think you can go too wrong.
  12. Like
    gordon reacted to oPossum in 256 x 192 graphics display using Fraunchpad - preview   
    A frame buffer for 256x192 pixels requires 6k. That is more than will fit in RAM, so the frame buffer is in the FRAM memory. NTSC video generated using TimerA0 for sync, and SPI with DMA for video.
     
    Graphics library functions:


    [*:hf56qo2f]Pixel
    [*:hf56qo2f]Line
    [*:hf56qo2f]Box
    [*:hf56qo2f]Circle
    [*:hf56qo2f]Ellipse
    [*:hf56qo2f]Quadratic and cubic bezier curve
    [*:hf56qo2f]BitBlt up to 24 pixels wide
    [*:hf56qo2f]OR, AND, and XOR drawing modes
    [*:hf56qo2f]Text with 8 x 12 font
     


  13. Like
    gordon got a reaction from bluehash in Quick reference section   
    1. +SLAU144, please don't leave this out
    3. a collection of links to the plenty "What do I need/Where do I start"-type of forum topics (ones with the answers I mean, so people can be pointed at one place)
    4. an Amazon referral link to the Davies book
  14. Like
    gordon reacted to Orpheus in Hot air pencil recommendation?   
    Sparkfun has a $9.95 300W "fat pencil" that might suit your needs. It's called the Heaterizer XL-3000 Heat gun. It doesn't show up on a search for hot air or other terms you might check, and I can't link it directly because I'm newly reregistered after my much neglected 1-post account was deleted. I have one, but haven't used it much. All I can say is: it's too cool for solder rework out of the box, so it may suit your needs (but I cut a small metal cone with tin snips to decrease airflow, and that raised its air output to the light rework range). I plan to experiment more with hacking it later, but I only took a brief glimpse inside.
     
    I can see no reason why it wouldn't work with a power tool motor speed controller (Harbor Freight commonly has these for $15 with coupon). The inductive load of the small motor should be minimal, so it should be 95% resistive, and therefore compatible with the common <$10 "incandescent only" light dimmer, if they go up to 300W. (I hack things with these dimmers all the time)
     
    It's much more like a handheld desktop tool than pistol or hairdryer-style hot air guns are
  15. Like
    gordon reacted to nexusone1984 in 4X4X4 LED cude   
    Been busy with a lot of other stuff... but after a little time here and there put together a 4x4x4 LED Cube.
     
    Soldering the LED's took me forever....
     
    I used Common Cathode configuration for the LED's, this way logic 1 turns on the LED. and Logic 1 also turns on a Row transistor.
     
    Simple little demo.
     


     
    Parts: Launchpad board, 3 x 74HC595 8-bit shift registers, 4 x 2N3904 NPN transistors, 64 Yellow LED's.
  16. Like
    gordon got a reaction from oPossum in SBW connector layout   
    For the record, SugarAddict dug up this. A bit wasteful on everything, but there is a standard .
  17. Like
    gordon got a reaction from SugarAddict in Fixed TI Eagle library   
    Got bitten by this. Not sure I can post the complete fixed library, but there's nothing against posting some random binary junk, so here's the XDelta against the original SLAC060e (that is v16 of the library).
     
    I have fixed (I think all of) the outline-(thus pin)-not-on-default-grid cases as well as some occurrences of the outline being on the Names layer (instead of Symbols). The fix only affects the symbols (packages and devices should be unchanged), and only the outlines and pins (so pin names and the like will look a bit oddly placed to the alert reader).
     
    I have accidentally modified some lines that were not on the default grid, but don't have pins either -- sorry . It's just aesthetics, apart from looking a (tiny) bit odd, no real change here.
     
    Dear TI, the Eagle libraries are great <3, please rent a guy for a month or three who knows how to do them properly, thank you!
     

    MD5(ti-msp430-v16.lbr.xdelta) = cf93d7b756aa723696d49f1200f25854
    ti-msp430-v16-xdelta.zip
  18. Like
    gordon got a reaction from bluehash in Fixed TI Eagle library   
    Got bitten by this. Not sure I can post the complete fixed library, but there's nothing against posting some random binary junk, so here's the XDelta against the original SLAC060e (that is v16 of the library).
     
    I have fixed (I think all of) the outline-(thus pin)-not-on-default-grid cases as well as some occurrences of the outline being on the Names layer (instead of Symbols). The fix only affects the symbols (packages and devices should be unchanged), and only the outlines and pins (so pin names and the like will look a bit oddly placed to the alert reader).
     
    I have accidentally modified some lines that were not on the default grid, but don't have pins either -- sorry . It's just aesthetics, apart from looking a (tiny) bit odd, no real change here.
     
    Dear TI, the Eagle libraries are great <3, please rent a guy for a month or three who knows how to do them properly, thank you!
     

    MD5(ti-msp430-v16.lbr.xdelta) = cf93d7b756aa723696d49f1200f25854
    ti-msp430-v16-xdelta.zip
  19. Like
    gordon got a reaction from kenemon in Standalone Nightmare   
    TEST and RST. Don't rely on pin numbers alone, for what if you'll use a smaller (or larger) chip?
     
    But yes, the general idea is the same with all SBW-programmable devices.
     
    Edit: for advice on schematic capture software, there's a whole thread. Add KiCad to that list; it seems to be popular in some circles.
  20. Like
    gordon got a reaction from nuetron in Fixed TI Eagle library   
    Got bitten by this. Not sure I can post the complete fixed library, but there's nothing against posting some random binary junk, so here's the XDelta against the original SLAC060e (that is v16 of the library).
     
    I have fixed (I think all of) the outline-(thus pin)-not-on-default-grid cases as well as some occurrences of the outline being on the Names layer (instead of Symbols). The fix only affects the symbols (packages and devices should be unchanged), and only the outlines and pins (so pin names and the like will look a bit oddly placed to the alert reader).
     
    I have accidentally modified some lines that were not on the default grid, but don't have pins either -- sorry . It's just aesthetics, apart from looking a (tiny) bit odd, no real change here.
     
    Dear TI, the Eagle libraries are great <3, please rent a guy for a month or three who knows how to do them properly, thank you!
     

    MD5(ti-msp430-v16.lbr.xdelta) = cf93d7b756aa723696d49f1200f25854
    ti-msp430-v16-xdelta.zip
  21. Like
    gordon reacted to oPossum in Fast itoa() for CCS   
    itoa() is not part of the standard C library and is absent from CCS.
     
    Here are three functions to convert signed and unsigned integers to ASCII. They are written for speed, not compactness.
     
    void itoa(int, char *); // Convert signed integer to ASCII
    void utoa(unsigned, char *); // Convert unsigned integer to ASCII
    void btoa(unsigned, char *); // Convert unsigned char to ASCII (leading spaces)
     
    itoa() and utoa()

    utoa ; --- Unsigned to ASCII --- ; - Range 0 to 65535 ; - Leading zeros supressed push R10 ; clr R14 ; Clear packed BCD mov #-1, R10 ; Flag as positive rla R12 ; Get bit 15 of binary jmp unsigned ; itoa ; --- Integer to ASCII --- ; - Range -32768 to +32767 ; - Leading zeros supressed push R10 ; clr R14 ; Clear packed BCD rla R12 ; Get bit 15 of binary subc R10, R10 ; Save sign bit jne notneg ; Positive... inv R12 ; Negate negative numbers inc R12 ; This will overflow only for -32768 unsigned ; dadd R14, R14 ; Multiply BCD by 2 and add binary bit notneg ; .loop 12 ; Do 12 bits rla R12 ; Get bit 14 to 3 of binary dadd R14, R14 ; Multiply BCD by 2 and add binary bit .endloop ; clr R15 ; Clear digit 1 of packed BCD .loop 3 ; Do 3 bits rla R12 ; Get bit 2 to 0 of binary dadd R14, R14 ; Multiply BCD by 2 and add binary bit dadd R15, R15 ; .endloop ; swpb R14 ; Swap digit order mov R14, R12 ; Copy packed BCD digits and #0x0F0F, R12 ; Mask digits 5 & 3 rra R14 ; Shift digits 4 & 2 to lower nibble rra R14 ; rra R14 ; rra R14 ; and #0x0F0F, R14 ; Mask digits 4 & 2 tst R10 ; Negative? jne nosign ; No, skip sign... mov.b #'-', 0(R13) ; Negative sign to string inc R13 ; nosign ; mov #('0' << 8) | '0', R10 ; Make ASCII add R10, R12 ; add R10, R14 ; add R10, R15 ; cmp.b R10, R15 ; Is first digit a 0? jne dig5 ; No... cmp.b R10, R14 ; Is second digit a 0? jne dig4 ; No, only the first... cmp.b R10, R12 ; Is third digit a 0? jne dig3 ; No, only the first two... cmp R10, R14 ; Is fourth digit a 0? (second is zero) jne dig2 ; No, only the first three... dig1 ; First four digits are all 0 swpb R12 ; Fifth digit to string mov.b R12, 0(R13) ; inc R13 ; clr.b 0(R13) ; NULL terminate string pop R10 ; reta ; Return ; dig5 ; mov.b R15, 0(R13) ; First digit to string inc R13 ; dig4 ; mov.b R14, 0(R13) ; Second digit to string inc R13 ; dig3 ; mov.b R12, 0(R13) ; Third digit to string inc R13 ; dig2 ; swpb R14 ; Fourth digit to string mov.b R14, 0(R13) ; inc R13 ; jmp dig1 ; ;
    btoa()

    btoa ; --- Byte to ASCII --- ; - Range 0 to 255 ; - Leading zeros converted to spaces clr R14 ; Clear packed BCD swpb R12 ; Move LSB to MSB .loop 8 ; Do 8 bits rla R12 ; Get a bit of binary dadd R14, R14 ; Multiply BCD by 2 and add binary bit .endloop ; ; mov R14, R12 ; Copy packed BCD digits and #0x0F0F, R12 ; Mask digits 1 & 3 mov #('0' << 8) | '0', R15 ; Make ASCII add R15, R12 ; mov.b R12, 2(R13) ; Move digit 3 to bcd[2] swpb R12 ; Swap digits 1 & 3 mov.b R12, 0(R13) ; Move digit 1 to bcd[0] rra R14 ; Shift digit 2 to lower nibble rra R14 ; rra R14 ; rra R14 ; and #0x0F0F, R14 ; Mask digit 2 add R15, R14 ; Make ASCII mov.b R14, 1(R13) ; Move digit 2 to bcd[1] clr.b 3(R13) ; NULL terminate string cmp.b R15, 0(R13) ; Is first digit a 0? jne b2aex ; No... cmp.b R15, 1(R13) ; Is second digit a 0? jne b2a2d ; No, only the first.. mov #(' ' << 8) | ' ', 0(R13); Make first two digits spaces reta ; Return b2a2d ; mov.b #' ', 0(R13) ; Make first digit a space b2aex ; reta ; Return
    itoa.zip
  22. Like
    gordon got a reaction from zeke in Teach how to Enable Serial Communication   
    By setting bits in registers .
     
    OK, seriously. This topic is slightly :evil: larger than a forum post. The MSP430x2xx Family User's Guide devotes about 80 pages to this subject, the Davies Book about 120, and that's only serial comms (which, mind you, is not equivalent to UART, as you seem to think/imply, but also includes I2C and SPI; add to that there are two different hardware modules implementing these, then there's always bit-banging) -- you most certainly need a bit of a familiarity with at least the clock system to make heads or tails of any of this.
     
    There is no way to answer this question in this form. I suggest you read through our excellent collection of information for beginners first: viewtopic.php?f=8&t=449, viewtopic.php?f=8&t=920 and viewtopic.php?f=8&t=1075 (maybe others too).
  23. Like
    gordon reacted to nuetron in LED matrix display pixel ghosting   
    See this thread.
     
    I've had pretty good results with Eagle, seems to be lacking some older and newer devices, though.
    Here's the library I created for the 'G2231, same pinout as 'G2211.
     
    If/when you get Eagle installed, just extract the zip into the lbr folder in the Eagle install folder.
    msp430g2231.zip
  24. Like
    gordon got a reaction from RobG in is possible to control a pump with PWM @ 220V (AC)?   
    Just spamming really, but the sequence "DMX" caught my eye. Have you guys seen this? There seem to be some other gems too. Dunno yet what it will be good for, but there you go anyway.
  25. Like
    gordon reacted to jsolarski in Uniarch mspgcc ISR syntax   
    For coding interrupts on uniarch mspgcc --
     
    use the following format
     

    __attribute__((interrupt(ISR_VECTOR))) void Isr_Vector_Name(void) { //code goes here }
     
    no need to include signal.h, or leagacymsp430.h
    you will only need to include the device specific header or msp430.h
    http://sourceforge.net/mailarchive/foru ... pgcc-users
    or check out my post for all 4 variations ---http://justinstech.org/2011/07/msp430-different-interrupts-for-different-compilers/
     
    also one other thing i noticed is isr_compat.h in the current build for uniarch
    I will trying it out and seeing if it will make porting code from either IAR/CSS or mspgcc4 easier.
×
×
  • Create New...