go_away

Author Topic: Programming the tiny2313.  (Read 1669 times)

0 Members and 1 Guest are viewing this topic.

Offline yash25Topic starter

  • Full Member
  • ***
  • Posts: 82
  • Helpful? 0
Programming the tiny2313.
« on: July 07, 2009, 04:45:12 PM »
Hi everyine. I'm making a basic Photovore bot with the Tiny2313. And I'm making it the exact same way as that shown in the 50$ robot tutorial. I'm also programming the chip with the 10 pin ISP cable which goes to the serial port of the pc. The only two places where i have diverted my project from the 50$ robot are as follows:
1) I've used a tiny2313 instead of the atmega8.
2) I'm using coreless pager motors instead of servos( with a motor driver circuit L293D).

Now, what changes do I make in my program and how ( so that my program satisfies both the modifications I have made in the circuit)?
Scientists dream about doing great things. Engineers do them.

Offline jamort

  • Supreme Robot
  • *****
  • Posts: 375
  • Helpful? 2
Re: Programming the tiny2313.
« Reply #1 on: July 07, 2009, 07:43:57 PM »
well the first thing your going to have to do is change what pins the output/ inputs on... im not really sure as im not familiar with the attiny series from atmel... then instead of digital output i believe its going to have to be analog... correct me if im wrong so its going to be rather much to change
my english teacher once said, "dont talk about what you dont know in public...."

so I replied the truth, " Exactly why I dont ever talk about English."

Offline SmAsH

  • Supreme Robot
  • *****
  • Posts: 3,959
  • Helpful? 75
  • SoR's Locale Electronics Nut.
Re: Programming the tiny2313.
« Reply #2 on: July 08, 2009, 12:46:48 AM »
get the datasheet and where it says PD0, PD1 etc... thats where stuff will be connected, change if necessary...
Howdy

Offline jamort

  • Supreme Robot
  • *****
  • Posts: 375
  • Helpful? 2
Re: Programming the tiny2313.
« Reply #3 on: July 08, 2009, 01:06:02 AM »
instead of pwn it will be spike right? were its analog
my english teacher once said, "dont talk about what you dont know in public...."

so I replied the truth, " Exactly why I dont ever talk about English."

Offline yash25Topic starter

  • Full Member
  • ***
  • Posts: 82
  • Helpful? 0
Re: Programming the tiny2313.
« Reply #4 on: July 08, 2009, 02:05:30 AM »
instead of pwn it will be spike right? were its analog
I did'nt understand that jamort! And what about the fact that im using pager motors instead of servos, will that change thae program?
Scientists dream about doing great things. Engineers do them.

Offline SmAsH

  • Supreme Robot
  • *****
  • Posts: 3,959
  • Helpful? 75
  • SoR's Locale Electronics Nut.
Re: Programming the tiny2313.
« Reply #5 on: July 08, 2009, 02:11:23 AM »
you still use pwm for motor drivers...
youll have two pins per motor... you will set one high and one low to determine the direction of rotation.
pwm can be used on this. i also think if you are short on pwm pins you can pwm the enable pins...
Howdy

Offline yash25Topic starter

  • Full Member
  • ***
  • Posts: 82
  • Helpful? 0
Re: Programming the tiny2313.
« Reply #6 on: July 08, 2009, 02:49:38 AM »
Ok...that was slightly greek to me...but here's my interpretation:
in my circuit, i have given two p[ins per motor, so what u are saying is that i make one permanently GND  so that i can vary the pulse width at the other pin and make it move.
what i did'nt understand was this:
pwm can be used on this. i also think if you are short on pwm pins you can pwm the enable pins...
do i have to give special pins called pwm pins? or are they one of the two pins that are going to the motor (...the ones that are'nt grounded)???
Scientists dream about doing great things. Engineers do them.

Offline Ro-Bot-X

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,431
  • Helpful? 25
  • Store: RoBotXDesigns.ca
Re: Programming the tiny2313.
« Reply #7 on: July 08, 2009, 05:38:33 AM »
My friend, you need to read the Motor controllerl tutorial here: http://www.societyofrobots.com/member_tutorials/node/159 and the PWM tutorial here: http://www.societyofrobots.com/member_tutorials/node/228

I don't know the pin settings for the $50 robot so I can't tell you what pins you should use, unless you make a list and post it here, I will not look it up for you. But here are the pin settings I use in my dual motor controller using tiny2313:

// Module  Arduino Pin  Tiny2313   Pin   Arduino  Module
//                                 +-\/-+
// Reset               PA2  1|     |29  VCC
// RX         (D 0)   PD0  2|     |19  PB7  (D 16)    SCL (SKC )
// TX         (D 1)   PD1  3|     |18  PB6  (D 15)   (MISO)
// Xtal        (D 2)   PA1  4|     |17  PB5  (D 14)   SDA (MOSI)
// Xtal        (D 3)   PA0  5|     |16  PB4  (D 13)*  M1A (OC1B)
// Enc1A # (D 4)   PD2  6|     |15  PB3  (D 12)*  M2A (OC1A)
// Enc2A # (D 5)   PD3  7|     |14  PB2  (D 11)*  M1B
// Enc1B    (D 6)   PD4  8|     |13  PB1  (D 10)    M2B
// Enc2B  *(D 7)   PD5  9|     |12  PB0  (D 9)      M2En
//                      GND 10|     |11  PD6  (D 8 )     M1En
//                                +----+
//
// * indicates PWM port
// # indicates external interrupt
//
// M1 = RightMotor
// M2 = LeftMotor
// E1 = RightEncoder
// E2 = LeftEncoder

Module is my board, so that is the function of the pin in my board. Arduino is the name of the pin in Arduino and Pin is the pin name by data sheet.
Check out the uBotino robot controller!

Offline yash25Topic starter

  • Full Member
  • ***
  • Posts: 82
  • Helpful? 0
Re: Programming the tiny2313.
« Reply #8 on: July 08, 2009, 01:51:42 PM »
Thank you so much Ro-bot X!!! im going to read all that right now!
Scientists dream about doing great things. Engineers do them.

 


Get Your Ad Here