Jump to content
43oh

Rickta59

Members
  • Content Count

    1,135
  • Joined

  • Last visited

  • Days Won

    71

Reputation Activity

  1. Like
    Rickta59 got a reaction from yyrkoon in What is your Backup Process?   
    In the 37 years I've been writing code, I've only asked an admin to recover a file for me once.  Turns out that file was on a disk that was being backed up by a SCSI tape drive that had been having problems and of course all the tapes were bad. However, it is always easier to write code the second time  : )
     
  2. Like
    Rickta59 got a reaction from bluehash in CCS v7 and Energia, Cannot Debug or Run Code   
    You can hack your gel script:
    $ diff tm4c1294ncpdt.gel rk1294ncpdt.gel  127a128,132 > OnRestart() > { >     GEL_AdvancedReset("System Reset", 1); > } >  $ pwd /home/kimballr/ti/ccsv7/ccs_base/emulation/gel  
  3. Like
    Rickta59 got a reaction from Fmilburn in [Energia Library] Nordic nRF24L01+ library   
    the problem is the example code there @fmilburn ... move the #include <SPI.h> ahead of the include <Enrf24.h>
    ...
    #include <SPI.h>
    #include <Enrf24.h>
    #include <nRF24L01.h>
    Enrf24 radio(P2_0, P2_1, P2_2);  // CE, CSN, IRQ pins
    ...
  4. Like
    Rickta59 reacted to zeke in Implementing an I2C slave device.   
    I have done both of these tasks for more than one client.
    The 1-Wire protocol speed ends up being about 15kHz, which is slow but reliable. It's really cool to see on an scope though.
    I developed the I2C slave code using the sample TI code as the starting point.
    Here are the research materials that I referred to while writing my I2C code:
    http://www.nxp.com/documents/application_note/AN10216.pdf http://www.nxp.com/documents/user_manual/UM10204.pdf http://i2c.info/i2c-bus-specification http://www.ti.com/lit/an/slva704/slva704.pdf My slave code just follows the logic of the transaction.
  5. Like
    Rickta59 got a reaction from LiviuM in Hello from Bangalore   
    In the US April 1 is a good day to be ignored.
  6. Like
    Rickta59 reacted to tonyp12 in Basic MSP430 GPIO Macros   
    As all gio registers start with port and then OUT, IN, IE etc, example: P1OUT, with some macro word scrambling you can do this:
    #define read & // words for common gpio interaction #define clear &= ~ #define set |= #define toggle ^= #define Button1(y,x) (P1 ##x y BIT0) // PORT and PIN (ignore the ##x y) #define BlueLED(y,x) (P2 ##x y BIT5) To use them: BlueLED(set,DIR); BlueLED(clear,OUT); Button1(clear,DIR);                       // a input Button1(set,OUT);                         // pull-up resistor Button1(set,REN);                           Button1(set,IES);                         // falling edge button1(clear,IFG); Button1(set,IE);                           
  7. Like
    Rickta59 got a reaction from energia in Using Energia with MSP430G2231   
    Here is a version written with fabooh. https://github.com/RickKimball/fabooh
     

    /* * andyd273.cpp - simple fabooh msp430g2231 program to turn on a relay for 10 seconds * when the user button on the launchpad is pressed * * Created on: Feb 13th, 2017 * Author: kimballr * Pinout: * P1.3 is button on launchpad board * P1.6 is relay output (also lights led) */ #include <fabooh.h> #define SMALL_INIT4 /* don't initialize .bss and .data sections */ #include <main.h> #include <serial.h> namespace { const uint32_t BAUD_RATE=9600; typedef serial_default_t<BAUD_RATE, CPU::frequency, TX_PIN, NO_PIN> serial; serial Serial; } void setup() { PUSH2::set_mode(INPUT_PULLUP); P1_6::set_mode(OUTPUT); P1_6::low(); Serial.begin(); } void loop() { for (; { int n = 1; do (PUSH2::read()) ? --n : (n = 5000); while (n); do (PUSH2::read()) ? n = 5000 : --n; while (n); Serial << "turning on relay\r\n"; P1_6::high(); Serial << "wait 10 seconds\r\n"; delay(10000); Serial << "turning off relay\r\n"; P1_6::low(); } }   
    I've included a compiled version of this so you can just load it on the msp430g2231 launchpad.
    Use the mspdebug command to load it (Find mspdebug.exe someplace in the Energia install tree on your hard disk)
     
    C:\ mspdebug rf2500 "prog andyd273.hex"
     
    rename this file to andyd273.hex
    andyd273.txt
  8. Like
    Rickta59 got a reaction from AndyD273 in Using Energia with MSP430G2231   
    Here is a version written with fabooh. https://github.com/RickKimball/fabooh
     

    /* * andyd273.cpp - simple fabooh msp430g2231 program to turn on a relay for 10 seconds * when the user button on the launchpad is pressed * * Created on: Feb 13th, 2017 * Author: kimballr * Pinout: * P1.3 is button on launchpad board * P1.6 is relay output (also lights led) */ #include <fabooh.h> #define SMALL_INIT4 /* don't initialize .bss and .data sections */ #include <main.h> #include <serial.h> namespace { const uint32_t BAUD_RATE=9600; typedef serial_default_t<BAUD_RATE, CPU::frequency, TX_PIN, NO_PIN> serial; serial Serial; } void setup() { PUSH2::set_mode(INPUT_PULLUP); P1_6::set_mode(OUTPUT); P1_6::low(); Serial.begin(); } void loop() { for (; { int n = 1; do (PUSH2::read()) ? --n : (n = 5000); while (n); do (PUSH2::read()) ? n = 5000 : --n; while (n); Serial << "turning on relay\r\n"; P1_6::high(); Serial << "wait 10 seconds\r\n"; delay(10000); Serial << "turning off relay\r\n"; P1_6::low(); } }   
    I've included a compiled version of this so you can just load it on the msp430g2231 launchpad.
    Use the mspdebug command to load it (Find mspdebug.exe someplace in the Energia install tree on your hard disk)
     
    C:\ mspdebug rf2500 "prog andyd273.hex"
     
    rename this file to andyd273.hex
    andyd273.txt
  9. Like
    Rickta59 got a reaction from Fmilburn in Using Energia with MSP430G2231   
    Here is a version written with fabooh. https://github.com/RickKimball/fabooh
     

    /* * andyd273.cpp - simple fabooh msp430g2231 program to turn on a relay for 10 seconds * when the user button on the launchpad is pressed * * Created on: Feb 13th, 2017 * Author: kimballr * Pinout: * P1.3 is button on launchpad board * P1.6 is relay output (also lights led) */ #include <fabooh.h> #define SMALL_INIT4 /* don't initialize .bss and .data sections */ #include <main.h> #include <serial.h> namespace { const uint32_t BAUD_RATE=9600; typedef serial_default_t<BAUD_RATE, CPU::frequency, TX_PIN, NO_PIN> serial; serial Serial; } void setup() { PUSH2::set_mode(INPUT_PULLUP); P1_6::set_mode(OUTPUT); P1_6::low(); Serial.begin(); } void loop() { for (; { int n = 1; do (PUSH2::read()) ? --n : (n = 5000); while (n); do (PUSH2::read()) ? n = 5000 : --n; while (n); Serial << "turning on relay\r\n"; P1_6::high(); Serial << "wait 10 seconds\r\n"; delay(10000); Serial << "turning off relay\r\n"; P1_6::low(); } }   
    I've included a compiled version of this so you can just load it on the msp430g2231 launchpad.
    Use the mspdebug command to load it (Find mspdebug.exe someplace in the Energia install tree on your hard disk)
     
    C:\ mspdebug rf2500 "prog andyd273.hex"
     
    rename this file to andyd273.hex
    andyd273.txt
  10. Like
    Rickta59 got a reaction from dubnet in Using Energia with MSP430G2231   
    Here is a version written with fabooh. https://github.com/RickKimball/fabooh
     

    /* * andyd273.cpp - simple fabooh msp430g2231 program to turn on a relay for 10 seconds * when the user button on the launchpad is pressed * * Created on: Feb 13th, 2017 * Author: kimballr * Pinout: * P1.3 is button on launchpad board * P1.6 is relay output (also lights led) */ #include <fabooh.h> #define SMALL_INIT4 /* don't initialize .bss and .data sections */ #include <main.h> #include <serial.h> namespace { const uint32_t BAUD_RATE=9600; typedef serial_default_t<BAUD_RATE, CPU::frequency, TX_PIN, NO_PIN> serial; serial Serial; } void setup() { PUSH2::set_mode(INPUT_PULLUP); P1_6::set_mode(OUTPUT); P1_6::low(); Serial.begin(); } void loop() { for (; { int n = 1; do (PUSH2::read()) ? --n : (n = 5000); while (n); do (PUSH2::read()) ? n = 5000 : --n; while (n); Serial << "turning on relay\r\n"; P1_6::high(); Serial << "wait 10 seconds\r\n"; delay(10000); Serial << "turning off relay\r\n"; P1_6::low(); } }   
    I've included a compiled version of this so you can just load it on the msp430g2231 launchpad.
    Use the mspdebug command to load it (Find mspdebug.exe someplace in the Energia install tree on your hard disk)
     
    C:\ mspdebug rf2500 "prog andyd273.hex"
     
    rename this file to andyd273.hex
    andyd273.txt
  11. Like
    Rickta59 got a reaction from LiviuM in Energia vs CCS vs LearningCurve vs Ability to control things...   
    How are you combining the data? Strings (that uses heap RAM and is subject to fragmentation)? A large static buffer (that will reduce total RAM)?  You are using an msp430g2553 yes?  It only has 512bytes of RAM. People don't often notice that an Arduino chip has 2k of RAM and assume anything that fits on an arduino will run on an msp430g2553. If I had only one shot at a wild guess, I'd say you are running out of ram in either the stack or heap.  Blowing out RAM is very easy to do. Energia exacerbates memory and flash usage problems.
     
    -rick
  12. Like
    Rickta59 got a reaction from NurseBob in Energia vs CCS vs LearningCurve vs Ability to control things...   
    How are you combining the data? Strings (that uses heap RAM and is subject to fragmentation)? A large static buffer (that will reduce total RAM)?  You are using an msp430g2553 yes?  It only has 512bytes of RAM. People don't often notice that an Arduino chip has 2k of RAM and assume anything that fits on an arduino will run on an msp430g2553. If I had only one shot at a wild guess, I'd say you are running out of ram in either the stack or heap.  Blowing out RAM is very easy to do. Energia exacerbates memory and flash usage problems.
     
    -rick
  13. Like
    Rickta59 got a reaction from Rei Vilo in Alternative super small CRT for msp430-elf-gcc 4.9.1   
    So it turns out this is a waste of time ...
     
    using the -minrt flag provided to the link phase accomplishes the same thing ... discovered when I ran:
     
     $ msp430-elf-gcc --target-help
     
    -rick
     
    [Edit: Although, it is truly a min run-time. It does initialize .data section if you have some, but doesn't include the code to if you don't, same for the .bss values to zero]
  14. Like
    Rickta59 got a reaction from Fmilburn in MSP430 Infrared Controlled Wearable   
    @@Fmilburn, I'm not sure  you went back and looked at the older posts here, might be worth a look. Opossum did some nice posts about IR. He has a fondness for those TV B Gone things ...
     
    http://forum.43oh.com/topic/2254-pronto-ir-code-transmission/
     
    https://forums.adafruit.com/viewtopic.php?p=22714
     
    -rick
  15. Like
    Rickta59 got a reaction from dubnet in MSP430 Infrared Controlled Wearable   
    @@Fmilburn, I'm not sure  you went back and looked at the older posts here, might be worth a look. Opossum did some nice posts about IR. He has a fondness for those TV B Gone things ...
     
    http://forum.43oh.com/topic/2254-pronto-ir-code-transmission/
     
    https://forums.adafruit.com/viewtopic.php?p=22714
     
    -rick
  16. Like
    Rickta59 reacted to enl in Electronic Thermometer with analog meter   
    The board sockets on to the power header

    The 5-pin with the cable going to the right is for a button and double pole, center off momentary switch for adjusting the scale in operation. The software does linear interpolation from 0 to 100 degrees F, and allows for key points every 10 degrees. The three yellow wires go to the remote sensor (DS18B20). The mounting is leftover oak from redoing a floor. Glued up, planed, bored for the meter and the electronics, and finished to hang on the wall. The circuit board is mounted by putting epoxy in the pocket and dropping it in.
     
    Power board on. The tie point for the power line isn't on yet.

     
    The face of the finished display:

    The finish is shellac. I slopped on a heavy coat, light sanded, and then wiped another couple on. Then paste wax. Not perfect, but I banged it out quickly.
     
    The meter:

     
    Operating. The temp in my shop has climbed to 66F with a lot of help from the electric radiator.

     
     
  17. Like
    Rickta59 got a reaction from NurseBob in CCS Free   
    @@NurseBob, didn't you feel outraged when they started giving away CCS with the purchase of some launchpad boards back in September? You should have asked for a refund back then.
     
    What about the people who bought a launchpad to get the free CCS?  Don't they feel taken?  What about the people who got the double whammy? They bought a black msp432 so they could get a free CCS. Now they have a board with chips that has been deprecated, and the latest of version of CCS won't even work with that board. (Sorry I posted about $9.99 deal. I didn't know they were going to give it away 3 months later )
     
    Over the years I've spent small fortunes on various compilers and tools. Microsoft C in the 80's, and 90, and early 2000s.  I used to have a MSDN subscription that cost $2200 per year. Borland C++ was less expensive but still wasn't free. I'm sure none of you remember Centerline-C++ in the 90's, it eventually turned into the product called Rational Purify C++. It cost about $5000/seat in the 90s.  Add in the cost of many bounds check tools and many frameworks to make cross platform development easier and it all adds up to a lot of wasted money.  However, all these products were the cost of doing business.  I was making money so I had to spend money.
     
    I've never understood the idea of paying real money for a development tool for use with a hobby.  The sad thing, and I have no inside knowledge of this just a hunch, I'm sure if google or Disney gave any hint of wanting to use TI chips, I would be surprised if TI made google or Disney pay for a CCS license.  It is only the little guys who actually pay for a license and then they get ignored when they have issues because they don't represent a large revenue stream.
     
    Personally, I'm glad they are now providing CCS for free.  Even if you purchased CCS you didn't get any better support than those that were using the code size limited version.  At least the value of support matches the price of the product : )
     
    What I've observed with TI, if they are offering you a deal that sounds too good to be true, they are getting ready to obsolete that product.
     
    -rick
  18. Like
    Rickta59 reacted to jazz in Software async serial tx/rx without timer   
    Instead of breakpoint debugging I am using fast logging (http://forum.43oh.com/topic/2646-software-debugging-without-hardware-tools). On MSP430F5xx USB devices by adding one extra CDC (http://forum.43oh.com/topic/2972-sbw-msp430f550x-based-programmer/?p=25923) and on MSP430x2xx devices by hardware UART (http://forum.43oh.com/topic/2972-sbw-msp430f550x-based-programmer/?p=34398).
     
    Right now, working on project based on entry level MSP430x2xx devices without hardware UART, and don't like at all timer based soft UART. Code presented here is universal, with LP 9600 bps as target rate. It is too slow for debugging, and I'm not using LP locked to 9600 bps. Just removed from original code, part related to delay, and it is (almost) perfectly matched to 115200 bps with MSP430x2xx running on 1 MHz. And total code size (for UART TX) is close to nothing.
    #define DBGPDIR P1DIR #define DBGPOUT P1OUT #define DBGPBIT BIT2 ;-------------------------------------------------------------------- ; DbgInit ;-------------------------------------------------------------------- DbgInit bis.b #DBGPBIT, &DBGPDIR ; TX pin bis.b #DBGPBIT, &DBGPOUT ; TX High ret ;-------------------------------------------------------------------- ; DbgUartTX R15 -> Uart ;-------------------------------------------------------------------- DbgUartTX ; Byte R15 -> Uart ; 1000000 / 115200 = 8.681 9 CLK push.w R14 push.w R15 mov.w #DBGPBIT, R14 and.w #000FFh, R15 add.w #00300h, R15 ; Stop bit(s) jmp DbgUartTXLow ; Send start bit... DbgUartTXBit rra.w R15 ; 1 Get bit to tx, test for zero jc DbgUartTXHigh ; 2 If high... DbgUartTXLow bic.b R14, &DBGPOUT ; 4 Send zero bit jmp DbgUartTXBit ; 2 Next bit... DbgUartTXHigh bis.b R14, &DBGPOUT ; 4 Send one bit jnz DbgUartTXBit ; 2 If tx data is not zero, then more bits to send... pop.w R15 pop.w R14 ret
  19. Like
    Rickta59 reacted to JWoodrell in MSP430 how to make WS2811Driver reduce from 800 kHz to 400 kHz link inside   
    personally I use the SPI method exclusively for the smart LEDs  (WS2812B, and sk6812 recently)  one trick for getting the timing to cooperate is to set the SPI divider to get you close then you can change the rate of the MCLK registers to fine tune the timing.  it only has to be changed while the SPI is transmitting so you can change the clock back to normal "speed" after your done with the transmission.
  20. Like
    Rickta59 got a reaction from m0nk37 in MSP430 how to make WS2811Driver reduce from 800 kHz to 400 kHz link inside   
    do you mean ucs1903?
     
    https://www.google.com/url?sa=t&source=web&rct=j&url=http://www.bestlightingbuy.com/pdf/UCS1903%2520datasheet.pdf&ved=0ahUKEwjdwbLRhv_QAhWB4CYKHW1cAgYQFggaMAA&usg=AFQjCNHoYBl1ZT-VnoPdVKydzOUcP4lB8w
     
    If so, the timing on that is completely different 0.5us short pulse, 2.0us long pulse, 2.5us total cycle
     
    -rick
  21. Like
    Rickta59 got a reaction from LiviuM in CCS Free   
    @@NurseBob, didn't you feel outraged when they started giving away CCS with the purchase of some launchpad boards back in September? You should have asked for a refund back then.
     
    What about the people who bought a launchpad to get the free CCS?  Don't they feel taken?  What about the people who got the double whammy? They bought a black msp432 so they could get a free CCS. Now they have a board with chips that has been deprecated, and the latest of version of CCS won't even work with that board. (Sorry I posted about $9.99 deal. I didn't know they were going to give it away 3 months later )
     
    Over the years I've spent small fortunes on various compilers and tools. Microsoft C in the 80's, and 90, and early 2000s.  I used to have a MSDN subscription that cost $2200 per year. Borland C++ was less expensive but still wasn't free. I'm sure none of you remember Centerline-C++ in the 90's, it eventually turned into the product called Rational Purify C++. It cost about $5000/seat in the 90s.  Add in the cost of many bounds check tools and many frameworks to make cross platform development easier and it all adds up to a lot of wasted money.  However, all these products were the cost of doing business.  I was making money so I had to spend money.
     
    I've never understood the idea of paying real money for a development tool for use with a hobby.  The sad thing, and I have no inside knowledge of this just a hunch, I'm sure if google or Disney gave any hint of wanting to use TI chips, I would be surprised if TI made google or Disney pay for a CCS license.  It is only the little guys who actually pay for a license and then they get ignored when they have issues because they don't represent a large revenue stream.
     
    Personally, I'm glad they are now providing CCS for free.  Even if you purchased CCS you didn't get any better support than those that were using the code size limited version.  At least the value of support matches the price of the product : )
     
    What I've observed with TI, if they are offering you a deal that sounds too good to be true, they are getting ready to obsolete that product.
     
    -rick
  22. Like
    Rickta59 got a reaction from yyrkoon in More C versus C++   
    # best solution
    $ while true; do for sensor_file in /tmp/bus/w1/devices/28-*/w1_slave; do echo "scale=2; $(cat ${sensor_file} | grep  -E -o ".{0,0}t=.{0,5}" | cut -c 3- )/1000.0" | bc; done; sleep .5; done
  23. Like
    Rickta59 got a reaction from yyrkoon in More C versus C++   
    You are linux. Maybe you should just bash it:
    #!/bin/bash SENSOR_FILES=$(echo /sys/bus/w1/devices/28-*) while true; do for sensor in ${SENSOR_FILES}; do VALUE=$(sed -e 's/t=//' < $sensor); echo "scale=2; ${VALUE}/1000.0" | bc; done; sleep .2 done; -rick
  24. Like
    Rickta59 got a reaction from yyrkoon in More C versus C++   
    If the code you wrote above does what you want why do you want to be "c++ complete" ?
     
    The big advantage of boost is that it is cross platform and mostly made up of c++ templates except for the operating system stuff (which filesystem code is).  If you aren't planning on running this code on any other OS than linux then maybe it isn't worth your time.   Only you can decide what is time worthy.
     
    -rick
  25. Like
    Rickta59 got a reaction from yyrkoon in More C versus C++   
    The c++ way on a real os like linux would be to the boost library. It is all about iterators.
     
    http://www.boost.org/doc/libs/1_59_0/libs/filesystem/example/simple_ls.cpp
     
    -rick
×
×
  • Create New...