amitdandyan
Newbie level 6
pic16f876
I have developed the following program to glow an led connected to first pin of PORT B using Mikro C...now the problem is how can i give delay value, eg 250us etc...????
unsigned short i;
void main()
{
TRISB = 0;
PORTB = 0X00;
USART_init(9600); // initialize USART module
// (8 bit, 19200 baud rate, no parity bit...)
while (1)
{
if (USART_Data_Ready()) // if data is received
{
i = USART_Read(); // read the received data
USART_Write(i); // send data via USART
PORTB = 0x01;
Delay_ms('i');
PORTB = 0x00;
}
}
}
I have developed the following program to glow an led connected to first pin of PORT B using Mikro C...now the problem is how can i give delay value, eg 250us etc...????
unsigned short i;
void main()
{
TRISB = 0;
PORTB = 0X00;
USART_init(9600); // initialize USART module
// (8 bit, 19200 baud rate, no parity bit...)
while (1)
{
if (USART_Data_Ready()) // if data is received
{
i = USART_Read(); // read the received data
USART_Write(i); // send data via USART
PORTB = 0x01;
Delay_ms('i');
PORTB = 0x00;
}
}
}