
thanhtran
-
Content Count
67 -
Joined
-
Last visited
-
Days Won
1
Reputation Activity
-
thanhtran got a reaction from vicvelcro in MSP430F5510 powered by USB port without an extra LDO?
My 5510 test board next to a SD card
-
thanhtran got a reaction from jayshreekant in MSP430 Launchpad very very basic UART
Go to Ti.com, search for the chip that you're using. Then download the example codes. It should have an example which allows you to send / receive UART data. In the example, you should see how you can connect the wires / pins. If you want the UART to talk to a PC's serial port, you need a level adapter in between the MSP and the PC.
-
thanhtran reacted to blankfield in ATX2CHARGER - switch your ATX into a car battery charger with MSP430 [UPDATED]
Hi, my project basis only on modification of some feedback resistors, no need to play with trafo.
Up to ~17V for typical ATX PSU is maximum value. Above this value you need to rewind or made a new transformer. In my opinion it's to tricky, especially to disassemble fragile core (2 "E" shapes glued together).
-
thanhtran got a reaction from bluehash in [Call for Designs] CC3000 WiFi BoosterPack
This was my quick and dirty break out board. I overcooked the pcb on a cooker and the flux turned brown, but it still works
-
thanhtran got a reaction from jazz in MSP430F5510 powered by USB port without an extra LDO?
My 5510 test board next to a SD card
-
thanhtran reacted to tonesenna in About the MSP430 clocks.
VLO , DCO and External crystal are all clock generatores. Which one to use depends on your needs in terms of clock speed, accuracy and power consumption.
VLO is a very low power clock that runs in the 10s kHz. While speed is very limited, it provides you a means of having a clock driving some system logic with minimal power consumption. This clock generator isn't accurate at all IIRC.
DCO is a high speed clock generator that runs in MHz range. Is requires more power but allows clock speeds magnitudes higher than VLO. Accuracy is tipical in the range of 1 ~2% so it should be ok for applications that don't rely heavilly on clock accuracy.
Crystal oscilators are the most accurate clock source and probably the most power hungry (except the 32k768 crystal LFXT oscillator). They may provide veri accurate timings and also high clock speeds. On the other hand, crystal oscillators, may require more power than the DCO and probably take longer to wake up from a low power mode than a VLO or DCO oscillator.
MCLK, SMCLK and ACLK ate clocks sourced from each of the above clock generators. The MSP430 may allow you to independently source each clock from each available clock generator and also divide the clock frequency by some desired factor.
By using different clocks you gain flexibility to, for inastance, put the device into a low power mode where MCLK clock source is disabled (power savings yay!!), but VLO may be kept running, driving ACLK which in turn drives a timer that will wake the device some time later.
The MSP430 manual goes into great detail explaining the possible combinations of clock generators and clock signals.
The datasheed for each device gives you a pretty reasonable figure of power consumption of the chip with each of the clocks running.
--
to
-
thanhtran reacted to RobG in MSP430F5510 Breakout Board
Someone has suggested that it would be nice to have F5510 board with access to all pins, so I made one.
Unlike my F5510 Development Board, this one is not compatible with Booster Packs.
Any suggestions before I send it off to Seeeeed?
It will be available as PCB only.
-
thanhtran reacted to jpnorair in Garage door opener
There are several glitches in these parts.
They don't like to be forced into idle during RX or TX process. Don't do it, it can have unpredictable consequences.
Don't use CS/CCA. It just doesn't work properly and it inexplicably takes longer than reading the RSSI directly upon lock.
The WOR timer does not always send an interrupt when it expires.
You need to reset TEST0 to a specified value from SRFS (I think that's the one) everytime you engage RX or TX. This is one of the most cryptic and most important errata to workaround. I suspect it could be causing your lockup.
-
thanhtran reacted to RobG in MSP430F5510 powered by USB port without an extra LDO?
You can use it but the maximum current you can draw from VUSB is 12mA.
-
thanhtran got a reaction from bluehash in Project with an 430 Launchpad + wifi?
Microchip has the Wifi module (RN-171) that just needs a serial port to talk to Wifi. It can be set as an AP so that smart phone can connect to without an AP. The TI module needs an AP to work with.
The TiWiSL module is only $25 at DigiKey, and you can just connect couple wires to make it work with your MSP430 FRAM board. I made a small breakout board for this TIwi module. If you need the Eagle file I can upload here.
-
thanhtran reacted to jazz in MSP430 USB Benchmark
It was already explained on topic:
Firmware is in TI txt format, and It can be flashed by USB BSL. "MSP430_USB_Firmware_Upgrade_Example-1.2.1-Setup.exe" can be download from here:
http://software-dl.t.../index_FDS.html
-
thanhtran reacted to larsie in Garage door opener
I'm trying to make a garage door opener using some cheap CC2500 boards bought through a group-buy at 43oh.com (2 USD each) and a really nice board designed by RobG. I've made a prototype first, and it seems to work, but is not very pretty. I need to maybe make it more compact and make a case for it. Here's a picture:
The code is definitely not finished, but you can download it here if you want to look at it. It's based on the TI CC2500 library (not SimpliciTI, which would probably have been a natural choice). I'm using the bitbanging version, as I didn't have any surface mount MSP430G2553.
I guess maybe I should put the battery beneath.
-
thanhtran reacted to jazz in MSP430F5510 warms with RST pin pulled low
MSP430F5510 will not work with USB BSL sample code, because it is prepared/compiled for MSP430F5529. For using original TI USB stack with MSP430F5510, some small modification to source code are needed because by default it is prepared for MSP430F5529. Try my benchmark packet with MSP430F5510, it will enumerate.
-
thanhtran reacted to oPossum in Launchpad Mini - revision 3
A few updates...
- 2 or 4 pin pushbuttons
- SPI MISO/MOSI reversing jumpers (J8)
- Support for FTDI on 6 pin 100 mil header - requires 2 trace cuts and a jumper
lp_mini_r3.sch
lp_mini_r3.brd
-
thanhtran reacted to RobG in [Group Buy-10] [O] RGB SMD LED (with built-in controller)
Created one.
(Updated 12/12, added package with longer pads)
5050WS2811.lbr
-
thanhtran reacted to jazz in MSP430F5510 warms with RST pin pulled low
During making of my first MSP430F5510 p2p board (http://forum.43oh.com/topic/2775-msp430-usb-benchmark/) I made mistake with self/bus powered option, selected by jumpers. Later I found the source of the problem and it was fixed, but chip was already damaged. After this, it was able to flash and execute program like on any other non damaged device, but chip was hot (almost) all the time.
-
thanhtran reacted to jpnorair in MSP430F5510 warms with RST pin pulled low
Your board might have a flaw. I have never experienced this, exactly, but I have had similar experiences with faulty boards. I have a broken EXP5529 board, so even if it's from TI, it doesn't mean it is flawless.
Anyway, always buy two boards.
-
thanhtran reacted to spirilis in MSP430F5510 warms with RST pin pulled low
That's pretty wild. Not sure why the chip would overheat while in RESET state like that. But yeah all MSP430's should have a 47K pullup on RESET to +Vcc.
-
thanhtran reacted to RobG in [Group Buy-10] [O] RGB SMD LED (with built-in controller)
Shipped:
Rickta59
oPossum
Touch (you will get 2 envelopes, my fault :-( )
Mtlevine
Soma4all
thanhtran
-
thanhtran reacted to Philipp in Touch Enabled LED business card
Hey, just saw this on H'a'D:
Nothing new there, basically only 8 leds, an msp430, a battery and some pcb, but i really like his design More Details
-
thanhtran reacted to garyamort in Turning a Launchpad into a poor mans IOIO
I've been working on turning a Launchpad into a poor mans IOIO. The latest version of the IOIO adds support for connecting from the computer to the board using a bluetooth serial connection. This means if I copy the underlying protocol[or at least as much as I need] - I can then emulate the IOIO for my real goal[see below].
I'm just in the beginning phase right now, my initial goal is to get it working so I can use the IOIO protocol to turn on and off the 2 LED's on board. IE just cloning the Digital Output functionality and only on 2 pins.
I'm hoping to finish that this weekend. Right now I just have the initial skeleton of combining the TI example code for 9600 baud uart and some basic IOIO headers.
https://github.com/garyamort/IOIOExtension
Once I get the 2 pins working, the next step is to allow for access to all 10 available pins on the MSP430G2553 [there is 1 and a half ports available, but 2 pins have to be used form the serial connection].
This is where I figured I'd ask if there is a standard way of doing things as I'm re-learning C as I go along.
A command will consist of a few bytes of data:
The command byte, such as I beleive 6 and 7 for digital output. 6 to turn a pin into a digital output, 7 to change the value being sent out. Following the command is the "pin number" - where pin number is defined by where they come out on the board, not where they are on the launchpad.
For my purposes:
Pin 1: Port 1.0
Pin 2: Port 1.3
Pin 3: Port 1.4
Pin 4: Port 1.5
Pin 5: Port 1.6
Pin 6: Port 1.7
Pin 7: Port 1.0
Pin 8: Port 2.1
Pin 9: Port 2.2
Pin 10: Port 2.3
Pin 11: Port 2.4
For the simple case of:
Pins 1 and 5[1.0 and 1.6] I can use a simple switch/case to send the correct BIT to P1SEL
However, to expand it to all 10 pins, I would rather not have a humungous SWITCH/CASE. It would be better to have a mapping of pins to their appropriate bit, port address, and value. Something like:
PINDEF selectedPin = pinmap[1];
selectedPin->port |= selectedPin->digitalOutBit;
selectedPin->iovalue |= selectedPin->digitalOn;
While I understand easily how to do the digitalOutBit and digitalOn - they are just values. The question is how to I assign a variable[selectedPin->port] so that it can be used in the same manner as P1SEL ?
Thanks for any feedback.
Sidenote: my /goal/ is yet another oscilliscope. However, since my strongest skillset is website engineering[php/HTML/CSS/Javascript] - my preference is to make the scope as a Javascript application run from the web browser. I can hack enough Python to use the Python serial and websocket library to provide access to the com port from the web browser - so with that in place it makes it a lot faster for me to write IOIO apps which will also be usable with a Launchpad by using Javascript.
For added fun, I want to setup a PHP library so that I can have the launchpad display the number of users on a website via an LED bargraph and maybe have it play a sound when different "goals" are met.
NOTE: I found I had to hunt through the project settings in CCS to find and enable the "relaxed-ansi" option in order to get the "packed" structures to work.
-
thanhtran reacted to username in AR Drone Control V2
Howdy all,
Got another video with my AR Drone. This time the MSP430 was used for alittle bit more then just acting as a remote. With the MSP430G2553, the W5200, and a wireless switch, I was able to control it from an isolated embedded system. Once I have abit more time i'll implement a pair of joysticks to control the drone. As for how it works, the MSP430 sends SPI data to the W5200, then the W5200 sends UDP commands to the drone. Took abit of time to figure out how to fly the thing. Constant communication must occur with the drone or else its crashes (gotta love darn WDTs). Theres also a rather tedious initialization sequence that you gotta do on startup. Anyhow, heres a video:
Special thanks to Rob G for his awesome W5200 driver code.
You can see his thread for his W5200 project here: viewtopic.php?f=35&t=2529&start=110
Cheers!
-Nate Zimmerman
-
thanhtran reacted to bluehash in Rocket Data Logging to Flash
Hi all,
This code is from Daniel Huber and posted here with permission.
Enjoy!..
/* Samples pin 1.3 and averages values until a change is detected. * Then continues to measure , stores the values in buffer of size 32int, * writes full buffer to flash memory. * If flash memory full, stops measuring and repeatedly transmits content of flash. */ #include "msp430g2231.h" #include "stdbool.h" #include "stdlib.h" #define TXD BIT1 // TXD on P1.1 #define Bit_time 104 // 9600 Baud, SMCLK=1MHz (1MHz/9600)=104 #define LEDR BIT0 // LED red #define LEDG BIT6 // LED green #define LED_DIR P1DIR #define LED_OUT P1OUT #define DAT0 0xFC00 // start of data-flash memory #define DAT1 0xFE00 // second segment of data- flash memory #define DATN 512-16 // size of data flash memory, last 32 bytes are used for interrupt vectors #define CHANNEL INCH_3 // mesaure channel unsigned char BitCnt; // Bit count, used when transmitting byte unsigned int TXByte; // value sent over UART when Transmit() is called unsigned int i; // 'for' loop variable bool ADCDone; // ADC Done flag unsigned int ADCValue; // Measured ADC Value unsigned int ADCAvg; // averaged ADC Value unsigned int *pflash=(unsigned int *)DAT0;// pointer into data flash memory // Function Definitions void TransmitInt(unsigned int val); // transmits an int void Transmit(void); //transmits a byte void Single_Measure(); //measures with avarage void Single_Measure0(); //measure single value void delay(short del); //delays 1/8^del sec void storedat(int buf[]); // writes buffer to flash memory void ereaseflash(); // erease flash memory void prflash(); // transmits flash memory content void main(void) { int ib=0; //index into buf int buf[32]; // buffer for data values int im=0; // counter of measurements WDTCTL = WDTPW + WDTHOLD; // Stop WDT: PWD,Hold,NMIReset BCSCTL1 = CALBC1_1MHZ; // Set range DCOCTL = CALDCO_1MHZ; // SMCLK = DCO = 1MHz // BCSCTL3 |= LFXT1S1; // sets LFXT1Sx to 0b10, VLO mode, bit not set-> 32KHz P1SEL |= TXD; // Connected TXD to timer pin P1DIR = TXD | LEDR | LEDG; // use TX and LED P1OUT = LEDR & ~LEDG; // Turn on LED at P1.0 __bis_SR_register(GIE); // interrupts enabled ereaseflash(); // erease flash memory FC00-FDFF Single_Measure(); // first measurent buf[ib]=ADCAvg; while(abs((int)(buf[ib]-ADCAvg)) Single_Measure(); } ib++; // accept first measurement im++; while(1) { P1OUT ^= LEDR; // blink red LED during measurement Single_Measure(); // measure one point buf[ib++]=ADCAvg; // store data point in buffer im++; // counter of measuremenst if(ib>=32){ // if we have 32 data points in buffer storedat(buf); // store data in flash memory TXByte=buf[0]; ib=0; } if(im>=DATN){ // transmit measured data repeatedly P1OUT &= ~LEDR; while(1){ P1OUT ^= LEDG; // blink green LED during measurement; prflash(); delay(0);P1OUT ^= LEDG;delay(0);P1OUT ^= LEDG;delay(0); } } // __delay_cycles (1000000); // delay program execution for 1000 cycles delay(2); } } // makes avearged single measurement, average in ADCAvg void Single_Measure(){ ADCAvg = 0; for (i = 0; i Single_Measure0(); ADCAvg += ADCValue; } ADCAvg >>= 3; // divide by 8 } /** * Reads ADC channel once using AVCC as reference. **/ void Single_Measure0() { ADCDone=false; ADC10CTL0 &= ~ENC; // Disable ADC ADC10CTL0 = ADC10SHT_3 + ADC10ON + ADC10IE; // 16 clock ticks, ADC On, enable ADC interrupt ADC10CTL1 = ADC10SSEL_3 +CHANNEL; // Set 'chan', SMCLK __delay_cycles(1000); ADC10CTL0 |= ENC + ADC10SC; // Enable and start conversion _BIS_SR(CPUOFF + GIE); // sleep CPU // while(!ADCDone) // wait until done // ADCDone=false; } void TransmitInt(unsigned int val){ TXByte = val & 0x00FF; // Set lower byte Transmit(); // Send TXByte = (val >> 8); // Set upper byte TXByte = TXByte & 0x00FF; Transmit(); } /** * Transmits the value currently in TXByte. The function waits till it is * finished transmiting before it returns. **/ void Transmit() { TXByte |= 0x100; // Add stop bit to TXByte (which is logical 1) TXByte = TXByte BitCnt = 0xA; // Load Bit counter, 8 bits + ST/SP CCTL0 = OUT; // TXD Idle as Mark TACTL = TASSEL_2 + MC_2; // SMCLK, continuous mode CCR0 = TAR; // Initialize compare register CCR0 += Bit_time; // Set time till first bit CCTL0 = CCIS0 + OUTMOD0 + CCIE; // Set signal, intial value, enable interrupts while ( CCTL0 & CCIE ); // Wait for previous TX completion } /** * ADC interrupt routine. Pulls CPU out of sleep mode. **/ #pragma vector=ADC10_VECTOR __interrupt void ADC10_ISR (void) { ADCValue = ADC10MEM; // Saves measured value. // ADCDone = true; // Sets flag for main loop. __bic_SR_register_on_exit(CPUOFF); // Enable CPU so the main while loop continues } /** * Timer interrupt routine. This handles transmitting and receiving bytes. **/ #pragma vector=TIMERA0_VECTOR __interrupt void Timer_A (void) { CCR0 += Bit_time; // Add Offset to CCR0 if ( BitCnt == 0) // If all bits TXed { TACTL = TASSEL_2; // SMCLK, timer off (for power consumption) CCTL0 &= ~ CCIE ; // Disable interrupt } else { CCTL0 |= OUTMOD2; // Set TX bit to 0 if (TXByte & 0x01) CCTL0 &= ~ OUTMOD2; // If it should be 1, set it to 1 TXByte = TXByte >> 1; BitCnt --; } } // sleep for some time= 1/8^del sec // del=0 1sec, del=1 1/8sec del=2 1/64sec dl=3 1/492sec void delay(short del){ short s=0; if(del==1||del==3)s=WDTIS0; if(del>=2)s+=WDTIS1; WDTCTL = WDTPW + WDTHOLD + WDTCNTCL + WDTTMSEL + WDTSSEL ; // Watchdog stop, Timer auf "0", Counter-Mode, ACLK IE1 |= WDTIE; // Watchdog Interrupt Enable //WDTCTL = 0x5A3C ; // Watchdog Start WDTCTL = WDTPW+WDTTMSEL+WDTCNTCL+WDTSSEL+s / *WDTIS1+WDTIS0*/ ; // Passwd,NMI,Interval,Clear Cnt,SourceClk=ACLCK,Sel:00=Clk/32768 01=Clk/8192 10:Clk/512 11=Clk/64 _EINT(); // Interrupt enabled _BIS_SR(LPM1_bits + GIE); // put CPU to sleep } // delay interrupt routine, wakes up CPU #pragma vector=WDT_VECTOR __interrupt void WATCHDOG_ISR (void) // interrupt routine for delay { __bic_SR_register_on_exit(CPUOFF); // Enable CPU so the main while loop continues } // saves restart vector at FFFE // erease flash memory from FC00 to FFFF // restores restart vector at FFFE void ereaseflash(){ unsigned int resvec=*(unsigned int *)(0xFFFE);// save restart vector WDTCTL =WDTPW+WDTHOLD; //disable watchdog FCTL3 = FWKEY; // Lock = 0 A500 FCTL1 = 0xA502; // ERASE = 1 0xA502 FWKEY+ERASE *((unsigned int *)DAT0)=0; // erase Flash segment *((unsigned int *)DAT1)=0; // erase Flash segment // restore restart vector FCTL1=FWKEY+WRT; //Enable write *(int *)0xFFFE= resvec; //restore restart vector FCTL1 = FWKEY; /* disable erase and write */ FCTL3 = FWKEY+LOCK; /* set Lock = 1 */ } // writes data from buffer buf to flash memory void storedat(int buf[]){ // reprogram flash WDTCTL =WDTPW+WDTHOLD; //disable watchdog, NMIReset // FCTL2=FWKEY+FSSEL1+FN0; //SMCLK/2 FCTL3=FWKEY; //Clear LOCK FCTL1=FWKEY+WRT; //Enable write for(i=0;i FCTL1=FWKEY; //Done. Clear WRT FCTL3=FWKEY+LOCK; //Set LOCK } // trasmits content of flash memory void prflash(){ unsigned int *p=(unsigned int *)DAT0; while(p TransmitInt(*p++); } } // transmits content of buffer /* prbuf(int buf[]){ for(i=0;i TXByte = buf[i] & 0x00FF; // Set TXByte Transmit(); // Send TXByte = (buf[i] >> 8); // Set TXByte to the upper 8 bits TXByte = TXByte & 0x00FF; Transmit(); } } */
-
thanhtran reacted to oPossum in Volt/Amp/Watt meter
This is a simple voltage and current meter that uses the TI INA219 chip. Voltage measurement range is 0 to 26 volts with 4 mV resolution and current measurement range is -4 to +4 amps with 1 mV resolution (when using a 0.01 ohm shunt). The specs are inferior to a pair of quality multimeters, but it is a fraction of the price and shows wattage in addition to voltage and current. The Nokia 5110 display is used so the firmware could be enhanced to do simple graphing. Sending the measurements to a computer could also be done.
Using the INA219 makes for a very simple circuit.
The normal display is three lines with voltage, amperage and wattage.
Pressing the P1.3 switch will show the 6 registers in the INA219 in hex and signed decimal.
The code is written in C++ and uses templates for the LCD, IIC and INA219. Software SPI and IIC is used for maximum portability.
vam.zip
-
thanhtran reacted to oPossum in Volt/Amp/Watt meter
The accuracy is +/- 0.2% typical. That is similar to a low cost 3 1/2 digit DMM.
It alternates between current and voltage samples. It only has one ADC.
For 12 bit resolution it takes about 1 millisecond to sample both current and voltage, so about 1000 samples per second. The resolution can be adjusted down to 9 bits for an almost 10x increase in speed. It is also possible to average up to 128 samples.
Full details are in the spec sheet linked in the first post.