Society of Robots
     | Robot Forum | Robot Tutorials | Robot FAQ |
September 10, 2010, 12:59:44 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: SoR Robot Chat every friday night. Join us! (forum integration fix coming when I have time)
http://www.societyofrobots.com/robotforum/chat/

Robot Forum
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: help me with ATmega32..  (Read 941 times)
0 Members and 1 Guest are viewing this topic.
cannonTopic starter
Beginner
*

Helpful? 0
Offline Offline

Posts: 5


View Profile
« on: April 12, 2009, 12:41:38 AM »

I had successfully completed d $50 robot with ATmega8..
when i try to do d same using ATmega32, i cant program it correctly..
I hav been using the same code as be4..
I just changed d pin numbers to that of 32..
shd i change the SoR_utils, etc to make it wrk for 32??
pls help..
Logged
Razor Concepts
Supreme Robot
*****

Helpful? 49
Offline Offline

Posts: 1,750



View Profile WWW
« Reply #1 on: April 12, 2009, 12:44:57 AM »

Change the MCU name in the makefile to atmega32
Logged

cannonTopic starter
Beginner
*

Helpful? 0
Offline Offline

Posts: 5


View Profile
« Reply #2 on: April 12, 2009, 12:53:56 AM »

did tht..
wht i basically wanna knw is whether it wil wrk with the old header files??
Logged
Razor Concepts
Supreme Robot
*****

Helpful? 49
Offline Offline

Posts: 1,750



View Profile WWW
« Reply #3 on: April 12, 2009, 01:54:03 AM »

Try a LED blink program or something. The source files for the mega8 are from AVRlib - may or may not work with the mega32. I've tried with a mega644 and the avrlib source files don't work.
Logged

superchiku
Supreme Robot
*****

Helpful? 5
Offline Offline

Posts: 952


cooll


View Profile
« Reply #4 on: April 12, 2009, 02:24:22 AM »

see everything has to be changed...atmega32 has a diff set of pins and also registers inside it...the same program wont work...u have to change the initialization part and many more . .
Logged

JAYDEEP ...

IT AND ROBOTICS ENGINEER

"IN THE END IT DOESNT EVEN MATTER"
cannonTopic starter
Beginner
*

Helpful? 0
Offline Offline

Posts: 5


View Profile
« Reply #5 on: April 12, 2009, 03:24:39 AM »

i had tried led blink program.. prob is port can be turned on only, it cant be turned off..

and i'm not tht much of a prog genius..
can anyone giv me prog with req initializations for atmega32??

or atleast some place whr i can find instructions for d same??
Logged
SmAsH
Supreme Robot
*****

Helpful? 75
Offline Offline

Posts: 3,944


SoR's Locale Electronics Nut.


View Profile
« Reply #6 on: April 12, 2009, 03:43:17 AM »

are you sure you can turn it on? if you can turn it on you should be able to turn it off with the right code.
Logged

cannonTopic starter
Beginner
*

Helpful? 0
Offline Offline

Posts: 5


View Profile
« Reply #7 on: April 12, 2009, 03:49:17 AM »

for eg, if i giv
PORT_ON(PORTB,0), only tht turns on..

but it doesnt turn off by giving,

PORT_OFF(PORTB,0)
 Huh

Logged
superchiku
Supreme Robot
*****

Helpful? 5
Offline Offline

Posts: 952


cooll


View Profile
« Reply #8 on: April 12, 2009, 08:40:42 AM »

i can give u a direct code for atmeaga32...it started with atmega16 but the structure of 16 and 32 are completely same..
Code:
# include<avr/io.h>
int main(void)

{
 DDRD=0x01;
 TCCR1B|=((1<<CS10)|(1<<CS11));
 while(1)
  {
  if(TCNT1>=3000)
   {
    PORTD^=(1<<2);
TCNT1=0;
   }
 
   
    }
 
   
 
 return(1);
}

this is flashing led with 1 sec gap

Logged

JAYDEEP ...

IT AND ROBOTICS ENGINEER

"IN THE END IT DOESNT EVEN MATTER"
Admin
Administrator
Supreme Robot
*****

Helpful? 110
Offline Offline

Posts: 9,851



View Profile WWW
« Reply #9 on: May 13, 2009, 09:48:48 PM »

http://www.societyofrobots.com/step_by_step_atmega168_swapout.shtml
Logged

Pages: [1]
  Print  
 
Jump to:  


Related Topics
Subject Started by Replies Views Last post
ATMega32 and sensors
Software
bobl 4 1843 Last post July 29, 2007, 08:20:50 AM
by dunk
Finished Schematic of Atmega32 Board
Electronics
Trumpkin 15 4155 Last post September 29, 2008, 11:57:13 AM
by ceruleanplains
how to code Micromouse on ATMega32
Software
sandy 2 2064 Last post February 05, 2009, 08:38:50 AM
by horo333
programming atmega32 using a laptop
Electronics
academicloody 7 822 Last post March 24, 2009, 04:45:06 PM
by Soeren
Powered by MySQL Powered by PHP Powered by SMF | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!


Advertise on this Forum