Playing with timer interruption

1 post / 0 new
tyrantyr's picture
Playing with timer interruption

Hi, guys.

I'm working on a project where I need to interface a Netgear WGR614v8 with two other serial devices. Since the router only have one UART available on the board, I started to work on a soft UART driver, using the GPIO controlled LEDs. At moment, I've developed a module that does the RS232 transmission at baudrate of 4800. To do that, I've changed the HZ kernel variable to 4800 so the timer interrupt is set to that frequency. I have to patch the kernel to accept that frequency, and include my GPIO UART transmission code on the timer interrupt queue. Despite the fact that is recommended that the HZ should not set any higher than 1000, the system runs fine and I could transmit streams of bytes using this GPIO UART without any error.

But the problems arose when I tried to increase the baudrate, cause the device I'm trying to interface needs 19600 at minimum. At this high frequency, the kernel doesn't even boot. Before I get back to the kernel code, trying to hack a solution, I wanna ask here if anybody had a similar problem and could come with an alternative solution. When I was programing ARM microcontrollers, I could to have several timer interrupts running, each running at different frequencies. If we have that on the BCM5354, I could use a timer interrupt for the kernel and a different one for my GPIO UART driver.

Any ideas ?