Pages: [1]   Go Down
Author Topic: Bwa ha ha ! Frankenboard lives!  (Read 878 times)
0 Members and 1 Guest are viewing this topic.
Wisconsin
Offline Offline
Newbie
*
Karma: 0
Posts: 30
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Using Arduino IDE and the tutorials from Adafruit and Sparkfun, I've cobbled together a chip to program. I have been using the "upload using programmer" command and then hunting down the cpp.hex in the temp folder, and then uploading via Avrdude. So far though, the blinking and fading led sketches are the only ones that have worked.  Is there a big difference in the way you would write code for an Arduino and a standalone? Or maybe the way the IDE compiles for Arduino vs. what you would want for a standalone?
For example the sweep and knob sketches result in the servo rotating clockwise continuously no matter what changes I make to the code.

Would really appreciate any suggestions. Also if any one wants links to the resources I've used so far I can post those links.

Edit: Frankenboard is a more accurate description
« Last Edit: January 21, 2013, 03:08:06 pm by Robofarmer » Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 439
Posts: 23748
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Maybe not so much "Frankenchip" as "Frankenboard" eh?

IDE only knows which chip you are using; doesn't care about the rest of the board.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

South Texas
Offline Offline
Edison Member
*
Karma: 8
Posts: 1023
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

As long as the chip is a 328/328P the code should run the same whether it was loaded using the Bootloader or using an ISP.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16518
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
For example the sweep and knob sketches result in the servo rotating clockwise continuously no matter what changes I make to the code.

That's because you are not using a real servo, but rather you have an ex-servo. Once a servo has been modified for continuous rotation is ceases to be a servo but rather has been morphed into becoming a bidirectional, variable speed, geared motor drive. So while you still need to use the arduino servo software to interface and control your ex-servo, the write values you send to it causes it to do different things then a standard unmodified servo does with the same write values.

This has nothing to do with running sketch code on a arduino board Vs a standalone circuit.

Lefty

« Last Edit: January 21, 2013, 01:15:31 pm by retrolefty » Logged

Wisconsin
Offline Offline
Newbie
*
Karma: 0
Posts: 30
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I may have misstated that line. I meant to say that it only rotates in a clockwise direction at the same rate, it does hit the stop, but it keeps trying. And knob and sweep do the same thing. I can change the output pin, but nothing else in the code seems to affect anything.
I am beginning to get the sneaking suspicion i just did some really lame small mistake.
Logged

Wisconsin
Offline Offline
Newbie
*
Karma: 0
Posts: 30
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Am I correct in thinking that the IDE does make subtle changes though? Such as pin 9 in the IDE would be translated to pin 14 in the code?
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 439
Posts: 23748
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Only if your code is redefining it. Or are misinterpreting the pin mapping.
Got something you can post?


* Bare_minimum_uC.jpg (66.33 KB, 960x720 - viewed 16 times.)
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Wisconsin
Offline Offline
Newbie
*
Karma: 0
Posts: 30
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That is an extremely useful little .jpg there. I was looking at the schematic and thinking "pin 9" in the code referred to the the ninth pin down the left side to begin with. Then I found the pin map http://arduino.cc/en/uploads/Hacking/Atmega168PinMap2.png and thought that the IDE was doing something in compiling the code so that the signal went to the 14th pin of the controller.  So following this tutorial http://arduino.cc/en/uploads/Hacking/Atmega168PinMap2.png I connect the yellow lead from my servo to the 14th pin on my Atmega328 (which is the only pin putting out any kind of signal) and it should work right?
Looking at the .jpg you provided, how would I know which 9 the code would output on?
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 439
Posts: 23748
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
pinMode(9, OUTPUT);
refers to the pin marked D9 on the symbol, physical pin 15.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Wisconsin
Offline Offline
Newbie
*
Karma: 0
Posts: 30
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, I can see that now. Any idea why my controller is just rotating the servo clockwise like crazy even with the pot disconnected?
Logged

Pages: [1]   Go Up
Jump to: