Hola de nuevo, creo entender que el funcionamiento de USE_AND_MASKS es configurar los bits de una rutina en concreto
//------------AND MASK------------------------------------------------
#else
#define USART_TX_INT_ON 0b10000000 // Transmit interrupt on
#define USART_TX_INT_OFF 0b00000000 // Transmit interrupt off
#define USART_TX_INT_MASK (~USART_TX_INT_ON) //Mask Trnasmit Interrupt select bit
#define USART_RX_INT_ON 0b01000000 // Receive interrupt on
#define USART_RX_INT_OFF 0b00000000 // Receive interrupt off
#define USART_RX_INT_MASK (~USART_RX_INT_ON) //Mask Receive Interrupt select bit
#define USART_ADDEN_ON 0b00100000 // Enables address detection
#define USART_ADDEN_OFF 0b00000000 // Disables address detection
#define USART_ADDEN_MASK (~USART_ADDEN_ON) //Mask address detection select bit
#define USART_BRGH_HIGH 0b00010000 // High baud rate
#define USART_BRGH_LOW 0b00000000 // Low baud rate
#define USART_BRGH_MASK (~USART_BRGH_HIGH) //Mask baud rate select bit
#define USART_CONT_RX 0b00001000 // Continuous reception
#define USART_SINGLE_RX 0b00000000 // Single reception
#define USART_CONT_RX_MASK (~USART_CONT_RX) //Mask Continuous Reception select bit
#define USART_SYNC_MASTER 0b00000100 // Synchrounous master mode
#define USART_SYNC_SLAVE 0b00000000 // Synchrounous slave mode
#define USART_SYNC_MASK (~USART_SYNC_MASTER) //Mask usart mode select bit
#define USART_NINE_BIT 0b00000010 // 9-bit data
#define USART_EIGHT_BIT 0b00000000 // 8-bit data
#define USART_BIT_MASK (~USART_NINE_BIT) //Mask 9 bit transmit select bit
#define USART_SYNCH_MODE 0b00000001 // Synchronous mode
#define USART_ASYNCH_MODE 0b00000000 // Asynchronous mode
#define USART_MODE_MASK (~USART_SYNCH_MODE) //Mask sync/async mode select bit
#endif
Pero de no usar dicho #define ¿Como quedan configurados sus registros? ¿Es mejor el uso de dicho #define? ¿Viendo los binarios como se a cual registro se refiere?
Por ejemplo
#define USART_BRGH_HIGH 0b00010000 // High baud rate no coincide con el registro TXSTA
Gracias.