Step 3Some circuit Problems
Apart from the ICSP and processor which we've seen, we now see the charliegrid which will discussed next section. This is the LEDs and limiting resistors in the top right hand corner.
At the bottom left hand corner we see the three microswitches.
Note that the switches just connect three pins on port B to ground.
This was a problem.
I had originally intended to use the weak pullup function on Port B of the 16F88 to save some components, notably pullup resistors on the switch inputs. However when laying out the board I assigned one of the charliegrid control lines to another pin on PortB. This was a simple layout decision, it was easier to layout the board in such a small space by moving the traces to more easily accessible pins on the PCB. If you have enough space you'd connected all of the charliegrid controls lines to the same port.
However when the charliegrid program was written, it worked OK, except for some sort of leakage on LEDs connected to the PortB pin. When one LED was lit up, a couple of other ones lit up weakly. In the end I added pullups to the switches and disabled the weak pullups. You can see the extra added pull up resistors and some prototyping mistake wire in the ICSP picture of the previous section.
Another problem was a silly one, made by me cutting and pasting code from another project to the microdot project without thinking.
I had inadvertantly copied code that enabled the A/D converter for one of the pins. This is a big problem if you then use that pin as an output. It draws too much current and eventually will kill or seriously damage the pin. This is exactly what happened, everything ran OK at first, and after testing overnight I found some LEDs were not lighting at all, and some were lighting several LEDs at once. This took several nights to track down to a faulty RA0 pin....the one I had accidentally configured as an analog input. The charliegrid multiplexing system necessarily configures it's control pins as either input or output.
I replaced the chip, very carefully making sure not to lift the fine tracks in the process and now make sure I disable all analog inputs, which can be seen in the previous sections code fragment.
Last problem was with the power supply. I've used a simple dropping diode to drop the 6V to 5.4V from two button cells, this saved frying the micro everytime you changed batteries. Not the best way to regulate the voltage, but it is very space saving.
The problem came about because I only had a 16F88 device handy, not a 16LF88 device. The 'LF' allows operation down to about 3V, so the battery could drop to nearly half power before the device would stop operating. With the 'F' device, the battery pair can only drop about 1V before the device will start resetting itself because the power is too low.
I'd also planned to get the watch to put itself into low power mode, and wake up when a button is pressed to conserve power. The software at the moment doesn't have this functionality, it will be added when the housing and mounting instructable is written.
So for this section:
- you can't use weak pullups on an charliegrid control signals
- be careful not to configure a charliegrid control signal as an analog input as well
- use a 16LF88 device instead of a 16F88 device so you can get better life from the battery.
| « Previous Step | Download PDFView All Steps | Next Step » |
1
comment
|
Add Comment
|
ian
says:
![]() |
Add Comment
|












































