On 15/12/2013 22:28, Jo Even Skarstein wrote:
But I'm wondering about the TXRDY register. I left that test out on purpose simply because in BaS this test always returns true. So I simplified it, but maybe I should have fixed BaS instead... (BaS-gcc, BaS.c, lines 64-69).
As I understand, the PIC is accessible through an internal serial port. The ColdFire serial ports have a FIFO which can buffer a few bytes before actually sending them. By testing TXRDY, you ensure that there is enough room in the FIFO for an additional byte. For a command of 4 bytes, I think it can work without the TXRDY test because all the bytes fit in the FIFO. But for reliable general purpose routines, testing TXRDY is important. The main idea is to avoid losing a byte if the previous ones are not already sent (or buffered).
I am looking into PIC code now, the goal is to get PS/2 working.
The experimental PIC binary that Alan sent me last year worked almost perfectly. I was able to use my PS/2 mouse directly plugged on the FireBee, without any additional Eiffel.
It would be easy to add new features - the battery monitoring - but as BaS is also monitoring the PIC there might be conflicts when reading from it.
The BaS should have an API to disable its internal PIC monitoring, so FreeMiNT can take the control.
-- Vincent Rivière