Hi guys, 1st post from a complete newbie.
I’d like to make a box that opens after you turn it in few specific directions as described here: deddieslab.blogspot.ca/2011/01/secret-dicey.html
It is based on Baby Orangutan B-328, MMA7361LC 3-Axis Accelerometer and DS65HB digital servo. The theory is pretty simple: when you turn the box, accelerometer sends signals to Orangutan and if signals match predefined value, the servo turns.
My problem that I have zero programming experience and the code files posted on the project page (yourplaceor.mine.nu/files/secret_dicey012a.c) disappeared from the file hosting. I did search here but couldn’t find the discussion of that project. However, because most of you have long time experience with that controller, you may have a copy of that project source files, or could step-by-step guide me how to re-create them
Looking for your help
We are not familiar with that puzzle box and do not have a copy of the source code for that project. It looks like a neat project. I noticed someone (maybe you) left a comment on the blog post asking the author for the code. Hopefully the author responds with the source code.
This might be an ambitious project for someone with no programming experience. If you do decide to recreate this project, you might start by looking at the Baby Oranguntan B User’s Guide and the Pololu AVR Library Command Reference. The “Orangutan Analog-to-Digital Conversion” and “Orangutan Servos” sections in the Pololu AVR Library Command Reference explain how to read analog inputs and control servos with our Orangutan robot controllers.
Yes, I left the message for the author, but looking at his activity during last years I have a little hope for that. I already looked at the documentation, and it is well described, so should be no problem to connect, program and configure these devices. However I see there some additional (and I believe needed) features as auto power shut down, that may be an issue for me to recreate.
Though the idea of that project is neat, I wanted to take it to the next level I work with leather and will make that box covered with nice carved and tooled leather.
Connected and programmed and it works!
The only issue - it not always changes the state when turned (probably accelerometer’s output doesn’t always match the constants in the programm).
I tried to debug it with Atmel Studio and Pololu USB AVR programmer and found that it doesn’t support debug with Atmel Studio…
Any suggestions? Should I go for another device with debug functionality?
For debugging, I recommend using the USB-to-TTL-serial adapter feature available on the Pololu USB AVR programmer. You can connect the TX pin on the Baby Orangutan (PD1) to the RX on the programmer and have your program send information about its state via serial. You can read more about using the USB-to-TTL-serial adapter feature in the “Communicating via the USB-to-TTL-Serial Adapter” section of the Pololu USB AVR programmer user’s guide.
Can I connect Atmel -ICE Basic debugger to the standard programming interface of Baby Orangutan without modifying the Baby-O?
I’d like to use this debugger from Atmel: http://store.atmel.com/PartDetail.aspx?q=p:10500377#tc:description
I am not familiar with that ICE debugger, but according to the Atmel-ICE user guide, you should be able use the debugWIRE interface with megaAVRs using the ISP header. For interfacing with our Baby Orangutan, you will probably have to remove the capacitor from the RESET line, which is the capacitor closest to the PB5 pin. You might find this thread on using the AVR Dragon with the Baby-O helpful.
Unfortunately the board was already installed inside the box and I have an access only through its 6-pin connector. Can’t modify the board.
Is there another debugger that was tested with this unmodified board?
I do not know of any debuggers that work with the Baby Orangutan without any modification. As I mentioned before, you might be able to use the TX pin to communicate with the AVR programmer to debug it. Alternatively, if there is an LED visible, you could have it flash specific signals for debugging. Also, you could write debugging data to the EEPROM during the run and read it with the AVR programmer.
That’s a good idea, thanks!