Hi Guys,
I have an interesting problem that I have come across :S
I think its either a problem with my code or some issue with the hardware.
I’ve posted on a forum specific to the FPGA code so i’m more asking here if people know of any hardware reason the following would be happening??
I’m trying to implement a data link from a UAV (remote controlled plane basically) and a ground computer.
We are using an RF modem to transmit the Uart link from the plane to the ground.
The hardware used is the [HAC-UM96 Ultra Low PowerData Radio Module set to transmit and recieve on the same channel with RS-232 and no parity (8N1).
Hooked up two computers using this device via hyperterminal and works a charm, press any key on one computer at any time and it gets transmitted straight away to the other.
The problem comes when i run the Uart via a max-232 chip on a FPGA. While delay in the following code is less then 10000 all printf get through to the other end of the RF link (PC Nios terminal or hyperterminal). At a delay of 20000; 1 in 5 get through, 30000; 1 in 3, 40000; 1 in 7, 50000; 1 in 2, 100000; 1 in 9.
All of these various delays work fine with a straight rs-232 cable link to the computer its only the RF link that misbehaves.
Is there any reason you can think of that this would be happening??
Thanks
Chris
int main()
{
unsigned int i;
unsigned int j;
unsigned int count;
/* make sure no IRQ enabled */
IOWR(UART_0_BASE, 3, 0x00);
/* flush any characters sitting in the Rx holding register */
i = IORD(UART_0_BASE, 0);
i = IORD(UART_0_BASE, 0);
count=0;
for (;;) {
printf("Hello World! %i\n",count);
count++;
j=0;
while (j<delay)
j++;
//}
}
return 0;
}
](http://www.sparkfun.com/datasheets/RF/HAC-UM96_manual.pdf)