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 06 Dec 2004 01:58 PM by  scobb
Setting up an I/O port
 11 Replies
Sort:
You are not authorized to post a reply.
Author Messages
ftiernan
New Member
New Member
Posts:


--
23 Sep 2004 03:42 PM
    Can anyone point me to some sample code to set up an I/O port and toggle a few bits on the LH7A400-10 board using PB4.2? Thanks - FT
    mikea@logicpd.com
    New Member
    New Member
    Posts:


    --
    28 Sep 2004 06:06 PM
    Logic has a white paper that will be released soon that has bunch of information about the A400's GPIO usage on the card engine. There is some example code, although very simple with no error checking, etc. You can look for this to be released within the week.
    ftiernan
    New Member
    New Member
    Posts:


    --
    07 Oct 2004 11:22 PM
    Thanks Michael, look forward to the white paper. In the meantime thought I would just post a few items gleaned in the interim that may be of help to others grappling with this topic for the first time.

    First step is to get the Sharp LH7A400 System on Chip User's guide
    - as of 10/7/04 it could be found at:

    http://www.sharpsma.com/s...c/LH7A400_splash.htm

    To get an I/O pin note that, for example, from Logic's LH7A400-10 Card Engine Hardware Specification that Pin 25 of J1C Connector can be used as either Interrupt 2 (uP_nIRQC) Input or Port F bit 2 I/O

    also note that this same pin is available at pin 14 of J16 Expansion Header
    (from page 10 of the ZOOM SKD Application Board Schematic)

    Using the Sharp user's guide note that the physical address of the GPIO Port F Interrupt enable Register
    is 0X8000.0E58. Pin 2 of this register must be set to 0 to disable the interrupts.

    also note that physical address of the GPIO Data Direction REgister for Port F is 0x8000.0e34 -
    Pin 2 of this register must be set to 1 to make this pin an output

    and finally note that the phsical address of the GPIO Data Register for Port F is 0x8000.0e30
    setting bit 2 of this register to 1 will make the J16 pin 14 go High and setting bit 2 of this
    register to 0 will make the J16 pin 14 go low.


    in your Windows program declare the following physical address variables:

    PHYSICAL_ADDRESS Gpio_Address = {0x80000e34,0}; // Address for GPIO Data Direction Register F
    PHYSICAL_ADDRESS Gpio_PD_Address = {0x80000e30,0}; // Address for Port F data register
    PHYSICAL_ADDRESS Gpio_INT_Address = {0x80000e58,0}; // address for Port F Interrupt enable register

    declare a variable to get the virtual addresses:

    volatile void * gpioPtr;

    you can get the virtual addresses for a registier by using a call of the form:

    gpioPtr = MmMapIoSpace(Gpio_INT_Address,4,FALSE);

    once you have the address you can set a value using an instruction like:

    *(DWORD*)gpioPtr |= 1<<2;
    mikee@logicpd.com
    New Member
    New Member
    Posts:


    --
    12 Oct 2004 01:51 PM
    ftiernan,

    Thanks for taking the time to post your experiences. We at Logic really appreciate it.

    --mikee
    scobb
    New Member
    New Member
    Posts:


    --
    23 Nov 2004 09:59 AM
    Thanks for the good info.

    I'm in the process of installing the ce_ddk so that I can get at the MmMapIoSpace() function.

    I'm getting the following warnings on linking:
    Linking...
    ceddk_lib.lib(ddk_map.obj) : warning LNK4099: PDB 'ddk_map.pdb' was not found with 'C:\Program Files\Windows CE Tools\wce420\LPD_ARMV4_SDK\lib\ARMV4\ceddk_lib.lib' or at 'C:\NMDev\Ateed\Test\CE SPI Test\ARMV4Dbg\ddk_map.pdb'; linking object as if no
    debug info
    ceddk_lib.lib(ddk_bus.obj) : warning LNK4099: PDB 'ddk_bus.pdb' was not found with 'C:\Program Files\Windows CE Tools\wce420\LPD_ARMV4_SDK\lib\ARMV4\ceddk_lib.lib' or at 'C:\NMDev\Ateed\Test\CE SPI Test\ARMV4Dbg\ddk_bus.pdb'; linking object as if no
    debug info


    Are the .pdb files available? What are the consequences of not having them?

    Steve
    mikee@logicpd.com
    New Member
    New Member
    Posts:


    --
    23 Nov 2004 10:26 AM
    This is an extremely common warning that can be ignored. For some reason, Platform Builder tends to delete these *.pdb files. Also, Microsoft doesn't ship them for a lot of components as well.

    The *.pdb files are used by the debugger to do "source-level" debugging of a particular library. Since you aren't likely to ever need to debug the source code of the CEDDK, you can just ignore the warning.

    Regards,

    --mikee
    scobb
    New Member
    New Member
    Posts:


    --
    23 Nov 2004 03:03 PM
    Thanks, I thought so. However, you can never be too careful

    What is the most reasonable way for a thread (IST or otherwise) to wait for an input on PF1 (INT1) under CE 4.20?

    While I'd love a good example (and won't turn it down), I also like to RTFM. Any documentation suggestions for an embedded guy new to CE?

    Thanks,
    Steve
    mikee@logicpd.com
    New Member
    New Member
    Posts:


    --
    23 Nov 2004 03:06 PM
    Check out our sample "foo" driver implementation. It should walk you through the whole thing.

    --mikee
    scobb
    New Member
    New Member
    Posts:


    --
    23 Nov 2004 04:04 PM
    Brilliant. Thanks.

    Where is it?

    I looked in http://www.logicpd.com/auth/downloads.php?model=LH7A400 but didn't find anything close. Except maybe
    "sample_zoom_app.zip".

    If that was it, it didn't seem to handle specific INTn type interrupts.

    Cheers,
    Steve
    mikee@logicpd.com
    New Member
    New Member
    Posts:


    --
    23 Nov 2004 04:49 PM
    Nope, that's not it. I don't see it posted under the A400 downloads. I'll ask our Apps team about it and get back to you.

    --mikee
    Anonymous
    Posts:


    --
    23 Nov 2004 05:55 PM
    scobb,

    The example Foo driver will be posted to the downloads page next week. Check back for updates.

    Thank you,
    scobb
    New Member
    New Member
    Posts:


    --
    06 Dec 2004 01:58 PM
    Thanks.
    I haven't seen it yet, but I could have missed it. Can you post a link?

    Cheers,
    Steve
    You are not authorized to post a reply.