Jump to content
43oh

Rickta59

Members
  • Content Count

    1,135
  • Joined

  • Last visited

  • Days Won

    71

Reputation Activity

  1. Like
    Rickta59 reacted to oPossum in DIY Mini Launchpad   
    Make use of the second MCU (and female headers) included with the Launchpad 50 mm x 50 mm board size - low cost from Seeed & iTead Mostly through hole - anyone can build this Populate with components as needed Mounting holes for secure attachment Power, P1.6 & P1.0 LEDs LED enable jumpers Reset & P1.3 switch Coaxial power jack and/or terminal block Optional Microchip MCP1700/1702 voltage regulator 6 pin power/program/debug/serial connector UART line swap jumper Prototype with Launchpad, build permanent project with this.
    lp_mini.brd
    lp_mini.sch

  2. Like
    Rickta59 got a reaction from oPossum in PADrINO = MSP430 with Arduino's footprint   
    Seems like we do. I think what others are unsuccessfully trying to suggest to you is that they might like your
    board better if you added a second row of headers aligned on the standard .1" grid like the Olimex board.
     
    Do the pins on your boards map to pins on the msp430 that have compatible functionality as the atmega pins?
    I mean with regard to I2C, SPI, PWM, ADC, UART, etc.
     
    Does the board take care of making the inputs and outputs 5 volts?
     
    Are you going to create an Arduino API for the msp430f5172?
     
    -rick
  3. Like
    Rickta59 reacted to voelker in Launchpad Geocache box   
    Hi,
     
    i'am proud to present my latest creation, the launchpad based geocache box. Some of you may have read the story of the original reverse geocache puzzle (http://arduiniana.org/projects/the-reve ... he-puzzle/). I was looking for a gift to build for this christmas and i decied to build my own geocache box. I first thought of using an ARM micro-controller but the launchpad with an msp430g2553 seemed like a perfect fit. I dug into my electronic junk box and found a bluetooth gps module and a servo. I ordered a lcd display (3v compatible) and a switch and i was good to go !
    The box is a wooden box on which i drew a wind rose using my soldering iron (pyrography) in which i stuffed all the electronic in the lid.
    I hacked the bluetooth gps module to get a serial output, and in addition, it provides a 3v regulated power supply, a battery charger and the raw battery voltage. The gps is connected to the MSP430g2553 uart, the display is connected to the I2C port (USCIB0) and a GPIO drives the servo. The unregulated supply power the display backlight and the servo. In addition a reed switch is used as a secret backdoor.
    You can download the code at http://code.google.com/p/msp430-reverse-geocache/.
    I will provide schematics and a video asap (some pictures are attached to this post).
     
    When fisrt powered the box display an hello message and then show waiting for gps signal. When the gps signal is acquired, the display shows the distance and bearing to the target. When the target is reached, the display shows a congratulation message, and loads the next target (there is seven target to reach). When all targets are reached the lid opens and reveal the true gift. Then the box can either be used as a development kit, or you can put something in it, close it and it will remain closed for one year just displaying the current date and time.
     
    EDIT: now with the video !

     
    EDIT:
    ASCII schematic rocks !



  4. Like
    Rickta59 reacted to username in MSP430 Reflow Oven   
    Hey all,

    Nate here, made a nice little reflow oven to help me in the construction of surface mount boards. Got a video explaining it all here:

    PCBs and Control Boards for sale here: viewtopic.php?f=22&t=2040
    No longer for sale, no time to pump any out.
     

    Project Video:





    Project Pics:







    Schematic:This is my old V1 schematic. Todo if you want a better board:
    -Use a MSP430G2553 MCU (more pins and flash)
    -Use a non EOL thermocouple driver IC: MAX31855KASA+
    -Add in a FT230XS for a USB interface
    -Add flyback protection to relay LSD if a mechanical relay is used.
     
    Full size at link:
    http://forum.43oh.com/uploads/monthly_12_2011/post-4818-135135531417.jpg
     



    Oven: Convection (30 usd)
    http://www.walmart.com/ip/Black-Decker-Toaster-Oven-Stainless-Steel/16913546
     
    Oven: IR (recommended that you use an IR oven of sorts)
    http://www.walmart.com/ip/George-Foreman-Infrared-Countertop-Oven-with-Rotisserie/19411514
     
     
    C# GUI for live plotting:

     

    Here is the BOM:

    Update: Schematic has most Part #s on it
     
    Thermal-couple: (Important that it is low thermal mass and rated for temp range)
    Digikey: 290-1911-ND
     
    Thermal-couple IC:
    MAX31855KASA+
    MAX31855KASA+T
     
    Relay: (this is a mechanical relay. I salvaged a SSR for my V2. I highly recommend you use an SSR for long life and quicker switching times)
    Digikey: T9AS1D22-5-ND (Relay)

    Misc Digikey Part # (Part Discription)
    MC78M05CDTGOS-ND (5V regulator Dpak)
    445-1590-1-ND ( CAP CER 1.0UF 25V Y5V 0805)
    754-1133-1-ND ( LED 2X1.2MM 630NM RD WTR CLR SMD)
    754-1127-1-ND (LED 2X1.2MM 570NM GN WTR CLR SMD)
    CP-102B-ND (CONN POWER JACK 2.5MM PCB CIRC)
    785-1112-1-ND (MOSFET N-CH 20V 25A TO-252 (Relay))
    IRLML6344TRPBFCT-ND ( MOSFET N-CH 30V 5A SOT23 (SSR Load))
    RMCF0805JT100KCT-ND ( RES 100K OHM 1/8W 5% 0805 SMD)
    RMCF0805JT47K0CT-ND ( RES 47K OHM 1/8W 5% 0805 SMD)
    RMCF0805FT499RCT-ND ( RES 499 OHM 1/8W 1% 0805 SMD)
    296-8247-5-ND (IC 8-BIT SHIFT REGISTER 14-SOIC)
    296-28430-1-ND (IC MCU 16BIT 20TSSOP)
    RMCF0805JT1K00CT-ND ( RES 1K OHM 1/8W 5% 0805 SMD)
    CT94EY104-ND (TRIMMER 100K OHM 0.5W TH)
    MCP1700T3302ETTCT-ND ( IC REG LDO 3.3V 250MA SOT23-3)

    + a 16x2 LCD display
    + some dip headers that are used for jumping and programing.
    + 5mm/.2in lead spacing terminal headers for relay and thermocouple input.
  5. Like
    Rickta59 got a reaction from GeekDoc in Best place to start for a noob AVR user?   
    There are 2 popular approaches to using the ATMEL chips, you can use an ISP programmer or a serial bootloader.
    Depending on which method you choose dictates how you will create projects and program the chips. It looks like
    there was an ISPmkII in your load of booty so you can use either method.
     
    Here are some sites worth looking at:
     
    http://www.avrbeginners.net/
    http://tom-itx.dyndns.org:81/~webpage/how_to/atmega168/mega168_howto_main_index.php
    http://smileymicros.com/blog/2011/06/15/arduino-on-a-breadboard-breadboarduino/
    http://itp.nyu.edu/physcomp/Tutorials/ArduinoBreadboard
    http://www.avrfreaks.net
     
    -rick
  6. Like
    Rickta59 got a reaction from bluehash in Best place to start for a noob AVR user?   
    There are 2 popular approaches to using the ATMEL chips, you can use an ISP programmer or a serial bootloader.
    Depending on which method you choose dictates how you will create projects and program the chips. It looks like
    there was an ISPmkII in your load of booty so you can use either method.
     
    Here are some sites worth looking at:
     
    http://www.avrbeginners.net/
    http://tom-itx.dyndns.org:81/~webpage/how_to/atmega168/mega168_howto_main_index.php
    http://smileymicros.com/blog/2011/06/15/arduino-on-a-breadboard-breadboarduino/
    http://itp.nyu.edu/physcomp/Tutorials/ArduinoBreadboard
    http://www.avrfreaks.net
     
    -rick
  7. Like
    Rickta59 reacted to voodoofish in Parallax RFID reader v2   
    I didn't want to take away from NatureTM's post on a similar title, so I'm just calling this v2.
     
    This is my version of the parallax RFID Reader code. I'm using oPossum's software asyncserial code as the base for communications as it was extremely small and just worked right out of the box. The code currently compiles to Text: 608 bytes and Data 100 bytes. This is running on the 2231 chip but I'm sure would run fine on the 2211 as well.
     
    Pins used, VCC for power to the RFID reader, GND for ground, P1.4 for serial in and P1.0 for enable/disable of the reader.
     
    The brief on it:
    1. read RFID
    2. Disable RFID reader
    3. Output matches and mismatches
    4. Add small Delay(I did this as an experiment in learning ASM so not sure if this is the best way to do it. I could have used a simple delay function written in c which would have made control of the delay a little easier to set. )
    5. turn on Reader
     
    Now step 3 can be modified to just output if it matches or not....but I didn't do that with this code.
    I've also added a couple of functions to the serial.asm file that turn on and off the Red LED P1.0 and another wait function....Seeing as I'm not quite sure if I did this correct or not...I'm sure someone may spot issues.
     
    I tried my hand at a simple diff function....I'm sure it could be better as well...but heck, it worked for me so far...I'd love to hear recommendations on it.
    EDIT: depending on your system this may not work on the linux side right away....I forgot that the code for the button press was important in that if you just plug this in it'll play havoc with some serial ports...so...you need a delay or set the first transmit of the device within the button interrupt....ooops...

    Main body of code...

    // RFidRead.c #include "msp430g2231.h" //change as needed #define keyCount 3 #define idc 11 static const unsigned char ID[][12] = { {0x0A, 0x30, 0x46, 0x30, 0x33, 0x30, 0x32, 0x38, 0x31, 0x33, 0x42, 0x0D} // 0F0302813B ,{0x0A, 0x30, 0x34, 0x31, 0x35, 0x42, 0x30, 0x43, 0x34, 0x34, 0x34, 0x0D} // 0415B0C444 ,{0x0A, 0x30, 0x46, 0x30, 0x33, 0x30, 0x32, 0x38, 0x30, 0x35, 0x31, 0x0D} // 0F03028051 }; // oPossums function code void serial_setup(unsigned out_mask, unsigned in_mask, unsigned duration); void putc(unsigned); void puts(char *); unsigned getc(void); //new functions to enable and disable the Red LED void Red_Off(void); void Red_On(void); void Wait(void); //my diff funciton. var 1 is the input key(read in from the rfid reader), var 2 is the diff key from the ID Array. unsigned char diffAR(unsigned char a[],const unsigned char b[]); void main(void) { unsigned char key[12]; //array to hold keys read in through reader // Disable watchdog WDTCTL = WDTPW + WDTHOLD; //disabled as I now just put this code into a loop without initialization via button press //P1IE = 0x04; // P1.3 interrupt enabled //P1IES |= 0x04; // P1.3 Hi/lo edge //P1IFG &= ~0x04; // P1.3 IFG cleared // Use 1 MHz DCO factory calibration DCOCTL = 0; BCSCTL1 = CALBC1_1MHZ; DCOCTL = CALDCO_1MHZ; //I'm wondering if it's possible to set up 3 pins for serial com.... // Setup the serial port // Serial out: P1.1 (BIT1) // Serial in: P1.4 (BIT2) // Bit rate: 2400 (CPU freq / bit rate) serial_setup(BIT1, BIT4, 1000000 / 2400); //Start of read code. puts("\r\nRFID Read...\r\n"); //if data comes out garbled check the baud rate....try hitting reset as well. //_BIS_SR(LPM0_bits + GIE); //disabling for now as I don't need this. while(1){ int i; for(i = 0;i<11;i++) { // Do forever //c = getc(); // Get a char key[i]=getc(); //putc(c); // Echo it back } Red_On(); //Check for 0F or 04 for(i = 0;i<11;i++) { putc(key[i]); } puts("\r\n"); int x; for(x=0;x if (diffAR(key, ID[x])==1) {puts("\r\nKey matches...\r\n");} else {puts("\r\nKey mismatch...\r\n");} } //Some test code...figured maybe it would be useful for someone. /* for(; { // Do forever c = getc(); // Get a char switch(c) { case 'a' : putc(c); Red_On(); break; case 'b' : putc(c); Red_Off(); break; default : putc(c); Red_Off(); } } */ Wait(); //wait for a little bit. Red_Off(); //Re-enable RFID reader. } } //not used atm, left in just in case though... #pragma vector=PORT1_VECTOR __interrupt void Port_1(void) { char c; c = getc(); putc(c); P1IFG &= ~0x04; // P1.3 IFG cleared } unsigned char diffAR(unsigned char a[],const unsigned char b[]){ unsigned char diff = 0; unsigned char t = 0; unsigned char count = 0; unsigned char i; for(i = 0;i<11;i++) { putc(b[i]); } //A do while loop...WOO... do { //compare arrays here t=(b[count]==a[count])? 1:0; count++; if (count == 11) {diff = 1;} } while(t == 1); //a=(x==y)? 1:0; return diff; }
     
    And the slightly modified code from oPossum

    ; serial.asm .cdecls C, LIST, "msp430g2231.h" .bss in_bit_mask, 2 ; Serial in pin .bss out_bit_mask, 2 ; Serial out pin .bss bit_dur, 2 ; Bit duration in cycles .bss half_dur, 2 ; Half bit duration in cycles ; .text ; .def serial_setup ; void serial_setup(unsigned out_mask, unsigned in_mask, unsigned bit_duration); .def putc ; void putc(unsigned c); .def puts ; void puts(char *s); .def getc ; unsigned getc(void); .def Red_On ; .def Red_Off ; .def Wait ; ; serial_setup ; - Setup serial I/O bitmasks and bit duration (32 minimum) mov R12, &out_bit_mask ; Save serial output bitmask mov R13, &in_bit_mask ; Save serial input bitmask bis R12, &P1DIR ; Setup output pin bis R12, &P1OUT ; bic R13, &P1DIR ; Setup input pin or R13, R12 ; bic R12, &P1SEL ; Setup peripheral select mov R14, R12 ; sub #16, R14 ; Adjust count for loop overhead rla R14 ; Multiply by 2 because NOP is two bytes mov R14, &bit_dur ; Save bit duration sub #32, R12 ; Adjust count for loop overhead mov R12, &half_dur ; Save half bit duration ; Added by mark to allow for LED fun! bis.b #01000001b,&P1DIR ; make P1.0 and P1.6 output jmp Red_Off ; all others are inputs by default ret ; Return ; ; - Send a single char putc ; Char to tx in R12 ; R12, R13, R14, R15 trashed mov &out_bit_mask, R15 ; Serial output bitmask mov &bit_dur, R14 ; Bit duration or #0x0300, R12 ; Stop bit(s) jmp bit_low ; Send start bit... ; tx_bit mov R14, R13 ; Get bit duration tx_delay nop ; 4 cycle loop sub #8, R13 ; jc tx_delay ; subc R13, PC ; 0 to 3 cycle delay nop ; 3 nop ; 2 nop ; 1 ; rra R12 ; Get bit to tx, test for zero jc bit_high ; If high... bit_low bic.b R15, &P1OUT ; Send zero bit jmp tx_bit ; Next bit... bit_high bis.b R15, &P1OUT ; Send one bit jnz tx_bit ; If tx data is not zero, then there are more bits to send... ; ret ; Return when all bits sent ; ; ; - Send a NULL terminated string puts ; Tx string using putc push R11 ; mov R12, R11 ; String pointer in R12, copy to R11 putsloop ; mov.b @R11+, R12 ; Get a byte, inc pointer tst.b R12 ; Test if end of string jz putsx ; Yes, exit... call #putc ; Call putc jmp putsloop ; putsx pop R11 ; ret ; ; getc ; - Get a char mov &bit_dur, R14 ; Bit duration mov &in_bit_mask, R13 ; Input bitmask mov #0x01FF, R12 ; 9 bits - 8 data + stop rx_start ; Wait for start bit mov &P1IN, R15 ; Get serial input and R13, R15 ; Mask and test bit jc rx_start ; Wait for low... ; mov &half_dur, R13 ; Wait for 1/2 bit time ; rx_delay nop ; Bit delay sub #8, R13 ; jc rx_delay ; subc R13, PC ; 0 to 3 cycle delay nop ; 3 nop ; 2 nop ; 1 ; mov &P1IN, R15 ; Get serial input and &in_bit_mask, R15 ; rrc R12 ; Shift in a bit ; mov R14, R13 ; Setup bit timer jc rx_delay ; Next bit... ; rla R12 ; Move stop bit to carry swpb R12 ; Move rx byte to lower byte, start bit in msb ret ; Return with rx char and start bit in R12, stop bit in carry ; ; Added by Mark Red_On bis.b #00000001b,&P1OUT ; set P1.6 (green on) ret ; Red_Off bic.b #00000001b,&P1OUT ; set P1.0 (red on) ret Wait mov.w #31834,R10 ; load R10 with value for delay L1 dec.w R10 ; decrement R10 jnz L1 ; if R10 is not zero jump to L1 ret .end ;
  8. Like
    Rickta59 reacted to gordon in LP Booster Pack Eagle footprints   
    (OK, I have no idea where to put this. BH, feel free to move it around.)
     
    Continuing from viewtopic.php?f=9&t=1348&start=40#p11369
     
    This is the final version; I don't think it can be made any better as well as generic at the same time.
     
    All variants verified against the TI LaunchPad Eagle files.
     
    Thanks to SugarAddict for the corrections.
     
    Pro tip: make your References layer yellow (or any other unused bright color) while placing your components.
     
    Addendum: DipTrace users look here: viewtopic.php?f=35&t=2972
    TI_launchpad.zip
  9. Like
    Rickta59 got a reaction from zeke in New chips shipping with the LaunchPad?   
    Yikes! Texas Instruments fixes a wrong and we complain? I applaud TI for fixing the problems with the first LP version.
    TI, please don't even think about reversing your decision. You have it right now!
     
    o New chips, Yay! The msp430g2553 and msp4302452 are much better chips for the first time msp430 user. More memory, more pins, real UART, more more more. Why would TI want the first impressions of the 430 to be small, small, small. Too bad the first version shipped with those cost sensitive chips. It is hard to change first impressions. How many potential users did they alienate with the first version?
     
    o Fixed the TX/RX problem! I like the elegant solution that lets you use either chip without having to supply any F-F jumpers.
     
    o Standard Launchpad device configuration! A standard device configuration means booster boards can ship with headers already mounted. No more wondering what the user might have. I don't have a problem with pre-soldered headers. I haven't run with the chips in my Launchpad socket since about day 4. I put my msp430 chips on a breadboard and makes it a lot easier to prototype.
     
    Good Job TI!
     
    -rick
  10. Like
    Rickta59 reacted to canid in Big problem with my Launchpad   
    I have not been able to fix the borken one. I wanted to update to let everybody know that I was able to replace my Launchpad. I bought two just in case.
     
    In the spirit of community that this forum has shown me, and because it's the Holiday season, I would offer to help out. If somebody else here knows what it's like not to be able to come up with $5 for equipment and needs a launchpad, please let me know. Limited to places that TI will ship.
  11. Like
    Rickta59 got a reaction from zeke in Saving flash space, by making use of infomem   
    You can avoid overwriting the infoa segment, which is where most of the precalibrated values are stored by using:

    __attribute__((section(".infob")))

    __attribute__((section(".infoc")))

    __attribute__((section(".infod")))
     
    each .infox section is 64 bytes. If you avoid .infoa you don't have to worry about what might be stored there.
     
    [EDIT]
     
    -rick
  12. Like
    Rickta59 got a reaction from DecebaL in Software async serial tx/rx without timer   
    Here is an msp430-gcc port of serial.S. Only some minor changes required:
     
    renamed from serial.asm to serial.S
    changed header inclusion, .cdecls to #include
    added ':' to all labels
    changed .bss directives to .lcomm
    changed .def directives to .global
    fixed argument registers CCS using R12-R15 for arg1-arg4, GCC uses R15-R12 for arg1-arg4
    reworked temp registers because of argument register reorder
    changed OR asm statements to BIS statements
     

    ; serial.S - gcc port of serial.asm #include ;------------------------------------------------------------------------------- ; --- define PC,SP,SR gcc only knows about registers --- #define PC r0 #define SP r1 #define SR r2 #define ARG1 R15 #define ARG2 R14 #define ARG3 R13 #define ARG4 R12 .lcomm in_bit_mask, 2 ; Serial in pin .lcomm out_bit_mask, 2 ; Serial out pin .lcomm bit_dur, 2 ; Bit duration in cycles .lcomm half_dur, 2 ; Half bit duration in cycles ; .text ; .global serial_setup ; void serial_setup(unsigned out_mask, unsigned in_mask, unsigned bit_duration); .global putc ; void putc(unsigned c); .global puts ; void puts(char *s); .global getc ; unsigned getc(void); ; .p2align 1,0 ; align on a word boundary serial_setup: ; - Setup serial I/O bitmasks and bit duration (32 minimum) mov ARG1, &out_bit_mask ; Save serial output bitmask mov ARG2, &in_bit_mask ; Save serial input bitmask bis ARG1, &P1DIR ; Setup output pin bis ARG1, &P1OUT ; bic ARG2, &P1DIR ; Setup input pin bis ARG2, ARG1 ; bic ARG1, &P1SEL ; Setup peripheral select mov ARG3, ARG1 ; sub #16, ARG3 ; Adjust count for loop overhead rla ARG3 ; Multiply by 2 because NOP is two bytes mov ARG3, &bit_dur ; Save bit duration sub #32, ARG1 ; Adjust count for loop overhead mov ARG1, &half_dur ; Save half bit duration ret ; Return ; ; - Send a single char putc: ; Char to tx in R15 ; R12, R13, R14, R15 trashed mov &out_bit_mask, R12 ; Serial output bitmask mov &bit_dur, R14 ; Bit duration bis #0x0300, ARG1 ; Add Stop bit(s) to tx char jmp bit_low ; Send start bit... ; tx_bit: mov R14, R13 ; Get bit duration tx_delay: nop ; 4 cycle loop sub #8, R13 ; jc tx_delay ; subc R13, PC ; 0 to 3 cycle delay nop ; 3 nop ; 2 nop ; 1 ; rra ARG1 ; Get bit to tx, test for zero jc bit_high ; If high... bit_low: bic.b R12, &P1OUT ; Send zero bit jmp tx_bit ; Next bit... bit_high: bis.b R12, &P1OUT ; Send one bit jnz tx_bit ; If tx data is not zero, then there are more bits to send... ; ret ; Return when all bits sent ; ; ; - Send a NULL terminated string puts: ; Tx string using putc push R11 ; mov ARG1, R11 ; String pointer in R15, copy to R11 putsloop: ; mov.b @R11+, ARG1 ; Get a byte, inc pointer tst.b ARG1 ; Test if end of string jz putsx ; Yes, exit... call #putc ; Call putc jmp putsloop ; putsx: pop R11 ; ret ; ; getc: ; - Get a char mov &bit_dur, R14 ; Bit duration mov &in_bit_mask, R13 ; Input bitmask mov #0x01FF, ARG1 ; 9 bits - 8 data + stop ; rx_start: ; Wait for start bit mov &P1IN, R12 ; Get serial input and R13, R12 ; Mask and test bit jc rx_start ; Wait for low... ; mov &half_dur, R13 ; Wait for 1/2 bit time ; rx_delay: nop ; Bit delay sub #8, R13 ; jc rx_delay ; subc R13, PC ; 0 to 3 cycle delay nop ; 3 nop ; 2 nop ; 1 ; mov &P1IN, R12 ; Get serial input and &in_bit_mask, R12 ; rrc ARG1 ; Shift in a bit ; mov R14, R13 ; Setup bit timer jc rx_delay ; Next bit... ; rla ARG1 ; Move stop bit to carry swpb ARG1 ; Move rx byte to lower byte, start bit in msb ret ; Return with rx char and start bit in R15, stop bit in carry
     
    -rick
  13. Like
    Rickta59 reacted to simpleavr in TI Launchpad plays Bad Apple   
    this is my entry to 2011 Nov/Dec POTM.
     
    been a while since my last project. the "bad apple" sound and sight reminds me of days when i spend afternoons in video arcade shop/parlor/institute? wasting my time/life. hope u enjoy.
     
    this is not an original project, rather a mesh up of what i can google for my target toy instrument. original source / site are credited in the source code and mentioned.
     



     
    description
     
    . reproduction of the internet meme "bad apple" sound and sight, in a self contained device
    . ti launchpad / msp430 low end device demo
    . msp430 spi usage, bit-bang style, on two devices
    . lcd module access demonstrated
    . sd / mmc low level access demonstrated
    . polyphonic tone generation via pwm demonstrated
     

     
    schematic
     

    // MSP430F20x2/3 ----------o--------------o Audio out // ----------------- | | o // /|\| XIN|- | --- | // | | | .-. --- 10-500nF | // --|RST XOUT|- | | 1-10K | | // | | |_| |--------------- // LED <-|P1.0 | | ___ // | | | /// SD / MMC card /|\ // | pwm out P2.6|----- --------------------- | // | | | Vcc 4|--- // | as CS P1.7|-------------->|1 CS, select device | // | as MOSI P1.6|<--------------|7 MISO, data out | // | | ----------->|2 MOSI, data in | // | | | --------->|5 CLK, spi clock | // | | | | | Gnd 3|--- // | | | | --------------------- | // | | | | --- // | | | | Nokia 5110 breadout /// // | | | | ----------------------------- // | as SCLK P1.1|---|-o->|7 SCLK, spi clock | // | as MISO P1.2|---o--->|6 MOSI, data in | // | as D/C P1.3|------->|5 D/C, data or control | // | as RST P1.4|------->|4 RST, reset, low active | // | as SCE P1.5|------->|3 SCE, select , low active | /|\ // | | ----|2 Gnd | | // | | | | Vcc 1|--- // --- ----------------------------- // /// // // SD (back side) Micro-SD (back side) // __________________ __________________ // / 1 2 3 4 5 6 7 8 | 1. CS .. SEL / 1 2 3 4 5 6 7 8 | 1. NC // |9 | 2. DATAIN .. SDO | | 2. CS .. SEL // | | 3. GND .. Gnd | | 3. DATAIN .. SDO // | S O - + C I | 4. 3.3V .. Vcc | S O + C - I | 4. 3.3V .. Vcc // | | 5. CLK .. Clk | | 5. CLK .. Clk // | | 6. GND/NC .. Gnd | | 6. GND/NC // | | 7. DATAOUT .. SDI | | 7. DATAOUT .. SDI // | | 8. DAT1 | | 8. DAT1 // | | 9. DAT2 | | 9. DAT2
    the circuit is consist of three modules.
     
    . a sd / mmc module that reads content from sd / mmc card
    . a lcd module that show video on nokia 7110 or 5110 lcds
    . a polyphonic pwm output implementation, 8 channels are used in this project
    . the sd / mmc module and the lcd module shares some pins
    . both sd / mmc module and the lcd module are isolated and can be included in other projects
    . the core part of the code implements pwm sound and controls timing for content reads and displays
     
    firmware
     
    the firmware was done under ubuntu 11.10 w/ mspgcc4 + mspdebug as programmer. it is also test built under windows 7 with cygwin environment, mspgcc4 is also used and a MSP430Flasher.exe (command line programmer released by TI) is used to program the launchpad. it should build also w/ CCS as i had compiler directives to switch code portions. however i did not verify, you are on your own if you are on CCS or IAR.
     
    the are additional details / options that you can tweak, they are explained in the source code. they are not listed here as you only need them if you built the project.
     
    content generation
     
    data content for both the video and sound can be created via the supplied zcontent.pl script. input for content includes an avi video file and a midi file. this script can be used to generated alternate contents for most avi and midi files.
     
    the followings are needed for content generation
    . we need an avi file for video
    . we need a midi file for audio, prefer about 8 channel simple paino instrument
    . supporing utility / tools
    . should be done in a linuxish machine or w/ cygwin
    . unixish bin-utils, etc. we need "sort" for sure
    . perl, the internet duct tape to tie things together
    . certian perl modules, like "Image::BMP", "POSIX"
    . midicsv and whatever he requires, this is for midi extraction
    . ffmpeg to extract bitmaps from video
    . dd utility (part of linux / cygwin) to write content binary to sd / mmc card
     
    i don't want to put full details in this post as it may be too long to read. and it can be found here at http://www.simpleavr.com/msp430-projects/bad-apple. comments / suggestions are most welcomed.
     
    source tarball is available here as attachment. binaries (contents + firmware) are available at the mentioned link.
    bad_apple_src.tgz
  14. Like
    Rickta59 reacted to oPossum in 2 wire Nokia 5110 interface   
    This is a way to use the Nokia 5110 LCD with only 2 GPIO pins. Software SPI allows any 2 pins to be used. In some cases the data line may be shared with another external peripheral such as an output shift register or an other 5110.
     
    The D/C and Reset lines are controlled by stretching the clock pulse. R/C values must be calculated for the specific clock frequency that the MSP430 will run at. A variety of Schmitt trigger gates could be used, such as MC14584, CD40106, 74HC14, 74HC132, etc...
     
    Wiring...

     
    The clock pulse for D0 is stretched when a command byte is sent. The PCD8544 controller latches the D/C line during the rising edge of the clock during the D0 period.
    A reset pulse uses an even longer clock pulse.

     
    Software SPI for 2 wire scheme

    typedef enum { lcd_command = 0, // Array of one or more commands lcd_data = 1, // Array of one or more bytes of data lcd_data_repeat = 2 // One byte of data repeated } lcd_cmd_type; void lcd_send(const unsigned char *cmd, unsigned len, lcd_cmd_type type) { register unsigned mask; // CLK high upon entry and exit do { // Send bits 7 to 1 mask = 0x0080; // msb first do { // if(*cmd & mask) { // Test bit P1OUT |= LCD_DATA; // 1 bit, data high P1OUT &= ~LCD_CLK; // Clock low } else { // P1OUT &= ~(LCD_CLK | LCD_DATA); // 0 bit, data & clock low } // P1OUT |= LCD_CLK; // Clock high mask >>= 1; // Next bit } while(!(mask & 1)); // Check if bit 0, loop if not // Send bit 0 if(*cmd & mask) { // Test bit P1OUT |= LCD_DATA; // 1 bit, data high P1OUT &= ~LCD_CLK; // Clock low } else { // P1OUT &= ~(LCD_CLK | LCD_DATA); // 0 bit, data & clock low } // if(!type) __delay_cycles(10); // Stretch clock if command - DC will go low P1OUT |= LCD_CLK; // Clock high if(!(type & 2)) ++cmd; // Inc buf pointer if not repeat } while(--len); // Decrement byte count, next byte if not zero... } void lcd_reset(void) { P1OUT &= ~LCD_CLK; __delay_cycles(10000); P1OUT |= LCD_CLK; __delay_cycles(10000); }
  15. Like
    Rickta59 reacted to xpg in Eclipse plugin for mspdebug and msp430-gcc   
    It's seem that I finally succeeded in building a plugin for Eclipse, which contains compiled versions of GCC, GDB, and mspdebug, and also integrates these somewhat into Eclipse. Currently, I would strongly advice people, who which to try my plugin, to use Eclipse Indigo.
     
    There are three installable features: MSP430Eclipse, which is the Eclipse integration, and two binary toolchains (32 and 64 bit Linux). Yes, it's Linux only for now. Installing MSP430Eclipse and the appropriate toolchain will take a while, as the toolchains are quite big (yes, there are plenty of improvements to be made). I'll try to describe how to get started with this Eclipse plugin in this post.
     
    Go to the "Help->Install new software" menu, and type in "http://eclipse.xpg.dk" as the repository. If you had installed my previous version, please uninstall it first by going to "Help->About", select "Installation Details" and choose the MSP430Eclipse feature and click "Uninstall".
     

     
    Once installed, Eclipse will prompt you to restart. Please do. Once Eclipse pops up again, start by going to the Eclipse preferences ( Select menu "Window->Preference"). There should be a MSP430-tab at the left side. Selecting it will show the toolchain configuration. Here it is possible to use the MSP430 toolchain that comes with your distribution, or you can select a prebuild one (if installed). Perform your selection of choice, and hit the "Apply" button.
     

     
    Next task is to create a MSP430 C project. Go to "File->New->Project...", a project type selection box will appear. Open the "C/C++"-group, select "C Project", and press Next.
    Here, you open the "MSP430 Cross Target Application" group and select "Empty Project". Name your project (let's call it Blinky),

    and hit the "Next"-button. Next part of the wizard is about configurations, just press "Next" (not Finish, yet). Finally, you will be brought to a dialog to select the MSP430 target. Select the appropriate MCU from the (huge) drop-down list, and then click "Finish".
     

     
    Now we create a source file: Right click the project and select "New->Source File"; name it "main.c". Write some simple code, such as:

    #include #include void delay(unsigned int j) { for(;j>0;j--); } void main(void) { WDTCTL = WDTHOLD | WDTPW; P1DIR |= BIT6; while(true) { P1OUT ^= BIT6; delay(20000); } }
     
    Right click the project and select "Build Project". If everything goes well, your project should start compiling. If not, please let me know .
     
    Before trying to upload the binary to your Launchpad, please ensure that you have the following udev rule installed on your system (and that your user is in the plugdev group):

    ATTRS{idVendor}=="0451", ATTRS{idProduct}=="f432", MODE="0660", GROUP="plugdev"
    Place the code in /etc/udev/rules.d/90-launchpad.rules, or something similar. Some distributions have done this for you, others have not.
     
    In order to upload the binary select the MSP430-menu and choose "Upload to target". Note, that this is the MSP430-menu in the main Eclipse menubar (there is also one in the context menu of the project, but it does not work). With a bit of luck, the code should be uploaded to the Launchpad and blink LED2.
     
    Next up is debugging. This is the most experimental part of the plugin, so don't expect it to work :-). Click "Run->Debug Configurations..." from the Eclipse menubar. Right click the "GDB Hardware Debugging"-group on the left, and select "New".
    Go to the "Debugger"-tab and ensure that "Use remote target" is checked and that "mspdebug" is chosen in the list. In the "GDB Command" field type: "${dk.xpg.msp430eclipse.variable.debugger}" instead of "gdb".

     
    Now, press "Debug" and the magic should happen. Eclipse will most likely ask if it should open the Debug perspective, say "Yes". The MCU will be reset and the current program location will be somewhere strange. Select the "main.c" file and place a breakpoint somewhere in main().

    Press F8 to run until the breakpoint is reached. Now it should be possible to single step through the program. When you are done with debugging, simply terminate the session by pressing the red stop button.
     
    Well, I guess that's it for now. Please try it out, and tell me if it works for you. If there is sufficient interest in this, I'll keep developing it. Now, I need to get some sleep, it's 1 AM and I need to get up early tomorrow :oops:
  16. Like
    Rickta59 got a reaction from oPossum in Delay function with one cycle granularity   
    gcc port of this code available here:
     
    https://gist.github.com/1384579
     
    -rick
  17. Like
    Rickta59 got a reaction from gordon in Delay function with one cycle granularity   
    gcc port of this code available here:
     
    https://gist.github.com/1384579
     
    -rick
  18. Like
    Rickta59 reacted to MattTheGeek in EasyMSP 1.0.0 RC1 Release Planned   
    A lot of progress has been made... So in about 2 weeks from today (Dec. 1st), I'll be releasing EasyMSP 1.0.0 RC1. I've made it leaner, lighter, and faster. (Blinky is 236 bytes...). Look forward to it.
     
    Regards,
    Matthew
  19. Like
    Rickta59 reacted to bluehash in PetiteFS FATfs SDCard USCI code   
    Edit: July 6th, 2014
    Please also note that Pabigot maintains BSP430 which has an example for the msp430. He also tracks any changes done to the ElmChan library with patches made to the example. Refer this post.
     
    ---------------------------------------
    First version. It's very untidy as I just got it to work. Works on USCI on the MSP430G2553. Supports Read/Listing. The monitor code does not have write yet. It works on the SDCard Boosterpack.
     

    I also used Rickta's serial code to reduce file size. I'll update to the next version once I have time and a clean it up to. Also need to add more features.

    Usage in screenshot.
    di : disk initialize
    fi : mount disk
    fl : list files
    fo filename: open file name.



    Latest Code:
    http://www.43oh.com/forum/viewtopic.php?f=10&t=1883&start=20#p18738'>Code Rev 0.2

    Member Contributed Code:
    Jazz_ys - http://forum.43oh.com/topic/1427-petitefs-fatfs-sdcard-usci-code/page__st__20#entry24449'>Link
    SDCARD_PetiteFS_2553_v0.01.zip
    SDCARD_PetiteFS_2553_v0.02.zip
  20. Like
    Rickta59 reacted to greeeg in Small ASM printf   
    ok. All the features of a good printf function have been added.
     
    NEW!! Editable output function. This adds 2 bytes to BSS but no affect on function size.
    (This should allow a function like sprintf(); to be created very easily.)
    Define your function before any calls to xprint(); like so:

    out_dev(&xputc);
     
     
    Format strings parsed to xprint follow these rules
    %[Zero filled?][Min. Width][Long?][Type]
     
    Zero Filled: either '0' or nothing.
    Min. Width: 1-9 or nothing.
    Long: 'l' or nothing.
    Types:


    [*:2vft2qoj] u - Unsigned
    [*:2vft2qoj] d - Signed integer
    [*:2vft2qoj] s - String [ram & flash]
    [*:2vft2qoj] c - Character
    [*:2vft2qoj] X - Hexadecimal
    [*:2vft2qoj] b - Binary
    [*:2vft2qoj] o - Octal (Not sure how useful this really is. Removing saves 8 bytes )

     
    Some examples:

    xprint("%05u",1234); \\produces "01234" *Zero filled, Width:5, Unsigned xprint("%X",0x2F); \\produces "2F" *Hexadecimal xprint("%9ld",-1234567); \\produces " -1234567" *Width:9, Long, Signed
     
     
    All this with a total footprint of 278 bytes of flash and 2 bytes of static ram. with all functions enabled

    ASM xprint.s > xprint.o text data bss dec hex filename 278 0 2 280 118 build/xprint.o
     
    Still only designed for mspgcc. Support for CCS and IAR should be easy if all compilers use the stack to transfer variable parameters.
    Will continue to optimize the code.
    xprint-v0.3.zip
  21. Like
    Rickta59 reacted to gwdeveloper in F5529 Breakout Dev Board (Now with pics!)   
    Using RobG's code for the 5110 lcd, I have a display going on UCA1 SPI. Changes are below:
     

    #define LCD5110_SCLK_PIN BIT0 #define LCD5110_DN_PIN BIT4 #define LCD5110_SCE_PIN BIT3 #define LCD5110_DC_PIN BIT5 #define LCD5110_SELECT P4OUT &= ~LCD5110_SCE_PIN #define LCD5110_DESELECT P4OUT |= LCD5110_SCE_PIN #define LCD5110_SET_COMMAND P4OUT &= ~LCD5110_DC_PIN #define LCD5110_SET_DATA P4OUT |= LCD5110_DC_PIN #define LCD5110_COMMAND 0 #define LCD5110_DATA 1

    void writeToLCD(char dataCommand, char data) { LCD5110_SELECT; if(dataCommand) { LCD5110_SET_DATA; } else { LCD5110_SET_COMMAND; } UCA1TXBUF = data; while(!(UCA1IFG & UCTXIFG)) ; LCD5110_DESELECT; }

    // spi for lcd P4OUT |= BIT3 + BIT5; P4DIR |= BIT3 + BIT5; P4SEL |= BIT0 + BIT4;

    void UCA1_init_lcd(void) { // spi for lcd UCA1CTL0 |= UCCKPH + UCMSB + UCMST + UCSYNC; // 1st edge cap; msb 1st; master; sync UCA1CTL1 |= UCSSEL_2; // smclk UCA1BR0 |= 0x01; UCA1BR1 = 0; UCA1CTL1 &= ~UCSWRST; // enabled }
  22. Like
    Rickta59 reacted to bluehash in Get your Booster Packs Sponsored - $10   
    Hello guys..This has been at the back of my head for a long time. So lets start at Booster Packs.

    43oh will be glad to sponsor your initial Booster Pack[bP] development. $10 will be awarded to you to make initial PCBs or purchase parts. It's not much, but it is an incentive. A max of two BPs will be sponsored/month.

    Your selection depends on the following factors:
    [1] Be a member on this forum for at least 4 weeks and have a minimum of 20 posts.
    [2] A thread in the Booster Pack sub-forum.
    [3] Create initial schematics and layouts in the thread, including selection of parts.
    [4] BP usable by a large number of people.
    [5] Open source your schematic and PCB Files. Git it if you have to, but keep a copy on the Forum.
    [6] Some amount of test code if the success of your Booster Pack depends on it.
    [7] A voting system for the community to decide if the BP needs to be sponsored. I'm not sure how many votes make a good BP. If there are enough "Yes" votes(more than 50%) than "No"... your sponsored.

    I can't think of anything else.I'd also like to put a donate button for members to donate towards the pool. Would there be any interest in this? Donations will be made public to ensure transparency. I would appreciate the communities response to the idea. This will also help increase the number of sponsorships/month.

    There is no liability once you are sponsored(since the schematics/PCB files have been shared). It's a matter of mutual understanding that you will not run away with the boards. Maybe give them away with the interested party paying for shipping.

    One thing to keep in mind is to keep this KISS - Keep It Simple, Stupid.
    Also, no arguing, but intelligent debate when voting. This is NOT a competition.
  23. Like
    Rickta59 got a reaction from SugarAddict in F5529 Breakout Dev Board (Now with pics!)   
    OK, so I went to the Post Office today and got a surprise. My SA 5529 board showed. It is white, very white.
    I like it. First step, solder on some male headers. Second step, cross fingers and plug it in. Great! it shows
    up as a usb device on linux:
     

    $ lsusb Bus 001 Device 048: ID 2047:0200 Texas Instruments MSP430 USB HID Bootstrap Loader
     
     
    I looked around for how to communicate with it on linux using mspdebug via the USB BSL. That didn't yield any
    results that jumped out at me on google. I quickly decided to give up on that tack and went looking for the
    test/reset/vcc/gnd pins so I could see some blinky lights. Time to whip up a little test program to toggle P1.0.
    Here is a picture of that setup. Bonus! the led is even on in the picture:
     

     
    Fun! So now I have lots of reading to do. I'd like to figure out how to use BSL over USB. However, I'll probably
    still use the setup so I can do debugging using msp430-gdb.
     
    Oh yeah, I'm using msp430-gcc and mspdebug to program this device. Free CCS just isn't going to cut it with
    128k of available Flash.
     
    Thanks SA!
  24. Like
    Rickta59 got a reaction from RobG in F5529 Breakout Dev Board (Now with pics!)   
    OK, so I went to the Post Office today and got a surprise. My SA 5529 board showed. It is white, very white.
    I like it. First step, solder on some male headers. Second step, cross fingers and plug it in. Great! it shows
    up as a usb device on linux:
     

    $ lsusb Bus 001 Device 048: ID 2047:0200 Texas Instruments MSP430 USB HID Bootstrap Loader
     
     
    I looked around for how to communicate with it on linux using mspdebug via the USB BSL. That didn't yield any
    results that jumped out at me on google. I quickly decided to give up on that tack and went looking for the
    test/reset/vcc/gnd pins so I could see some blinky lights. Time to whip up a little test program to toggle P1.0.
    Here is a picture of that setup. Bonus! the led is even on in the picture:
     

     
    Fun! So now I have lots of reading to do. I'd like to figure out how to use BSL over USB. However, I'll probably
    still use the setup so I can do debugging using msp430-gdb.
     
    Oh yeah, I'm using msp430-gcc and mspdebug to program this device. Free CCS just isn't going to cut it with
    128k of available Flash.
     
    Thanks SA!
  25. Like
    Rickta59 got a reaction from pine in What are the minimal pins to connect an 430 on breadboard   
    Great write-up here:
     
    http://www.43oh.com/forum/viewtopic.php?f=8&t=1152&p=7679#p7679
     
    -rick
×
×
  • Create New...