NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Everything Else » Nerdkits Simulator
August 28, 2013 by countryguy828 |
Somewhat thinking outloud here... Is there some sort of simulator software out there to test programs with before downloading to the nerdkit? If not how hard would it be to create some such software? Dave |
---|---|
August 28, 2013 by pcbolt |
Dave - AVR studio has emulator capabilities. I'm not sure how well they work though. I played around with the AVR debugger and an Dragon programmer (using the debugWire interface) awhile back and one of the things that's almost impossible to simulate is timing and interrupts. For instance using just a "delay_us(10)" statement will step through tons of NOP statements unless it's disabled. The one thing I found helpful if I wasn't at home to test code on a chip, was to write code and compile it with a "gcc" and see if it ran in a console screen. Then later on I could import it into my project code, make some tweaks and upload it to a chip for testing. |
August 31, 2013 by countryguy828 |
Hi Guys, I tossed together a sketch of what I had in mind for a Simulator. Here is a screenshot. Dave |
August 31, 2013 by Noter |
That looks pretty cool but it's a lot less work just to test programs on the real thing especially when you start using sensors. How would you simulate a temperature sensor? And if you do what about the hundreds of other sensors? Then it gets even more complex when you start using SPI, I2C, or one wire busses to talk to smart devices like a real time clock or external eeprom. And timing or interrupts like pcbolt mentioned would need consideration too. Pretty hard to beat the real nerdkit and it fits in your pocket for road trips. The biggest drawback to the nerdkit out of the box is flipping the program/run switch and resetting power to start the the new program. When you get tired of that get an ISP programmer and it's all automatic, just type 'make' hit return on the PC when you're ready and it's all done for you. Doesn't get much easier than that. |
September 01, 2013 by countryguy828 |
Guess my idea isn't too practical. In an attempt to get some new discussion going I posted this to see what other's ideas were on this idea. I may continue to play with it a little more. For me sometimes I'm away from home and can only take laptop not the whole pile of parts so it was an idea I could test code with. After I had the interface done in visual basic I realized...Maybe I should have done this in Java so non windows guys could use it. Then again its been two years since I touched Java... Dave |
September 01, 2013 by Noter |
You would probably spend all your time working on the simulator instead of a nerdkit program anyway. No doubt it would give you something to do when you're away from home but maybe you'd get more bang from studying and learning to program your cell phone when you're not around the nerdkit. I have a lot of fun interfacing my cell phone to my nerdkit projects. |
September 03, 2013 by JimFrederickson |
While I think that the Simulation Project would be interesting, I think you may get Maybe a better example of what I mean is that "the Simulation Project could take up so Trying to effectively incorporate the code necessary to do a simulation as well as Then the simulation vs real hardware testing differences may take more time as well. That being said... I have a small box, about 6" x7", that incorporates the AVR, LCD, and Keyboard. That There are times though, for many projects that I need the pins to do other things For situations as the above I have done something similar to what you have Prototyped So I have a "virtual keyboard and virtual LCD that are on the PC and connected to the I tried using C, VB, and Java. But those did not enable seamless operations between Linux and Windows. (Most of my Ultimately I went with Python. (I would have preferred to stay with Java, but I I am not a Python "Fan Boy" per se'. There are lot of things I don't like about The things I do like though are it's great ability to have the same program run on I use: Python 2.7 and 3.3 (transitioning.) I go back and forth between Geany and Programmer's Notepad for editing. (Probably will |
September 03, 2013 by pcbolt |
Dave - You're project sort of tweaked my curiosity and I had a look at the Atmel Studio 6.0 simulator. There is a video HERE that shows the very basics of what you need to do to set things up. I didn't realize you could have an external file that could simulate inputs for you...that's pretty cool. Unfortunately the video doesn't go in to that kind of detail. It looks like it would be fun to play around with when you're on the road. |
Please log in to post a reply.
Did you know that NerdKits has been featured on Slashdot, Hack A Day, Hacked Gadgets, the MAKE blog, and other DIY-oriented websites? Learn more...
|