LCD testing for Decimus

Having installed the LCD, it was time to get the code working for it. First I realised that it may not have been so clever to put the LCD on the same SPI port as the encoders. This will mean that I have to take care that the encoders are not being read when the LCD is active. Since the encoders are sampled every interrupt, it means turning them off while writing to the screen. That, in turn, means not writing to the screen while moving, or holding position. I may end up having to patch the board to put the LCD on the other SPI port. In fact, I wish I had done that in the first place as it would just share lines with the UART and I could easily switch between the UART and the SPI for writing debugging messages. Ah well, live and learn. (more…)

Continue ReadingLCD testing for Decimus

Adding a timer and the graphical LCD

primus micromouse splash screenThis is a fairly big jump. With the LEDs and buttons tested, it is time to add the main graphical display, made from a Nokia cellphone display. Also, there is the main system timer event.

The simple user IO is working, and it is time to add a system timer. This will generate an interrupt every millisecond. In the final mouse a lot of work will be done in here – processing buttons, driving the LEDs, reading sensors and calculating drive signals for the motors.While that may seem a lot in a millisecond, the dsPIC used in primus can execute about 16,000 instructions in that tme and we should only need a small proportion of that time. (more…)

Continue ReadingAdding a timer and the graphical LCD