On 22/11/2010 13:12, Olin Lathrop wrote: > Oli Glaser wrote: >>> If I really needed to know what a A/D reading was in this setup as a >>> one-off, I would probably use two pins, one clock and one data. A >>> sequence of 10 clocked bits is short enough to be captured on a >>> scope and then analysed by hand. It's only 10 bits after all. >> Yes, that's the kind of thing I was thinking of when I mentioned bit >> banging stuff - a couple of pins, or maybe just one Tx pin if they are >> in short supply, then you could use the PicKit2 UART tool. I have done >> this quite a lot - I just use the PGC/PGD pins as the Tx/Rx so it >> saves having to move the PicKit2 connections at all. > Yes, you could do it with one pin and a UART to receive bytes. The probl= em > with that is that the timing has to be just right. While that's doable, > it's a lot more work than just clocking out 10 bits and analyzing the sco= pe > capture once or twice. If you had to do it regularly, then the extra eff= ort > of creating a software UART at a standard baud rate could be worth it. > Maybe in this case to read one or two registers it's not so important,=20 but I find it helps for reading a bunch of data out. I have a few=20 standard C routines in a file I wrote ages ago that I add to my project,=20 set the baud rate and it's ready - timing is not a big deal really as=20 it's unlikely you need to send the data quickly, I usually use 4800 or=20 9600. I just used this for debugging the Temp Logger project I as=20 working on, quite useful for reading the various registers of the Dallas=20 sensors, RTC and the values written to eeprom. The PicKit2 UART tool is the main reason I do it like this, as it uses=20 the same lines for the UART as programming. I'm sure people all have their favourite methods of debugging small=20 micros - I like the Morse code beeper just mentioned... :-) --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .