chuat
Member level 1
- Joined
- May 11, 2011
- Messages
- 41
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 1,288
- Activity points
- 1,559
#include <p18C452.h>
#include <usart.h>
void main(void)
{
// configure USART
OpenUSART( USART_TX_INT_OFF &
USART_RX_INT_OFF &
USART_ASYNCH_MODE &
USART_EIGHT_BIT &
USART_CONT_RX &
USART_BRGH_HIGH,
25 );
while(1)
{
while( ! PORTAbits.RA0 ); //wait for RA0 high
WriteUSART( PORTD ); //write value of PORTD
if(PORTD == 0x80) // check for termination
break; // value
}
CloseUSART();
}
OpenUSART( USART_TX_INT_OFF &
USART_RX_INT_OFF &
USART_ASYNCH_MODE &
USART_EIGHT_BIT &
USART_CONT_RX &
USART_BRGH_HIGH,
[COLOR="red"]25[/COLOR] );
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?