- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am really getting to my wits end.
I have a design using the sequencing ADC in PSoC4.
It has gotten into a state where the StartConvert API function appears to be blocking. If I include that function in the main code nothing after it will be executed.
If I include it in a timer interrupt service routine it will block there too.
If I include it in the main line of code in free-running mode, the ADC will carry on converting and I can see that the ADC ISR is updating sample values from a potentiometer to the PWM (driving an LED).
If I configure the ADC as "Hardware triggered" and put the StartConvert in the main line of code it blocks still.
This behavior does not seem right to me and appears to disagree with the API documentation for the SAR ADC in PSoC 4.
Has anyone else had this issue? Any clues as to what I am doing wrong?
Could it be an interrupt timing / latency issue?
Any help or advice is appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nothing that I have experienced so far. Can you post your complete project, so that we all can have a look at all of your settings? To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How do you determine "blocked"? Is there any code in main after the StartConvert()? Do you read the results of the ADC in an ISR? (and maybe this one consumes all CPU)?
(When using "hardware triggered", you don't need to use StartConvert at all)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It turns out that the UART was actually the cause - a race condition of some sort.
Because each ADC conversion was sending a byte of data to the TX buffer, and the UART is too slow to keep up at the baud rate chosen.
Now I'm looking into how to use a semaphore along with the UART Done interrupt to make sure I don't try to stuff the buffer too full 🙂
Had to use an oscilloscope to find this one...
Thanks all for your responses.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As a follow up, increasing the TX buffer size in the SCB UART solved the problem.
I also just realized this was not a question about PSoC Creator and this is the wrong forum... so thanks for graciously replying.
-Ben.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As a follow up, increasing the TX buffer size in the SCB UART solved the problem.
I also just realized this was not a question about PSoC Creator and this is the wrong forum... so thanks for graciously replying.
-Ben.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As a follow up, increasing the TX buffer size in the SCB UART solved the problem.
I also just realized this was not a question about PSoC Creator and this is the wrong forum... so thanks for graciously replying.
-Ben.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As a follow up, increasing the TX buffer size in the SCB UART solved the problem.
I also just realized this was not a question about PSoC Creator and this is the wrong forum... so thanks for graciously replying.
-Ben.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As a follow up, increasing the TX buffer size in the SCB UART solved the problem.
I also just realized this was not a question about PSoC Creator and this is the wrong forum... so thanks for graciously replying.
-Ben.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As a follow up, increasing the TX buffer size in the SCB UART solved the problem.
I also just realized this was not a question about PSoC Creator and this is the wrong forum... so thanks for graciously replying.
-Ben.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As a follow up, increasing the TX buffer size in the SCB UART solved the problem.
I also just realized this was not a question about PSoC Creator and this is the wrong forum... so thanks for graciously replying.
-Ben.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What makes you think, a reply is not accepted when you hit the "Post" button? There should be some changes in the forum SW to have that prevented.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Bob,
That is a bug in the forum software. I only hit the "Post" button a single time.
Regards,
Ben.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@jordanyte, don't sweat the small stuff, ALL forum posters have had
multiple posts, blank post, upload vacuum post. I fnd on high latency
connections I get double posts.
Fear not, the forum police are asleep at the switch.
Refards, Dana.