- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Using the PSOC6 Pioneer kit, it is interfaced with an external ADC (16 bit parallel output).
I have the 16 GPIO pins configured, but they are spread across several ports of the Pioneer kit (ports 0, 1, and 5).
When reading these 16 bits, is there a "fast read", or a way of reading all 16 GPIO pins at once, in order to save time?
Solved! Go to Solution.
- Tags:
- external adc
- psoc6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
RiTa,
There is related discussion re writing 16-bit value atomically to 2 Control registers in PSoC5. Same approach may work for PSoC6
32-bit parallel non-contiguous GPIO write technique
/odissey1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just a quick addition, here is my code to read the 16 pins, scattered across multiple ports:
resultADC = (Cy_GPIO_Read(P11_0_PORT, P11_0_NUM)) |
(Cy_GPIO_Read(P11_2_PORT, P11_2_NUM) << 1) |
(Cy_GPIO_Read(P7_0_PORT, P7_0_NUM) << 2) |
(Cy_GPIO_Read(P7_3_PORT, P7_3_NUM) << 3) |
(Cy_GPIO_Read(P7_4_PORT, P7_4_NUM) << 4) |
(Cy_GPIO_Read(P7_5_PORT, P7_5_NUM) << 5) |
(Cy_GPIO_Read(P7_6_PORT, P7_6_NUM) << 6) |
(Cy_GPIO_Read(P7_7_PORT, P7_7_NUM) << 7) |
(Cy_GPIO_Read(P8_7_PORT, P8_7_NUM) << 😎 |
(Cy_GPIO_Read(P8_6_PORT, P8_6_NUM) << 9) |
(Cy_GPIO_Read(P8_5_PORT, P8_5_NUM) << 10) |
(Cy_GPIO_Read(P8_4_PORT, P8_4_NUM) << 11) |
(Cy_GPIO_Read(P8_3_PORT, P8_3_NUM) << 12) |
(Cy_GPIO_Read(P8_2_PORT, P8_2_NUM) << 13) |
(Cy_GPIO_Read(P8_1_PORT, P8_1_NUM) << 14) |
(Cy_GPIO_Read(P8_0_PORT, P8_0_NUM) << 15);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
RiTa,
There is related discussion re writing 16-bit value atomically to 2 Control registers in PSoC5. Same approach may work for PSoC6
32-bit parallel non-contiguous GPIO write technique
/odissey1