Show Posts
Pages: [1]
1  Using Arduino / Networking, Protocols, and Devices / Re: Official WiFi shield Network Scan problem on: November 21, 2012, 01:07:32 am
Now I’ve updated the post. I’ve uninstalled the flip to simulate the problem you met with. And install the flip again to test on my wifi shield sucessfully!
Please check the links for downloading the flip from ATMEL.
If possible, please try it again. Even if there're some other problems, please leave a reply on the DFRobot link. I will follow this case and make it clearer!
2  Using Arduino / Installation & Troubleshooting / Re: Updating Firmware on Arduino WiFi shield on: November 14, 2012, 03:17:53 am
I am trying to do this on Windows. And all it says on all the guides
Windows: use flip to upload the hex file to your board

But the problem I have is that I can't find the chip on the list of devices to be able to do that.
Here is the list I get on FLIP:

AT89C5115       AT89C51AC2       AT89C51ED2     AT89C51RD2       AT89S58         AT90USB1286    AT90USB82
AT89C5130       AT89C51AC3       AT89C51IC2      AT89C51RE2       AT89S64         AT90USB1287    ATmega16M1
AT89C5131       AT89C51CC01     AT89C51ID2      AT89C51SND1     AT90CAN128    AT90USB162     ATmega16U2
AT89C5132       AT89C51CC02     AT89C51RB2     AT89C51SND2     AT90CAN32      AT90USB646     ATmega16U4
                      AT89C51CC02     AT89C51RC2     AT89D54            AT60CAN64     AT90USB647      ATmega32C1

ATmega32M1    ATmega64M1        ATxmega128B3      ATxmega256A3BU    ATxmega384C3      ATxmega64B3
ATmega32U2    ATxmega128A1U   ATxmega128C3      ATxmega256A3U      ATxmega64A1U     ATxmega64C3
ATmega32U4    ATxmega128A3U   ATxmega16A4U      ATxmega256C3       ATxmega64A3U     
ATmega32U6    ATxmega128A4U   ATxmega16C4        ATxmega32A4U       ATxmega64A4U
ATmega64C1    ATxmega128B1     ATxmega192A3U     ATxmega32C4         ATxmega64B1

Which one should I choose I tried most of them and when I try to connect it says : "Could not open USB device".

I just wrote a simple step by step tutorial for how to upgrade Arduino WIFI shield on windows by using AVR32 studio. Here's the link.
Hope it's helpful!
3  Using Arduino / Project Guidance / Re: Interrupts and PWM/DigitalWrite on: October 15, 2012, 05:56:42 am
After testing several times on my mobile platform, finally, figure out the problem is that the high-frequency electromagnetic interference from motor driver affect the interrupt signal.And we found a simple solution for this problem also. We could use a simple RC circuit made by a 10K resistor and a 104p capacitance to filter the interference.

Here is a simple connection photos for it. Please check it! smiley-confuse
4  Using Arduino / Project Guidance / Re: Interrupts and PWM/DigitalWrite on: October 10, 2012, 03:30:25 am
I've got some new conclusion from my testing today.

#define LEFT 0
#define RIGHT 1
long coder[2] = {
int lastSpeed[2] = {

#define LFDirPin 4
#define LFMotorDriverPin 5
#define RTMotorDriverPin 6
#define RTDirPin 7

void setup(){
  Serial.begin(9600);                            //init the Serial port to print the data
  attachInterrupt(LEFT, LwheelSpeed, CHANGE);    //init the interrupt mode for the digital pin 2
  attachInterrupt(RIGHT, RwheelSpeed, CHANGE);   //init the interrupt mode for the digital pin 3
void loop(){
  static unsigned long timer = 0;                //print manager timer
  if(millis() - timer > 1000){                   
    Serial.print("Coder value: ");
    Serial.print("[Left Wheel] ");
    Serial.println("[Right Wheel]");
    lastSpeed[LEFT] = coder[LEFT];   //record the latest speed value
    lastSpeed[RIGHT] = coder[RIGHT];
    coder[LEFT] = 0;                 //clear the data buffer
    coder[RIGHT] = 0;
    timer = millis();

void InitDriverPins(){

void RunMotor(){
void LwheelSpeed()
  coder[LEFT] ++;  //count the left wheel encoder interrupts
void RwheelSpeed()
  coder[RIGHT] ++; //count the right wheel encoder interrupts

I tried the same code above on my two Romeo board. But get the different result like the picture posted. One of the Romeo is v1.0. And the other one is v1.1. The different between two Romeo board is just that the old one is using the Duemilanove bootloader and the new one is using the Uno bootloader.

It seems that the old version board works properly with encoder and the feedback is really stable. Even if you force to stop the rotation of the motors, it could get the right feedback. But the new Romeo board with Uno bootloader will attach some randomly error interrupts like you guys said.

I will keep working on figuring out the reasons of this problem. I'm gonna to flash the old duemalinove bootloader on my new Romeo v1.1 board to figure out if it's a bug.
5  Using Arduino / Project Guidance / Re: Interrupts and PWM/DigitalWrite on: October 10, 2012, 02:51:59 am
We are using new, fully charged 7.2v (2800 mAh NiMH) batteries on 2wd platform, v1.1 Romeo controller... 40% duty cycle PWM. USB is also connected at 9600 baud (to get data back to the Serial Monitor).

Note that we have looked at the signals on an oscilloscope--the signals from the encoders are very clean. I've also tried switching from PWM on 5 and 6 to 2 and 13, but the results are the same: at higher duty cycles, the ISR is being invoked a seemingly random factor of 2-20 times what is expected.

Hi, have you tested the working voltage of the sensor when motor is running? On the other hand, have you another new encoder?
6  Using Arduino / Project Guidance / Re: Interrupts and PWM/DigitalWrite on: October 09, 2012, 02:36:47 am
The encoder connection picture
7  Using Arduino / Project Guidance / Re: Interrupts and PWM/DigitalWrite on: October 09, 2012, 02:33:05 am
Hi guys,

I have a problem. I am trying to use my rotary encoders and interrupts. Whenever I try to use interrupts to count the number of rotation hits, the value is totally wrong.  If I rotate the wheel by hand the value is correct but when I use the analogWrite function for PWM, the value is way higher then it should be.  I've even tried using the digitalWrite function for 100% duty cycle PWM but I get the same result, an incorrect count value for the encoders.  I am using DFRobot encoders:
The resolution is: 20 PPR.

here is my code:

#define encoder1PinB  3
#define rightMotorIn 5
#define rightMotorOut 6
volatile unsigned int encoder1Pos = 0;
int dutyCycleRight = 200;

void setup() {
  pinMode(encoder1PinB, INPUT);
  digitalWrite(rightMotorOut, LOW);
  attachInterrupt(1, doEncoder1, RISING);
  Serial.begin (9600);
  Serial.println("start");                // a personal quirk


void loop(){
  analogWrite(rightMotorIn, dutyCycleRight);

void doEncoder1() {

Any help would be awesome!



I have used the sample code to test my encoder with my DFRobot Romeo and it works fine.
Here's a list of what I'm using.
1. Arduino IDE 1.01
2. DFRobot Romeo controller
3. Same encoders from DFRobot

Generally speaking, if you could get the right feedback from the encoders, when turning the wheels by hand. But it's not working properly when running the motors. It means that your power supply is not strong enough. So the working voltage of your system is not stable @5v(maybe lower than 4v). Then the sensor can't work properly. Then you get the wrong interrupts.

1.So I suggest you test your 4wd/2wd with the external power supply such as 7.4v battery or 7v power adapter to supply power for your Arduino board. The max current of usb is just 800mA. So the single power supply from USB is not suitable for testing the sensors when running the motors.
2.Test the working voltage of the encoders to avoid the power supply problems.

This's my connection pictures.
Pages: [1]