Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Reputation Activity

  1. Like
    tripwire reacted to ike in any way to restore DCO calibration values w/o a crystal hooked up?   
  2. Like
    tripwire reacted to oPossum in Bug with PxOUT + INPUT_PULLUP?   
    It's octal (for historical reasons)
    011 == 9 == 0x09 == 0b00001001 ==  BIT3 | BIT0
    BIT3 is the switch
  3. Like
    tripwire reacted to roadrunner84 in Problem with bit wise operation   
    There are five properties of a digital I/O pin:
    PxIN: the input value PxOUT: the output value PxDIR: the pin direction (input/output) PxREN: the resistor enable PxSEL(2): the special function First and foremost, the behaviour of the pin can be different for every pin when it is in second/third/fourth function mode, so the rest of the story only holds when PxSEL is 0 and if it exists PxSEL2 is also 0.
    Now then, PxIN holds the read back value, it always does, no matter the other three properties. However, when the pin is set as output PxIN will hold the output value, not the actual level of the pin.
    PxDIR | PxIN ------+----- 0 | Pin level 1 | PxOUT level PxREN enables the resistor, this means that the pin is connected via a resistor to PxOUT. As a consequence the voltage on the pin can be overridden by external driving high or low. Contrary to intuition (at least mine), PxREN does not change behaviour depending on PxDIR.
    PxOUT determines the output drive level, this value is ignored if PxDIR is 0 and PxREN is 0.
    PxDIR is the direction, 1 is output, 0 is input. When PxREN is low, this changes the pin from diriving high or low to the pin being a floating (high impedance, HiZ) input pin. However, if PxREN is enabled, PxDIR does not change the pin from driving to floating. If PxDIR is 1 however, PxIN will hold the value of PxOUT, not the actual pin level!
    PxOUT PxDIR PxREN external | PxIN external ---------------------------+-------------- 0 0 0 0 | 0 0 0 0 0 1 | 1 1 0 0 0 HiZ | ? HiZ PxIN logic may become unstable; undesired power dissipation 0 0 1 0 | 0 0 0 0 1 1 | 1 1 0 0 1 HiZ | 0 0 Pull-down enabled 0 1 0 0 | 0 0 Driving an output pin; not recommended; may damage circuit 0 1 0 1 | 0 short High current influx; may damage circuit 0 1 0 HiZ | 0 0 0 1 1 0 | 0 0 0 1 1 1 | 0 1 Pin voltage ignored; PxIN equals PxOUT 0 1 1 HiZ | 0 1 Pull-up enabled. Pin voltage ignored; PxIN equals PxOUT 1 0 0 0 | 0 0 1 0 0 1 | 1 1 1 0 0 HiZ | ? HiZ PxIN logic may become unstable; undesired power dissipation 1 0 1 0 | 0 0 1 0 1 1 | 1 1 1 0 1 HiZ | 1 1 Pull-up enabled 1 1 0 0 | 1 short High current outflux; may damage circuit 1 1 0 1 | 1 1 Driving an output pin; not recommended; may damage circuit 1 1 0 HiZ | 1 1 1 1 1 0 | 1 0 Pin voltage ignored; PxIN equals PxOUT 1 1 1 1 | 1 1 1 1 1 HiZ | 1 1 Pull-up enabled
  4. Like
    tripwire reacted to cde in Problem with bit wise operation   
    It's set up that way because it's easier for them to reuse a register, than to have an extra register that's only used if p1ren is set. And because the msp430s have both pull-ups like most mcus, but also have pull-downs, unlike AVRs or PICs. So they need a register to define which level the pin is at, 0 or 1. Since P1Out determines that anyway, they reused the same register.
    Setting P1Ren doesn't affect p1out for the same reason, since there is pull ups AND pull downs, they use whatever is in p1out to determine which resistor is used. If setting p1ren overrided p1out, it could cause issues.
    As for destroying the pin or mcu, no, because with the r1.5 launchpad, the p1.3 button has no external pull up. Without the external pull up, if you set no internal pull resistor, the line would be either floating (when the button is not pressed) or directly grounded (when the button is pressed). With a pull-down enabled and a button that pulls to ground, the pin would always be at ground, so there is no short circuit. The only way to possibly damage the mcu (Without adding external components) would be to have p1.3 set to output high, then pressing the p1.3 button. Direct short of vcc to ground.
    As a note, the r1.4 launchpad does have the external pull-up 47k (and cap) on the p1.3 line. Had you enabled the internal pull-down, which is roughly 50k, the two resistors would have created a voltage divider and the voltage at the pin would have been roughly half VCC (~1.85v), which might not be enough to trigger the voltage level change at that pin.
  5. Like
    tripwire reacted to RobG in Saving data to flash on power down   
    Here is a simple solution to the problem I had, saving data when power goes down.
    There are two parts needed, a diode (1N4148) and a capacitor (~47uF.)
    The way it works, you isolate main power from MCU and connect capacitor on the MCU's side.
    One of the pins is connected to the main power and will trigger an interrupt.
    In the interrupt routine, we will be saving data to flash.
    This is a simple proof of concept, the final code should include low voltage detection for situations like dying battery.



    #include "msp430g2231.h" unsigned int data = 0; unsigned int * const savedDataPtr = (unsigned int *)(0x1000); void main(void) { WDTCTL = WDTPW + WDTHOLD; P1DIR &= ~BIT1; P1IE |= BIT1; P1IES |= BIT1; P1IFG &= ~BIT1; P1REN |= BIT1; P1OUT &= ~BIT1; P1DIR |= BIT0; P1OUT |= BIT0; data = *savedDataPtr; if(data == 0xFFFF) data = 100; unsigned int counter = data; _bis_SR_register(GIE); while(1) { counter = data; while(counter > 0) { _delay_cycles(1000); counter--; } P1OUT ^= BIT0; } } // Port 1 interrupt service routine #pragma vector=PORT1_VECTOR __interrupt void Port_1(void) { P1OUT &= ~BIT0; data += 100; // Save value FCTL2 = FWKEY + FSSEL0 + FN1; FCTL1 = FWKEY + ERASE; FCTL3 = FWKEY; *savedDataPtr = 0; FCTL1 = FWKEY + WRT; *savedDataPtr = data; FCTL1 = FWKEY; FCTL3 = FWKEY + LOCK; P1IFG &= ~BIT1; }
  6. Like
    tripwire reacted to roadrunner84 in Problem with bit wise operation   
    Time for a little tutorial in binary!
    There are three primitive binary operations:
    invert (negate/not): take one input and give back the opposite (a 0 becomes a 1, a 1 becomes a 0) and: take two inputs and give back a 1 if both inputs are 1 as well (give back 0 if any or all inputs are not 1) or: take two inputs and give back a 1 if any or all inputs are 1 (give back 0 only if no inputs are 1) Visually it looks like this, here A and B are inputs and U is the output
    NOT AND OR A | U A B | U A B | U --+-- ----+-- ----+-- 0 | 1 0 0 | 0 0 0 | 0 1 | 0 0 1 | 0 0 1 | 1 1 0 | 0 1 0 | 1 1 1 | 1 1 1 | 1 In the language C, the bitwise notations for these three operations are ~ (tilde, not), & (ampersand, and), | (pipe, or)
    So changing a value in bit X to it's inverted value is written as
    X = ~X;
    Now, C does not have a bit variable type, (almost) only integer number variables. So a little about bitwise operations on numbers. For the sake of simplicity I use 4-bit numbers, in reality most variables are either 8-bit or 16-bit (or 32/64-bit on PCs).
    Say I have a variable X and I want to set the least significant bit (the bit most to the right when written), how do I do that? I do an OR operation with the value which holds one 1, which is is the least significant bit position, this value is 1
    X = X | 1;
    X: 0 1 0 0 1: 0 0 0 1 ------- OR 0 1 0 1 Observe that a bit in the result is one if any or all bits directly above it are 1 as well.
    X: 0 1 0 1 1: 0 0 0 1 ------- OR 0 1 0 1 Note that the value of this bit in the variable is not important for the result; the least significant bit is always 1 in the result, because one of the inputs was always 1.
    Now if we want to clear that bit? We do an AND with the inverse of 1. Say what? Let's draw it
    1: 0 0 0 1 ------- NOT ~1: 1 1 1 0 X: 0 1 0 1 ~1: 1 1 1 0 ------- AND 0 1 0 0 So by ANDing with the inverse of the desired clear bit, you can actually set it to 0. In C we'll write
    X = X & ~1;
    Note that in both these cases ONLY the least significant bit changes, any bits that may be set or cleared in other bit positions are unaffected. This is why you want to use the OR and AND operations, not simple assignments.
    In C there are shorthands for operations on something itself:
    X = X & ~1; equals X &= ~1;
    X = X | 1; equals X |= 1;
    So if I write P1OUT |= BIT0; I will only be affecting the bits that are set in BIT0, which is only the least siginificant bit. BIT1 only has the second least siginificant bit set, BIT2 the third least siginificant bit, etcetera.
    Advanced bit subjects
    If you want to alter multiple bits, you can first OR them together:
    BIT0: 0 0 0 0 0 0 0 1 BIT2: 0 0 0 0 0 1 0 0 ---------------- OR 0 0 0 0 0 1 0 1 BIT0 | BIT2 Then you can use this to set or clear both bits simultaneously:
    X = X | BIT0;
    X = X | BIT2;
    X = X | BIT0 | BIT2;
    in short
    X |= BIT0 | BIT2;
    Now if you want to clear both bits in X, you need to use the negated values
    X = X & ~BIT0;
    X = X & ~BIT2;
    X = X & ~BIT0 & ~BIT2;
    X &= ~BIT0 & ~BIT2;
    BIT0: 0 0 0 0 0 0 0 1 ---------------- NOT ~BIT0: 1 1 1 1 1 1 1 0 BIT2: 0 0 0 0 0 1 0 0 ---------------- NOT ~BIT2: 1 1 1 1 1 0 1 1 ~BIT0: 1 1 1 1 1 1 1 0 ~BIT2: 1 1 1 1 1 0 1 1 --------------- AND 1 1 1 1 1 0 1 0 ~BIT0 & ~BIT2 X: 0 1 0 1 0 1 0 0 1 1 1 1 1 0 1 0 ---------------- AND 0 1 0 1 0 0 0 0 Note that any bit that used to be 0 stays 0 and any 1 stays 1, except for the bits that are 0 in ~BIT0 & ~BIT2
    We could get the value 1111 1010 in another way as well: take the inverse of 0000 0101. As you know by now, 0000 0101 is attained by ORing BIT0 and BIT2
    BIT0: 0 0 0 0 0 0 0 1 BIT2: 0 0 0 0 0 1 0 0 ---------------- OR 0 0 0 0 0 1 0 1 BIT0 | BIT2 0 0 0 0 0 1 0 1 BIT0 | BIT2 --------------- NOT 1 1 1 1 1 0 1 0 ~(BIT0 | BIT2) X: 0 1 0 1 0 1 0 0 1 1 1 1 1 0 1 0 ---------------- AND 0 1 0 1 0 0 0 0 Observe that the result of ~(BIT0 | BIT2) is identical to ~BIT0 & ~BIT2. This property is called Demorgan's law:
    By inverting both inputs and the output of an AND operation, I get an OR operation. By inverting both inputs and the output of an OR operation, I get an AND operation. Since ~BIT0 inverted is ~~BIT0, which is equal to BIT0, this property holds. So I take NOT NOT BIT0 (ie: BIT0) and NOT NOT BIT2 (ie: BIT2) and replace the AND operation with an OR operation. Then I NOT the result once more and get the same result.
    X = X & ~BIT0 & ~BIT2;
    X &= ~BIT0 & ~BIT2;
    which is equal to
    X &= ~(~~BIT0 | ~~BIT2);
    is equal to
    X &= ~(BIT0 | BIT2);
    As a last reminder: BIT0, BIT1, etc. are part of the MSP430 library (msp430.h), not part of the C language itself. So you cannot use these definitions in a PC application unless you create them first.
    Exclusive or and asymmetric bitwise operations
    Apart from the three basic operation there is one other operation that might be useful on occasion; the exclusive or. Exclusive or (or XOR in short) is written as ^ (circumflex, xor) and gives back 1 if exactly one input is 1 (give back 0 if no or both inputs are 1)
    XOR A B | U ----+-- 0 0 | 0 0 1 | 1 1 0 | 1 1 1 | 0 XOR can be used to toggle bits. If I have a variable X and want to toggle the least siginificant bit, I XOR X with 1.
    X = X ^ 1;
    X ^= 1;
    X: 0 1 0 1 0 1 0 1 1: 0 0 0 0 0 0 0 1 ---------------- XOR 0 1 0 1 0 1 0 0 X: 0 1 0 1 0 1 0 0 1: 0 0 0 0 0 0 0 1 ---------------- XOR 0 1 0 1 0 1 0 1 As you can see, it works both ways. Be careful when using XOR, as you explicitly have no control over the resulting value; you only make sure it has changed, so keep track of the value it may have had before.
    To make our list of operators complete, let's sum up all 16 possible output combinations and see when they're useful and when not.
    NUL AND AND ~ A ~ AND B XOR OR ~( OR ) ~( XOR ) ~B OR ~ ~A ~ OR ~( AND ) ONE A B | U A B | U A B | U A B | U A B | U A B | U A B | U A B | U A B | U A B | U A B | U A B | U A B | U A B | U A B | U A B | U ----+-- ----+-- ----+-- ----+-- ----+-- ----+-- ----+-- ----+-- ----+-- ----+-- ----+-- ----+-- ----+-- ----+-- ----+-- ----+-- 0 0 | 0  0 0 | 0  0 0 | 0  0 0 | 0  0 0 | 0  0 0 | 0  0 0 | 0  0 0 | 0  0 0 | 1  0 0 | 1  0 0 | 1  0 0 | 1  0 0 | 1  0 0 | 1  0 0 | 1  0 0 | 1 0 1 | 0  0 1 | 0  0 1 | 0  0 1 | 0  0 1 | 1  0 1 | 1  0 1 | 1  0 1 | 1  0 1 | 0  0 1 | 0  0 1 | 0  0 1 | 0  0 1 | 1  0 1 | 1  0 1 | 1  0 1 | 1 1 0 | 0  1 0 | 0  1 0 | 1  1 0 | 1  1 0 | 0  1 0 | 0  1 0 | 1  1 0 | 1  1 0 | 0  1 0 | 0  1 0 | 1  1 0 | 1  1 0 | 0  1 0 | 0  1 0 | 1  1 0 | 1 1 1 | 0  1 1 | 1  1 1 | 0  1 1 | 1  1 1 | 0  1 1 | 1  1 1 | 0  1 1 | 1  1 1 | 0  1 1 | 1  1 1 | 0  1 1 | 1  1 1 | 0  1 1 | 1  1 1 | 0  1 1 | 1 As you may see, some operations aren't useful, like the NUL and ONE operator, just use hard values in these cases. The A, B, ~A and ~B operator ignore one parameter, so leave the ignored parameter out.
    Then we find the three btiwise operators AND, OR and XOR and their twins ~( AND), ~( OR ) and ~( XOR ). When I write ~( AND ), read it like X = ~(A & B );
    There are four operators left, which I named ~ AND, ~ OR, AND ~ and OR ~. These operators take one of their two parameters inverted, they are asymmetrical; you cannot flip the two parameters and get the same result. As an example the ~ AND operator is written like X = ~A & B;
  7. Like
    tripwire reacted to SirPatrick in CircuitCo Educational Boosterpack LCD Code Example   
    I found a post on the TI E2E community asking questions about the LCD on the educational boosterpack. Someone posted some code for energia and it worked perfect. I took the code and "translated" it to non energia. Here is the forum post. Also here is documentation for the LCD itself from the manufacturer website (PDF). Right now this code prints "hello 43oh.com" . I am going to play with it more later tomorrow. If it is messy code I apoligize, long day at school work in addition to getting use to this platform.. 

  8. Like
    tripwire reacted to roadrunner84 in scientific notation   
    Since you're going to read a digital value, start considering this. I assume the ADC value is 16 bits (probably better than you're going to get).
    Now, since your sensor current is exponential with the pressure you're going to do some maths first. This should be done in integer if at all possible. But in this case, floating point is very attractive. Consider that floating point calculations are very big and slow. The MSP does not have an integer multiplier, so floating point logarithms are going to be huge.
    Since we must convert it back to integer values to do sensefull printing, we're going to determine the range successively and then do a conversion to integer. I'll use plain math operations here, which is discouraged in most cases because of the heavy load.
    unsigned short current = getADC(); // any form of input float pressure = current2pressure(current * current_factor); // current_factor maps the ADC (voltage) value to the actual current, alternatively integrate this in your conversion function. // Now pressure is in the range of 1e-7 and 1e3 for example (for simplicity I assume pressure will never exceed 1000mbar) signed char exponent = (signed char)log10(pressure); unsigned short pressure_mantissa = (unsigned short)(pressure * exponent * 100); // pressure_mantissa is in the range [100..1000) char result[8]; // remember the string terminator result[0] = (pressure_mantissa / 100) + '0'; // integer arithmetic (999/100 = 9) result[1] = '.'; result[2] = (pressure_mantissa / 10) % 10 + '0'; result[3] = (pressure_mantissa) % 10 + '0'; result[4] = 'e'; if (exponent >= 0) { result[5] = exponent + '0'; result[6] = 0; } else { result[5] = '-'; result[6] = '0' - exponent; // '0' - -1 == '0' + 1 } result[7] = 0;
  9. Like
    tripwire reacted to multivac in programming a msp430g2955 through BSL   
    so i was able to program the micro with my makeshift tools. ill post the info here in case it`s useful to anyone.
    first though, thanks jazz for the support!!
    apparently the g 2955 uses the old "ROM" style BSL described in salu319e as 1xx,2xx,4xx family bootloader. the specific version reported for mine by TI
  10. Like
    tripwire reacted to zeke in F5529 Breakout Dev Board (Now with pics!)   
    If you have a ton of TH crystals then your choice makes sense. The guy you sell this board to may not though.
    The only gotcha with a TH crystal is that you can't let the body of the crystal touch the ground plane you've poured under it. If it does then it probably is also touching the tracks coming from the crystal pins and that shorts out the crystal. That's why TH crystals had insulator pads on them in ancient days.
    The USB tracks should make the straightest line between the connector and the chip as reasonably possible. Make sure the tracks are 0.010" wide. Make sure they have a 0.010" space between them. That's it. Any components that have to attach to the USB tracks should do so at a 90' angle so that the track path isn't disturbed. It is also preferable to minimize their length, if possible.
    I haven't consulted the design files for TI's 5529 board so I don't understand their design selections. The 27 ohm resistors are there to minimize the transient responses that occur on the USB lines. They limit the current spikes but they also lower the maximum speed on that transmission line. I guess it all depends upon the MCU and what it expects. For comparison, the FTDI chips want 0 to 10 ohms there.
    There's no need to worry about your EE skills. You are demonstrating good EE skills with your work. Just because I'm buffing your layout doesn't mean it's a bad design. I'm sure the design will work. I'm just offering a contrasting opinion for you to compare against. It's like two artists talking about a work of art - a matter of taste and opinion for the most part.
    Again, GOOD JOB! And I mean it! :thumbup:
  11. Like
    tripwire reacted to atramposch7 in MSP430G2553 MicroSD .wav Music Player   
    Well i wanted to use TA0.1, and TA0.2 for outputs for the left and right speakers, but TA0.2 doesnt exsist on the pinout in the datasheet for the G2553, so i changed it to Timer1. Plus I'm using a lot of the PORT1 pins for console and SPI work. So i wanted to just move that to PORT2. 
  12. Like
    tripwire reacted to SiskinEDGE in SD Media Player with FAT16   
    Here is a video of the music player in action:

    The code has the following functionality:
    Initilise the FAT16 filesystem from an SD card in a single command - ThinFAT_Init();
    Open Files on an SD card and allow you to test each filename with a callback
    Index Files by useing the same command as to open them with a callback
    returns data on if the filestream is active
    returns data on how far the file has been read through
    callback for when end of the file is reached
    Open Folders on an SD card - Untested

    and limitations:
    uses 54 bytes of ram approx
    dosen't support fragmented files
    reads file end to closest sector, not byte (for performance reasons)
    reads FAT16 filesystems, not FAT32
    has no support for long filenames (it would be silly on these chips)
    I dont know if this fits within a 2K flash

    when implementing this on your own chip keep in mind you change which wire is the Chip select in the MMC.h file

    it is based on the DIY Life Talking MSP430 Project.

    It has been designed for the MSP430G2352 but if you remove the CCR2 References it should work for other projects easily.

    P1.2 - TA0.1
    P1.3 - Input for Playing and Changing Music File
    P1.4 - TA0.2
    P1.5 - SMCLK out - SD Card Pin 5
    P1.6 - SDO - SD Card Pin 2 MOSI
    P1.7 - SDA - SD Card Pin 7 MISO
    P2.7 - CS - SD Card Pin 1 Card Select
    VCC - SD Card Pin 3,6
    Ground - SD Card Pin 4

    the pins on the SD card are counted from the first contact after the recessed contact across, the recessed one is 9. you can check on wikipedia when your unsure.
    SD Media Player.zip
  13. Like
    tripwire reacted to TheDirty in First etch & surface mount!   
    I've helped a lot of people with this and all I can say once you get a method down you are golden, but even with the exact steps it takes experimentation and time to get it so it's quick and easy.  You may have to modify the steps to get things to work for you.  I started many years ago and got my process down.  For some people now it may not be worth it to go through the learning curve, but if I want to experiment with a board or just need a little add on, I can get a board from Eagle to etched and drilled in a couple hours when waiting for Seeed can take a month or more for 10 boards were I don't need 9 of them.
    For my steps I use:
    HP1012 printer and I still have the old Staples Glossy Photo paper that they don't sell anymore.
    I use a clothes iron to iron on the resist.
    My steps are:
    I'll print out the design on a regular piece of paper and cut it out. I use the cut out to cut a piece of copper clad to size.  File the edges down. I cut out a piece of the glossy paper just bigger than the design and tape it on a regular piece of paper. Print the design onto the glossy paper. Iron the design onto the board.  I use high heat.  Pressure and duration need to be experimented with.  I use a paper towel on the top to help make sure I don't get heat and pressure spots.  I don't know how to describe.  I use decent pressure and put it on for a minute or two.  Rub around and turn the board a few times while doing it to make sure you are doing the pressure evenly. Then need to scrub the paper off.  Let it soak first and then I use a toothbrush and my thumbs to get the paper off. Etch with warmed ferric chloride.  I just use the plastic sandwich boxes and drop the board in.  I rock it back and warm it over a desk light I have.  The light shines through and you can see the etching process and when all the copper has been removed because you can see through the board. Drill using a drill press I have.  You can get PCB sized drill bits from e-bay for cheap. Clean using acetone. ??? Profit I took pictures once when I was experimenting with the fab-in-a-box paper.  This paper does a total release of the laser toner and doesn't work as well for me.  The toner on its own doesn't make a great resist.  They sell a green film that you can use after to seal the toner better for a better etch, but I never got it to work properly.  They recommend a laminator to put it on though and I've never gone through the trouble of getting a laminator.
    The paper you use is the biggest variable.  The paper I use isn't available anymore and I don't know of any good replacements.  Many people use glossy magazine paper.  The super glossy and stiff kind you get in higher end magazines.
    Many people swear by the laminators.  I haven't needed one, but they are available cheap on e-bay and there are some recommended ones if you google around.
    Like I said before, I've had bad experiences with everything other than ferric chloride.  FC seems to be the most forgiving on resist.
    I use Eagle to design the board.  If you put all your tracks on the top layer (red) you will need to 'mirror' the board when printing.  If you put all your tracks on the bottom layer (blue) you don't mirror the board when printing.
  14. Like
    tripwire reacted to JWoodrell in First etch & surface mount!   
    hey @@TheDirty what chemical / process steps do you use, your boards look nice and sharp.  I would like to be able to prototype y own boards just because waiting 2 to 3 weeks for turn around is kinda annoying.
    my trick with solder paste is in realizing it is just too thick in its base form from the syringe, it is designed to stick and stay in its cutout shape in the stencil.  but since were applying it by hand, we need to change that behavior.  I use a hard plastic disc and dot my flux pen a few times on it to get a pool of flux (not too much) and then syringe some solderpaste into that pool.  I use the tip of an exacto knife to mix the two around until it is a nice smooth mixture and more flowing than the paste it started at.  you have to play a balancing act between diluting it down for workability, and too much where there isn't enough solder per volume to be usefull.
    I take my exacto and get a small ball of the thinner paste on the tip, and "dot" the pads with it, you get a nice controlled small application of solder paste, and its very quick to just dot dot dot dot down the line then get another bit on the knife and dot dot dot ...   it works well for me
    it takes a bit to get the feel for it, but I find it very usefull in doing the 0402 SMD things i work with mostly now.  
  15. Like
    tripwire reacted to PolkaDot in First etch & surface mount!   
    Recently had my first go at printing a board and soldering surface-mount components. It's a straight-forward breakout for an FT230XS.
    On the etching side, I used a 2:1 mixture of Hydrogen Peroxide solution and Muratic Acid. Initially clear, it turned a lovely neon green when the copper started reacting! Etch took maybe 5-6 minutes.
    I used an "ultra fine tip" Sharpie as the resist; learned the hard way that the 'Micron' brand of super fine tip pens doesn't work for this application  :-( . I was struggling to mark the pads with the sharpie, so instead I drew a dark box across an entire row of pins then used a type of dental pick to scratch a fine line between adjacent pads. Seemed to work pretty well!
    I had bought a syringe of solder paste for the occasion, but ultimately I couldn't make it cooperate--globs kept bridging pins. Eventually I just put down solder on all the pads, put some flux on the pins and reflowed that way.
    Anyhow, it was a somewhat messy learning experience, but hopefully next I'll print/mount the whole module. Will keep you posted!

  16. Like
    tripwire reacted to TheDirty in First etch & surface mount!   
    I do home etching fairly often.  The chinese cheapo prototype places are pretty sweet, but fairly often I just need a single board for something specific.  Usually just testing with a specific chip.  I do toner transfer and I've been doing it for years, so I've got the process pretty set down.
    I tried out the acid/peroxide solution a few times, but it's just too harsh.  It will cut through my resist and I get a lot of pitting.
    If you get bridges, just suck them up with some solder wick.

  17. Like
    tripwire reacted to bluehash in Vendor section tryout   
    Hi All,
    When at the MakerFaire, I met quite a few people who were interested in advertising @@43oh. These companies are related to embedded systems and hopefully give you guys nice deals. I've talked to Saleae, Panavise, Gabotronics, Solarbotics etc.. Some still have to get back to me.
    There will be a one month trial starting June 2013(next month), where vendors will get free advertising for a month to try out the space. There will be a 250x30 ad space for each vendor to a max of 3 to 5 displaying at a time on the forum frontpage.
    Please bear in mind, that you can put your Tindie shop link in your signature. Members who sell boards in The 43oh Store or Tindie are not classified as vendors, as you guys are already contributing.
    As a note, you can collapse the sub-forum by clicking the  "-" sign.

    I welcome any comments on this issue..
  18. Like
    tripwire reacted to GeekDoc in Vendor section tryout   
    This sounds great!  I would love to see ads from those you mentioned.  I, for one, would be very likely to jump on any deals offered by these companies (would really like a Panavise, and an XProtoLab (my old one died)).
  19. Like
    tripwire reacted to rockets4kids in A few notes about TI's command line compilers   
    For those unaware, CCS calls command line programs for all phases of compilation and linking.  Back in the days of CCS V4 I attempted to use these directly without any luck.  Shortly thereafter I discovered mspgcc and largely ignored CCS.  However, I have long wanted to be able to use these CLI tools so I can verify that my code is indeed cross-platform while developing.
    I recently had another go, this time with much more success.  Not only did I succeed in getting the tools working from the command line, but I was able to get them working via Wine under OS/X.  Now I will be able to do all of my CCS verification directly under OS/X without having to run a virtual machine.
    All you need are the following three directories from your CCSv5 install.  You can just copy the files, there do not appear to be any registry hoops to jump through, and it seems as if the files cal live anywhere with the proper edits to your makefiles.
    C:\ti\ccsv5\tools\compiler\msp430_4.1.5 - the compiler itself
    C:\ti\ccsv5\ccs_base\msp430\include - chip-specific includes and linker scripts
    C:\ti\ccsv5\utils\bin - gmake.exe if you want to use the makefiles created by CCS
    I am still working on understanding what the CCS-generated makefiles do and rolling that into my own.  If anyone is interested I'll post a follow-up.
    Theoretically this could also be used to run TI's compilers under a native eclipse install under OSX, but I have no intention of even attempting this.  Perhaps the only other useful application of this would be to use TI's compilers on extremely resource-limited machines.  The full compiler+includes is only about 200 megs and seems to require very little RAM at runtime.
  20. Like
    tripwire reacted to Samartist in 4x4x4 LED cube, using 3 pins of MSP430 launchpad   
    This is my 4x4x4 led cube project, done with MSP430, using only 3 pins of MSP, the circuit diagram is shown in the photos, the hardware consists of 3 shift registers, 74595, and 4 NPN transistors...

    you can learn how to make a 4x4x4 LED cube by instructables or youtube or some other sites, its easy to make...
    but make sure that you make exact same connections as shown in the cicuit diagrams... or else this code won't work in the new hardware...

    the hardware can be built as shown in the circuit diagram...

    the code is given below, you can changes it and make your own animation with it....
    this is what i have done with the cube...

  21. Like
    tripwire reacted to JWoodrell in reset pin   
    the reason for the capacitor and resistor on the reset pin is simple... I don't remember where I read it, but it makes sense.  it is there so that when the chip is powering up it is held in reset for some predetermined amount of time, the larger the RC circuit the longer it is held in reset while the power supplies stabilize.  then once its up, the resistor holds the reset pin high so it doesn't randomly reset like if it was floating. *edit* hehe roadrunner already posted this, i didn;t read the whole thread before posting */edit*
    you can have as large of a capacitor on the line as you want, as long as the programming input is isolated from the capacitance it doesn't care what is there.
    this is how I set up my stuff, and it seems to work well

  22. Like
    tripwire reacted to roadrunner84 in reset pin   
    The combination works as a low pass filter, or a delay circuit. If you have a slow rising power, the msp might bout up during a brown power voltage. By using the R/C network you ensure that reset will come high after the voltage is in the stable range.
    If you're using a lab supply or plain battery these will probably be no issues, but it can become a problem if you're using an on-board regulator to get power from.
  23. Like
    tripwire reacted to pabigot in can clock settings affect pin pullup?   
    Never use + when combining bit flags.  Use bitwise-or:
    P1bits_active = BIT6 | BIT7; If you use + at some point you'll get in trouble when a signed value and BIT7 both get involved.   That's more likely than you might think:  unqualified "char" is neither signed nor unsigned, but it can behave as signed in some compilers (mspgcc) and unsigned in others (IAR).
    TI example code may be littered with examples of using +, but it's still a poor practice.
    Addendum: If you have that habit, consider:
    unsigned char P1bits_active = BIT6 + BIT7; ... P1REN = P1bits_active + BIT6; /* can't remember whether BIT6 is in P1bits_active, but we need it here */ Probably not at all what you intended.
  24. Like
    tripwire reacted to oPossum in TLV data (calibration) parse and display   
    This firmware will parse and display the TLV (tag length value) information stored in info segment A.
    Software serial (9600/8/N/1) is used so this will run on any G series chip.

    Output from G2452 showing DCO and ADC/temperature sensor calibrations.

    #include  <msp430.h> volatile unsigned txdata = 0; #pragma vector = TIMER0_A0_VECTOR __interrupt void Timer0_A0(void) {     if(txdata) {         (txdata & 1) ? (CCTL0 &= ~OUTMOD2) : (CCTL0 |=  OUTMOD2);         txdata >>= 1;         CCR0 += 104;     } else {         CCTL0 &= ~CCIE;     } } void putc(const char c) {     while(CCTL0 & CCIE);     txdata = 0x0200 | (c << 1);     CCR0 = TAR + 16;     CCTL0 = OUTMOD0 | CCIE; } void print(const char *s) {     while(*s) putc(*s++); } void print_hex_digit(unsigned n) {     putc("0123456789ABCDEF"[n & 0x0F]); } void print_hex_byte(unsigned n) {     print_hex_digit(n >> 4);     print_hex_digit(n); } void print_hex_word(unsigned n) {     print_hex_digit(n >> 12);     print_hex_digit(n >> 8);     print_hex_digit(n >> 4);     print_hex_digit(n); } // TLV tags static const char * const tag_checksum[] = { "Checksum", 0 }; static const char * const tag_empty[] = { "TAG_EMPTY", 0 }; static const char * const tag_unknown[] = { "Unknown Tag", 0 }; static const char * const tag_dco[] = {     "TAG_DCO_30",     "CALBC1_16MHZ CALDCO_16MHZ",     "CALBC1_12MHZ CALDCO_12MHZ",     "CALBC1_8MHZ  CALDCO_8MHZ",     "CALBC1_1MHZ  CALDCO_1MHZ",     0 }; static const char * const tag_adc[] = {     "TAG_ADC1x_1",     "CAL_ADC_GAIN_FACTOR",     "CAL_ADC_OFFSET",     "CAL_ADC_15VREF_FACTOR",     "CAL_ADC_15T30",     "CAL_ADC_15T85",     "CAL_ADC_25VREF_FACTOR",     "CAL_ADC_25T30",     "CAL_ADC_25T85",     0 }; void dump_tlv_segment(const unsigned a, const unsigned n) {     const unsigned * const s = (unsigned *)a;       // Start of info segment     const unsigned * const e = s + n;               // End of info segment     const char * const *tag = tag_checksum;         // Segment begins with checksum     unsigned len = 2;                               // Length of checksum     unsigned chk = 0;                               // Init checksum                                                     //     const unsigned *p;                              //                              for(p = s; p < e; ++p, len -= 2) {              // Do segment         const unsigned d = *p;                      // Get a word         chk ^= d;                                   // Update checksum         if(!len) {                                  // Next tag?             len = 2 + (d >> 8);                     // Setup length of tag             switch(d & 0xFF) {                      // Setup for tag type                 case 0x01: tag = tag_dco; break;    // DCO cal                 case 0x08: tag = tag_adc; break;    // ADC cal                 case 0xFE: tag = tag_empty; break;  // Empty                 default: tag = tag_unknown; break;  // Unknown             }                                       //         }                                           //         print_hex_word((unsigned)p);                // Address         print(" ");                                 //         print_hex_word(d);                          // Data         if(*tag) {                                  // Tag             print(" "); print(*tag); ++tag;         //         }                                           //         print("\r\n");                              //     }                                               //     chk ^= *s;                                      // Fixup and validate checksum     chk += *s;                                      //     //print_hex_word(chk);                          //     print("Checksum is ");                          //     if(chk) print("IN");                            //     print("valid\r\n");                             // } void main(void) {     WDTCTL = WDTPW | WDTHOLD;     DCOCTL = 0;     BCSCTL1 = CALBC1_1MHZ;     DCOCTL  = CALDCO_1MHZ;     CCTL0 = OUT;     TACTL = TASSEL_2 | MC_2;     P1SEL = BIT1;     P1DIR = BIT1;     __enable_interrupt();     print("Tag Length Value entries in Info Segment A\r\n");     dump_tlv_segment(0x10C0, 32);         for (;; }
  25. Like
    tripwire reacted to oPossum in accuracy of the 2553's built in temperature sensor?   
    The tags in info segment A can be displayed with this code:
    The only G series chips I have seen with temperature cal is the G2452.
    Here is code that will read the cal data and use it:
  • Create New...