Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

need help in my final year project.

Status
Not open for further replies.

Shock

New Member
I am new into PIC16f873 also as well as the coding.

I am required to design a program and interface (eg, infrared interface) to control a dc motor using pic16f873.

i need some assistance on guiding me to build the interface and the coding.

help is appreciate.
 
You can get lots of examples and source code from internet.
You can use google for that.

I completely agree with RUsslk.
 
Google like instructed and read, attempt a schematic and upload it, pick a language to program it with and come back (I believe that is what they are
saying)
 
Have you looked at Nigel's tutorials? One is an infra red communications programme. He also has included some of the hardware designs.

His link is at the bottom of his posts. Search for Nigel Goodwin.

Also, you should have posted this in the Micro Controllers forum.
 
Sorry for replying late. Been thinking how to build the communication for ir.

I googled and found this basic IR cct, wonder if is able to work?

CCT


My simple idea is using PIC16F873 and using RB 0 port to contorl to communication for the IR, if IR detected, the Bits will send to L293 IC to Move the motor in a direction.

I need some feed back for this. Thank you
 
Shock

I think the light in the room will cause problems if you plan to just send an IR signal and the IR rx to turn on and not send to turn off..

Go look at Nigel's IR tutorial. You will need some form of coding to make it error free.
 
list p=16f873
include "p16f873.inc"

org 0x00
goto START

;Configuration section
START bsf STATUS,5
movlw 0x06
movwf ADCON1
movlw b'00000000'
movwf TRISA ;Set PORTA as output port
movlw b'00000001'
movwf TRISB ;Set PORTB as input port
movlw b'00000000'
movwf TRISC ;Set PORTC as output port
movlw b'00000111'
OPTION
bcf STATUS,5
clrf PORTC ;Clear PORTC before program start
clrf PORTA ;Clear PORTA before program start

;Program starts
BEGIN btfss PORTB,0 ;Test PORTB (infrared receiver input)
goto ANTICLK ;Got obstruction in infrared signal,
;motor move anticlockwise
goto CLOCK ;No obstruction in infrared signal, motor move
;clockwise

ANTICLK movlw b'00000101' ;Bit 2 to enable L293B chip, bits 0 and 1
;to move motor anticlockwise direction
movwf PORTA
movlw b'00010001'
movwf PORTC ;LEDs signify motor movement
clrf TMR0
movlw b'00100010'
movwf PORTC
clrf TMR0
movlw b'01000100'
movwf PORTC
clrf TMR0
movlw b'10001000'
movwf PORTC
clrf TMR0
goto BEGIN ;Recheck infrared signal for obstructions

CLOCK movlw b'00000110' ;Bit 2 to enable L293B chip, bits 0 and 1 to
;move motor clockwise direction
movwf PORTA
movlw b'10001000'
movwf PORTC ;LEDs signify motor movement
clrf TMR0
movlw b'01000100'
movwf PORTC
clrf TMR0
movlw b'00100010'
movwf PORTC
clrf TMR0
movlw b'00010001'
movwf PORTC
clrf TMR0
goto BEGIN ;Recheck infrared signal for obstructions

end

This is my simple coding for the project. I had it run today and i found out that i have the problem with the timer. The led just doesnt move as it is. I still working on it, pls gimme some feedback or any enhancement for code
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top