SPI data transfers

I use SPI  on my micromouse both to talk to the Nokia graphical LCD and to talk to the LS7366 quadrature encoders. A large number of devices can be connected to the SPI data lines, MOSI and MISO. Each device needs its own select line. This all appear very simple and friendly. There is, however a potential problem due to the flexibility of the SPI configuration.

(more…)

Continue ReadingSPI data transfers

Battery voltage monitor

Decimus has one of the ADC inputs dedicated to monitoring the battery voltage. The batteries used in this micromouse are Lithium Polymer cells and it is particularly important that they are not allowed to discharge too far. Since the full battery voltage is about 7.4 Volts, this gets divided by four in a simple resistive divider before being sampled by the ADC.

(more…)

Continue ReadingBattery voltage monitor

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

Wheel assemblies for Decimus 2

The wheels have given me so much trouble that it all has to be downhill from here. This is how they are put together.Good wheels are essential in a micromouse. We want something that is robust, reliable and capable of precision, repeatable movement. There should be no wobbling and shaking and their relationship to the body of the mouse must be constant, or at least predictable. Clearly, the grip of the tyre is essential for high performance. The wheel in a simple mouse will probably need to carry the final stage reduction gear. (more…)

Continue ReadingWheel assemblies for Decimus 2

Primus in control and moving

After a lot of messing about with other stuff, Primus is now back on track and has the basic motion code written and installed. Movement within the maze is possible with steering off the walls to prevent collisions; fixed size moves and in-place turns are functioning; forward error detection and correction is working.

(more…)

Continue ReadingPrimus in control and moving

Formula1 Rat Race – How fast is that?

The schools competition includes a head-to-head drag race called Formula 1. If you want to know how fast you have to be, read this.The Formula 1 Rat Race track is straight and 7.2m long. At the start end is an area 375mm long where the rat starts from. At the end is a 1.2m long area for the mouse to come to a rest. It must not overshoot this area of penalties will be incurred that will almost certainly eliminate the rat from the competition. (more…)

Continue ReadingFormula1 Rat Race – How fast is that?

Feeling our way with sensors

The sensors are a critical part of a micromouse. Primus uses six infra-red reflective sensors. Here is code to test that they are working.Now that we have a nice display to show what the sensor reading are, we can get that module tested. Since the hardware is very simple, there is not a lot to go wrong. Yet somehow I had a dead sensor when I first tested the Primus prototype. It was a simple dry joint that would have been detected by more careful inspection of the board. (more…)

Continue ReadingFeeling our way with sensors