>Okay, I'm just a bit confused by the manual on this one. >The section on the A/D converter say that if ADCON1 is >set to zeroes, then all five of the ANx inputs are useable >(which is what I need). > >But I also need to use SPI (master mode, output only) >to run a display driver such as a MAX7219. Now, in the >SPI section, it says (I'm paraphrasing here) that RA5 >can be used as a general purpose *output* if not >needed for SPI operation. > >So, here's the question: Can RA5/AN4 work as an A/D >input even when the SPI is being used as described above? >Any insight will be greatly appreciated! Yes and no! The pin will function perfectly as an output so long as you write the whole port at once. Any read-modify-write type instructions (bsf, bcf, any instruction with port RA as the destination) may fail. The problem is that since that pin is configured as analog input, the DIGITAL input has been disabled. That means that any instruction that attempts to read that pin will always show that pin as '0'. Any instruction that reads that port, modifies some or all of the bits within that port, then writes the new value back to that port will write '0' in those bit positions. If you want to bit-diddle only THAT pin on the post, bcf/bsf WILL work. However, if you diddle any other bit within that port, RA5 will 'magically' go back to being a zero. dwayne Dwayne Reid Trinity Electronics Systems Ltd Edmonton, AB, CANADA (403) 489-3199 voice (403) 487-6397 fax