-
Content Count
618 -
Joined
-
Last visited
-
Days Won
81
Posts posted by Fmilburn
-
-
I think they may be referring to the attachment of an ISR in Energia: http://energia.nu/reference/attachinterrupt/
I believe Rei Vilo has posted an Energia library here on 43oh so do a search for that. I remember posting something for the F5529 using driverlib also.
-
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.
-
It is being declared both uint8_t and unsigned long - it should be one or the other. Maybe the GCC compiler accepts this and the TI does nor.
-
see above
-
The error says there is “multiple definition of ‘analog_reference’”. Find the occurrences and make sure it is defined only once is the short answer. If you do a search for “multiple definition of” on stack exchange or the like it will give examples of what can cause the error.
-
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...
-
This was quite a while back but it looks like readADC() is a function I wrote for Code Composer Studio - not for Energia. Use analogRead() for Energia. You only need to make the additions that Robert posted for Energia, or the ones I posted for CCS, if you are trying to get it to read the ADC quicker.
-
Hi @Lukman
what processor/LaunchPad are you using and what version of Energia? The above is for the F5529.
-
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.
-
Try the code in Arduino Playground: http://playground.arduino.cc/Main/MPU-6050#short
I had a quick look and the simple example reading raw values appeared to stick to Arduino and not use processor specific calls. Don't double post the same topic.
-
-
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.
-
HI @dubnet
It looks like you had fun with that
. 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.
-
There is some additional information on the IR project I did with 43oh member input here:
I started out in Energia and ended up writing everything in CCS for the final project.
-
You should not put slow executing code like a call to a function with cycle wasting loops inside an ISR. Flag the interrupt and handle it outside the ISR.
-
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.
-
I don't use Energia for the MSP432 so I don't know if you can - I am not sure it has a pins.h file. You can look in github and see what has been provided there, e.g. https://github.com/energia/Energia/tree/master/hardware/msp432/cores/msp432/driverlib
I imagine you could use #define and DriverLib to set something up.
-
-
-
Find the call to software serial that is in the library and replace it with a call to hardware serial. The Energia reference documentation is located here: http://energia.nu/reference/serial/
-
-
Hello @Anik96
The TM4C123G is an ARM processor and differs in both timers and registers from the MSP430 but read through chicken’s posts here:
He describes clearly how to do it but you will need to account for the difference in processors.
-
you need to create a new variant. Do a search on 43oh for “Energia variant”. See for example:
-
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.
attach interrupt rtc timer
in General
Posted
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.