Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Thread Tools Display Modes
Old 4th April 2005, 02:32 AM   (permalink)
New Member
owika is on a distinguished road
Default line follower help

hi Micro Experts.
I`m planning to use a PIC16F877A to make a line follower . I want my line follower to have the feature of saving the path last travelled into memor.i'm using 2 infrared sensor. I set PORTA AS input and PORTB as output. i'm using mplab asm.Micro Experts, how to write the program interface the sensor with output motor . Kindly help me .
owika is offline   Reply With Quote
Old 4th April 2005, 05:43 AM   (permalink)
Experienced Member
 
Someone Electro is on a distinguished road
Send a message via AIM to Someone Electro Send a message via MSN to Someone Electro Send a message via Yahoo to Someone Electro
Default

first you delclare the outputs and inputs then you read PORTA write its state in EEPROM set the motors wait for about 100 ms and repeat

as for the reading its reads from EEPROM sets PORTB wait about 100ms and repet


or do you need help for writing/reading form EEPROM


be shure that you have protection diodes on motors or the back emf will fry your PIC
__________________
Il give you shocking experience.
Someone Electro is offline   Reply With Quote
Old 12th April 2005, 02:51 AM   (permalink)
New Member
owika is on a distinguished road
Default

thank man. can you give me the example of the program in asm Language
owika is offline   Reply With Quote
Old 12th April 2005, 05:10 AM   (permalink)
Experienced Member
 
Someone Electro is on a distinguished road
Send a message via AIM to Someone Electro Send a message via MSN to Someone Electro Send a message via Yahoo to Someone Electro
Default

well i program my PICs in mikroBasic not in asembely.

I think basic is much much easyer than asembely.You have a lot more functions,varius functuns for LCDs,EEPROMs,manchester code and even CP cards (you can do this stuf in 3-8 lines of code)
I also like the sound libary that outputs an freq. on the selected pin.

for the stuf you wod think its easyer in asembely you can also put the asm command an write the asembely code right in the midle of basic code.
__________________
Il give you shocking experience.
Someone Electro is offline   Reply With Quote
Old 12th April 2005, 08:03 AM   (permalink)
Experienced Member
nisrine is on a distinguished road
Default

ur project sounds interesting...
I wish i can help with, i m still a newbie and i would like someone if he can give me more information or some step that help me start implementing it .
thanks in advance
nisrine is offline   Reply With Quote
Old 12th April 2005, 08:35 AM   (permalink)
Experienced Member
UnD3aD is on a distinguished road
Default

Quote:
be shure that you have protection diodes on motors or the back emf will fry your PIC
i want to build a line follower and i'm newb. I saw many schematics where the motor is connected directly to the Pic pins... can you give me a scheme or post a link with protection diodes?
UnD3aD is offline   Reply With Quote
Old 12th April 2005, 08:58 AM   (permalink)
Super Moderator
 
Nigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to behold
Default

Quote:
Originally Posted by UnD3aD
Quote:
be shure that you have protection diodes on motors or the back emf will fry your PIC
i want to build a line follower and i'm newb. I saw many schematics where the motor is connected directly to the Pic pins... can you give me a scheme or post a link with protection diodes?
You can't connect motors directly to PIC pins!, you MUST use a driver of some sort (commonly an H bridge is used).

If you've seen diagrams with motors connected directly to PIC pins either the diagram doesn't work, or (more likely) you're reading the diagrams incorrectly.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline   Reply With Quote
Old 12th April 2005, 09:01 AM   (permalink)
Experienced Member
UnD3aD is on a distinguished road
Default

and one more question.. how i control the motor speed?
UnD3aD is offline   Reply With Quote
Old 12th April 2005, 09:15 AM   (permalink)
Super Moderator
 
Nigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to behold
Default

Quote:
Originally Posted by UnD3aD
http://chanhak.com.ne.kr/line_tracer-circuit.htm
http://chanhak.com.ne.kr/remobot_circuit.htm
Neither of those show a motor connected to the PIC (and I can't read the text, but it CERTAINLY won't say that!). The pins labelled 'motor' feed to driver circuits!.

For speed control you use PWM, it's a HUGE advantage switchign to the PIC16F876, as it has two hardware PWM channels - one of my tutorials shows how to set it up for a dual motor robot, giving 127 forwards and backwards speeds.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline   Reply With Quote
Old 12th April 2005, 04:28 PM   (permalink)
Experienced Member
 
Someone Electro is on a distinguished road
Send a message via AIM to Someone Electro Send a message via MSN to Someone Electro Send a message via Yahoo to Someone Electro
Default

For the ones that dont know thats PWM it Pulse Width Modulaton.
Its aculy making an freq. but the duty cilce is changing so for 30% motors power you switch on for 30% for the time on then off for 70% of the time.

I wod recomed mikroBasic programing language for newbys.

http://www.mikroelektronika.co.yu/en...rs/mikrobasic/

Its easy to leran,reqires litle lines of code to do somting,realy nice libarys for LCD,Sound, EEPROM,CompactFlash cards...

if you alredy lernd asembely i wod recomedn stiking to it but if you dont know any programing language i wod recomed basic
__________________
Il give you shocking experience.
Someone Electro is offline   Reply With Quote
Old 12th April 2005, 05:02 PM   (permalink)
Experienced Member
UnD3aD is on a distinguished road
Default

i have a pic 16f84a and a pic16f628 .. the last one have only a PWM channel.... can i control 2 motors with only one channel?
UnD3aD is offline   Reply With Quote
Old 12th April 2005, 06:37 PM   (permalink)
Experienced Member
 
Someone Electro is on a distinguished road
Send a message via AIM to Someone Electro Send a message via MSN to Someone Electro Send a message via Yahoo to Someone Electro
Default

For a newby i wod sugest control whith no PWM youst use two I/O pins.one for the left motor and one for the right one.This way you wod hav off or on ar full power.
You dont realy need PWM Its wod yust make the robot thurn more smothy.so it starts thurnig slow and then fast.Whis no PWM it simply makes an tight thuurn sudenly changing direction.

ADC (Analog Digital Converter) can be a real pain for a newby since it needs some setings.

As for the hardware you cod make an voltage divider out of two phototransistors and feed it output in the ADC

BTW: nave you newbys made some LED blinkers and stuf like that so get some expiriece (becose LED blikers are the easyest stuf to make)
__________________
Il give you shocking experience.
Someone Electro is offline   Reply With Quote
Old 12th April 2005, 09:15 PM   (permalink)
Experienced Member
UnD3aD is on a distinguished road
Default

so can someone give me a scheme for conecting the motors to pic 16f628 ?
UnD3aD is offline   Reply With Quote
Old 13th April 2005, 05:30 AM   (permalink)
Experienced Member
 
Someone Electro is on a distinguished road
Send a message via AIM to Someone Electro Send a message via MSN to Someone Electro Send a message via Yahoo to Someone Electro
Default

you cod do it whith two power trasistors.Its base coneted to an I/O pin thru a resistor and conet the coletor and emiter to the power rails whith an motor betven (If you nave an PNP emiter to V+ and coletor to motor or if you have an NPN conct the colector to ground and eemiter to motor)

whith this you cod ony thurn the motor one way

DON'T forget the protection diodes on the motors or the PIC will be fryed from the motors back emf (the diodes must conduct the oposite way you conect the power)

you cod also use an H bridge motor driver IC
__________________
Il give you shocking experience.
Someone Electro is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes




All times are GMT. The time now is 03:03 AM.


Electronic Circuits  |  Radio Controlled
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.