Search

Technical Discussion Group Forum

This forum is provided for user discussion. While Beacon EmbeddedWorks support staff and engineers participate, Beacon EmbeddedWorks does not guarantee the accuracy of all information within in the Technical Discussion Group (TDG).

The "Articles" forums provide brief Articles written by Beacon EmbeddedWorks engineers that address the most frequently asked technical questions.

To receive email notifications when updates are posted for a Beacon EmbeddedWorks product download, please subscribe to the TDG Forum of interest.

TDG Forum

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 26 Jan 2006 04:00 PM by  Ole
GPIO access using an application
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages
mikea@logicpd.com
New Member
New Member
Posts:


--
06 Jan 2006 07:33 AM
    Quote:

    Customer Question:
    Can I access the GPIOs (J38) using a simple application for the LoCE image or do I need your BSP for that ?
    Do you have a sample application (with source code)that access the GPIOs ?



    To use GPIO signals on any platform with our LoCE BSP or NK.bins (Images), you can simply create an application using a tool such as Embedded Visual C++. You can then download over ActiveSync or simply put the application on a CF card.

    The application needs to correctly map a physical address space for the memory mapped areas needed. Also, be sure to correctly initialize the GPIO pins (don't make any assumptions). Follow the guidelines in the specific processor's User Guide for the GPIO.

    typical steps:
    0) Do your homework, make sure another peripheral isn't using the signal. Trace the signal back to the processor pin on the SOM schematic, if available or the HW Spec. Make sure you know how you need to initialize the GPIO signal using the processor's User Manual.
    1) Map the physical HW registers to virtual addresses [MmMapIoSpace]
    2) Initialize the proper HW registers to set up the GPIO pin using the new virtual addresses. (Specific to each processor)
    3) Read/Write from the GPIO signal using the virtual addresses for the GPIO data registers. (Specific to each processor)

    We have a sample application (very simple) that shows how to set up the virtual memory area you want to access. We also have posted a sample driver that may be useful.

    (WinCE Sample Hardware Access Application)
    http://www.logicpd.com/downloads/637/

    (WinCE Sample Foo Driver)
    http://www.logicpd.com/downloads/476/

    Hope this helps and good luck,
    -Mike
    Ole
    New Member
    New Member
    Posts:


    --
    26 Jan 2006 04:00 PM
    Be aware of that many GPIO pins are multiplexed, ie they may initially belong to some other interface/peripheral. Make sure you turn this multiplexing off (by writing to a special config register) before you set the data direction registers, and eventually read or write the data register for the port you are using.
    All register adresses are found in the prosessor's User Manual.

    It is smart to test this in Lolo before making a CE application or driver, then you are sure you have the right physical adresses.

    Ole J.
    You are not authorized to post a reply.