Jump to content

bluehash

Administrators
  • Content Count

    7,290
  • Joined

  • Last visited

  • Days Won

    193

Reputation Activity

  1. Like
    bluehash reacted to Peabody in G2553 BSL using BSLDEMO2?   
    I finally figured it out.  The special signalling pattern didn't work because DTR is inverted coming out of BSLDEMO2.  So that was never going to work.  But entering BSL cold start from an application gave errors because I used the +u switch in the command line.  It looked like that was the correct thing to do since I was indeed bypassing the signalling pattern, but for reasons I don't understand, when you use that switch the program doesn't send the password on all commands, in particular the ones I was trying to test with (read and verify).  But of course the G2553 was expecting a password for these commands, so I got an error.
    I've recompiled BSLDEMO2.exe from the source code provided by TI, but with the polarity of DTR reversed.  So it should all work now.  I've asked TI to publish a new version of BSLDEMO2 with DTR polarity the right way for use with the USB-to-serial adapters, but I doubt they will do that.  This is all "deprecated", so I doubt they will be willing to spend any effort or money fixing it.
     
     
     
  2. Like
    bluehash got a reaction from Medsimo in TIVA C, PWM mode   
    Quick calculation:
    Max system clock TivaC-1294: 120Mhz
    PWM divisors: /2,/4,/8,/16,/32,/64
    PWM bits: 16
    Min PWM frequency @120Mhz: 
    Slowest PWM clock : 120/64 = 1.875Mhz
    Max PWM load value = 65535(16-bit)
    Minimum PWM frequency = 65536/1875000 = 0.02495 seconds
    Inverse : 1/0.023495 = 28.6Hz.
    Max PWM frequency @120Mhz: 
    Fastest PWM clock : 120Mhz
    Min PWM load value = 2 - so that you can add 1 to the load value to get 50% duty.
    Maximum PWM frequency = 2/120000000 = 1.67e-8 seconds
    Inverse : 1/1.67e-8 = 60MHz.
  3. Like
    bluehash got a reaction from tripwire in FourThreeOh wins TI Community Highlight of the Year Award for 2016   
    Thanks @Rei Vilo.
    To all, the award goes to you too. Thanks for being wonderful members.
  4. Like
    bluehash reacted to hmjswt in External eeprom library   
    Hallo I am using this code for my 430G2553.
    /* LaunchPad EEPROM Author : Henk Siewert File : EEPROMTest Date : 27 september 2016 Version : 003 MCU : TI MSP430G2553 Memory : Microchip Language : Energia C++ Compiler : Energia 0101E0017 Systeem : Windows XP Pro SP3 Editor : NotePad++ WWW : http://www.swtcomp.com Pin 6 IC = SCL --> 9 LET OP! Nieuw in 17 Pin 5 IC = SDA --> 10 LET OP! Nieuw in 17 Pin 8 IC = VCC --> Vcc (3.3V) Pin 4 en 7 IC = GND --> GND 4,7K Pull up on pin 5 and 6 !!! Let op - Is jumper geplaatst? */ #include <Wire.h> // I2C library int disk1 = 0x50; // Address of EEPROM chip // 50 for Microchip 1,2,3 GND // 57 for Atmel 1,2,3 open #define memmax 32768 // Maximum memory: // 32768 for Microchip 24LC256 // 65536 for Microchip 24LC512 // 131072 for Microchip 24LC1026 // 4096 for Atmel 24C32 byte value = 133; // Value to write to EEPROM void setup(void) { Serial.begin(9600); // Start serial Wire.begin(); // Start I2C start(); // Start program } void start() { test(); } void test() // Write and read data to memory locations { for ( unsigned long address = 0; address < memmax; address++) { writeEEPROM(disk1, address, value); Serial.print( address ); Serial.print(" = "); Serial.print(readEEPROM(disk1, address)); Serial.println(" "); } } void writeEEPROM(int deviceaddress, unsigned long eeaddress, byte data ) { Wire.beginTransmission(deviceaddress); Wire.write((int)(eeaddress >> 8)); // MSB Wire.write((int)(eeaddress & 0xFF)); // LSB Wire.write(data); Wire.endTransmission(); delay(5); // Writing takes time } byte readEEPROM(int deviceaddress, unsigned long eeaddress ) { byte rdata; Wire.beginTransmission(deviceaddress); Wire.write((int)(eeaddress >> 8)); // MSB Wire.write((int)(eeaddress & 0xFF)); // LSB Wire.endTransmission(); Wire.requestFrom(deviceaddress,1); if (Wire.available()) rdata = Wire.read(); return rdata; } void loop() { // Not used }  
  5. Like
    bluehash reacted to Clavier in Sending data via USB to another USB   
    The G2553 chip itself does not have USB support. You can go through the LaunchPad's "application"/"backchannel" UART; you firmware then just needs to write/read the UART. You also need an application on the host PC to read from one COM port and write to another.
    But why use USB? Why can't you control the solenoid directly from the LaunchPad?
  6. Like
    bluehash reacted to JRDavisUF in driverlib crc32 problem   
    Thanks for the ideas.  Energia uses the WDT for other purposes, as such I didn't put it in my code.  However, I just stuck it in and that doesn't help.  I did try getting rid of the MAP_ stuff and that didn't help either.  I also noticed that the example defined the returned crc value as volatile, so I changed that, but it didn't help either.
    I missed the 1-clock cycle note.  As such, I changed my 1 microsecond delay to a 1 cycle delay and the code works fine.  I'm guessing that must be the issue. 
  7. Like
    bluehash reacted to nickds1 in driverlib crc32 problem   
    I highly doubt that this is an HW issue, though it's possible.... lets start with the code...
    Is the Watchdog timer still running? You've not stopped it (though I don't use Energia and don't know if it's stopped by default)..
    The code you provided is a bit messy, but is essentially the same as in the driverlib manual, and looks OK, except the WDT is on.
    As this seems to be a timing-sensitive issue, I'd start by stopping the WDT.
  8. Like
    bluehash reacted to chicken in driverlib crc32 problem   
    I wonder if there's some aggressive compiler optimization going on. The compiler wouldn't know what's happening inside the ROM functions and may put function calls out of order. Maybe worth a try to see if it works with straight calls to the driver lib (i.e. dropping the MAP_ prefix).
    PS: The reference manual says, that CRC result is available after 1 clock cycle. Also no mention of CRC issues in the errata.
  9. Like
    bluehash reacted to JRDavisUF in Using RTC_C alarm and WiFi at the same time   
    FWIW, I did figure out why my RTC clock accuracy was so bad.  By default, the RTC clock sources the internal 32k crystal, not the external LFXT as BCLK.  As such, to get it to work:
    1) Define frequency of LFXT to 32k:   MAP_CS_setExternalClockSourceFrequency(32768, 48000000); // LF, HF
    (why energia doesn't do this already, I don't know.  I see how starting it might consume power unnecessarily, but why not set the value atleast???)
    This step might not be needed, but since I wanted to query my clock speeds later, I added it.
    2) Turn on LFXT (I loop on this since it doesn't always take):  bool status = MAP_CS_startLFXTWithTimeout(CS_LFXT_DRIVE3, 10);
    3) Tell the RTC to use LFXT:  MAP_CS_initClockSignal(CS_BCLK,CS_LFXTCLK_SELECT,CS_CLOCK_DIVIDER_1);
    With my msp432 launchpad, this gives me about 5ppm  (testing every 15s for about 2 weeks).
    Hope this helps anyone else who might have had issues...
    jrd
    PS  Of course, you probably don't need to use the MAP_ versions...but I figured why not
    PPS  This is how I was getting my actual clock speeds...ie, why I added step 1.
        // Get the values
        uint32_t aclk   = MAP_CS_getACLK();
        uint32_t mclk   = MAP_CS_getMCLK();
        uint32_t smclk  = MAP_CS_getSMCLK();
        uint32_t hsmclk = MAP_CS_getHSMCLK();
        uint32_t bclk   = MAP_CS_getBCLK();
  10. Like
    bluehash reacted to nickds1 in Easy way to monitor peak stack usage...   
    Hi,
    I needed a way to see how much of my C++ stack was being consumed in my MSP application - the traditional way is to "poison" the stack with a known pattern, and then to see how much of it gets burnt away.
    So I wrote the following - hope folk find it useful:
    The following code allows you to simply do this and to check at any point how much of the pre-allocated stack was consumed during peak usage, i.e. how close your app got to the bottom of the stack, or indeed, whether it over-ran. The TI CCS documentation is completely wrong in the names it gives for the global symbols that define the size and start of the stack - needs to be updated,
    Stick this code (or similar) wherever you want to report on/check stack usage <smallest number of byes left free on the stack since initialisation>/<configured size of the stack>.
    #if defined(STACK_CHECK) std::printf( "Stack: %d/%d\n", stackMinFreeCount(), stackMaxSize() ); #endif and then, in your main code you need to poison the stack as early as possible and then define the reporting routines: // Define STACK_CHECK to include stack usage diagnostics #define STACK_CHECK #if defined(STACK_CHECK) #define STACK_INIT 0xBEEF // Pattern to use to initially poison the stack extern uint16_t _stack; // Start of stack (low address) uint16_t stackMinFreeCount(void); uint16_t stackMaxSize(void); #endif #if defined(__cplusplus) extern "C" { #endif #if defined(__TI_COMPILER_VERSION__) || \ defined(__GNUC__) int _system_pre_init( void ) #elif defined(__IAR_SYSTEMS_ICC__) int __low_level_init( void ) #endif { //... stuff... #if defined(STACK_CHECK) // // Poison the stack, word by word, with a defined pattern // // Note that _system_pre_init is the earliest that we can // do this and that it may not be possible in TI-RTOS // // When we call the __get_SP_register intrinsic (same on IAR & CCS), it will return the address // of the RET address for the caller of this routine. Make sure that we don't trash it!! // register uint16_t *stack = &_stack; // Address of lowest address in .stack section register uint16_t *stack_top = reinterpret_cast<uint16_t *>(__get_SP_register()); do { *stack++ = STACK_INIT; // Poison stack addresses } while (stack < stack_top); // Stop before top of stack to leave RET address #endif return 1; } #if defined(__cplusplus) } #endif #if defined(STACK_CHECK) /** * Check how deep the stack usage has been * * \return \c uint16_t Minimum number of bytes to bottom of stack */ extern uint16_t __STACK_END; // End of data extern uint16_t __STACK_SIZE; // Linker-set size of stack uint16_t stackMinFreeCount(void) { const uint16_t *stack = &_stack; uint16_t freeCount = 0; while (*stack == STACK_INIT && stack++ <= &__STACK_END) { freeCount++; } return freeCount << 1; } /** * Return size of C++ stack * * Set by the linker --stack_size option * * \return \c uint16_t Configued maximum size of the stack in bytes */ uint16_t stackMaxSize(void) { return static_cast<uint16_t>( _symval(&__STACK_SIZE) ); } #endif int main(void) { ... stuff #if defined(STACK_CHECK) std::printf( "Stack: %d/%d\n", stackMinFreeCount(), stackMaxSize() ); #endif ...stuff }  
  11. Like
    bluehash reacted to maximlee in Use of enum variables in .h and .c   
    Thank you.
    I am sorry for my late answer - I tried to change the code and compile it, but due to other errors couldn't do that. Anyway, I think that my problem was also related to code writing rather then enum mistakes: I was able today to compile the code.
    My lcd_send_string(* char) function was declared in a functions.h file as following:
    char *enum2str(enum IOchannel); #ifdef LCD void lcd_init(void); void lcd_send_string(char *s); #endif while LCD was defined in another definitions.h file:
    #define LCD LCD4 I had to comment #ifdef and #endif, and then everything compiled succesfully, including that function with enums: lcd_send_string(enum2str(haltIn)).
  12. Like
    bluehash reacted to mavro12345 in "Blinky" fails to compile   
    well, I had the same trouble. it was fixed by the following lines:
    sudo apt-get install libc6:i386 libx11-6:i386 libasound2:i386 libatk1.0-0:i386 libcairo2:i386 libcups2:i386 libdbus-glib-1-2:i386 libgconf-2-4:i386 libgdk-pixbuf2.0-0:i386 libgtk-3-0:i386 libice6:i386 libncurses5:i386 libsm6:i386 liborbit2:i386 libudev1:i386 libusb-0.1-4:i386 libstdc++6:i386 libxt6:i386 libxtst6:i386 libgnomeui-0:i386 libusb-1.0-0-dev:i386 libcanberra-gtk-module:i386
    and
    sudo ln -s /lib/i386-linux-gnu/libudev.so.1 /lib/libudev.so.0
    As the previous response, it ws related to the Code Composer Studio Installation, those lines are taken from
    http://mostlyanalog.blogspot.mx/2014/09/msp430arm-development-on-linux.html
  13. Like
    bluehash reacted to energia in Delayed start MSP430FR5969   
    Are you using Energia? If yes, then there is indeed a delay. This is due to the startup code figuring out what clock source to use for low power modes.
    Details can be found in enableXtal() in wiring.c.
    Robert
  14. Like
    bluehash reacted to Fmilburn in Trouble Energia 17 Windows 10 msp430g2   
    Hi @@osmanfish and welcome to 43oh,
     
    Irritating isn't it?  It can be caused by several things.  It can happen with the MSP430G2 and Energia if you are using serial print and close the serial monitor down while the sketch is printing.  This does not seem to happen with other LaunchPads.  Try unplugging the LaunchPad at the computer and then plug it back in.  You may have to try uploading one or more times to get it working again.  Also, avoid shutting down the serial window.  Flash (upload) the target chip without shutting the serial monitor.
     
    If this does not seem to be your problem then google "Could not find MSP-FET430UIF on specified COM port (error = 57)" and you will find a number of other possible causes.  Look on the TI e2e site.
  15. Like
    bluehash reacted to energia in Where do I find the Script that runs after clicking Upload   
    What you could do is build Energia from source. You can then change the upload command in https://github.com/energia/Energia/blob/master/app/src/processing/app/debug/MSP430Uploader.java.
  16. Like
    bluehash reacted to 89383836620029234943 in Hello from TX   
    I'll update my status. I downloaded Energia again with no change. However I was successful when I tried a different USB port.
    Looks like I can get going now!
  17. Like
    bluehash reacted to brelliott18 in I2C - MSP430 to MSP430 problems   
    SUCCESS !
    using Mods as above plus twi.c and twi.sw.c  from this link :-
    http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/p/529036/1924562#1924562
    plus adding :-
     
    Wire.setModule (0)  before Wire.begin() in Void Setup() in both Master and Slave :-
    I have managed to send two characters from the Master to turn off the Red Led in a loop on the Slave.
     BIG Thanks again to B@TTO.
    Wouldn't it be perhaps a good idea if these files were updated and placed in the Energia GitHub Repository ?  How is this process carried out ?
     
     
     
     
     
     
  18. Like
    bluehash got a reaction from dubnet in Atomo Modular Electronics System - Raspberry-pi   
    Cool concept to adding boards to the Raspberry Pi.
    Atomo is a complete system for building electronic things with four parts: Control, IO, Power, and Connector. 
    https://www.indiegogo.com/projects/atomo-modular-electronics-system-arduino--2#/
    https://youtu.be/0uOsLvB1of0
     
     
     
  19. Like
    bluehash reacted to zeke in Implementing an I2C slave device.   
    This is my approach to state machines. Your mileage may vary.
    Determine all of the sub-systems that you will want to service Commands, Controls and Inputs, User Interface, and Data Setup a system tick timer that fires its interrupt on a regular consistent basis. This system doesn't have to go into LPM4. If it does then periodically wake up the system and cycle through the software service loops then go back to sleep. Setup a series of service flags that are set during the interrupt service routine and cleared after being serviced: Flag(s) for Commands, Flag(s) for Controls and Inputs, Flag(s) for User Interface, and Flag(s) for Data Setup a variable that acts like the system timer odometer. Every Odometer == (DesiredInterval%ServiceFlag_n_now) set the ServiceFlag_n Decide how often you will service the other functional blocks of your code. For example, Update the 2x20 LCD display every one second, or Update the Serial Console every 250ms, or Retrieve the Temperature from a sensor every 15 minutes. Setup an Interrupt Service Routine to catch any characters coming into the Serial Port Buffer. Stuff them into the Input Ring Buffer Set a flag that there's something to service. In the main loop, scan all of the service flags to see if any are set. Call the servicing function for each set flag. Clear the service flag at the end of that process. Configure the program to repeat continuously until Kingdom Come.
    I've left out significant details about setting up all of the peripherals and general variables so don't forget to do that stuff.
    This is just the basic gist of my state machines on a bare metal level.
  20. Like
    bluehash reacted to cameron in Eagle Library for CC1310   
    @ykaradana I will upload an EAGLE library for the CC1310 here to help anyone who needs this in the future. Specifically, it is the 128RHB version, but obviously it will work with any of the RHB variations. Hope it helps you.
    Cameron
    CC1310F128RHB.lbr
  21. Like
    bluehash got a reaction from Fmilburn in Use of enum variables in .h and .c   
    Welcome to 43oh.
    lcd_send_string(enum2str(haltIn)); What is the "haltIn" type. Can you type type cast or initialize it to the enum.
    The below works for me. Try to use typedef, to avoid tping "enum IOChannel" everytime.
    typedef enum {V1 = 11, I1 = 101, V2 = 12, I2 = 102}IOchannel;
    char *enum2str(IOchannel enumVariable) {    switch(enumVariable)    {       case V1:         return "V1";       default:         return "I1";    } } /**  * Main program.  */ int main(void) {     IOchannel haltIn = V1;    enum2str(haltIn); }
     
  22. Like
    bluehash got a reaction from NurseBob in FourThreeOh wins TI Community Highlight of the Year Award for 2016   
    Thanks @Rei Vilo.
    To all, the award goes to you too. Thanks for being wonderful members.
  23. Like
    bluehash got a reaction from dubnet in 20170311 - Upgrade   
    More upgrades:
     PHP5.4 -> 5.6 Memcache support for forums. Added 12GB more to disc size.
  24. Like
    bluehash reacted to greeeg in GPS logger for a local Beagle club   
    This project was put on hold over the holidays. It's always a busy time, plus the club doesn't hold meets over summer.
    But I have just completed another 10 units. More of the same, but thought you guys might enjoy some more photos.





     
    I couldn't get the same batteries as the last batch, which were 650mAh, these have much smaller 220mAh. But this still provides about 4 hours of run time.
    The uBlox GPS modules are a huge improvement. Even without the SAW filter in the RF path and the sub-optimal PCB size compared to the antenna. These find more GPS satellites faster than the G.top modules, plus they also use glonass which doubles the visible satellites.
     
     
  25. Like
    bluehash got a reaction from Barcooler in MSP430 analog clock   
    Came across this while browsing.
    MSP430 Analog Gauge Clock

     
     
×
×
  • Create New...