go away spammer

Author Topic: avrisp mkii noy connecting to axon  (Read 5760 times)

0 Members and 1 Guest are viewing this topic.

Offline pk44Topic starter

  • Jr. Member
  • **
  • Posts: 22
  • Helpful? 0
avrisp mkii noy connecting to axon
« on: January 18, 2011, 04:01:01 PM »
i have the avrisp mk2 hooked up to my usb port and axon. when i go to the connect button and select the avrisp mk2 and hit connect it first says connection failure and then after the second try the program always freezes. also for some reason my left servo slowly turns when i hook up the usb port,that might have something ti do with it. thanks for any help, im obviously new at this.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: avrisp mkii noy connecting to axon
« Reply #1 on: January 19, 2011, 10:08:14 AM »
What are the colors of the two LEDs on the AVRISP mk2 programmer?

Also, try restarting your computer.

Offline pk44Topic starter

  • Jr. Member
  • **
  • Posts: 22
  • Helpful? 0
Re: avrisp mkii not connecting to axon
« Reply #2 on: January 20, 2011, 11:25:29 AM »
the light is green so it should be connecting and i restarted my computer but that didn't work. i tried running the bootloader in DOSBox but that did not work either. :(

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: avrisp mkii noy connecting to axon
« Reply #3 on: January 20, 2011, 07:15:53 PM »
Are both lights green, or just one light is green?

What is your battery voltage (check with multi-meter).

Also, what is your operating system?

Offline pk44Topic starter

  • Jr. Member
  • **
  • Posts: 22
  • Helpful? 0
Re: avrisp mkii noy connecting to axon
« Reply #4 on: January 22, 2011, 04:32:20 PM »
There is only one light on this. It says mkii though. My operating system is windows 7. My battery is 6 volts if it is functioning properly. Thanks for the help.

Offline pk44Topic starter

  • Jr. Member
  • **
  • Posts: 22
  • Helpful? 0
Re: avrisp mkii noy connecting to axon
« Reply #5 on: January 22, 2011, 04:40:38 PM »
i think i might have just figured out why it does not work. The driver software for the isp doesn't seem to be compatible, even when installing manually using the hardware wizard. but does that explain why the bootloader doesn't work on my VM?

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: avrisp mkii noy connecting to axon
« Reply #6 on: January 22, 2011, 04:46:32 PM »
Quote
There is only one light on this.
There must be TWO green lights for it to program properly.

Unplug it from both the Axon and your computer. Then only plug it into your computer. Does only one green light turn on when plugging it in?

Quote
My battery is 6 volts if it is functioning properly.
Measure it with a multimeter.

Offline pk44Topic starter

  • Jr. Member
  • **
  • Posts: 22
  • Helpful? 0
Re: avrisp mkii noy connecting to axon
« Reply #7 on: January 23, 2011, 12:45:02 PM »
Sorry, i mean there is only one LED on the programmer, there are not two, the only one there is lights up. I don't have a multimeter. I really do think that it is a problem with the driver not installing correctly though.

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: avrisp mkii noy connecting to axon
« Reply #8 on: January 23, 2011, 02:38:03 PM »
The user guide for the programmer http://www.atmel.com/dyn/resources/prod_documents/AVRISPmkII_UG.pdf may help - re the lights. Apologies if you've already got that link.
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: avrisp mkii noy connecting to axon
« Reply #9 on: January 23, 2011, 05:20:58 PM »
Unplug it from both the Axon and your computer. Then only plug it into your computer. Does only one green light turn on when plugging it in?

Good chance your battery is dead. Try another 6V battery thats fully charged.

Offline pk44Topic starter

  • Jr. Member
  • **
  • Posts: 22
  • Helpful? 0
Re: avrisp mkii noy connecting to axon
« Reply #10 on: January 26, 2011, 07:56:13 PM »
well i finally got some code to upload using the bootloader in windows xp mode :). thanks for the help. But there is one more thing i would like to ask. i have this code in my control.c file that i wrote to make my robot which has two modified servos turn left when it detects a wall. i am good a C++ but know nothing about programming microcontrollers. here it is:

int range;

void update(void)
void robot(void)

void control(void)
{
       robot();
}
void update(void)
{
       range= sharp_IR_interpret_GP2D12(a2dConvert8bit(0));
}
void robot(void)
{
      update();
      while(1)
      {
             update();
             if(range < 10 )
         {//go left
          servo( PORTE,7,550);
          servo( PORTJ,6,550);
          }
             else
             {
                     servo(PORTE,7,600);
                     servo(PORTJ,6,800);
             }
       }
}

i have included sensors.c and hardware.c in my source files. thanks for any help!

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: avrisp mkii noy connecting to axon
« Reply #11 on: January 26, 2011, 08:37:03 PM »
Whats wrong with the code/robot?

Offline pk44Topic starter

  • Jr. Member
  • **
  • Posts: 22
  • Helpful? 0
Re: avrisp mkii noy connecting to axon
« Reply #12 on: January 26, 2011, 10:01:32 PM »
i cant believe i neglected to say the most important part! well, it just doesn't seem to do anything. the servos never move at all in any direction no matter how many times i put my hand or a box in front of the sensor. i think i need to calibrate the sensor or set it up to function in the code somehow but i couldn't find a clear explanation of how to do this on the source code page. thanks for your help, i really appreciate people taking the time to answer my very uneducated questions! but since this is my first robot i am hoping that i can just learn by doing.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: avrisp mkii noy connecting to axon
« Reply #13 on: January 26, 2011, 10:07:01 PM »
right before this line:
if(range < 10 )

add this line:
rprintf("\nrange is %d",range);

It'll be obvious why it's not working after you do that :P

Also, change:
int range;

to be:
unsigned int range;

Offline pk44Topic starter

  • Jr. Member
  • **
  • Posts: 22
  • Helpful? 0
Re: avrisp mkii noy connecting to axon
« Reply #14 on: January 27, 2011, 09:15:26 AM »
where does printf() output to if i do  not have and lcd screen attached? can i leave the axon hooked up to the usb port and have it output to the computer?

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: avrisp mkii noy connecting to axon
« Reply #15 on: January 27, 2011, 09:47:51 AM »
can i leave the axon hooked up to the usb port and have it output to the computer?
Yeap. Use hyperterminal to view the data. It's by far the best way to debug software, by outputting data to your PC.

Offline pk44Topic starter

  • Jr. Member
  • **
  • Posts: 22
  • Helpful? 0
Re: avrisp mkii noy connecting to axon
« Reply #16 on: January 27, 2011, 02:53:52 PM »
i added the printf and connected in hyperterminal but nothing seems to be happening. no information is being displayed in hyperterminal for some reason. could i learn what is wrong without hyperterminal?

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: avrisp mkii noy connecting to axon
« Reply #17 on: January 27, 2011, 03:14:13 PM »
You will need hyperterminal to debug problems in the future, not just the one here. Trust me on this, it'll save you tons of time in the future for a small time investment now.

follow this tutorial:
http://www.societyofrobots.com/programming_data_logging.shtml

Offline pk44Topic starter

  • Jr. Member
  • **
  • Posts: 22
  • Helpful? 0
Re: avrisp mkii noy connecting to axon
« Reply #18 on: January 27, 2011, 05:18:27 PM »
i followed the tutorial word for word but it still isnt working. i have tried now a couple times but it hasnt work. i re-checked my code too. any advice?

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: avrisp mkii noy connecting to axon
« Reply #19 on: January 27, 2011, 07:46:35 PM »
You need to get a multi-meter, or at least a fully charged battery before we continue. I suspect your battery is dead. :P

Offline pk44Topic starter

  • Jr. Member
  • **
  • Posts: 22
  • Helpful? 0
Re: avrisp mkii noy connecting to axon
« Reply #20 on: January 27, 2011, 09:00:39 PM »
okay, so i plugged my other battery in and it didn't work either. so i guess i'm out to buy a charger or a multimeter...

Offline pk44Topic starter

  • Jr. Member
  • **
  • Posts: 22
  • Helpful? 0
Re: avrisp mkii noy connecting to axon
« Reply #21 on: January 28, 2011, 01:22:47 PM »
i changed my code to webbotlib. here it is, still doesn't work:


#include "sys/axon.h"
#include "servos.h"
#include "a2d.h"
#include "Sensors/Distance/Sharp/GP2D12.c"

 
// Define two servos
SERVO left = MAKE_SERVO(FALSE, E3,1500, 500);
SERVO right = MAKE_SERVO(TRUE , E4,1500, 500);
 
// Create the list - remember to place an & at the
// start of each servo name
SERVO_LIST servos[] = {&left,&right};
 
// Create a driver for the list of servos
SERVO_DRIVER bank1 = MAKE_SERVO_DRIVER(servos);

//make sensor
Sharp_GP2D12 sensor = MAKE_Sharp_GP2D12(ADC0);
 
//the larger this number, the more likely your robot will drive straight
#define threshold 8
 
// In my initialising code - pass the list of servos to control
void appInitHardware(void){
    // Initialise the servo controller
    servoPWMInit(&bank1);
    // Give each servo a start value of 'stop'
    act_setSpeed(&left, 0);
    act_setSpeed(&right,0);
   distanceInit(sensor);
}
TICK_COUNT appInitSoftware(TICK_COUNT loopStart){
    return 0;
}
 
// This is the main loop
TICK_COUNT appControl(LOOP_COUNT loopCount, TICK_COUNT loopStart){
   distanceRead(sensor);
    if(sensor.distance.cm < 10){
        // go left
        act_setSpeed(&left,DRIVE_SPEED_MIN);
        act_setSpeed(&right,DRIVE_SPEED_MAX);
    }else{
        // Go forwards
        act_setSpeed(&left,DRIVE_SPEED_MAX);
        act_setSpeed(&right,DRIVE_SPEED_MAX);
    }
    return 20000; // wait for 20ms to stop crazy oscillations
}

could the battery explain the code not working (if it is right) as well as hyperterminal?

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: avrisp mkii noy connecting to axon
« Reply #22 on: January 28, 2011, 04:08:20 PM »
could the battery explain the code not working (if it is right) as well as hyperterminal?
Yeap.

Also, programming the Axon on a low/dead battery can on very rare chance brick it (a very bad thing).

Offline pk44Topic starter

  • Jr. Member
  • **
  • Posts: 22
  • Helpful? 0
Re: avrisp mkii noy connecting to axon
« Reply #23 on: January 28, 2011, 08:00:37 PM »
i charged my battery for about an hour, it might need more, but still nothing is working. not even the bootloader. does the red power light still come on if it is 'bricked'?

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: avrisp mkii noy connecting to axon
« Reply #24 on: January 28, 2011, 09:24:08 PM »
The red LED should turn on if the Axon is receiving power, no matter what. My bet is your battery is the problem.

Are you sure you are plugging in the battery the right way? :P

Offline pk44Topic starter

  • Jr. Member
  • **
  • Posts: 22
  • Helpful? 0
Re: avrisp mkii noy connecting to axon
« Reply #25 on: January 28, 2011, 09:41:04 PM »
yes, black cable on the outside, right? the red light still turns on so i was just wondering if it wouldn't be on if it was 'bricked'.but since it can still be on there is a possibility i might have bricked it because it is not programming anymore. thanks.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: avrisp mkii noy connecting to axon
« Reply #26 on: January 28, 2011, 11:49:09 PM »
If it is bricked, it will give you an error when trying to program it. Are you plugging the battery into the BAT pin?

Do the servos twitch when you plug the battery in? If not, power is probably too low. Definitely get a multi-meter to check the battery.

Also, what else do you have plugged into your Axon? Just two servos and one sharp IR?

Offline pk44Topic starter

  • Jr. Member
  • **
  • Posts: 22
  • Helpful? 0
Re: avrisp mkii noy connecting to axon
« Reply #27 on: January 29, 2011, 10:34:43 AM »
well i got an error last night but today it programmed smoothly, so that's strange but i guess its not bricked :).the servos do not twitch when i plug the battery in but i charged it for 2 hours(the amount of time recommended). but yes, all i have plugged in is two servos and a sharp ir.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: avrisp mkii noy connecting to axon
« Reply #28 on: January 29, 2011, 11:25:31 AM »
What was the error you got?

Offline pk44Topic starter

  • Jr. Member
  • **
  • Posts: 22
  • Helpful? 0
Re: avrisp mkii noy connecting to axon
« Reply #29 on: January 29, 2011, 11:44:39 AM »
well, the bootloader has been working strangely lately, i think that my code that is running is now preventing it from connecting. is there a way to manually clear the flash? in debugging my program it looked like it didn't even make it to the main loop so i need to reupload code to see what is going on. so i think it might be the code and not the battery.

 


Get Your Ad Here

data_list