Yesterday’s problem, that riddled me for a few hours last night… was that I depended on an array stored in EEPROM to handle the menu system, and for the new AVR’s…. I didn’t initialize the EEPROM. I learned my lesson, I’ll always put a ‘List to do for new AVR’s’ at the top of my projects, so that when I am in that situation again, I’ll look at that list to make sure it works, the first time. Also save often. I was working on the below code, and had it almost finished, when my PC reset. Not fun (Ctrl + S)!
Luckily getting it working was one of the first things I did tonight, the other, was to setup both Wireless Testers (WT) for a timing experiment. They both have 16 MHz resonators, and I want to see how quickly they drift apart with time. So I have a test pin, A0 (PORT C pin 0), that is connected to both WT’s, and a single connected to 3.3V. Each has a 10K pulldown resistor. When I remove the wire from 3.3V, the test starts.
In the test, it gets the current time, compares it to the time the test started, and saves it to a 16GB SD card, and it does this every 100 ms. As I have found in my preliminary testing, sometimes a SD card write can take longer than a second. I have a flag that is set if the time hasn’t exceeded 100ms, at which point it waits until 100ms before taking another measurement. I am curious if as the file gets bigger, will it start to take longer to write to it? Can the arduino handle really big file sizes? I have it running right now, and I intend to leave it running all night.
With both systems working, both LCD’s and SDCards(If I don’t fry it tonight), I’ll start working on the design of the wireless testing plan. Contrary to this test, writing all of the data transferred to the SD card won’t be the objective, the objective will be to test the wireless modules. So a simple time stamp, as well as if the packet was received with the correct checksum, will be sufficient. I will create a simple python script to handle the data, so I won’t have to put it into excel to get the important statistics.
I am really looking forward to making the controller, and all of the little projects that are associated with it. Progress!!!
Here is a code Snippet: