Show Posts
Pages: [1] 2 3 4
1  Using Arduino / Motors, Mechanics, and Power / Re: Dynamixel Servo Library on: September 28, 2012, 07:18:30 am
Hi,
I am wondering, anyone tried to write the source code firmware in c of Mx28 ?
2  Using Arduino / Programming Questions / Re: Convert 2 pin code into 1 pin code. on: September 19, 2012, 10:55:52 am
Here are some hints:-

To set pin high:

PORTB |=  (1<<2);

To set pin low:

PORTB &= ~(1<<2);
----------------------------------------------------------------------------------

pin14 is PB2 (ie BIT2).

I want BIT2 to go to 0 instead of 1.
----------------------------------------------------------------------------------

instead of

else
      if(pwm<1000)
      {
         OCR1B = (1000-pwm);
         TCCR1A |= bit(COM1B1);
         Motor_Port |= Motor_Clockwise;
      }

just have :

else {
         OCR1B = (1000-pwm);
             TCCR1A |= bit(COM1B1);
             Motor_Port &= ~Motor_Anticlockwise;
 }

-----------------------------------------------------------------------------------

add the line:

uint16_t PWM;

to Motor.c as well
3  Using Arduino / Programming Questions / Re: Convert 2 pin code into 1 pin code. on: September 18, 2012, 08:03:36 pm
sorry Holmes4, i only want c program  to be modified. I don't want arduino codes. I have more hints for you if you want to help me.
4  Using Arduino / Programming Questions / Re: Convert 2 pin code into 1 pin code. on: September 18, 2012, 11:20:57 am
Holmes4. There is no link. I purchased it from electronics shop. It has 5 pins. 5Volt, PWM, DIR, BRAKE, GND.
5  Using Arduino / Programming Questions / Re: Convert 2 pin code into 1 pin code. on: September 18, 2012, 11:00:06 am
Hi Mark, the original code motor.txt don't work with one pin. I want to modify it.
6  Using Arduino / Programming Questions / Re: Convert 2 pin code into 1 pin code. on: September 18, 2012, 10:50:41 am
Here is the full motor.h file.
Code:
#include <avr/delay.h>
#include <avr/io.h>
#include <avr/iom8.h>
#include <avr/interrupt.h>
#include <ctype.h>
#include "UtilsAndDefines.h"

#define Motor_Clockwise BIT2
#define Motor_Anticlockwise BIT1
#define Motor_Port PORTB
#define Motor_Dir DDRB



/**
*@brief simply control PWM for the motor.\n
The pwm must be givem with values between 0 and 2000.\n
The 1000 is the motor stopped. The 0 is the 100% PWM rotating Anticlockwise and the 2000 is the 100% PWM rotating Clockwise
The PWM has increments of one step with 1000 steps of resolution.
*@var pwm This is the pwm to set on the motor
*@return 2 if rotating clockwise.\n
1 if stopped.\n
0 if anticlockwise.\n
-1 if fail or bad value or limit reached.
*/
int8_t SetPWM(uint16_t pwm);


/**
*@brief Init the motor low level control, on this case pins, timers, pwm variables, etc.
*/
void InitMotor(void);

uint16_t PWM;

I also attached the Schematic.I only want to control motor direction from only one pin 14.
7  Using Arduino / Programming Questions / Re: Convert 2 pin code into 1 pin code. on: September 18, 2012, 10:22:09 am
Yes i don't want it for arduino. I want to run it for atmega 8a 32pin tqfp. And the pin 14 of atmega 8a is connected to DIR pin of 10amp motor shield. Please modify motor.txt.
8  Using Arduino / Programming Questions / Convert 2 pin code into 1 pin code. on: September 18, 2012, 07:52:08 am
Hi;I have a motor.c code in which pin 13 and 14 are set\used for clockwise and anti-clockwise direcion as original firmware. I want to use only one pin 14 for DIR and then set the values to HIGH and LOW for clockwise and anti-clockwise direction.
I attached the original code below.
Please tell me how to use the lines below in original code.

#undef F_CPU
#define F_CPU 1000000UL
#include <avr/io.h>
#include <util/delay.h>
int main(void) {
  DDRB = (1 << 2);
  while(1) {
    PORTB |= (1 <<2);
    _delay_ms(200);
    PORTB &= ~(1 << 2);
    _delay_ms(200);
  }
}
9  Using Arduino / Motors, Mechanics, and Power / Re: Diff. B/w PWM and DIR of motor shield board on: September 17, 2012, 02:34:50 am
How I can set the Direction of motor with Values HIGH and LOW in C programming ? smiley-sad
10  Using Arduino / Motors, Mechanics, and Power / Re: Diff. B/w PWM and DIR of motor shield board on: September 14, 2012, 10:04:35 pm
Yes I have the datasheet. It says:-

GND – connect to GND on controlling board
DIR – Pulled down to GND Forward by default and Backward when 5V (logic high)
PWM – Pulse Widht Modulation input to control speed of motor (recommended freq 20Hz to
400Hz)
BRK – breaking input to halt the motor in operations when 5V (logic high)
5V – regulated 5V output from motor driver board (maximum 50mA supply)
11  Using Arduino / Motors, Mechanics, and Power / Re: Diff. B/w PWM and DIR of motor shield board on: September 14, 2012, 04:25:47 am
Thanks. But there is only 1 direction pin in motor driver board. Motor can rotate in 2 directions. How only 1 pin manage this ?
12  Using Arduino / Motors, Mechanics, and Power / Diff. B/w PWM and DIR of motor shield board on: September 14, 2012, 02:04:00 am
Hi,
I want to know the difference between pwm and direction pin of motor driver board. I want to connect 10amp motor driver board with atmega 8a 32pin. Atmega 8a has 3 pins for PWM.
13  Development / Other Software Development / Re: Burn .hex into Arduino UNO 3. on: September 09, 2012, 05:20:24 am
oh but why it will not work ?
14  Development / Other Software Development / Burn .hex into Arduino UNO 3. on: September 09, 2012, 04:43:28 am
Hi; I have a .hex file written for ST CORTEX-M3 ( ST32F103C8 @ 72MHZ,32BIT). I want to burn it inside Uno 3. How I can burn it ? Will the file work properly after burning because Uno 3 has Atmega 328 and the file is written for ARM Cortex smiley-roll-blue
After burning I have to remove the Atmega 328 chip from UNO 3 ?
15  Using Arduino / Motors, Mechanics, and Power / Re: Options for controlling high current DC motors on: September 01, 2012, 09:10:22 am
Can you just tell me how i can connect Suf2001 with uno 3 ? Which pins go where ? I will replace it then.
Pages: [1] 2 3 4