- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, I have tested my programs with different resolution of ADC in 8MHz (According to the datasheet, this is the maximum dataclock for the module). The ADC values are then trasmitted to a virtual terminal through UART. It is interesting that the ADC has significant chattering bit in ADC resolution which are higher than 8bit.
These are some examples that I get when the analogue input are connected to ground:
8Bit (In Hex Form)
0001
0002
0001
0002
0001
0001
0002
0001
...
...
9bit or higher resolution (In Hex Form)
0001
0002
0002
0001
0002
0001
0002
0001
...
...
0102
...
...
0101
...
...
Are these mainly caused by the 8-bit PWM cycles in the ADC module? Please correct me if I have made any misconceptions.
Thank you very much.
Thank you very much.
- Labels:
-
PSoC 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When you get a 0x0102 when the input is tied to GND there is someting darn wrong. Can you post an actual project here.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
First I noticed that you are using outdated versions of ADCINC and UART. I strongly suggest (and if it is for experimental usage only) to update to the latest versions!
I found 2 warnings when generating (after a clean) the project anew:
The CPU-clock is set to 8MHz which is not more (as required) than the ADCINC-clock (which I would set to 4-6MHz while testing)
SysClk*2is disabled which is re-enabled while debugging. I would suggest to have it generally enabled.
There are some (more cosmetic) issues I found.
The UART TX interrupt is enabled, but unused. I would disable it.
There are two ADCINC-module parameters not set and so are undefined, I would set them to reasonable values:
NegInput (set to same as posinput
PWMOutput (set to None)
It is rather uncommon in the world of embedded µControllers to end the program (after 1000 conversions) this you will have to change for final releases to an infinite loop.
Two (cosmetic) C-usages:
if(condition != 0) is usually written as if(condition)
and
Value = Value + 1; is done with Value++; which is not only less to type but may generate less code.
Happy coding
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Bob,
I have modified my codes according to you guidance and now the code just works well~ And how can we actually disable the UART TX interrupt? Is it just changing 'TXEmpty' to TXComplete'?
Thank for your patience, once again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Got your mojo workin' ! Fine
Tx interrupt cannot be disabled in PSoC1, sorry, my fault!
Bob