| ??? 11/24/03 12:09 Read: times |
#59293 - RE: at89s8252 and ADS1286 with SPI Responding to: ???'s previous message |
Darek,
The ADC1286 chip has not pure SPI. Your reading algorithm is wrong. Did you read the datasheet? Please have a look at example from http://www.nomad.ee/micros/ads1286.html below 10 REM ADS1286 demo v1 15 GOSUB 1050 20 GOSUB 1200 30 PRINT AV 40 GOTO 20 1000 REM start conversion 1010 PORT1=0FFH 1015 PORT1=07DH 1020 RETURN 1050 REM stop ADC 1060 PORT1=0FFH 1070 RETURN 1100 REM one clock, leaves clock high 1110 PORT1=07DH 1120 PORT1=07FH 1130 RETURN 1200 REM take ADC reading 1210 GOSUB 1000 1215 AV=0 1220 GOSUB 1100 : GOSUB 1100 : GOSUB 1100 1230 FOR I=1 TO 12 1240 GOSUB 1100 1250 BT=PORT1.AND.1 1260 AV=AV+AV+BT 1270 NEXT I 1280 GOSUB 1050 1290 RETURN Want to get voltage reading. No problem. Just measure the VREF voltage, and modify the program to read (set V to your VREF voltage on line 16): 10 REM ADS1286 demo v1 15 GOSUB 1050 16 V=5.1 20 GOSUB 1200 30 PRINT V/4096*AV 40 GOTO 20 ... Seems it can help to undestand the problem. Regards, George |
| Topic | Author | Date |
| at89s8252 and ADS1286 with SPI | 01/01/70 00:00 | |
| RE: at89s8252 and ADS1286 with SPI | 01/01/70 00:00 | |
RE: at89s8252 and ADS1286 with SPI | 01/01/70 00:00 |



