
Antscran
-
Content Count
47 -
Joined
-
Last visited
-
Days Won
6
Reputation Activity
-
Antscran got a reaction from Adnan in Energy harvesting
Hi Adnan,
I have made a few energy harvesting circuits now and usually use Linear Technology IC's, they offer a good range of options. TI also do a range of devices as well as do other manufacturers, but I am less familiar with these.
You need to use a boost or similar topology (Sepic) if you want to have the system running when the solar cell is below the loads running voltage. Unsure of the power output of your solar cell, but this will determine the charging speed of your supercapacitor at any given irradiance level and load requirements. I have not used the voltage range that you require, but the LTC3105 should fit your requirements. The circuit calculations are easy enough and the datasheet walks you through everything you need.
Hope this is of some use,
Ant
-
Antscran got a reaction from semicolo in Code composer Studion Graphing Tool Tutorial
Hi all,
Just made a tutorial both written and video on how to use the graphing tool built into Code Composer Studio. I meant to do this awhile back just not had the time until now, hope it proves of some use.
http://coder-tronics.com/code-composer-studio-graphing-tool-tutorial/
https://youtu.be/-iGnh0_9YxE
Cheers,
Ant
-
Antscran got a reaction from rampadc in Code composer Studion Graphing Tool Tutorial
Hi all,
Just made a tutorial both written and video on how to use the graphing tool built into Code Composer Studio. I meant to do this awhile back just not had the time until now, hope it proves of some use.
http://coder-tronics.com/code-composer-studio-graphing-tool-tutorial/
https://youtu.be/-iGnh0_9YxE
Cheers,
Ant
-
Antscran got a reaction from Fred in Code composer Studion Graphing Tool Tutorial
Hi all,
Just made a tutorial both written and video on how to use the graphing tool built into Code Composer Studio. I meant to do this awhile back just not had the time until now, hope it proves of some use.
http://coder-tronics.com/code-composer-studio-graphing-tool-tutorial/
https://youtu.be/-iGnh0_9YxE
Cheers,
Ant
-
Antscran got a reaction from RobG in Code composer Studion Graphing Tool Tutorial
Hi all,
Just made a tutorial both written and video on how to use the graphing tool built into Code Composer Studio. I meant to do this awhile back just not had the time until now, hope it proves of some use.
http://coder-tronics.com/code-composer-studio-graphing-tool-tutorial/
https://youtu.be/-iGnh0_9YxE
Cheers,
Ant
-
Antscran got a reaction from veryalive in Code composer Studion Graphing Tool Tutorial
Hi all,
Just made a tutorial both written and video on how to use the graphing tool built into Code Composer Studio. I meant to do this awhile back just not had the time until now, hope it proves of some use.
http://coder-tronics.com/code-composer-studio-graphing-tool-tutorial/
https://youtu.be/-iGnh0_9YxE
Cheers,
Ant
-
Antscran got a reaction from tripwire in Code composer Studion Graphing Tool Tutorial
Hi all,
Just made a tutorial both written and video on how to use the graphing tool built into Code Composer Studio. I meant to do this awhile back just not had the time until now, hope it proves of some use.
http://coder-tronics.com/code-composer-studio-graphing-tool-tutorial/
https://youtu.be/-iGnh0_9YxE
Cheers,
Ant
-
Antscran got a reaction from chicken in Code composer Studion Graphing Tool Tutorial
Hi all,
Just made a tutorial both written and video on how to use the graphing tool built into Code Composer Studio. I meant to do this awhile back just not had the time until now, hope it proves of some use.
http://coder-tronics.com/code-composer-studio-graphing-tool-tutorial/
https://youtu.be/-iGnh0_9YxE
Cheers,
Ant
-
Antscran got a reaction from zeke in Code composer Studion Graphing Tool Tutorial
Hi all,
Just made a tutorial both written and video on how to use the graphing tool built into Code Composer Studio. I meant to do this awhile back just not had the time until now, hope it proves of some use.
http://coder-tronics.com/code-composer-studio-graphing-tool-tutorial/
https://youtu.be/-iGnh0_9YxE
Cheers,
Ant
-
Antscran got a reaction from bluehash in Code composer Studion Graphing Tool Tutorial
Hi all,
Just made a tutorial both written and video on how to use the graphing tool built into Code Composer Studio. I meant to do this awhile back just not had the time until now, hope it proves of some use.
http://coder-tronics.com/code-composer-studio-graphing-tool-tutorial/
https://youtu.be/-iGnh0_9YxE
Cheers,
Ant
-
Antscran got a reaction from Fmilburn in Code composer Studion Graphing Tool Tutorial
Hi all,
Just made a tutorial both written and video on how to use the graphing tool built into Code Composer Studio. I meant to do this awhile back just not had the time until now, hope it proves of some use.
http://coder-tronics.com/code-composer-studio-graphing-tool-tutorial/
https://youtu.be/-iGnh0_9YxE
Cheers,
Ant
-
Antscran reacted to oPossum in Tiny printf() - C version
This is a tiny printf() function that can be used with the chips that come with the Launchpad. Code size is about 640 bytes with CCS.
There are 7 format specifiers:
%c - Character
%s - String
%i - signed Integer (16 bit)
%u - Unsigned integer (16 bit)
%l - signed Long (32 bit)
%n - uNsigned loNg (32 bit)
%x - heXadecimal (16 bit)
Field width, floating point and other standard printf() features are not supported.
printf() code
#include "msp430g2231.h" #include "stdarg.h" void putc(unsigned); void puts(char *); static const unsigned long dv[] = { // 4294967296 // 32 bit unsigned max 1000000000, // +0 100000000, // +1 10000000, // +2 1000000, // +3 100000, // +4 // 65535 // 16 bit unsigned max 10000, // +5 1000, // +6 100, // +7 10, // +8 1, // +9 }; static void xtoa(unsigned long x, const unsigned long *dp) { char c; unsigned long d; if(x) { while(x < *dp) ++dp; do { d = *dp++; c = '0'; while(x >= d) ++c, x -= d; putc(c); } while(!(d & 1)); } else putc('0'); } static void puth(unsigned n) { static const char hex[16] = { '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}; putc(hex[n & 15]); } void printf(char *format, ...) { char c; int i; long n; va_list a; va_start(a, format); while(c = *format++) { if(c == '%') { switch(c = *format++) { case 's': // String puts(va_arg(a, char*)); break; case 'c': // Char putc(va_arg(a, char)); break; case 'i': // 16 bit Integer case 'u': // 16 bit Unsigned i = va_arg(a, int); if(c == 'i' && i < 0) i = -i, putc('-'); xtoa((unsigned)i, dv + 5); break; case 'l': // 32 bit Long case 'n': // 32 bit uNsigned loNg n = va_arg(a, long); if(c == 'l' && n < 0) n = -n, putc('-'); xtoa((unsigned long)n, dv); break; case 'x': // 16 bit heXadecimal i = va_arg(a, int); puth(i >> 12); puth(i >> 8); puth(i >> 4); puth(i); break; case 0: return; default: goto bad_fmt; } } else bad_fmt: putc(c); } va_end(a); }
test code
#include "msp430g2231.h" void serial_setup(unsigned out_mask, unsigned in_mask, unsigned duration); void printf(char *, ...); void main(void) { char *s; char c; int i; unsigned u; long int l; long unsigned n; unsigned x; // Disable watchdog WDTCTL = WDTPW + WDTHOLD; // Use 1 MHz DCO factory calibration DCOCTL = 0; BCSCTL1 = CALBC1_1MHZ; DCOCTL = CALDCO_1MHZ; // Setup the serial port // Serial out: P1.1 (BIT1) // Serial in: P1.2 (BIT2) // Bit rate: 9600 (CPU freq / bit rate) serial_setup(BIT1, BIT2, 1000000 / 9600); printf("%s", "\r\n*** printf() test ***\r\n"); s = "test"; c = 'X'; i = -12345; u = 12345; l = -1234567890; n = 1234567890; x = 0xABCD; printf("String %s\r\n", s); printf("Char %c\r\n", c); printf("Integer %i\r\n", i); printf("Unsigned %u\r\n", u); printf("Long %l\r\n", l); printf("uNsigned loNg %n\r\n", n); printf("heX %x\r\n", x); printf("multiple args %s %c %i %u %l %n %x\r\n", s, c, i, u, l, n, x); printf("\r\n*** Done ***\r\n"); for(;; }
-
Antscran reacted to oPossum in MSP430G Launchpad Frequency Counter
The itoa() function probably takes a signed integer. On the MSP430 that has a range of -32768 to +32767. You need something that takes an unsigned integer that has a range of 0 to 65535 to get beyond the 32767 limit. The next step would be using unsigned long to go all the way to 4,294,967,295.
A general purpose unsigned / unsigned long to ascii conversion can be found here:
http://forum.43oh.com/topic/1289-tiny-printf-c-version/
Here is a frequency counter that uses unsigned long to go up to 16 Mhz:
http://forum.43oh.com/topic/1913-frequency-counter-using-launchpad-nokia-5110-lcd/
-
Antscran got a reaction from RobG in MSP430G Launchpad Frequency Counter
Hi all,
After bit of help. I was inspired by this MSP430F550x frequency meter Jazz made and thought I would code one from scratch, different from the one I posted in the that original thread http://forum.43oh.com/topic/3317-msp430f550x-based-frequency-meter/
The one I made works fine but I am having an issue displaying above ~32kHz on the LCD, I know the variable Freq that holds the frequency is correct as viewed this in debug mode. So it must be my implementation of the itoa function or possibly a casting issue?....this is where my C skills are a bit sketchy!
The video shows the frequency counter in operation and it uses an early iteration of RobG's EduKit BoosterPack. It doesn't show what happens above 30kHz, however a negative value is displayed or one which is completely incorrect.
https://www.youtube.com/watch?v=Ene1dIvGBBo
The itoa function is attached as well but I doubt this is at fault, not one I have coded but I have used it before successfully.
#include "msp430.h" #include "edukit.h" #include "itoa.h" /*** Constants ***/ const int NumberSamples = 4; /*** Global variables ***/ volatile unsigned int CounterValue = 0; volatile unsigned int StoredCount = 0; volatile unsigned int Result = 0; unsigned int Freq = 0; unsigned int SampleTuneTime = 58950; /*** Function prototype ***/ void calc_freq(); void main(void) { /*** System Set-Up ***/ WDTCTL = WDTPW + WDTHOLD; // disable WDT initMSP430(); // init MSP430's clock BCSCTL3 |= LFXT1S_2; // VLO mode _delay_cycles(16000000); // wait for LCD to reset setUpSPIforLCD(SPI2, CA, DA); // set up LCD's SPI initLCD(); // init LCD clearScreen(COLOR_BLACK); /*** GPIO Set-Up ***/ P2DIR &= ~BIT0; // P2.0 set as input P2SEL |= BIT0; // P2.0 set to primary peripheral Timer1_A P1DIR |= BIT4; // Set P1.4 as output P1SEL |= BIT4; // Output SMCLK to P1.4 /*** Timer Set-Up ***/ TA0CCR0 = SampleTuneTime; // 2MHz = 500nS therefore 60000 = 30mS sample time TA0CCTL0 |= CCIE; // Interrupt enable TA0CTL |= TASSEL_2 + ID_3; // SMCLK, /8 TA1CCTL0 |= CCIE + CCIS_0 + CM_1 + CAP; // Interrupt enable, capture select CCIxA, Positive edge, capture mode TA1CTL |= TASSEL_2; // SMCLK /*** Set-up LCD text ***/ setColor(COLOR_GREEN); drawString(10, 5, FONT_LG_BKG, "Frequency"); drawString(25, 25, FONT_LG_BKG, "Counter"); setColor(COLOR_BLUE); drawString(110, 85, FONT_MD, "Hz"); _bis_SR_register(GIE); // Enter LPM0 w/ interrupt while (1) { TA1CTL |= MC1; // Start timer TA0CTL |= MC0; // Start timer while (CounterValue != NumberSamples); // Wait while CounterValue is not equal to 4 TA0CTL &= ~MC0; // Stop timer TA1CTL &= ~MC1; // Stop timer Result >>= 2; // Divide Result by 4 calc_freq(); unsigned char buffer[8]; int toLCD = Freq; //int counter = 0; int Base = 10; itoa(toLCD, buffer, Base); char array[8] = { 0, }; setColor(COLOR_BLACK); drawString(17, 80, FONT_LG_BKG, "888888"); setColor(COLOR_ORANGE_RED); //int2ASCII(Result, array, 0); drawString(5, 80, FONT_LG_BKG, buffer); _delay_cycles(1600000); // delay 100mS until next screen refresh Result = 0; // Zero Result CounterValue = 0; // Zero CounterValue StoredCount = 0; // Zero StoredCount TA0R = 0; // Zero Timer_A0 register TA1R = 0; // Zero Timer_A1 register } } //Timer_A0 TACCR0 Interrupt Vector Handler Routine #pragma vector=TIMER0_A0_VECTOR __interrupt void Timer0_A0(void) { TA0CTL &= ~MC0; // Stop timer TA1CTL &= ~MC1; // Stop timer CounterValue++; // Increment CounterValue if (CounterValue >= (NumberSamples +1)) // Reset values if NumberSamples +1 is reached { CounterValue = 0; // Zero CountValue StoredCount = 0; // Zero StoredCount } Result += StoredCount; // Store accumulated count in Result StoredCount = 0; // Zero StoredCount TA1CTL |= MC1; // Start timer TA0CTL |= MC0; // Start timer } //Timer_A1 TACCR0 Interrupt Vector Handler Routine #pragma vector=TIMER1_A0_VECTOR __interrupt void Timer1_A0(void) { StoredCount++; // Increment StoredCount } void calc_freq() { float SampTime = 0.03; // 30mS sample time Freq = Result / SampTime; // Divide the averaged sampled result by the sample time to gain the frequency } Cheers,
Ant
-
Antscran reacted to jazz in MSP430F550x based frequency meter
Timer TA0 is used for counting SMCLK (24 MHz) and TA1 for input signal, both with owerflow to registers. TA0 is aranged as 400 * 60000 = 24000000. When TA0 is finished (1 second), result is in stored in R11 TA1 without need for any number calculation/conversion.
Part of source:
TimerA0 inc.w R10 reti TimerA1 inc.w R11 reti Main ; Timer TA1 is set by default bis.b #BIT6, &P1SEL mov.w #CCIE, &TA1CCTL0 ; interrupt enabled ; Timer TA0 SMCLK/1 mov.w #TASSEL_2, &TA0CTL ; clock source SMCLK mov.w #CCIE, &TA0CCTL0 ; interrupt enabled mov.w #060000, &TA0CCR0 Measure mov.w #0, R10 mov.w #0, R11 clr.w &TA0R ; clear timer counter clr.w &TA1R ; clear timer counter bis.w #MC0, &TA0CTL ; start timer bis.w #MC1, &TA1CTL ; start timer Wait cmp.w #000400, R10 jne Wait bic.w #MC0, &TA0CTL ; stop timer bic.w #MC1, &TA1CTL ; stop timer ; R10 TA0 = 400 * 60000 = 24000000 ; R11 TA1 = Result
For Win32, CDC driver description is from TI USB Dev Pack: 1CDC_descTool.zip
-
Antscran reacted to roadrunner84 in MSP430F550x based frequency meter
For those of you who rather play with C than assembler, a translation as true to the ASM as possible:
__interrupt TimerA0_ISR(void) // Note that the implementation of an ISR is compiler dependent { ++R10; } __interrupt TimerA1_ISR(void) // Note that the implementation of an ISR is compiler dependent { ++R11; } void main(void) { // Timer TA1 is set by default P1SEL |= BIT6; TA1CCTL0 = CCIE; // interrupt enabled // Timer TA0 SMCLK/1 TA0CTL = TASSEL_2; // clock source SMCLK TA0CCTL0 = CCIE; // interrupt enabled TA0CCR0 = 60000; //Measure R10 = 0; R11 = 0; TA0R = 0; // clear timer counter TA1R = 0; // clear timer counter TA0CTL |= MC0; // start timer TA1CTL |= MC1; // start timer while(R10 != 400); // Wait TA0CTL &= ~MC0; // stop timer TA1CTL &= ~MC1; // stop timer // R10 TA0 = 400 * 60000 = 24000000 // R11 TA1 = Result } -
Antscran got a reaction from bluehash in MSP430F550x based frequency meter
I was playing around with the timers in the MSP430G2553 as making a frequency counter test, I don't have a function generator at home so was trying to generate a PWM and then also capture and count it...still working on this and not sure it's possible!
However I found this post useful and modified the code a little bit to run on the MSP430G2553, I have only tested it on a 1kHz test signal from my oscilloscope but seems to work and read 1009Hz consistently. Posted the code below so someone else might find it useful.
#include <msp430g2553.h> /*** Global variables ***/ volatile unsigned int CounterValue = 0; volatile unsigned int StoredCount = 0; unsigned int Result = 0; int main(void) { /*** Watchdog timer and clock Set-Up ***/ WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer BCSCTL1 = CALBC1_8MHZ; // Set range DCOCTL = CALDCO_8MHZ; // Set DCO step + modulation /*** GPIO Set-Up ***/ P2DIR &= ~BIT0; // P2.0 set as input P2SEL |= BIT0; // P2.0 set to primary peripheral Timer1_A /*** Timer_A Set-Up ***/ TA0CCR0 = 20000; // 20000*400 = 8000000 or 8MHz TA0CCTL0 |= CCIE; // Interrupt enable TA0CTL |= TASSEL_2; // SMCLK TA1CCTL0 |= CCIE + CCIS_0 + CM_2 + CAP; // Interrupt enable, capture select CCIxA, Positive edge, capture mode TA1CTL |= TASSEL_2; // SMCLK _BIS_SR(GIE); // Enter LPM0 with interrupts enabled while(1) { TA0CTL |= MC0; // Start timer TA1CTL |= MC1; // Start timer while(CounterValue != 400); // Wait while CounterValue is not equal to 400 TA0CTL &= ~MC0; // Stop timer TA1CTL &= ~MC1; // Stop timer Result = StoredCount; // Store frequency in Result CounterValue = 0; // Zero CounterValue StoredCount = 0; // Zero StoredCount TA0R = 0; // Zero Timer_A0 register TA1R = 0; // Zero Timer_A1 register } } //Timer_A0 TACCR0 Interrupt Vector Handler Routine #pragma vector=TIMER0_A0_VECTOR __interrupt void Timer0_A0(void) { CounterValue++; } //Timer_A1 TACCR0 Interrupt Vector Handler Routine #pragma vector=TIMER1_A0_VECTOR __interrupt void Timer1_A0(void) { StoredCount++; } -
Antscran got a reaction from chicken in MSP430F550x based frequency meter
I was playing around with the timers in the MSP430G2553 as making a frequency counter test, I don't have a function generator at home so was trying to generate a PWM and then also capture and count it...still working on this and not sure it's possible!
However I found this post useful and modified the code a little bit to run on the MSP430G2553, I have only tested it on a 1kHz test signal from my oscilloscope but seems to work and read 1009Hz consistently. Posted the code below so someone else might find it useful.
#include <msp430g2553.h> /*** Global variables ***/ volatile unsigned int CounterValue = 0; volatile unsigned int StoredCount = 0; unsigned int Result = 0; int main(void) { /*** Watchdog timer and clock Set-Up ***/ WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer BCSCTL1 = CALBC1_8MHZ; // Set range DCOCTL = CALDCO_8MHZ; // Set DCO step + modulation /*** GPIO Set-Up ***/ P2DIR &= ~BIT0; // P2.0 set as input P2SEL |= BIT0; // P2.0 set to primary peripheral Timer1_A /*** Timer_A Set-Up ***/ TA0CCR0 = 20000; // 20000*400 = 8000000 or 8MHz TA0CCTL0 |= CCIE; // Interrupt enable TA0CTL |= TASSEL_2; // SMCLK TA1CCTL0 |= CCIE + CCIS_0 + CM_2 + CAP; // Interrupt enable, capture select CCIxA, Positive edge, capture mode TA1CTL |= TASSEL_2; // SMCLK _BIS_SR(GIE); // Enter LPM0 with interrupts enabled while(1) { TA0CTL |= MC0; // Start timer TA1CTL |= MC1; // Start timer while(CounterValue != 400); // Wait while CounterValue is not equal to 400 TA0CTL &= ~MC0; // Stop timer TA1CTL &= ~MC1; // Stop timer Result = StoredCount; // Store frequency in Result CounterValue = 0; // Zero CounterValue StoredCount = 0; // Zero StoredCount TA0R = 0; // Zero Timer_A0 register TA1R = 0; // Zero Timer_A1 register } } //Timer_A0 TACCR0 Interrupt Vector Handler Routine #pragma vector=TIMER0_A0_VECTOR __interrupt void Timer0_A0(void) { CounterValue++; } //Timer_A1 TACCR0 Interrupt Vector Handler Routine #pragma vector=TIMER1_A0_VECTOR __interrupt void Timer1_A0(void) { StoredCount++; } -
Antscran got a reaction from bluehash in MSP430 voice control over bluetooth
Hi all,
I was playing around with the MSP430G2553 and the UART at the weekend, then remembered I had a cheap HC06 bluetooth module. The result being a basic Android app that you can control your launchpad using voice control, it's far from polished but a bit of fun all the same
Project tutorial. C code and Android App http://coder-tronics.com/msp430-voice-control-over-bluetooth/
Video demonstration https://www.youtube.com/watch?v=8Z5ixK30Ddc
Cheers,
Ant
-
Antscran got a reaction from Automate in MSP430 voice control over bluetooth
Hi all,
I was playing around with the MSP430G2553 and the UART at the weekend, then remembered I had a cheap HC06 bluetooth module. The result being a basic Android app that you can control your launchpad using voice control, it's far from polished but a bit of fun all the same
Project tutorial. C code and Android App http://coder-tronics.com/msp430-voice-control-over-bluetooth/
Video demonstration https://www.youtube.com/watch?v=8Z5ixK30Ddc
Cheers,
Ant
-
Antscran got a reaction from yosh in MSP430 voice control over bluetooth
Hi all,
I was playing around with the MSP430G2553 and the UART at the weekend, then remembered I had a cheap HC06 bluetooth module. The result being a basic Android app that you can control your launchpad using voice control, it's far from polished but a bit of fun all the same
Project tutorial. C code and Android App http://coder-tronics.com/msp430-voice-control-over-bluetooth/
Video demonstration https://www.youtube.com/watch?v=8Z5ixK30Ddc
Cheers,
Ant
-
Antscran got a reaction from cde in MSP430 voice control over bluetooth
Hi all,
I was playing around with the MSP430G2553 and the UART at the weekend, then remembered I had a cheap HC06 bluetooth module. The result being a basic Android app that you can control your launchpad using voice control, it's far from polished but a bit of fun all the same
Project tutorial. C code and Android App http://coder-tronics.com/msp430-voice-control-over-bluetooth/
Video demonstration https://www.youtube.com/watch?v=8Z5ixK30Ddc
Cheers,
Ant
-
Antscran got a reaction from Fred in MSP430 voice control over bluetooth
Hi all,
I was playing around with the MSP430G2553 and the UART at the weekend, then remembered I had a cheap HC06 bluetooth module. The result being a basic Android app that you can control your launchpad using voice control, it's far from polished but a bit of fun all the same
Project tutorial. C code and Android App http://coder-tronics.com/msp430-voice-control-over-bluetooth/
Video demonstration https://www.youtube.com/watch?v=8Z5ixK30Ddc
Cheers,
Ant
-
Antscran got a reaction from reaper7 in MSP430 voice control over bluetooth
Hi all,
I was playing around with the MSP430G2553 and the UART at the weekend, then remembered I had a cheap HC06 bluetooth module. The result being a basic Android app that you can control your launchpad using voice control, it's far from polished but a bit of fun all the same
Project tutorial. C code and Android App http://coder-tronics.com/msp430-voice-control-over-bluetooth/
Video demonstration https://www.youtube.com/watch?v=8Z5ixK30Ddc
Cheers,
Ant
-
Antscran got a reaction from adrianF in MSP430 voice control over bluetooth
Hi all,
I was playing around with the MSP430G2553 and the UART at the weekend, then remembered I had a cheap HC06 bluetooth module. The result being a basic Android app that you can control your launchpad using voice control, it's far from polished but a bit of fun all the same
Project tutorial. C code and Android App http://coder-tronics.com/msp430-voice-control-over-bluetooth/
Video demonstration https://www.youtube.com/watch?v=8Z5ixK30Ddc
Cheers,
Ant