saeed_pk
Full Member level 4
- Joined
- May 20, 2006
- Messages
- 237
- Helped
- 35
- Reputation
- 68
- Reaction score
- 28
- Trophy points
- 1,308
- Location
- Islamabad, Pakistan
- Activity points
- 2,655
Hi alls,
I am using usart in PIC16F877 i want to make a Parallel to serial converter baud rate 1200 bps i made PORT B as inputs and i want to transmit serially what is fed to PORTB
i am using Mikro C Compiler by MicroElectronica and using following code
unsigned short i;
void main()
{
TRISB=0x0F;
USART_init(1200);
while(1)
{
i=PORTB;
USART_Write(i);
}
}
it does not work
but when i just receive 0-255 numbers it works by following code
unsigned short i;
void main()
{
TRISB=0x0F;
USART_init(1200);
// initialize USART modul // (8 bit, 2400 baud rate, no parity bit...
for(i=0;i<256;i++)
{
USART_Write(i);
if(i==255)
i=0;
}
}
Please Help me what i do
I am using usart in PIC16F877 i want to make a Parallel to serial converter baud rate 1200 bps i made PORT B as inputs and i want to transmit serially what is fed to PORTB
i am using Mikro C Compiler by MicroElectronica and using following code
unsigned short i;
void main()
{
TRISB=0x0F;
USART_init(1200);
while(1)
{
i=PORTB;
USART_Write(i);
}
}
it does not work
but when i just receive 0-255 numbers it works by following code
unsigned short i;
void main()
{
TRISB=0x0F;
USART_init(1200);
// initialize USART modul // (8 bit, 2400 baud rate, no parity bit...
for(i=0;i<256;i++)
{
USART_Write(i);
if(i==255)
i=0;
}
}
Please Help me what i do