Saturday, April 5, 2014

AIM: Make a GPIO pin go high or low and check it using the multimeter.


Basic code: GpioApp/cyfxgpioapp.c form the 1.3 firmware.

Notes:

1.General purpose I/O pins are a special (simple) case of low
bandwidth peripherals that do not need DMA capability

2.Simple GPIO provides software controlled and observable
input and output capability. They also can raise interrupts.
Complex GPIOs support a variety of time based functions.
They either work off a slow or fast clock. Complex GPIOs
can also be used as general purpose timers by firmware.

3. The basic structure goes something like this.
a. Write the GPIO init function and define all the pins.
b. Write various thread functions.
c. Create an Application function which calls the threads.
d. In main function - Configure the pins for enable.  


Code Observations:

1. In CyFxGpioInit (void):
/* Override GPIO 21 as this pin is associated with GPIF Control signal.
     * The IO cannot be selected as GPIO by CyU3PDeviceConfigureIOMatrix call
     * as it is part of the GPIF IOs. Override API call must be made with
     * caution as this will change the functionality of the pin. If the IO
     * line is used as part of GPIF and is connected to some external device,
     * then the line will no longer behave as a GPIF IO.. Here CTL4 line is
     * not used and so it is safe to override.  */
    apiRetStatus = CyU3PDeviceGpioOverride (21, CyTrue);



Procedure:

1. The DAQ board has a TP2 at GPIO45.q

2. Use the basic gpioApp and modify the pins.

Observations:
1. so when we directly load the code, it doesnt return the connection status status as expected.
2. Trying to read and compare the GpioApp and the GpioSpi codes to see why the later returns the descriptors.
3. All your pin setting are done in:
                                                  void CyFxGpioInit (void)
4.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.