Jump to content

leomar01

Members
  • Content Count

    42
  • Joined

  • Last visited


Reputation Activity

  1. Like
    leomar01 reacted to szhao in RC Car Made with LaunchPad Box   
    Since I am working on the Robotics Boosterpack with @@HylianSavior and @@jwp071, I decided to make a prototype with the box LaunchPad comes with. I've used Firmata to send command to LaunchPad. Check out my other post here. 
     


     
    A quick overview of what's inside.
    Hardware
    - G2 LaunchPad Box 
    - MSP430F5529LP
    - Fuel Tank Boosterpack
    - DRV8833 Motor Drive Control
    - HC-06 Bluetooth
    - Pololu Gear Motor
    - Caps, wires, breadboard
     
    Software
    - Firmata over serial (enabled by Bluetooth)
    - Energia Library on LP
    - NodeJS on PC
  2. Like
    leomar01 reacted to roadrunner84 in CCS + Grace + different build configurations   
    Uhm... yes... include two separate Grace configurations in your project. Alternatively, use a single Grace configuration and manually override it for the different configuration.
  3. Like
    leomar01 got a reaction from bluehash in Ringbuffer - how do I identify "crititcal" sections   
    Thanks @@zlalanne, actually he has a lot of fifo implementations, most of them are hard to understand to me, but here's one that's pretty close to mine: http://users.ece.utexas.edu/~valvano/arm/FIFO.c
     
    I think I'll leave my implementation like it is ... until I discover a new problem ;-)
     
    Leo
  4. Like
    leomar01 reacted to oPossum in SPI 4-Pin Mode and TX Interrupt won't work, in 3-Pin Mode it works   
    Yes, you have to use 3 wire mode and a normal IO pin to select your SPI slave device.
  5. Like
    leomar01 reacted to oPossum in SPI 4-Pin Mode and TX Interrupt won't work, in 3-Pin Mode it works   
    Make sure UCxSTE is the proper level to allow transmission. 4 pin mode is for multi-master operation and is very rarely used.
  6. Like
    leomar01 got a reaction from Rickta59 in MSP430G2955 to valueline DIP20 adapter   
    wouldn't it be advisable to make the traces at least 8mil? I think 10 mil could be achieved on nearly every part of the board.
  7. Like
    leomar01 got a reaction from Nytblade in Energy, Measurements and Calculation of different RF modules   
    Dear forum members,
     
    As a X-Mas gift for my dad, I want to build a wireless thermometer with four transmitters. He allready has something cheap, but it doesn't work so well over the ~30m distance from the garden to the living room. Therefore I want to build something accurate, long distance, "endless battery life" (the transmitter will end in some rubber enclosure, so it can withstand the weather - therefore, ideally it shouldn't be nescessary to change batteries for the next 10 years or so) and rssi readout to determine if the wireless connection is good.
    Ok, that's my goal.
     
    This weekend I've started to evaluate some of the wireless modules I have at hand. Since I'm a big victim of tideals, I have the eZ430-RF2500-SEH solar energy harvesting kit with three eZ430-RF2500 modules. On the other hand, I have two Anaren AIR booster packs.
    On the first try, with the stock firmware of these kits, I got way better range out of the anaren modules. These modules are quite cheap, so that's ok. But, as I want to have a very long battery life, power consumption must be checked.
     
    First, I want to discuss the eZ430-RF2500T module:
     
    Please have a look at page 13 in http://www.ti.com/lit/an/slaa378d/slaa378d.pdf
    I did the same measurement with my DS1052E and a 30 Ohm resistor (didn't have anything else at hand).
    My measurement looks like this:

    On the right side there's more, until the transmission ends:

     
    I calculate the current like follows:
    measured voltage on the scope divided by 30 (Ohms of my resistor)
     
    The capacity is beeing calculated by:
    current times measured time
     
    My measurement is as follows:
    1. 1,6ms , 20mV -> 0,67mA --> 1,072

  8. Like
    leomar01 got a reaction from pabigot in Energy, Measurements and Calculation of different RF modules   
    Dear forum members,
     
    As a X-Mas gift for my dad, I want to build a wireless thermometer with four transmitters. He allready has something cheap, but it doesn't work so well over the ~30m distance from the garden to the living room. Therefore I want to build something accurate, long distance, "endless battery life" (the transmitter will end in some rubber enclosure, so it can withstand the weather - therefore, ideally it shouldn't be nescessary to change batteries for the next 10 years or so) and rssi readout to determine if the wireless connection is good.
    Ok, that's my goal.
     
    This weekend I've started to evaluate some of the wireless modules I have at hand. Since I'm a big victim of tideals, I have the eZ430-RF2500-SEH solar energy harvesting kit with three eZ430-RF2500 modules. On the other hand, I have two Anaren AIR booster packs.
    On the first try, with the stock firmware of these kits, I got way better range out of the anaren modules. These modules are quite cheap, so that's ok. But, as I want to have a very long battery life, power consumption must be checked.
     
    First, I want to discuss the eZ430-RF2500T module:
     
    Please have a look at page 13 in http://www.ti.com/lit/an/slaa378d/slaa378d.pdf
    I did the same measurement with my DS1052E and a 30 Ohm resistor (didn't have anything else at hand).
    My measurement looks like this:

    On the right side there's more, until the transmission ends:

     
    I calculate the current like follows:
    measured voltage on the scope divided by 30 (Ohms of my resistor)
     
    The capacity is beeing calculated by:
    current times measured time
     
    My measurement is as follows:
    1. 1,6ms , 20mV -> 0,67mA --> 1,072

  9. Like
    leomar01 got a reaction from oPossum in Oscilloscope or logic analyser?   
    I'm relatively new to tinkering with electronics. Soon I felt like I would need an oscilloscope. I'm also still a student and thus, money is always a problem. My parents got me the above mentioned DS1052E from Rigol as a birthday gift (man I'm lucky). Not much time went by until I was sure I would also need a logic analyser. Of course I bought that very good Saleae Logic. Now (after 3 months) I can say that I should've bought the Logic first. I can check almost everything I need with the Logic. I really recommend you to buy the Logic first. Then, please do yourself that favour, save your money for a real o'scope like the DS1052E or better. Don't waste any more time on even thinking about something like the DPScope.
    I hope this helps
  10. Like
    leomar01 got a reaction from dannyboy in Oscilloscope or logic analyser?   
    I'm relatively new to tinkering with electronics. Soon I felt like I would need an oscilloscope. I'm also still a student and thus, money is always a problem. My parents got me the above mentioned DS1052E from Rigol as a birthday gift (man I'm lucky). Not much time went by until I was sure I would also need a logic analyser. Of course I bought that very good Saleae Logic. Now (after 3 months) I can say that I should've bought the Logic first. I can check almost everything I need with the Logic. I really recommend you to buy the Logic first. Then, please do yourself that favour, save your money for a real o'scope like the DS1052E or better. Don't waste any more time on even thinking about something like the DPScope.
    I hope this helps
  11. Like
    leomar01 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(;; }

  12. Like
    leomar01 reacted to single in Reading the ds18b20 temperature sensor   
    I've made a few tests, this code starts working good from 5Mhz. At lower frequencies readout unstable or impossible.
     
    BUT I find a way how to run this algorithm with DCO on 1 MHz. All you need is to rewrite the arduino-like part using defines instread of using functions. This is my code:
     

    //------------------------------------------------------------------------------ // Arduino like digitalRead, pinMode, and digitalWrite and some other helper functions. //------------------------------------------------------------------------------ #define LOW 0 #define HIGH 1 #define INPUT 0 #define OUTPUT 1 #define delayMicroseconds(n) __delay_cycles(1*n) #define delay(n) delayMicroseconds(1000u*n) #define digitalRead(Pin) (P1IN & 1 << Pin) >> Pin #define setOUTPUT(pin) P1DIR |= (1 << pin) #define setINPUT(pin) P1DIR &= (~(1 << pin)) #define pinMode(pin, out) set##out(pin) #define setHIGH(pin) P1OUT |= (1 << pin) #define setLOW(pin) P1OUT &=(~(1 << pin)) #define digitalWrite(pin, bit) set##bit(pin)
  13. Like
    leomar01 got a reaction from bluehash in UART TX on Port2.0 for bigger value line devices   
    After many hours of struggling with datasheets, reading code samples, getting grace to work, asking a lot in this forum and getting much help, I finally got the SW UART on Port2.0 working (TX only - for now).
    /*####################################### This is one more way of a software uart, but on port2.0 for the 20pdip MSP430s.
    I have used many parts from here and there, but most of this code is generated in grace
    and afterwards slightly modified to achieve the goal of a software uart on port2.0
     
    My MSP430G2553 runs on 16MHz, if you want to use an other clockspeed, you have to adjust the bittime
     
    for suggestions and complaints, please feel free to contact me on 43oh.com
    leomar01
     
    */
     
    #include
     
    void putstr(char *str); // transmit string
    void transmit(unsigned char ch); // transmit a character
    void setup(void); // function for setting up the device
     
     
    #define BITIME (13 * 16) // prescaler: 8 -> 2 MHz /(13*8*2) = 9600 bits/sec
     
    unsigned char bitCnt; // number of bits to transmit
    unsigned int txByte; // transmit buffer with start/stop bits
     
    void setup(void)
    {
    BCSCTL1 = CALBC1_16MHZ;
    DCOCTL = CALDCO_16MHZ;
     
    /* Port 2 Output Register */
    P2OUT = 0;
     
    /* Port 2 Port Select Register (see page 50 in datasheet -> port2.0 will be Timer1_A3.TA0) */
    P2SEL = BIT0;
     
    /* Port 2 Direction Register */
    P2DIR = BIT0;
     
    /* Port 2 Interrupt Edge Select Register */
    P2IES = 0;
     
    /* Port 2 Interrupt Flag Register */
    P2IFG = 0;
     
    /* Configure Timer1 (See Users Guide page 374) */
    TA1CCTL0 = CM_0 + CCIS_0 + OUTMOD_0 + CCIE + OUT;
    TA1CCR0 = 1200;
    /* users guide page 372 -> clock source: SMCLK, input divider: 8, mode control: continuous up to 0xFFFF */
    TA1CTL = TASSEL_2 + ID_3 + MC_2;
    __bis_SR_register(GIE); // enable GIE in status register
    }
     
    void putstr(char *str)
    {
    char *cp;
    for (cp = str; *cp != '\0'; cp++) {
    transmit(cp[0]);
    }
    }
     
    void transmit(unsigned char ch)
    {
    bitCnt = 0xA; // Load Bit counter, 8data + ST/SP
    txByte = (unsigned int)ch | 0x100; // Add mark stop bit to txByte
    txByte = txByte << 1; // Add space start bit
     
    TA1CCR0 = TA1R + BITIME; // Some time till first bit
    TA1CCTL0 = OUTMOD0 + CCIE; // TXD = mark = idle
    while (TA1CCTL0 & CCIE); // Wait for ISR to complete TX
    }
     
     
    void main(){
    WDTCTL = WDTPW|WDTHOLD; // Stop watchdog timer
    // Kalibrierdaten f
  14. Like
    leomar01 got a reaction from SirZusa in UART TX on Port2.0 for bigger value line devices   
    After many hours of struggling with datasheets, reading code samples, getting grace to work, asking a lot in this forum and getting much help, I finally got the SW UART on Port2.0 working (TX only - for now).
    /*####################################### This is one more way of a software uart, but on port2.0 for the 20pdip MSP430s.
    I have used many parts from here and there, but most of this code is generated in grace
    and afterwards slightly modified to achieve the goal of a software uart on port2.0
     
    My MSP430G2553 runs on 16MHz, if you want to use an other clockspeed, you have to adjust the bittime
     
    for suggestions and complaints, please feel free to contact me on 43oh.com
    leomar01
     
    */
     
    #include
     
    void putstr(char *str); // transmit string
    void transmit(unsigned char ch); // transmit a character
    void setup(void); // function for setting up the device
     
     
    #define BITIME (13 * 16) // prescaler: 8 -> 2 MHz /(13*8*2) = 9600 bits/sec
     
    unsigned char bitCnt; // number of bits to transmit
    unsigned int txByte; // transmit buffer with start/stop bits
     
    void setup(void)
    {
    BCSCTL1 = CALBC1_16MHZ;
    DCOCTL = CALDCO_16MHZ;
     
    /* Port 2 Output Register */
    P2OUT = 0;
     
    /* Port 2 Port Select Register (see page 50 in datasheet -> port2.0 will be Timer1_A3.TA0) */
    P2SEL = BIT0;
     
    /* Port 2 Direction Register */
    P2DIR = BIT0;
     
    /* Port 2 Interrupt Edge Select Register */
    P2IES = 0;
     
    /* Port 2 Interrupt Flag Register */
    P2IFG = 0;
     
    /* Configure Timer1 (See Users Guide page 374) */
    TA1CCTL0 = CM_0 + CCIS_0 + OUTMOD_0 + CCIE + OUT;
    TA1CCR0 = 1200;
    /* users guide page 372 -> clock source: SMCLK, input divider: 8, mode control: continuous up to 0xFFFF */
    TA1CTL = TASSEL_2 + ID_3 + MC_2;
    __bis_SR_register(GIE); // enable GIE in status register
    }
     
    void putstr(char *str)
    {
    char *cp;
    for (cp = str; *cp != '\0'; cp++) {
    transmit(cp[0]);
    }
    }
     
    void transmit(unsigned char ch)
    {
    bitCnt = 0xA; // Load Bit counter, 8data + ST/SP
    txByte = (unsigned int)ch | 0x100; // Add mark stop bit to txByte
    txByte = txByte << 1; // Add space start bit
     
    TA1CCR0 = TA1R + BITIME; // Some time till first bit
    TA1CCTL0 = OUTMOD0 + CCIE; // TXD = mark = idle
    while (TA1CCTL0 & CCIE); // Wait for ISR to complete TX
    }
     
     
    void main(){
    WDTCTL = WDTPW|WDTHOLD; // Stop watchdog timer
    // Kalibrierdaten f
  15. Like
    leomar01 reacted to gwdeveloper in eZ430-RF2500-SEH sample source code   
    Hello leomar01, if you're starting with CCS for the first time the workspace will be fresh. Make sure you are selecting 'C:\Texas Instruments\eZ430-RF2500-SEH_Sensor_Monitor-v1.5' workspace folder. After that, Import a New Project by selecting from the top menu 'Project > Import Existing CCS Project'. If you browse to 'C:\Texas Instruments\eZ430-RF2500-SEH_Sensor_Monitor-v1.5' and press ok, it will list the proper project to import.
    After that, you'll need to create new Linked Resource. This is also in that readme.txt file. From CCS's top menu 'Window > Preferences' then on the left column, 'General > Workspace > Linked Resources' create a new resource called DEV_ROOT and select the 'C:\Texas Instruments\eZ430-RF2500-SEH_Sensor_Monitor-v1.5\CCE_Source' folder. Press ok and you should be able to compile and debug.
     
    Also, there will not be a main.c file in the project. In the project, the 'Components' folder is the files needed for SimpliciTI (the wireless stack used in the application). The 'Peer Applications' folder contains 'SEH_AP_v1.5.c' (access point) and 'SEH_ED_v1.5.c' (end device). These contain your main functions and are selected based on the active build configuration. Simply right-click on the project's folder and under 'Active Build Configuration' you can select the access point or end device.
     
    [attachment=0]Capture430.JPG[/attachment]
  16. Like
    leomar01 reacted to bluehash in Change pin of software UART   
    Check your msp device header file.
  17. Like
    leomar01 reacted to SirZusa in Change pin of software UART   
    then have a look at the following part of your code - this is where the pin gets toggled (line 11 + line 13) - toggle pin 2.0 where it says // Set TX bit to 0
     
    you can also have a look at: http://320volt.com/wp-content/uploads/2 ... 400.c.html
    he has TX on the 1.5 - i can't test actually because i am not at home
     

    if(!isReceiving) { 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 --; } }
  18. Like
    leomar01 reacted to SirZusa in Change pin of software UART   
    ahh now i see ... you use the 2553 - then you dont need software UART! it has hardware UART onboard - but on the Pins 1.1 and 1.2 do you really need it on Port 2.0? Otherwise i would advice you to use the hardware UART - it is faster, more stable, needs less space - and at least easier to use
     
    for the msp430g2553:
    P1.1 = RX
    P1.2 = TX
    if you use UART over the launchpad you will have to switch the jumpers that connect your
×
×
  • Create New...