Jump to content
43oh

Fmilburn

Members
  • Content Count

    618
  • Joined

  • Last visited

  • Days Won

    81

Posts posted by Fmilburn

  1. I think that for the most part Energia maintains the same functions and API as found in Arduino which does not have a RTC interrupt listed in the base reference. And while it might be possible to add it to Energia, I don’t believe it has been done.  Nonetheless, the RTC can be accessed as mentioned above. I don’t use Energia much anymore but In the LaunchPads I have the crystal is active. If you really want control of such things however it is probably best to use CCS. 

  2. This may seem rough but you are not going to learn to code by asking questions like these and need to start figuring out some of this on your own.  You do not seem to have an understanding of the C/C++ languages.  I suggest getting a book or taking an online course.  Start with simpler problems if necessary but learn to solve problems yourself.

    RE:  code that does not compile - decide whether you want to have an uint8_t variable or an unsigned long variable and then declare it as such.  E.G. for unsigned long:

    unsigned long counter PLACE_IN_FRAM;

    Regarding your counter code above.  This appears to be something copied from somewhere and has code not necessary for what you are trying to do such as the unused variables fadeValue and NUM_READS.  You do not say why it doesn't work or what you have done to try and fix it.  This is not the kind of thing people will want to spend time on trying to help you figure out.  Break it into pieces you understand, test them until they work as you want, and then put it back together piece by piece testing as you go.

  3. Hi @ash12 and welcome to 43oh,

    If you are new to microcontrollers or familiar with Arduino you can try the Energia  site.  For example, here is the page on the TM4C123:  http://energia.nu/pin-maps/guide_tm4c123launchpad/

    If you want to use Code Composer Studio, there are examples in the Resource Explorer.  Download CCS at ti.com.

    If there are specific things that interest you then try a search here on 43oh or at ti.com.  Do a search for TM4C123 training and lots of things will pop up...

     

     

  4. slaa322c.pdf

     

    See slaa322c.pdf at TI.com.  Also look at the documentation for the LaunchPad to see how they did it.  There is more information in the datasheet and family users guide   

    If I remember correctly there is a firmware example in CCS on how to use the external oscillator.  Energia does it automatically.

     

  5. These processes can be quite complex and the control is very dependent on the system.  Autotune doesn't always work and hand tuning is sometimes necessary.  It is impossible to guess what the constants should be without knowledge of the system and possibly experimentation.  Read the background material in the link I have given above for a better idea of how PID works.  If I remember correctly there is a very good link to a method for hand tuning when autotune fails.

  6. HI @dubnet

    It looks like you had fun with that :smile:.  The code is easy to read and looks good to me.  You can try using a switch statement in the ISR - something like this:

    
    //-----------------------  G P I O _ P O R T 1 _ I S R  ------------------------
    
    #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
    
    #pragma vector=PORT1_VECTOR
    
    __interrupt
    
    #elif defined(__GNUC__)
    
    __attribute__((interrupt(PORT1_VECTOR)))
    
    #endif
    
    void GPIO_PORT1_ISR(void)
    
    {
    
        switch(P1IV)
    
        {
    
    		case  0: break;                              //no interrupt pending
    
    		case  2: break;                              //P1.0
    
    		case  4: break;                              //P1.1
    
    		case  6:                                     //P1.2
    
    			GPIO_toggleOutputOnPin(RED_LED);
    
    			break;
    
    		case  8:                                     //P1.3
    
    			GPIO_toggleOutputOnPin(GREEN_LED);
    
    			break;
    
    		case 10: break;                              //P1.4
    
    		case 12: break;                              //P1.5
    
    		case 14: break;                              //P1.6
    
    		case 16: break;                              //P1.7
    
    		default: break;                              //should not get here
    
        }
    
    }

    The TI examples in their MSP430 training videos use this approach.

  7. I don't know of a library for the TM4C123G but if you are willing to put some time into it then it should not be too hard to convert the one for the MSP430 or Arduino.  There is a good introductory write-up at Adafruit: https://learn.adafruit.com/ir-sensor/overview.

    I was able to use that information and other stuff on the web to figure it out and write my own code.  It helps a lot to have an oscilloscope, or perhaps even better a logic analyzer when working through it.

  8. Quote

    Thanks for raining on my parade :) Seriously, though, thank you for your input. One thing I should've mentioned is this is for pedagogical purposes, not for development.

    I think what you are doing is fine for pedagogical purposes and for that matter development.  I too have been frustrated at times by not knowing what is going on in Energia and the time it takes to hunt it down.  Nonetheless, I found it useful especially when starting out.  Note that when you use DriverLib it is possible to hover the cursor in CCS and see what is going on underneath.

×
×
  • Create New...