31 lines
622 B
C
31 lines
622 B
C
|
|
#include <p18f448.h>
|
||
|
|
#include <usart.h>
|
||
|
|
#include <stdio.h>
|
||
|
|
|
||
|
|
int i;
|
||
|
|
|
||
|
|
/*void putch(unsigned char byte)
|
||
|
|
{
|
||
|
|
// output one byte
|
||
|
|
while(PIE1bits.TXIF=0) //set when register is empty
|
||
|
|
continue;
|
||
|
|
TXREG = byte;
|
||
|
|
}*/
|
||
|
|
void main()
|
||
|
|
{
|
||
|
|
//unsigned char i;
|
||
|
|
PORTB = 0;
|
||
|
|
TRISB = 1;
|
||
|
|
TRISC = 0x80; //TRISCbits.RC7 = 1;
|
||
|
|
//TRISCbits.RC6 = 0;
|
||
|
|
|
||
|
|
init_comms();
|
||
|
|
|
||
|
|
do {
|
||
|
|
i = PORTB; // Turn ON diodes on PORTB
|
||
|
|
Write1USART(i); //Usart_Write(i);
|
||
|
|
|
||
|
|
} while(1); // endless loop
|
||
|
|
}
|
||
|
|
|