- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am running the PSoC 6 BLE Pioneer kit and some of the pins aren't working.
I have set up a bunch of pins to be strong drive GPIO: P0.3, P13.6, P13.7, P7.0.
P0.3 which is the onboard LED works, and so does P13.6. But P13.7 and P7.0 stay floating or at 0V
Any ideas why some pins work and some are not on the pioneer kit?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You probably need to post code of initialization and GPIO access. Do you use HAL, PDL or something else? Do you check that returned cy_rslt_t from API call is CY_RSLT_SUCCESS? For example HAL functions could fail when you have configured pin in Device Configuration tool because HAL use HW manager to prevent multiple use of the same resource (GPIO pin for example) by multiple codes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The pins are all set up in the top design to be Digital Output(no hardware connection) and Strong Drive drive mode.
The code to toggle the pins is: Cy_GPIO_Write(RED_PORT, RED_NUM,0);
where RED is the name of the pin.
How do I tell if I am using HAL, or PDL or something else
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
According to function you posted, you are using PDL library.
If you modify your call to
cy_rslt_t status = Cy_GPIO_Write(RED_PORT, RED_NUM, 0);
CY_ASSERT(status == CY_RSLT_SUCCESS);
do it pass or do it break in debugger? It is good idea to check output using CY_ASSERT macro of any function that returns cy_rslt_t. Documentation to functions is here: PSoC 6 Peripheral Driver Library: GPIO Functions
If it pass without break in debugger, can you share full code of declaration RED_PORT and RED_NUM constants (macros) and also your initialization code (probably one of Cy_GPIO_Pin_Init, Cy_GPIO_Port_Init or Cy_GPIO_Pin_FastInit call) and related configuration structures (if used)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I get "use of undeclared identifier 'cy_rslt_t' " when I try your code. Any idea what I should include to get it to recognize cy_rslt_t?
It also doesn't recognize CY_RSLT_SUCCESS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Usually include at least following:
#include "cy_pdl.h"
#include "cyhal.h"
#include "cybsp.h"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Refer to the CY8CKIT-0BLE schematics.
- The P7_0 is not connected to the Arduino connector by default. Need to populate resistor R135.
- The P13_6 should work. There is a direct connection to the Arduino connector.
- The P13_7 is connected to the RED LED (LED9) and to the Arduino connector. This should be working, though you might see some difference in the measured voltage.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The build fails when I try to add these. It says Build Error: cy_pdl.h: No such file or directory.
I am using PDL 3.1.2 from Build Settings-> Peripheral Driver Library.
Where do I get those header files?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting your post:
"The code to toggle the pins is: Cy_GPIO_Write(RED_PORT, RED_NUM,0);"
That doesn't sound right - Cy_GPIO_Inv(...) is used to toggle a pin. If you always write 0 using Cy_GPIO_Write(...), the pin will stay at 0V.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm using both Cy_GPIO_Write(RED_PORT, RED_NUM,0) and Cy_GPIO_Write(RED_PORT, RED_NUM,1) to turn pin low and high