Gavin Jackson wrote: > I am using a 74A for some async TX/RX and would like to know what > the best way of configuring BRGH is? Either high speed or low speed > as I understand that there is a bug in one of the settings. Gavin: The bug is with BRGH = 1 (high speed); if you can get away with it in your application, set BRGH to 0 (low speed). > I also wrote some code and ran it in the MPLAB ver 3.22.02. The > code is for the 74A is as follows: > > ORG 00H > BSF STATUS,RP0 > CLRF TRISA > CLRF TRISE > BCF STATUS,RP0 > BSF PORTA,0 > BSF PORTA,1 > BSF PORTA,4 > BSF PORTE,0 > END > > Non of these instructions seem to set the bits, or that's what the > simulator indicates. The only bit which sets is Port A bit 4. Is it > something to do with their alternate functions? Yes. RA0-3, RA5, and RE0-2 default to ANALOG INPUTS on power-up (see Section 13 and Figure 13-2 in the 16C74 Data Book). You can make the pins outputs by writing to the TRIS registers (as you've done in your program), but when your program (or the simulator) reads from those pins, they'll always read low because the input side of each pin is still connected to the A/D circuitry. Note that the pins actually ARE going high; the simulator just can't tell that they are, because it always sees "0" when it looks at an output pin that's still configured as an analog input. To make the pins digital outputs AND digital inputs, so the simulator will accurately show the state of the output pins, write "xxxxx11x" to ADCON1 (register 0x9F). The following modification to your code will do it: ORG 00H BSF STATUS,RP0 CLRF TRISA CLRF TRISE MOVLW 00000110B ;New line. MOVWF ADCON1 ;New line. BCF STATUS,RP0 BSF PORTA,0 BSF PORTA,1 BSF PORTA,4 BSF PORTE,0 END Also, note that RA4 is an open-collector output... If you really want it to go high in your circuit, you'll need to ad a pullup resistor to it. -Andy === Meet other PICLIST members at the Embedded Systems Conference: === 6:30 pm on Wednesday, 1 October, at Bytecraft Limited's booth. === === For more information on the Embedded Systems Conference, === see: http://www.embedsyscon.com/ === Andrew Warren - fastfwd@ix.netcom.com === Fast Forward Engineering - Vista, California === http://www.geocities.com/SiliconValley/2499