- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Labels:
-
PSoC 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
few lines later:
"
The result of the calculation is referenced to AGND. For a ADC data value of 1500 the Voltage measured can be calculated to be 0.60V:"
2's comlement reading can not be 1500 because 11bit range is +- 1024
regards
robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Another example:
Delsig11 according to documentation return 8-bit value.
regards
robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't see all that in the documentation I have. Could be you have some older documentation with mistakes that have been edited since then.
- Pretty sure it's 11 bits. That sounds like a typo or copy/paste error, or a misunderstanding.
- The range is +/- Vref.
- The sign is in the upper bit(s). An 11-bit, two's-complement value is going to use 10 bits for the magnitude and 1 bit for the sign. An 11-bit unsigned value will just use 11 bits. Either way you get 2048 possible values.
A two's-complement, 11-bit value that's right-justified in a 16-bit field (what you'd usually see) will set all the unused bits to the same as the sign bit. So your values range from -1024 (0xFC00 or 0b11111100000000000) to +1023 (0x03FF or 0b0000001111111111). The actual value is 0x400 to 0x3FF.
Left-justified values are the same values shifted left by 5 so they have a 16-bit magnitude. I've never needed that myself but I assume it's handy for some situations.
As for the example that includes 1500, I have to agree that's weird. Those examples suggest that the value retrieved will be unsigned with an offset of 1024, but the documentation clearly states elsewhere that the values are two's-complement, and even say the upper 5 bits are used to sign-extend. Again, I suspect the tech writer copied another document and didn't notice the discrepancy when he edited it.