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.

5515 Push Buttons

I have been trying to find information on programming the EVM5515 push-buttons. There are 10 buttons on the board but i'm unable to find information on how these are to be programmed. 

In EVM_sample (from Spectrum Digital's website) the switches are defined under sar.h as follows:

#define SW7  0

#define SW8  0xd6

#define SW9  0x166

#define SW10 0x1d6

#define SW11 0x215

#define SW6  0x236

#define SW12 0x257

#define SW13 0x2c7

#define SW14 0x316

#define SW15 0x374

However I am trying to find some documentation that has information on these. Any suggestions on where I can find them?

Thanks,

Nandan

 

  • Nandan,

    What do you mean you want to program the switches?  The EVM technical reference, section 2.4.5 states:

    Switches SW6-SW15 are push button momentary switches which are read by the processor. These switches can take on any function defined by user software.

    If you look at the schematic, page 18 in the same document you can see that the switches are part of a resistor network so that each switch generates a different voltage.  The voltage is read by the onboard SAR ADC and the values you list above are the expected voltage for each switch to allow the software to determine which has been pushed.

    The code for reading the switches is in sar.c and the code that interprets the switches is in main.c.  This is the only documentation on how to use the switches that I am aware of.  Is this what you were looking for?

    Regards.

  • Hi Tommy,

    I did study the schematic and am aware that each switch generates a different voltage. The reason I posted the question is that on a closer look at sar.h, lcd.c and main.c, we can observed the following:

    In main.c in the switch-case statements we see that, for example, SW9 is associated with Led Blink On, and SW10 is associated with Led Blink Off. However in menu.c in the function menu1_on_LCD, we see that Blink On and Blink Off is controlled by SW12 and SW11 respectively. This is what is observed on actual hardware as well. Hence the mapping appeared to be a little confusing to me. 

    On modifying and simplifying the same program, it appears that pshing the push-button 12 corresponds to SW9, button 11 to SW10, etc. Therefore I wanted to check if there is some documentation to describe how this works and what the actual mapping is. Please correct me if my interpretation of the program is wrong.

    Thanks so much!

    Nandan

     

     

  • Also Just to clarify, all the programs I am referring to are from EVM_Sample available on Spectrum Digital's 5515 support page.

  • I observed the output of the ADC after each button press and found that the following definitions map to the push buttons rather than what has been defined in the file src.h:

    #define SW7  0x255

    #define SW8  0x314

    #define SW9  0x235

    #define SW10 0x215

    #define SW11 0x1D6

    #define SW6  0x371

    #define SW12 0x167

    #define SW13 0x1

    #define SW14 0x2C5

    #define SW15 0xD7

    I tested these definitions and the observations meet the expectations. 

  • Nandan,
    Your results match the schematic layout of the switches in the resister network.  There does appear to be an error in the code in the EVM_Sample demo application.  The best way to get this resolved is to report to Spectrum Digital through their Help Desk off the main page under Support: http://www.spectrumdigital.com/.  I will make sure that the C5000 Applications team knows about this so they can work with Spectrum Digital to get a patch out.

    Thanks for finding and reporting this discrepancy.

    Regards.