PDA

View Full Version : circuit diagram



challenger
04-16-2010, 08:29 PM
hey guys ,
i need some help urgently.
i have done a line follwer with atmega 16 , now for my project i need to do it using atmega 8
i searched online but din get proper circuit.if anyone has a circuit diagram for the board having atmega 8(include H-bridge), pls do post it.even related links will be helpful
thank you.

shashak
04-16-2010, 09:01 PM
whats the difficult part?
If you had made it on mega16 its just a pin swap and little tweaks for mega8. from where you got the mega16 circuit ?

lolman_returns
04-16-2010, 09:46 PM
Agree with shashak. Are you sure that you "made" the line follower the first time??

LOL !!! H-Bridge doesnt change with micro-controller, it changes with motors.

Moreover, without even knowing your previous circuit or your sensor arrangement or sensor type, how do you expect any sort of help?

So for your vague question , here is the vague reply.

Send inputs to one of the ports from the sensors after setting the port as an input port. Thinking that your sensor output is digital, so you don't need ADC.

Connect H bridge inputs to another port setting that port to output. Now thinking that you don't use speed control , you don't need pwm. But on the other hand , its just two motors,
so even using PWM wont hurt.


Porting the older code should be fairly easy IF AND ONLY IF you tried to understand the previous linefollower instead of just copying it.

challenger
04-19-2010, 10:21 PM
well i tried retaining the concept but there is some problem !!its not giving the output properly!!!
i had used assembly lang for atmega 16 and now using c .dont know wats wrong!!!
so i thought there is is a problem with ckt

lolman_returns
04-19-2010, 10:24 PM
O_O PLEASE! stop using Assembly for small projects. I would rather stick to not using assembly AT ALL!

Also, post your circuit diagram and code here and I will help you out.

challenger
04-19-2010, 10:27 PM
@ lol returns no need to be so harsh !! i was just asking the circuit !! its a direct question!!!!
well i have understood the concept properly !!!!
i have doubts with pwm .is it pin 15 and 16 used for that .thats wat i have done now!!!!
henceforth i am wanting the ckt to verify if its prope!!!

challenger
04-19-2010, 10:28 PM
i am neither opposing you:)

challenger
04-19-2010, 10:30 PM
program is proper since its just simple statements of if and else.

lolman_returns
04-19-2010, 10:32 PM
http://4.bp.blogspot.com/_zqABT3suzXE/SWdGRxwryhI/AAAAAAAAAO0/hNE8QgDCee8/s1600-h/IR+controlled+car.JPG

Check this circuit, it is pin 15 and 16 and stop being sensitive. I just used caps, I get emotional when I see people using assembly and treating Dear AVR like a stoneage 8051s.

Something helpful would be you copy pasting the portion where you initialize the timer/counter for PWM. also tell me the crystal frequency.

challenger
04-19-2010, 10:39 PM
pin 1-reset
pin2-isp
pin3-isp
pin7-vcc
pin 22- gnd
pin 15,pin 16 -to h bridge
pin 9,10 crystal
pin 23 24 25 to sensors
pin 18 to led followe by gnd
this the ouline of the connection

challenger
04-19-2010, 10:41 PM
its 16 mhz

challenger
04-19-2010, 10:44 PM
well i have done the same as given in that ckt!!!!.

lolman_returns
04-19-2010, 10:46 PM
Are you using any specialized header for PWM or did you initialize the registers yourself? are you sure you made all the calculations correct? Also what is the problem? Are the motors not turning at all?

challenger
04-19-2010, 10:52 PM
motors not turning at all .no o/p its like a stationary junk!!!! i am not using any specialized header for pwm .well for atmega 8 is there any need to intialize register ....i am using c i initialized the pins!!!!sorry if i am talking non sense i have just started learning !!!

lolman_returns
04-19-2010, 10:57 PM
Definitely, you need to initialize the PWM registers if you are using PWM generated using the uC timer/counter.

Wait, Are you generating PWM by changing the Delay time between pulses?? As in

for a 50% duty cycle.
pin15 = 1;
delay(50)
pin15=0;
delay(50)

challenger
04-19-2010, 11:14 PM
i am doing the latter one. ..... i had intialized when i used atmega 16 like you suspected before

challenger
04-19-2010, 11:18 PM
i got the solution hopefully :)

lolman_returns
04-19-2010, 11:20 PM
Well done, sometimes the problems are grassroot and we fail to look at them.

challenger
04-19-2010, 11:25 PM
absolutely:)thank u :)

shobhitkukreti
04-20-2010, 08:27 AM
read the datasheet. Working n C makes life a little easier , but you need to know the registers for the peripheral functions.

shashak
04-20-2010, 09:25 AM
I would rather stick to not using assembly AT ALL! .

I would say asm is very powerful should be use were they are more required but people do mess around it (that why we can call it messembly). But one should have hold on it and not forget it forever. Now days as C is God of logical modules but when writing intrupt routines, time critical functions or bootloaders still assembly is more suitable.

lolman_returns
04-20-2010, 06:53 PM
@shashak : I couldnt agree with you more. What I meant was "I would rather stick to not using assembly AT ALL! for small projects".

allbits
04-20-2010, 09:27 PM
well..

very much depends on the programmer (the guy/gal who writes the code)/and the chip. I used to write in assembly when it came to basic chips and when i tried writing in C, the memory got filled up fast. Assembly codes which came to about 400 bytes became more than a KB when compiled with microC. the chip was a 16F73. I dont know about AVR, but I think C becomes very relevant when the code size comes to more than say - a couple of kilobytes. and yes, for high end chips, no one even looks at the instruction set....for the sake of coding..

nitinsharma
06-15-2010, 12:33 AM
hey guys ,
i need some help urgently.
i wanna do a small course in robotics(A.I.).
so plz help me and tell about course.......in rajsthan

lolman_returns
06-15-2010, 12:50 AM
lol how can you find the course when you dont even have the patience to find the right section or create a new thread to post your problem.