Jump to content

igor

Members
  • Content Count

    586
  • Joined

  • Last visited

  • Days Won

    6

Reputation Activity

  1. Like
    igor got a reaction from Rei Vilo in Some Misconceptions about Libraries   
    The thread linked below provides tips on porting libraries to energia.
     
    howto: porting libraries
  2. Like
    igor got a reaction from jpnorair in eLua for SAM3 (Arduino Due)   
    It is on github in my fork of eLua, in the branch named SAM.
    The direct link is.
    https://github.com/ecdr/elua/tree/SAM
     
    Most of the SAM specific adaptations are in the src/platform/sam34 directory.
    https://github.com/ecdr/elua/tree/SAM/src/platform/sam34
     
    If you haven't used git it takes a bit of learning, but is really nice when using/managing a large project.
    I haven't done much on this recently, but would welcome contributions to the branch.  (Would be nice to get it totally working
    and incorporate into the eLua main line.)
  3. Like
    igor got a reaction from jpnorair in eLua for SAM3 (Arduino Due)   
    I am porting eLua to the Atmel SAM3/4 processors, in particular the SAM3X8E used in the Arduino Due.
     
    Port is running, with support for the serial console and several devices.
     
    PIO - works UART - works, except for buffering (xmodem does not work on serial console).  Hardware flow control written, but not tested. USB CDC - works, except for buffering (although attached build does not use it). Timers - works PWM - works, but has some issues (sometimes the drivers return wrong values to eLua, but it does work).  Have not tested for accuracy of frequency or duty cycle.  So far just uses the hardware pwms, use of timers as PWM (e.g., so can use more pins for PWM) is in the works. spi - written, but not tested (if you try it out, let me know). rand (generate numbers at random) - works rtc - works (but not sure about using external crystal) i2c (twi) - not finished adc - not finished can - not finished cnt (counter) - not finished dac - not written  
    Source code available on github -
    https://github.com/ecdr/eluain the SAM branch To talk to the console, use the programming port on the Arduino Due Usual settings 115200 baud, N, 8, 1You may need to set your terminal program to send a CR and LF as end of line. You can program the attached bin file to an Arduino Due using the Arduino boot loader (bossac).e.g., if the programming port is connected as COM8 (on windows) bossac.exe -Ufalse -pCOM8 -e -w -v -b elua_lua_arduinodue.bin -R Thank you to Sergio at simplemachines.it For my eLua port for the Stellaris launchpad, see
    http://forum.stellarisiti.com/topic/552-elua-for-stellaris-launchpad
    elua_lua_arduinodue.zip
  4. Like
    igor got a reaction from energia in storing sesor output to internal memory   
    More particulars - what giving you problems, how long do you need to store, etc.
    (The quick answer is put the readings in an array - then they are stored.  But maybe you want to do something more than that.)
     
    www.catb.org/esr/faqs/smart-questions.html
  5. Like
    igor got a reaction from energia in storing sesor output to internal memory   
    More particulars - what giving you problems, how long do you need to store, etc.
    (The quick answer is put the readings in an array - then they are stored.  But maybe you want to do something more than that.)
     
    www.catb.org/esr/faqs/smart-questions.html
  6. Like
    igor got a reaction from greeeg in how would I create a delay in output going high?   
    The main thing to be kept short in an ISR is execution time.  Even the longest execution path in this ISR isn't long.
    3-4 compares, a similar number of assignments, maybe a computed jump.  Doesn't even have any procedure calls or loops.
  7. Like
    igor got a reaction from greeeg in how would I create a delay in output going high?   
    The main thing to be kept short in an ISR is execution time.  Even the longest execution path in this ISR isn't long.
    3-4 compares, a similar number of assignments, maybe a computed jump.  Doesn't even have any procedure calls or loops.
  8. Like
    igor got a reaction from umesh in required primary expression   
    Where did you make the function take a void argument? Need to do in function definition, just leave function name in call.
     

    void calibrate(void) { if(maxValue<threshold) maxValue=threshold; }
  9. Like
    igor got a reaction from tripwire in Flash memory can be damaged by writes? (and related things)   
    Keeping pointer in RAM would be good move if you could.
     
    If you can't, can you get away with not storing a pointer at all?
    When you need to add a reading, search for the the end of where readings already are - takes more time, and have to reserve one reading value to mean there is no reading, but don't have to store the pointer.  Using binary search should be able to find the end in order of log2(maximum number of samples).  (One of the examples below just used a simple linear search.)
     
    I have definitely seen a temperature logger for the MSP430 using flash a long time ago.
     
    This isn't the one I was thinking of, but similar concept.
    http://benlo.com/msp430/
     
    Here is another one - which seemed to be unavailable at the moment, so I went to an archived version:
    https://web.archive.org/web/20130923235655/http://hiwaay.net/~bzwilson/temp_recorder/
  10. Like
    igor got a reaction from tripwire in Flash memory can be damaged by writes? (and related things)   
    Keeping pointer in RAM would be good move if you could.
     
    If you can't, can you get away with not storing a pointer at all?
    When you need to add a reading, search for the the end of where readings already are - takes more time, and have to reserve one reading value to mean there is no reading, but don't have to store the pointer.  Using binary search should be able to find the end in order of log2(maximum number of samples).  (One of the examples below just used a simple linear search.)
     
    I have definitely seen a temperature logger for the MSP430 using flash a long time ago.
     
    This isn't the one I was thinking of, but similar concept.
    http://benlo.com/msp430/
     
    Here is another one - which seemed to be unavailable at the moment, so I went to an archived version:
    https://web.archive.org/web/20130923235655/http://hiwaay.net/~bzwilson/temp_recorder/
  11. Like
    igor got a reaction from Fmilburn in general guide on porting arduino libraries to energia   
    Many of the simpler changes mentioned in the howto thread can be handled automatically using macros, etc.
    More recent versions of Energia include some macros which handle some of the changes mentioned in the thread.
     
    Having standard, cross-platform libraries for some common functions (which are not currently abstracted) would help.  
    (i.e. create a common abstraction layer for functions which are currently handled on a device specific basis).
    For instance: a standard timer class.  I worked some on a cross-platform timer object which would work on MSP430, AVR, SAM, Tiva.
    (Based on DueTimer, TimerOne, etc.)
    But this would only help if it became widespread enough that the program writer happened to have used it.
    (Though I suppose it might help if there was a simple enough way of translating timer access idioms on a particular machine
    into uses of the standard library that it could be done automatically.)
     
    Given that there are now Arduino environments used for many different processors (x86, STM32, etc.) it would probably help to have a more general guide to porting code/writing Arduino code that is easy to adapt to many different processors/families.
    (Of course most writers of Arduino programs, being inexperienced, would probably not use it.  But it might help for those writing libraries.)
  12. Like
    igor got a reaction from tripwire in Newbie question on MSP432 FPU   
    Have you tried generating an assembler listing of the code produced by Energia, and looked through that to see what instructions are being generated?  It is a little convoluted to do (wish there was a switch/button for it in Energia).
     
    e.g.
    http://forum.43oh.com/topic/7485-assembler-listing/
  13. Like
    igor reacted to Rei Vilo in howto: porting libraries - some help needed   
    About Pin Naming
     
  14. Like
    igor got a reaction from tripwire in MSP432 toggle a bit using bit banding?   
    On the Tiva processors the I/O ports have a nice masking property - you can use part of the address as a mask so that only certain bits are accessed.  (e.g. if you write to a port at a certain offset from the ports base address, it will only change bits 1 and 2 of the port (for instance), and leave the rest alone).  Handy if you need to read or change multiple bits at once (and faster than doing one bit at a time).
     
    Don't know if the 432 has that feature, and only useful if you need to do more than one bit at once.
  15. Like
    igor reacted to bluehash in Posting a Library for Energia   
    Thanks @@igor. I've fixed @@Rei Vilo's first post with updated links.
  16. Like
    igor got a reaction from bluehash in howto: porting libraries - some help needed   
    Sharing and using libraries:
     
    Some Misconceptions about Libraries Posting a Library for Energia
  17. Like
    igor reacted to bluehash in Merged forums support thread   
    Fixed. I think the issue occurred for members with the same username, but a different email id.
    I looked up your points from the Stellaris database. It was 83. Your current points are 65. I've added them up to 148.
     
    Apologies for this. 
  18. Like
    igor got a reaction from bluehash in Merged forums support thread   
    Seems like reputation/likes from stellarisiti are not recorded/counted after merge.
     
    If memory serves I had just about reached the magic 100 reputation before the merge (at least if you count likes on
    43oh and Stellarisiti, don't remember specific numbers from either one).
     
    Now I have lost a bunch of those reputation points.
    It looks like my account from Stellarisiti ( igor1426459857 ) is getting its reputation reported as 0 -
    despite there being various liked posts on the merged board (e.g., http://forum.43oh.com/topic/7029-elua-for-stellaris-launchpad ).
     
    (Wouldn't matter much, except sometimes there are offers only available to those with a certain number of reputation points.)
     
    Thanks
  19. Like
    igor got a reaction from spirilis in [MNP] Think of your Neighbors   
    This reminds me of a sketch on the radio show "I'm Sorry I'll Read that Again."
     
    It dealt with warning messages being installed in various lamp posts to remind motorists of various conditions - 
    e.g. "Oy, One Way Street" 
     
    The final warning had a recording of all sorts of noises (symphony orchestra, crashing sounds, explosions, a chorus singing Gilbert and Sullivan)  which concluded with the sedate warning "shh, you engine is making too much noise."  
     
    So why go LED for the reminder, how about using a speaker.
  20. Like
    igor got a reaction from amine in How to change system clock frequency of tiva c launchpad using PLL on energia?   
    Depends on the chip family
     
    TM4C1294
     
    SysCtlClockFreqSet
     
    On other family
     
    SysCtlClockSet
     
    These are the library calls in ROM or Tivaware.  If you want to see how to do it directly, look at the source code for those library routines.
  21. Like
    igor got a reaction from amine in How to change system clock frequency of tiva c launchpad using PLL on energia?   
    Depends on the chip family
     
    TM4C1294
     
    SysCtlClockFreqSet
     
    On other family
     
    SysCtlClockSet
     
    These are the library calls in ROM or Tivaware.  If you want to see how to do it directly, look at the source code for those library routines.
  22. Like
    igor got a reaction from bluehash in Low power Geiger counter with MSP430G2553 (Last updated: May 07, 2015)   
    I take it the built-in sprintf doesn't handle floats?
    If want to do it without using floats - could do something like:
    unsigned long long count3 = 3 * counts; sprintf(string,"%lu", (unsigned long)(count3/100) ); myScreen.text(0,1,string); add code to print the decimal point in the right position sprintf(string,"%u", (unsigned) (count3 % 100)); print this in the appropriate location That is just the skeleton - would have to fill in the printing code (and conditionals to handle 0 fractional part, etc.)
  23. Like
    igor reacted to M-atthias in Forth for fresh MSP chips   
    Mecrisp is a native code Forth for MSP430 cores and Mecrisp-Stellaris runs on ARM Cortex M0, M3, M4. Forth is a programming language with two stacks and an extendable compiler which has been designed decades ago for controlling a radio telescope in astronomy and shows its strengths in microcontrollers, too. Its most interesting feature for embedded programming is that the compiler runs inside of the microcontroller and you basically chat with it over a serial terminal line or any other link you can imagine and implement. You can wiggle your wires manually, experiment with fresh peripherals and try every definition you wrote immediately. No need for the "change, assemble, flash and try" cycle. Great for hardware debugging !

    Here is "the" classic Forth primer if you wish to get an idea how language looks like: http://www.forth.com/starting-forthTraditionally, Forth has been implemented with a virtual machine, but both my compilers generate native machine code for speed.

    Matthias
     
  24. Like
    igor reacted to dubnet in Forth for fresh MSP chips   
    http://mecrisp.sourceforge.net/
  25. Like
    igor got a reaction from ghlawrence2000 in PROGMEM / pointers on CC3200 (SOLVED)   
    Don't know the answer off hand - have you tried breaking this line down
    PGM_P menu_pgm_ptr = (PGM_P)pgm_read_word(&(MAIN_MENU_LABELS[1])) (either in the debugger, or using printf's) to see what the value is at each stage on the respective platforms?
     
    i.e. 
    Serial.println((ulong)MAIN_MENU_LABELS[1]); Serial.println((ulong)&(MAIN_MENU_LABELS[1])); Serial.println((ulong)(PGM_P)pgm_read_word(&(MAIN_MENU_LABELS[1]))); Serial.println((ulong)main_menu_2); (Adding whatever modifiers/coersion to get the output to be the address, and probably want to make come out in hex).
     
    What do you get if you do
    strcpy_P(buf,main_menu_2); Serial.println(buf);
×