It wasn't pretty. Coding late at night results in repeating mistakes like "uint_8" instead of "uint8_t", and lOts of subtle capItalIzation errors. I should typedef something easier than uint8_t, but it makes the code a little more obscure to someone looking at it later, such as judges.
Another thing that got in my way was the editor that comes with WinAVR, Programmers Notepad, chose Lucida Console for its font. I find it difficult to spot capitalization errors in that font. To compound things, PN uses font styles to do syntax highlighting, so I had to change several styles to make it more usable. It is nice be able to jump right to the syntax error. But I prefer Notepad++.
Programmers Notepad (with font changes)
VMLAB simulator
I quickly discovered a mistake deep inside the I2C handshake I'd inherited from that Atmel App note. I fixed that, and suddenly I've got the LCD display working and conversations happening on the I2C. I still need to figure out why my timer isn't issuing interrupts.
So today I'm feeling really upbeat about making the January 18th deadline. I'll even have simulation results! If I can get those interrupts running and the system going to sleep mode, I'll have exceeded my expectations. Maybe I'll have time to put the complex UI back in. jk!
One reason I jumped to compiling is that I was getting worried I'd outgrown the ATmega328. But that should not be a problem. The image is only 7K of flash so far. The RF functions shouldn't be over 2K. I should double check to see if I can move to the *168 part, although it is only a few cents cheaper.
Speaking of parts, I was watching macetech live streaming their SMT assembly process last night. They are building thirty LED controller boards. And we're not talking an Arduino and a couple through hole connectors. This board is about 4x4 inches, covered with buffer ICs and 603 discretes. And when they finish that task, they have to build some large number of LED boards to go with them. Quite a job using tweezers and a toaster oven.
They pointed out the electronics shortage is really affecting the ability to build stuff. They had to redesign their board a couple times due to the lack of available parts. Just what I need, a part shortage.
p.s. If you click on the PN image, you should quickly see why my system isn't going to sleep...
No comments:
Post a Comment