I couldn’t take it any longer. I haven’t played in a long time so I decided to start from scratch and design another digital clock. I’m working on the board right now. I had one more display, RTC, and 32.768KHz xtal left.
I am building my own display driver this time though. The display driver will be an MCP23S17 multiplexer and a PIC16F690 microcontroller. The display driver that I used in the Picaxe clock was about $8. Not counting the amount of time I’ve spent writing the code my display driver should be about $2. Plus, I really don’t want to have to buy a driver and then spend the money on shipping when I have what it takes to make something work. We’ll see how it goes. In theory it seems like it will work.
I’ll explain more in a few weeks. I’m also tackling this project to create a C header file for the DS1305. It might help someone else out who is trying to work with it.
Well, the clock hasn’t work for a few months. When I plug it in and then unplug it, it shows a few random letters. Then it stops doing anything. Well, I figured that the display driver was broke since I noted it acted quirky in the first article almost two years ago. I was wrong.
It seems that we should always start at the wall and begin troubleshooting from there. Always. This is probably rule number 1. Well, it all boiled down to this: the original wall-wart shorted out and burned up. This leads us to the title.
Check out the new power plug. The original wall wart was a 6 volt output. I am now using a 9 volt output since the 7805 IC would prefer a little more voltage. I also did a current consumption test, and this circuit uses less tham 30mA. Now it can be unplugged and transported much easier.
We are not using a crystal or an RTC for this digital clock!!! This is just a demonstration of the internal timers and is not intended to keep actual time.
So, since we aren’t using an RTC, and we are using just a simple internal RC oscillator embedded in our PIC16F690, what kind of accuracy are we looking at? Well, if you are a perfectionist, than stop reading!!! This will not compete with your Seiko (You’ll see why I said that soon). It can’t compete with the DS1305. What it can do is make a somewhat accurate clock at half the cost and half the soldering(maybe) and half the programming and half… I think you might see my point of why this is a cool project. We all have cell phones and computers that have Atomic timekeeping or something, but who has an Altoids clock? Or whatever you decide to do with it? If you can initial off on the “not perfect” line, please continue. (I’ll explain how inaccurate this thing is in just a few paragraphs) Continue reading →
Last night I was messing around with some stuff just for experimentation’s sake. I might use this in my Datalogger though, so I thought I would explore. I’m using the Pickit 2 to do some experiments on and learn new code. Here’s what I’ve discovered.
Using a potentiometer to trigger events:
In digital inputs, a high (1) is close to 5 volts, and a low (0) is close to ground. That’s all you get. Analog inputs are capable of many intermediate values ranging from either 0 – 255, or more depending on what chip you are using. I’m using the PIC16F690, and it has an 8-bit ADC. In this case ground will return 0×00 (0) and vdd will return 0xff (255).
#fuses intrc_io, nowdt, nobrownout, put
unsigned int adcByte;
setup_adc(adc_clock_internal); //The ADC uses a clock to work
setup_adc_ports(sAN0); //pin 19 ADC0
set_adc_channel(0); //This ADC0 is channel 0
while (1) //stay in this loop until reset
adcByte=read_adc(); //read_adc() return an 8-bit variable
/*I’m using the byte returned as the delay for an LED */
I combined my LCD and temp probe files into one and compiled…and (revised and compiled)*(at least 20 times)! (revised and compiled)*(at least 20 times)=a long night. I started working on this from 3 to 4pm. Then I picked back up at 10pm and I finally had it working by 2am. I now have a temperature, humidity and dewpoint reading. The SHT11 (from eBay or Parallax) is a great little item once you get a program written for it. Since I like to use Microchip and CCS C, I had to write a program, but I used the Basic Stamp examples for guidance. Continue reading →