This implementation of the S12ATD10B8C module is suitable for a system requiring a single ATD channel only. Reads automatically kick off a new sequence of eight conversions of the defined channel with the result being the average of those eight conversions. The maximum rate for updated data is approximately 20KHz. The defines within the c file may conflict with the header file for your 9s12 variant. Typical test:
// Note: printf is user defined void main(void) { int cur_data, prev_data; atdStart(); while (1) { if (atdRead(&cur_data) == ATD_SUCCESS) { if (cur_data != prev_data) { printf("atd:0x%02x\r", cur_data); prev_data = cur_data; } } } }
Attachment | Size |
---|---|
![]() | 6.95 KB |
![]() | 1020 bytes |