Jump to content
Forum sending old emails Read more... ×


  • Content Count

  • Joined

  • Last visited

  • Days Won


mgh last won the day on July 26 2018

mgh had the most liked content!

About mgh

  • Rank

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

330 profile views
  1. I think the second serial device is just called Serial1 instead of Serial. It is used the same way.
  2. mgh

    Add MSP432 support to Arduino?

    Wow! Thank you Rick, thank you @energia! I'll try some of these this weekend.
  3. mgh

    Add MSP432 support to Arduino?

    But I don't care about that multitasking - does anyone know if it would work otherwise? Yes, I know the black MSP432 has been abandoned, but I'm not going to throw away perfectly good hardware. Thanks for the response!
  4. Does anyone know if MSP432 (black) can be added to the standard Arduino setup? The reason: I've got an Adafruit Feather M0+ board working with Arduino, so the ARM Cortex-M compiler is "already there". I'm hoping maybe I could remove Energia (since I don't need the '430 support). If I add the JSON board file for the black MSP432 launch-pad, will the Arduino IDE get everything it needs to play with the MSP432? https://energia.nu/packages/package_msp432_black_index.json Also, is there a JSON file for the Tiva TM4C123 launch-pad? (same reason, have a Tiva, want to move everything over to one IDE). Thanks!
  5. I just installed Energia 1.8.7E21 on macos 10.12.6. From the Finder, the Energia version number is a little goofy. It shows "${version}" instead of the actual text. This is seen in the "Info.plist" file, and can be fixed there. ... <key>CFBundleShortVersionString</key> <string>${version}</string> <key>CFBundleVersion</key> <string>1.8.7</string> ...
  6. mgh

    Error during download

    I don't know that any of these ideas will help, it's just what I looked at when I tried to see what the problem might be. When you first start the Boards Manager, do you see the message "Downloading platforms index..."? It gets the small file http://www.energia.nu/pacakges/package_index.json . If you can see that, then it's talking to the package server OK. I've got a slow dial-up connection, so it sits there long enough for me to read it (and wait a little, too!). If you have a fast connection then it might blip past in an instant. It's interesting that it wants to get a 1.0.2 release, when there's a 1.0.3 release up on the site. Have you made any changes in Preferences / Network? If so, could they be blocking something?
  7. mgh

    What is your Backup Process?

    Mac OS X: TimeMachine and SuperDuper!. Every few days I plug in the external USB drive, and TimeMachine does its thing (backing up the files that changed). When that's done, I use SuperDuper! to make an image backup to a different partition on that same external drive. Once a month I plug in a different external drive (a WD My Passport Ultra) and clone the main drive to one of three partitions on the external - it's round-robin so I've got three monthly snapshots, plus TimeMachine, plus the other backup. I also have an old FireWire drive that gets an occasional copy of the main drive. I should store them in different locations, but they're all in the same room. For your case, I think TimeMachine could have helped, especially if, unlike my setup, you let it backup to a drive that's always connected - you would have had all the versions at your fingertips. One more tip: always, always verify that the backups are good -- boot from them if they're supposed to be bootable. This is something that I'm lazy at, and I know one of these days it's going to bite me.
  8. mgh

    How to start with TIVA C lauchPad

    I have TivaWare SW-EK-TM4C123GXL- unpacked on my system. I know there are more recent versions. It includes a 'doc' directory with many PDFs, like SW-TM4C-EXAMPLES-UG- which is the TivaWare Examples User Guide. The examples themselves are under "examples/peripherals/" There are many sample projects under the "examples/boards/ek-tm4c123gxl" directory, too. It takes awhile to get used to where everything is and how it works, but it's not difficult.
  9. mgh

    Fast sqrt() for 16-bit integers

    It shouldn't be too hard to tweak the TivaWare isqrt.c to use a 'word' instead of a 'long' - change the types to uint16_t, run the loop 8 times instead of 16, shift by 14 instead of 30 (I think that's right). As always, write a test program on the host to prove the algorithm before it goes onto the micro. Also, the third C example on this page might help: http://www.codecodex.com/wiki/Calculate_an_integer_square_root You'll pick the uint16 settings. Finally, a google search of "Integer Square Roots Jack Crenshaw" turns up lots of pages... some of which suggest that converting to float, using the FP, and converting back can be faster than the loops in these approximations. I haven't measured with the Tiva, so I don't know if this is true. Seems like it might... three instructions + the FP sqrt time? (you mentioned Stellaris, so I'm guessing Cortex M4F processor). Well, here's my attempt at my first comment - the TivaWare isqrt for 16bits instead of 32. /* * 16-bit integer square root * derived from TivaWare isqrt.c */ unsigned short isqrt(unsigned short value) { int i; unsigned short rem, root; rem = 0; root = 0; // loop over the eight bits in the root for ( i = 0; i < 8; i++ ) { // shift the root up by one bit root <<= 1; // move next two bits from the input into the remainder rem = ((rem << 2) + (value >> 14)); value <<= 2; // test root is (2n + 1) root++; if ( root <= rem ) { // root not more than the remainder, so the new bit is one rem -= root; root++; } else { // root is greater than the remainder, so the new bit is zero root--; } } return (root >> 1); } #ifdef TEST #include <stdio.h> #include <stdlib.h> int main(int ac, char *av[]) { int i; unsigned short n, r; for ( i = 1; i < ac; i++ ) { n = strtoul(av[i], NULL, 0); r = isqrt(n); printf("%-8s %8d %8d\n", av[i], n, r); } return 0; } #endif And the output of a test run: $ ./iq 10 20 30 40 50 60 70 80 90 100 1024 2048 4096 8192 16384 32768 10 10 3 20 20 4 30 30 5 40 40 6 50 50 7 60 60 7 70 70 8 80 80 8 90 90 9 100 100 10 1024 1024 32 2048 2048 45 4096 4096 64 8192 8192 90 16384 16384 128 32768 32768 181 Have fun! [Edit 1/1/2017 to fix incorrect comment in the code. Tsk!]
  10. You have separate routines: void tfr_bfobyte(byte data) void tfr_byte(byte data) And sendFrequency() calls tfr_byte(), but sendBfo() also calls tfr_byte() at one place. I don't know if that's a problem or not. My apologies for the noise if I'm off-base. (Sometimes I have to print the code out on paper and spread it out in front of me, to see what's actually going on.)
  11. mgh

    Logic Analyzers

    I'm late to this party, but here's two other suggestions: Ika-logic has a 4-channel semi-kit for 39 euros: https://www.ikalogic.com/scanalogic-2-edu-kit-2/ Mattair-Tech has a multi-tool for 23USD: https://www.mattairtech.com/index.php/development-boards/zeptoprog-ii.html No affiliation with either company, but I do have a very nice ATxmega128a3u board from MattairTech, and I wish I had the ScanaLogic device.
  12. mgh

    MSP432 Serial settings

    I'd be tempted to call the Energia Serial.setup() (or whatever), and then adjust the hardware registers for stop-bits and parity behind its back. Dirty, I know. There is an option to enable logging of the full build process ("Show verbose output during..."), so you should be able to find the Makefile and library locations from that. All the compilers and tools you need are included with Energia - that build log will show you the paths. Hmmm, interesting. LM4F has "HardwareSerial" files, but MSP432 has nothing. Edit: 05jul2016 - Arduino has "Serial.begin(speed, config)" where config is like SERIAL_8N1. Maybe this has been added to the latest Energia beta?
  13. mgh

    Errors compiling in Energia

    The errors are pretty much what they say they are - sinewave.cpp.elf section `.bss' will not fit in region `ram' - something is too big to fit in RAM. region `ram' overflowed by 1114 bytes - and that is how much it is too big. This is your bits array: int bits[100][8]={}; How much space does that take up? One 'int' is maybe 32-bits (yes?), so that's 4 bytes for one entry. Multiply by 800, to get 3200 bytes total. Find out what processor you are using and look-up how much RAM it actually has. Maybe only 2K? EDIT: I forgot to tell you how to fix this! SImply change the type from 'int' to 'char' or 'byte'. Instead of storing a single bit in a 32-bit value, we'll store it in a 8-bit value. This is still quite wasteful, but that should reduce the memory usage by a factor of 4. Also, there might be a problem in the three tests like this one: else if((sina[i]/16) > 1/2) That "1/2" is converted to "0" by the compiler. It is not a floating-point computation. Also, aren't all of your "sina[]" tests basically the same thing? I haven't thought deeply about this, but it seems to me that if "X/2 > 4", then "X/4 > 2" will also hold, and the same with "X/8 >1", and so on down the line. Finally, you say that 'sina' is a number from 0 to 8. OK, then dividing by anything bigger than 8 will give you zero. This is integer arithmetic, not floating-point. PS: the code that creates "sina" and builds "bits" can be moved out of "loop" and into "setup". You don't even need the "sin" array, actually. Good luck!
  14. mgh

    WDTCTL not working with MSP432?

    (I had an answer here which I thought was helpful, but I was mistaken, so ... I'll look around to see how to delete my comment. Sorry for messing up your topic.) In the meantime, this is the driverlib routine, which suggests you're doing the right thing. void WDT_A_holdTimer(void) { //Set Hold bit uint8_t newWDTStatus = (WDT_A->rCTL.r | WDTHOLD); WDT_A->rCTL.r = WDTPW + newWDTStatus; }