-
Close Enough
09/17/2020 at 22:04 • 0 commentsI decided to stick to 16F15345 and see where I can reduce code.
I wanted to use the haversine formula to calculate distance between the current location and the secret location but did not have enough program memory to do floating point operations. So I started scaling things down, start using equarectangular approximation and then a cosine approximation.
To approximate cosine I used the CORDIC algorithm in fixed point.
After all that, I realized I don't need to any of that math and can just see if the difference between my two coordinates is small enough. It's not an exact distance but it's close enough.
-
Mistakes and dilemmas
08/19/2020 at 00:05 • 0 commentsI started running out of space on the PIC16F15345, so I ordered what I thought was a drop in replacement with more memory. I made a mistake, the PIC16F18346 is not.
First issue is that it only has one UART port and I need two. I haven't looked through all the differences yet but trying to think through my options. There are no other 20 pin PICs that seem to fit.
1. Use the 16F18346 and write or find a software defined UART library.
2. Go back to 16F15344 and see if I can squeeze everything I need into the memory. This is toughy because there is some geometry calcs that are needed. Also want to eventually use a bootloader for flashing.
3. Respin the board for a bigger MCU. I plan on respining the board eventually but not for this version. Seems wasteful to do it now.
-
Locking clip
08/17/2020 at 18:13 • 0 commentsTook a long time to get this locking clip in. I tried just chiseling away the wood and have the solenoid latch to the wood but that didn't work so well. I made the clip but it was very hard to screw it in. The space is very tight and I didn't have a way to pre-drill. It came out a bit crooked but works.
Only downside is that the solenoid needs to be retracted before you can lock the box. That can be done with a finger or through a command.
-
Solenoid mounting
08/11/2020 at 00:55 • 0 commentsTook me a long time to figure out how to mount the solenoid. Milled out a little mounting plate.
-
GPS Configuration
07/22/2020 at 00:48 • 0 commentsSpent some time debugging GPS communication. I couldn't get the GPS to respond to my configuration commands. Turned out it was all on the terminating characters. For some reason, which I haven't spent time understanding, sending "\r\n" is not the same as sending 0xD 0xA.
-
Mechanical troubles
07/21/2020 at 12:32 • 0 commentsThe mechanical portion of this has been a struggle every step of the way. Worked on trying to install the latch plate, but can't get a screw driver in, so using tacs for now.
Also noticed the assembly that's holding the solenoid to the board is loose. I will need to add some lock washers to get a bit more bite.
-
Firmware work continues
07/17/2020 at 01:05 • 0 commentsToday been fixing some issues with integrating the different pieces of firmware. Had to trouble getting GPS to read out but can now read it but not getting a fix. Not sure what changed as it used to work.
Also got the solenoid to fire on command, because it's fun.