Jump to content
43oh

jsolarski

Members
  • Content Count

    568
  • Joined

  • Last visited

  • Days Won

    8

Reputation Activity

  1. Like
    jsolarski reacted to juani_c in how to optimize code?   
    Having this in mind I did a little search and found this;
    "Efficient Multiplication and Division Using MSP430"-> http://focus.ti.com/lit/an/slaa329/slaa329.pdf
    There is a table on page 7 showing the results from using different methods and there is a big improvement using those described in the app note.
  2. Like
    jsolarski reacted to gatesphere in Writing a roguelike game, just thought I'd share...   
    Chapter two: http://blog.suspended-chord.info/?c=37
     
    Also, new colors.
  3. Like
    jsolarski got a reaction from gatesphere in Chicago land events   
    2 upcoming events in the Chicago Area
     
    First - June 4th http://lizrevision.com/6-4-2011-4th-ann ... -sale.html

     
    second is another meetup for workshop88 Date to be decided probably a Thursday night in June/
    http://www.meetup.com/workshop88/events/20216231/
  4. Like
    jsolarski got a reaction from NatureTM in Value Line series easy DCO setting library   
    You can also use the DCO calibration code to customize your calibration, recently I have changed a bunch of my F2013s to Default on 2MHz on startup.
     
    Basically I overwrote the 1MHz calibration with 2 MHz data, tested on my scope and it works like a charm, also loaded up another blink led program and they work with the 2MHz settings .
     
     
    http://justinstech.org/2011/05/msp430-c ... n-for-dco/
     
    What this means is you could set all 3 settings to whatever you need them to be.
    Tested DCO calibration down to 500K, im looking to go lower later, and works up to 16MHz, have not tested any higher.
  5. Like
    jsolarski got a reaction from bluehash in Chicago land events   
    2 upcoming events in the Chicago Area
     
    First - June 4th http://lizrevision.com/6-4-2011-4th-ann ... -sale.html

     
    second is another meetup for workshop88 Date to be decided probably a Thursday night in June/
    http://www.meetup.com/workshop88/events/20216231/
  6. Like
    jsolarski reacted to zeke in Power supply testing procedures?   
    Well, it looks like I'm gonna answer my own question.
     
    I found this document that describes the salient details of power supply testing.
  7. Like
    jsolarski reacted to cde in Are the ValueLine chip outputs current limited?   
    Current is practically limited by it's voltage drop. At 6ma (Per pin, 48ma per port), the valueline chips drop 0.3v. Too much current draw, and the voltage drops enough to make the pin useless.
     
    Current is not physically limited by the chip. Always use resistors.
  8. Like
    jsolarski got a reaction from electronicsjunk.com in Sonix programming   
    you will need sonix MP-III writer, or other programmer
  9. Like
    jsolarski reacted to MattTheGeek in EasyMSP 0.8.2 Beta released   
    I've released a beta that fixes some timing issues and adds hardware and software SPI. software SPI is tested but hardware SPI isn't.
     
    Please check it out: http://code.google.com/p/easymsp/downloads/detail?name=EasyMSP%200.8.2%20Beta.zip&can=2&q=#makechanges
  10. Like
    jsolarski reacted to EngIP in How to program a Matrix   
    First off, I'd like to point out that I'm very much a noob. Bearing this in mind, please check everything I say against a reliable source.
     
    I don't know how much you understand about multiplexing etc. so I'll start from the beginning.
     
    A matrix consists of rows of LED's. Each row has all of the annodes (positive) or cathodes (negative) connected together. Each individual LED on the row has it's other leg connected to the same leg on all LED's in that column. So in your example, there are 4 rows and 6 columns. For the sake of argument let's say the row's have all of their annodes connected together, and all of the cathodes connected together on the columns. You're using a 10 x GPIO chip, so you can connect your rows to output pins 0-3, and your columns to 4-9.
     
    Now, you want to make row 1, column 1 illuminate. Row 1 has it's annode connected to output 0, column 1 has it's cathode connected to output 3. So to illuminate R1C1, you need output 0 to be 'ON', to put +V dc on the annode, and you need output 3 to be off, to put the cathode at 0v dc. However, because all of the LED's on the row share the same annode, you need to make the cathodes of LED's you DON'T want to switch on high.
     
    Look at it like this - you select which ROW to illuminate by turning the appropriate output to that ROW high. You select which COLUMN to illuminate by turning the appropriate output to that COLUMN low (on a common annode display).
     
    So now you know how to illuminate an individual LED, how do you create "images"? There are two ways, and it really depends on the hardware capabilities of your particular set-up.
     
    If you can supply enough current to drive all of the LED's in one row from the one pin, then you could write to your row once, setting the columns you want to be lit all in one go. For example, set row 1 high (and all other rows low), and set columns 2,3,4 and 5 low(with columns 1 and 6 high), and you'll have OFF,ON,ON,ON,ON,OFF on the top row of your matrix.
     
    If you can't drive enough power to the rows through one pin, you can illuminate each LED individually. To achieve the same display as mentioned above (OFF, ON, ON, ON, ON, OFF on Row 1), you would have to write to the row 3 times, setting each required column low in turn (and the other columns high).
     
    As for the code - that really depends on what you're trying to achieve. What might be the best approach for one outcome wouldn't necessarily be the best approach for another. Because of this, and because you'r hardware set-up is unknown, it's really down to you. But if you get something wired together, and have a go, I and others would be more than happy to help you fix your code.
     
    I hope this has cleared things up a little for you, but if not feel free to keep asking questions. Just don't expect anyone to do the work for you - it's hard enough to get motivated to work on our own projects, never mind anyone else's
  11. Like
    jsolarski reacted to zeke in Circuit Diagram Website   
    I regularly watch the RSS feed from this website: Electronic Circuit Diagram.
     
    There's some pretty interesting circuits there.
     
    I thought you all might like to follow it too.
  12. Like
    jsolarski reacted to gordon in Guidelines for the Use of the C Language   
    If you program (or plan to program) in C, MISRA (Wikipedia) sells a document titled Guidelines for the Use of the C Language in Critical Systems (Wikipedia).
     
    I found that to be a well-though-out source of information for general secure coding techniques. It focuses on embedded usage, but most of the principles apply generally. The document includes the guidelines themselves, rationale and example code as well.
     
    What included are really things that should be natural and evident for all C programmers (embedded or not), but (in my experience) sadly courses or books dealing with security stuff are either few and far between or are too focused on one particular system/environment (certainly not embedded). This is a very condensed representation of the whys and hows of the pitfalls and the way to avoid them all of us should have been taught in school (or should be in a new edition of K&R at the very least). It will not make you an expert overnight, but it will be eye-opening.
     
    If you are a C beginner, some of the items may be overwhelming (or outright scary); if you are a seasoned veteran, there still might be angles you have not thought of before. Some of it is definitely an overkill for a hobbyist, but following the general principle might help one not burning the barn or irrigating a new Lake Victoria in the back yard .
     
    The current version (MISRA C2) deals with C89 only; MISRA C3 (which will include C99 constructs as well) is said to come later this year, so blackmailing Santa might be a good idea .
     
    I am not a frequent standards buyer, but I figure that GBP10 (+tax, if applies), for which you get a 100+ page PDF document (watermarked to your name) borders on impulse buying for a document of this kind.
     
    (Apart from having bought it, not affiliated with them.)
  13. Like
    jsolarski reacted to RobG in Active high input?   
    There are two settings for internal resistor when PxDIR is 0 (input) and PxREN is 1 (enabled)
    PxOUT = 0, resistor pulls down, input is active high
    PxOUT = 1, resistor pulls up, input is active low
     
    When PxDIR is 0 (input) and PxREN is 0 (disabled,) input will be floating and must be pulled externally or connected to push-pull output.
    When PxDIR is 0, PxOUT has no effect on output, just the resistor.
     
    PxDIR = 0, PxREN = 1, PxOUT = 1, input is active low

     
    PxDIR = 0, PxREN = 1, PxOUT = 0, input is active high

  14. Like
    jsolarski reacted to bluehash in Free Digikey shipping tip   
    VIA Dangerousprototypes.com
  15. Like
    jsolarski got a reaction from bluehash in DCO VS VOLTAGE   
    It should continue working as long as you dont go below the brown out voltage, the side effect may be that the DCO may slow down a bit or start glitching. once it comes back up to regular voltage levels the DCO should be back to your selected clock speed.
     
    You will have to test on how low the voltage can go before it stops working, each chip will be slightly different Brownout voltage.
  16. Like
    jsolarski got a reaction from bluehash in Ethernet to serial module?   
    This is a DIgi One SP by Digi- 1 Port serial to Ethernet bridge/port server
    rs232 or rs422/485 full duplex or rs485 half duplex -- user selectable with switches
    optional termination resistor -- user selectable with switches
    input voltage 9v-30v .37A-11A
    pic1 http://justinstech.org/wp-content/uploads/2011/05/DSCN0619.jpg
    pic2 http://justinstech.org/wp-content/uploads/2011/05/DSCN0624.jpg
    pic3 http://justinstech.org/wp-content/uploads/2011/05/DSCN0625.jpg
    pic4 http://justinstech.org/wp-content/uploads/2011/05/DSCN0622.jpg
    pic5 http://justinstech.org/wp-content/uploads/2011/05/DSCN0626.jpg
    sry please be patient, the pictures are quite large. if you want a better picture of something on the board let me know.
     
     
    there is a Coldfire XCF5272VF, a max3243, 2x max 3491 an intel lxt972alc, AMD l320d890v1, 2675 voltage regulator, dg202b, an unknown memory chip, also some Ethernet hardware.
     
    interestingly there are 2 rows of headers one 6 pin and one 4 pin, no markings on what they are for. I will go more into detail when i have some more free time.
  17. Like
    jsolarski reacted to bluehash in Interrupts?   
    You poll the port pin to which the button is connected.
     

    unsigned char flagvariable = 0 volatile unsigned char buttonStatus; void main(void) { buttonStatus = P1IN & 0x8; // assuming you connected it to Pin 1.3 if (buttonStatus != 0) { flagvariable = 1; //button clicked }else flagvariable = 0; // unclicked }
     
    You don't even need a flag. Using your code:

    while ( ((P1IN & 0x8) !=0) && counter { //do my stuff counter++; }
     
    EDIT: Using the second half, would run your code as long as the button is pressed.
  18. Like
    jsolarski got a reaction from bluehash in Ethernet to serial module?   
    Serial to Ethernet links are quite common in the petro industry IE gas stations, If you are looking for an a quick tear down and pics, I have a few DigiPorts 4 port serial with WIFI or one port serial. they can be switched to rs232 or rs485 and have built in web interface. personally i havent touched them because of the resale value (retail 300 and 800+) only tested them to make sure they work.
     
    So i am willing to donate the single port for hacking or tearing both down for a fun and educational experience.
    also im willing to sell one of them for dirt cheap if need be with driver disk.
  19. Like
    jsolarski reacted to zeke in Question regarding Launchpad Programmer.   
    To quote Wikipedia:
     
    Debugging interface
     
    In common with other microcontroller vendors, TI has developed a two-wire debugging interface found on some of their MSP430 parts that can replace the larger JTAG interface. The eZ430 Development Tool contains a full USB-connected Flash Emulation Tool ("FET") for this new two-wire protocol, named "Spy-Bi-Wire" by TI. Spy-Bi-Wire was initially introduced on only the smallest devices in the 'F2xx family with limited number of I/O pins, such as the MSP430F20xx, MSP430F21x2, and MSP430F22x2. The support for Spy-Bi-Wire has been expanded with the introduction of the latest '5xx family, where all devices have support Spy-Bi-Wire interface in addition to JTAG.
     
    The advantage of the Spy-Bi-Wire protocol is that it uses only two communication lines, one of which is the dedicated _RESET line. The JTAG interface on the lower pin count MSP430 parts is multiplexed with general purpose I/O lines. This makes it relatively difficult to debug circuits built around the small, low-I/O-budget chips, since the full 4-pin JTAG hardware will conflict with anything else connected to those I/O lines. This problem is alleviated with the Spy-Bi-Wire-capable chips, which are still compatible with the normal JTAG interface for backwards compatibility with the old development tools.
     
     
    Take a look at this thread for a technical discussion on the topic.
  20. Like
    jsolarski reacted to NatureTM in Generating random numbers.   
    I was looking for example code for RF2500 last night and came across some TI code for using the ADC as a random number generator. The function was in assembly, so I rewrote it in C:
     

    bool getRandomBit(){ ADC10CTL1 |= INCH_5; ADC10CTL0 |= SREF_1 + ADC10SHT_1 + REFON + ADC10ON; ADC10CTL0 |= ENC + ADC10SC; while(ADC10CTL1 & ADC10BUSY); return ADC10MEM & 0x01; }
     
    Pin 1.5 is floating unconnected, and is measured by the adc. The LSB is used as the random bit. There's a twist though. Pin 1.4 is also floating unconnected, and is used as Vref+, so the top end of the range is floating as well. I thought that was pretty clever. Nice, TI!
     
    I wrote a few console programs to help me visualize the randomness. It turned out the generator was biased toward producing 0's. This function used with the previous function seemed to remove the bias:
     

    bool get0BiasRandomBit(){ if(getRandomBit()){ if(getRandomBit()) return 0; else return 1; } else{ if(getRandomBit()) return 1; else return 0; } }
     
    To test for bias, I displayed a meandering line in a serial console. If I get more 0's than 1's, the line should slowly skew to the left or right:
     

    #include "msp430g2231.h" #include "config.h" #include "softserial.h" #include #define CONSOLE_WIDTH 80 bool getRandomBit(); bool get0BiasRandomBit(); void main(){ int linePositon = CONSOLE_WIDTH / 2; char cursorPosition; DCOCTL = CALDCO_16MHZ; BCSCTL1 = CALBC1_16MHZ; WDTCTL = WDTPW + WDTHOLD; // Stop WDT SoftSerial_init(); _enable_interrupts(); while(1){ for(cursorPosition = 0; cursorPosition < linePositon; cursorPosition++) SoftSerial_xmit('8'); SoftSerial_xmit(' '); cursorPosition++; while(cursorPosition < CONSOLE_WIDTH){ SoftSerial_xmit('8'); cursorPosition++; } if(get0BiasRandomBit()) linePositon++; else linePositon--; if(linePositon < 0) linePositon = CONSOLE_WIDTH + linePositon; else if(linePositon >= CONSOLE_WIDTH - 1) linePositon = linePositon - CONSOLE_WIDTH; } } bool get0BiasRandomBit(){ if(getRandomBit()){ if(getRandomBit()) return 0; else return 1; } else{ if(getRandomBit()) return 1; else return 0; } } bool getRandomBit(){ ADC10CTL1 |= INCH_5; ADC10CTL0 |= SREF_1 + ADC10SHT_1 + REFON + ADC10ON; ADC10CTL0 |= ENC + ADC10SC; while(ADC10CTL1 & ADC10BUSY); return ADC10MEM & 0x01; }
     
    and some example output from this code:

     
    This sends a comma-separated list of random ints to the console:

    #include "msp430g2231.h" #include "config.h" #include "softserial.h" #include #include int adcGenRand16(); void reverse(char s[]); void itoa(int n, char s[]); void txString(char string[]); bool getRandomBit(); bool get0BiasRandomBit(); void main(){ int random; char string[7]; DCOCTL = CALDCO_16MHZ; BCSCTL1 = CALBC1_16MHZ; WDTCTL = WDTPW + WDTHOLD; // Stop WDT SoftSerial_init(); _enable_interrupts(); while(1){ random = adcGenRand16(); itoa(random, string); txString(string); } } void txString(char string[]){ int iString = 0; while(string[iString] != 0){ SoftSerial_xmit(string[iString]); iString++; } SoftSerial_xmit(','); SoftSerial_xmit(' '); } bool get0BiasRandomBit(){ if(getRandomBit()){ if(getRandomBit()) return 0; else return 1; } else{ if(getRandomBit()) return 1; else return 0; } } bool getRandomBit(){ ADC10CTL1 |= INCH_5; ADC10CTL0 |= SREF_1 + ADC10SHT_1 + REFON + ADC10ON; ADC10CTL0 |= ENC + ADC10SC; while(ADC10CTL1 & ADC10BUSY); return ADC10MEM & 0x01; } int adcGenRand16(){ char bit; unsigned int random; for(bit = 0; bit < 16; bit++){ random <<= 1; random |= get0BiasRandomBit(); } return random; } /* itoa: convert n to characters in s */ void itoa(int n, char s[]) { int i, sign; if ((sign = n) < 0) /* record sign */ n = -n; /* make n positive */ i = 0; do { /* generate digits in reverse order */ s[i++] = n % 10 + '0'; /* get next digit */ } while ((n /= 10) > 0); /* delete it */ if (sign < 0) s[i++] = '-'; s[i] = '\0'; reverse(s); } /* reverse: reverse string s in place */ void reverse(char s[]) { int i, j; char c; for (i = 0, j = strlen(s)-1; i c = s[i]; s[i] = s[j]; s[j] = c; } }
     

     
    I guess I got a little sidetracked from my original purpose of getting started with the RF2500, but I had fun.
  21. Like
    jsolarski reacted to zeke in MSP430 Day Presentations   
    Hi Guys,
     
    For those who could not attend the recent TI seminars on the MSP430 and the Stellaris, I found the webpage that lists all the presentations given on MSP430/Stellaris Day this past April.
     
    Take a look here.
     
    You want to read them before the end of May.
     
    Yes, you do!
  22. Like
    jsolarski reacted to bluehash in Something on the blog page..   
    A goodie for you guys on the Blog page. A bit expensive, but if you can afford it with the 43oh discount...
  23. Like
    jsolarski reacted to RobG in TI MSP430 datasheet improvements   
    Not sure which chip you are talking about, but the general rule is:
    BLAHx is a feature's bit in the register
    BLAH_x is a number for the feature's set of bits and is usually x * BLAH0
     
    For example
     
    BLAH0 is bit one, BLAH1 is bit two, and they can be anywhere in the register, like bit5 and bit6. 01100000
    BLAH_0 is a combination of BLAH0 and BLAH1 and it's 00 - 00000000
    BLAH_1 is 01 - 00100000
    BLAH_2 is 10 - 01000000
    BLAH_3 is 11 - 01100000, and so on if there's BLAH2
  24. Like
    jsolarski reacted to rockets4kids in MSPGCC support for newer Value Line parts?   
    There is a new development tree of mspgcc known as "Uniarch" whose goal is to reduce the effort required to add support for new chips. Apparently, adding support for new chips was a lot of work in current/previous versions. In any case, the first alpha release of Uniarch came out several weeks ago, and support for the complete set of Value Line chips was added earlier this week.
     
    There are no packages available, and you are going to need to pull the sources from git and compile it on your own, but fortunately it compiles quite easily under Linux and OS/X. I have not yet heard any reports one way or another from anyone who has attempted to compile it under mingw or cygwin.
     
    If you go this route, be aware that you are also going to need to pull the latest mspdebug sources from the git repository in order to program the new chips, and the gdb included with Uniarch is known to be broken. You should be able to use your existing gdb binary with the new toolchain.
     
    For details, check the past month's archives on mspgcc-users.
  25. Like
    jsolarski reacted to nexusone1984 in Scrolling text on a Dot matrix display...   
    Second part of my dot matrix display test... demo of scrolling text. And a swipe effect.
     


×
×
  • Create New...