How do I add a generic LED to an FN0 pin in the PowerPSoC® device?
Currently, the FN0_x pins do not appear in the Port selection drop-down menu of the LED User Module in PSoC Designer. The following steps can be used as a workaround to connect an LED to an FN0_x pin without placing the LED User Module.
Copy the .asm, .inc, and .h files of the appropriate FN0 pin into the project directory that contains the main.c file. For example, for pin FN0, copy LED_FN0_0.inc, LED_FN0_0.asm, and LED_FN0_0.h.
Copy the LED_FN0_General.asm file into the project directory that contains the main.c file.
In PSoC Designer, select Project > Add File. Use the Files of Type drop-down to select All Files (*.*). Select the three LED_FN0 files copied in steps 1 and 2, and then click Open.
Open each file that calls the LED_FN0 function. Include the C header file (.h) with the command: #include filename For example: #include LED_FN0_0.h
Call the Start function, LED_FN0_0_Start(), as shown in the attached example project in the main.c file.. It sets the correct drive mode of the pins.
Call any of the other LED functions as needed.
Option: The LED drive is set to active high (LED_On sets the output to HIGH). To change to active low, open the LED_FN0_x.inc file, and change the value of LED_FN0_x_Drive to 0 (LED_FN0_0_Drive: equ 0).
The sample project attached connects the FN0_0 pin to an LED. In this project, the state of the LED is toggled periodically.