This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Displaying raw capacitive sensor measurements Stellaris LM4F120

Other Parts Discussed in Thread: SM470R1B1M-HT

 

Hello,

I would first like to state that I am extremely new to the Stellaris LM4F120 and programming in general.

The below wiki states that I should be able to alter the cap touch program so that the UART will display the raw values.  They offer the following code but give no clue as to where in the program in should be placed.  Everywhere I place this code I get either an undefined error, or expecting an expression error.

http://processors.wiki.ti.com/index.php/Stellaris_LM4F120_LaunchPad_Capsence_calibration

UARTprintf("Sensor Calibration: \n");

    while(1)
    {
        //
        // Take raw capacitance measurements from each of the elements on the
        // capsense booster-pack.
        //
        TI_CAPT_Raw(&g_sSensorWheel, ulWheelCapValues);
        TI_CAPT_Raw(&g_sMiddleButton, ulMiddleValue);

        //
        // Print the measurements to the UART in the following order:
        //
        // Up, Right, Down, Left, Center
        //
        for(ulIndex = 0; ulIndex < 4; ulIndex++)
        {
            UARTprintf("%4d ", ulWheelCapValues[ulIndex]);
        }

        UARTprintf("%4d ", ulMiddleValue[0]);
    
        //
        // Write over the previous values in the next iteration.
        //
        UARTprintf("\r");
    }

Also I would like to ask if there is an Capacitive Touch Software Library Programmers Guide that has been written for the Stellaris LM4F120.  The one that is referenced through the wiki is for the MSP430, and appears to me that the way the capacitive touch is done between the two is completely different.

Any help that anyone can provide is greatly appreciated!

Lou

  • Does anyone have any suggests?

  • Feel your pain...

    These are complex and demanding MCUs - instant gratification not really, "in the cards."  Your goal is proper - but unlikely to be achieved w/out serious preparation & effort on your part.

    Suggest that you better familiarize yourself w/your MCU - there are many videos and code examples - most benefit from actively running these codes - and trying to understand their inner workings.

    There is also a 1400+ page MCU datasheet and the wonderful SW-DRL-UG (StellarisWare User Guide)  Both will add much to your understanding.

    Task you've set is unlikely until you've invested such time/effort...

  • Interesting and philosophical.  I understand that there are no shortcuts on the road to success.  The ARM Cortex M4 is not the processor that my company will be using in our final design.  We need the high temperature capabilities of the SM470R1B1M-HT based on the ARM7TDMI.  Therefore I do not need to know all the ins and outs of the Stellaris, just enough to demonstrate proof of concept.

    The Development board, by IAR, for the SM470R1B1M-HT is not available until the end of January, so I figured I would use the Stellaris to brush up on my C++ skills.  Apparently one forgets a lot since the eight years that the class was taken.

    I am merely using the program provided and trying to insert the code provided from the wiki, to display the values per the tutorial.  The "Getting Started with the Stellaris® EK-LM4F120XL LaunchPad Workshop" labs were laid out quite nicely and I learned a lot from them.  I just do not understand with the wiki could not be as helpful as those labs.

    From what I can find all the Cap Touch / Cap Sense / Cap Boost documentation is geared toward the MSP430.  This does very little to help me because the Stellaris functions, pins, etc are different from the MSP430 and I have no familiarity with either of them.

    If the solution is obivous then please forgive my ignorance.  There is a lot that I am attemping to brush up on, however getting these capacitiance values to display would go a long way towards showing management that this concept is the right path.

    Any help is greatly appreciated!

    Very Best Regards,

    Lou

  • Detail, crafting of your response drives me toward your cause.  Unfortunately - work group/I've done w/Cap-Sense used dedicated ICs from Cypress - along w/ARM MCU - also early ARM7TDMI.

    As I recall - you must configure the MCU for both GPIO output and input - so that the Cap-Sense charge/discharge times can be measured.  I'm unclear as to why you can't, "prove concept" - using the, "geared toward, MSP430."  Unstated is your reason for moving from MSP to Stellaris.

    If Stellaris must be made to work - my sense is you need to study and determine what functions/capabilities are harnessed from the MSP code examples.  (likely GPIO inputs & outputs, Timers, maybe simple PWM, and ADCs)  If you can get your arms around that - you can return here for specific assistance to implement the needed functions/capabilities - via Stellaris. 

    As the ARM field is broad - perhaps other ARM vendors have kits and documentation which will aid - focusing on your requirement. 

    Cap Sense intrigued our group due to its ability to enable our "printing" of such a switch(s) on the rear of our panel overlay - surely not the most (or any) "tactile" - but substantial cost-saver.

    Wish you well in your pursuit - perhaps the MSP review - as suggested - and presentation of your findings here - will generate stronger response...

    Final thought dawns - as Stellaris is "short-term" (no volume) solution - such effort is hard to justify.  Instead - why not choose MCU most like your preferred - but w/less capability (wide temp) and greater (i.e. in stock - availability).   Most of your effort then may be directly transferable to your final design...

  • I am both honored and humbled by your kind words.

    Perhaps I should have been more clear.  I have not worked with the MSP430.  I do have the 430BOOST CapTouch booster pack for the Stellaris.  I also have the StellarisWare code that makes the "CapTouch" booster work.  What I mean to say is that it is very tricky for me to dig into the Stellaris code and figure how it works because all the documentation the exists for the CapTouch booster pack was written for the MSP430.  Settings like PINOSC do not exist for the Stellaris since it does not have any internal resistors.  Therefore the code to generate the timing events, and the like, between the MSP430 and the Stellaris are very different.

    For our application we are looking to detect a decrease in capacitance to trigger an event.  If I can demonstrate the ability to display the increases in capacitance with the StellarisWare provided capsense.c code it will provide me with what values are being recorded and placed and allow me a greater insight into what needs to be done to switch the program to read a decrease instead of an increase as it is current configured.

    You are most likely correct when you state such work is hard to justify.  I was really hoping the ARM family would share characteristics especially in the way they referred to their functions and naming (i.e. GPIO in Stellaris ~ GIO in ARM7). 

    However at $5 for the Stellaris board, and being forced to wait to Mid February for the actual SM470R1B1M-HT Dev. board that I needed, it seemed like a good idea to use this as an opportunity to get reacquainted with microcontrollers and programming once again.

    Thank you for your time, do you have any good books that I could read regarding the ARM7?

    Vale,

    Lou

  • The "lure" of "5-10 USD" MCU board draws many - read/review then of 1400+ pg data manual and 500+ pg. SW-DRL-UG - (both of which are "really" required to gain functional understanding) too often negatively intrude upon such discount purchase...

    I'm jammed till mid-day, coming Monday.  If you can provide real (i.e. working) link to your, "Cap Touch booster pack for Stellaris" - and if it really is intended for Stellaris (not MSP) I'll devote several hours to read/review - then suggest workable code for your 5 USD "special."  If you enable, "Conversations" w/in your forum Set-UP - I can provide more detail - escape the wrath of moderators et. al.

    From my past work w/Cap Sense - multiple, Operator Panel Switches and circular, "Scroll Wheel" - my sense is that your, "reduction in Capacitance" may be a bit outside of the, "Sweet Spot" of the technology.  As always - devil in the details - I'll need to know what your "idling" Capacitance is - and by what percent it is likely to reduce.  Further - should this be a "production opportunity" - are you able to maintain a target consistency - so that each/every board can escape, "individual calibration/tweaking."  Suggest - that if you haven't yet - further investigate the efficacy of, "Reduced Capacitance detection & measure" - via Cap-Sense or similar...  (Could potentially be deal-breaker!)

    IIRC both Atmel and Sharp (Japan) provided strong reference links to early ARM7 books and tech papers.  Our group moved almost exclusively to Cortex M3 & M4 - from multiple vendors...