When you get a 0x0102 when the input is tied to GND there is someting darn wrong. Can you post an actual project here.
Thanks for your quick reply. Here is my project. The code is actually based on the example from CY8C3210-PSOCEVAL: C_Example_ADC_UART_LCD.
Once again, thank you very much.
ADC_Logger_9bit.zip 309.3 K
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)
Value = Value + 1; is done with Value++; which is not only less to type but may generate less code.
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.
Got your mojo workin' ! Fine
Tx interrupt cannot be disabled in PSoC1, sorry, my fault!