Gavin Jackson wrote: > > Hi there > > I am using the BSF instruction to set bits > on PORTD on a 16c74A. The whole port is > configured as output (CLRF TRISD). The > problem is, when I set a bit on the port, any > other bits that were set, clear and then the > bit the instruction specifies, sets. > Why don't the other bits remain set? > > I also had a problem getting the serial port > on the 16c74A to work. I tried everything! > It turned out the 2.4576MHz crystal was > not quite accurate enough. One would think > that crystals were supposed to be quite > accurate. Can't answer your PortD problem, I use mine for muxed address/data so I only output bytes to it. I have had no problems with the UART and I use a 2.4576MHz crystal, too. Even with BHRG low (note the silicon bug), you should be able to get bang-on baud rates at 38,400 (SPBRG==0), 19,200 (SPBRG==1) and lower. I use 9600 (SPBRG==3) and 1200 (SPBRG==31) with no problem. (I can't directly vouch for 19.2 and 38.4, but they should be fine.) Bottom line: make sure that you've got BHRG low. Otherwise, look to your code because baud rates should be fine even at +/- 10% -- that would be a *really* flaky crystal. --Matt