- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Greetings!
Using a PSOC6 BLE Pioneer kit with an external 16-bit parallel ADC. I want to trigger the ADC to convert (let's say, at a 20kHz rate), then interrupt on the ADC "done signal", and then read the 16 data pins from the ADC.
On the BLE Pioneer board, there is no group of 16 pins that is contiguous across a single port. In order to read the 16 data pins, I can do one of two things:
1. Read pins in software:
*Pseudo code here*
[In "ADC conversion done" interrupt]:
ADC_RESULT = Cy_GPIO_Read(Port 7, pin 6) | //ADC bit 0
Cy_GPIO_Read(Port 7, pin 7) << 1 | //ADC bit 1
Cy_GPIO_Read(Port 9, pin 0) << 2 | //ADC bit 2
Cy_GPIO_Read(Port 10, pin 0) << 3 | //ADC bit 3.... (do this for all 16 pins)
2. Read pins from two "8-bit" Status registers in the Creator schematic:
[In "ADC conversion done" interrupt]:
ADC_RESULT = StatusReg1_Read() | (StatusReg2_Read() << 8);
Is one of these methods faster than the other? Is there a third option that could read all 16 pins even faster?
Solved! Go to Solution.
- Labels:
-
PSoC Creator Software
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
RiTa,
Since reading speed is slow (20kHz), the method is not important. I believe that speed difference is about 2x times.
Another option is "atomic" reading:
32-bit parallel non-contiguous GPIO write technique
/odissey1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
RiTa,
Since reading speed is slow (20kHz), the method is not important. I believe that speed difference is about 2x times.
Another option is "atomic" reading:
32-bit parallel non-contiguous GPIO write technique
/odissey1