LED and PIC16F84A

Status
Not open for further replies.

uaefame

New Member
Hello everyne,

I started learning PIC for one semester now on my own and the main help was offcourse from this forum. I then moved into learning electrical software that will help me ask better in this forum i selected EAGLE.

Here the thing,
I have this drawing that i used EAGLE software to draw i have 2 questions if you can help me with in eagle software.

Q1> First, I want to move group of object togather from one place to another see attachment for clarification?
Q2> If you have any suggestion on how can i improve the drawing i already did please let me now?

Thanks in advance
 

Attachments

  • LEDwith16F84A.JPG
    33.8 KB · Views: 385
Its better if you can move to Eagle5.

How to move a group?

You just select the components by using the Group tool by dragging them.After select the Move tool & right click on the schematic & select Move:Group & move the cursor & place where you want to place.

To Improve your drawing you must use that Junctions using the Junction tool.This is very useful when doing a schematic capture from your drawing.So it will confirm whether it is connecting or not.
 
Last edited:
Thanks gayan for replying,

What you mean eagle5 i am using eagle 5.1.0 is that what you meant or another program please specify a website if you don't mind so i can download it or buy the software.

Group move is amazing i could move them and my drawing become more neat.

Right now i am learning more about junction ...

Q> My question is in the datasheet of 16F84A the MCLR is connected to resistor, capacitor and diodes as shown in page 28 is connecting MCLR to 10k resistor is enough or i should do the extra requirements (capacitor and diodes).
 

Attachments

  • LEDwith16F84Ar2.JPG
    27 KB · Views: 213
Only resistor will be fine.

If you start using a modern PIC like PIC 16F628A or PIC 16F88 you can leave open the MCLR pin & no need any connection to that pin.You can use that pin as an INPUT pin.
 
Last edited:
Thanks gayan for replying,

What you mean eagle5 i am using eagle 5.1.0 is that what you meant or another program please specify a website if you don't mind so i can download it or buy the software.

You are using the latest version. No need to change.
 
My goal is to control a bipolar stepper motor using sn754410 and pic16F84A

Here are two questions i need help with

Q1> How to draw a bipolar stepper motor using eagle or is there a liberay file with bipolar stepper motor because i couldn't find it?

Q2> The first pin in sn754410 need a PWM and i am using PIC16F84A i am not sure how can i get PWM from this PIC? any idea i apreciate it.
 
You don't need PWM, it is only for speed control usually which you can do by changing the step length.
 
I am still trying to draw a bipolar stepper motor using eagle but nothing yet, therefore i decided to focus on my next problem which is

Q1> How to program a bipolar stepper motor using 16F84A i am using the diagram shown below not yet finish but still working on it?
I mean do i send high B0 high B1 high B2 high B3 or there is a true table for it?

Q2> How diode are connected to a stepper motor coils?
 

Attachments

  • Sn754410.JPG
    32.9 KB · Views: 347
You will be connecting the stepper to the PCB with a connector. Just draw the connector. What connector you use if up to you.
 
You will be connecting the stepper to the PCB with a connector. Just draw the connector. What connector you use if up to you.

I mean is it possible to draw a stepper motor in the schematic section that what interest me at the moment (I am using eagle software)
 
I mean is it possible to draw a stepper motor in the schematic section that what interest me at the moment (I am using eagle software)

I know what you mean. My previous answer is still a good one.

But if you insist the answer is yes, it is possible.
Draw your stepper motor as a component. There is a tutorial on the Eagle site on drawing components. It is a skill you NEED to learn.

Next you will say you do not want to draw the stepper as a component. As I said most people would just draw the connector, because of this you will not easily find the the stepper component for Eagle.
 
THanks 3V0,

I connected the circuit for stepper motor and i am using this codes nothing worked!
The codes are
Code:
LIST	P=PIC16F84A
	#INCLUDE "P16F84A.INC"
	__CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _LP_OSC
	errorlevel -302

	cblock	0x0c
	d1,d2,d3
	endc

	org	0
init
	banksel	TRISA		;bank 1
	clrf	TRISA
	clrf	TRISB
	banksel	PORTB		;bank 0
	clrf	PORTB
main	bcf PORTB,1
		bcf PORTB,3
		bsf	PORTB,0
		bsf	PORTB,2
	call	Delay8ofsec
	bcf	PORTB,0
	bsf	PORTB,1
	call    Delay8ofsec
	bcf	PORTB,2
	bsf	PORTB,3
	call    Delay8ofsec
	bsf	PORTB,0
	bcf	PORTB,1
	goto	main

Delay8ofsec
			;124993 cycles
	movlw	0xA6
	movwf	d1
	movlw	0x62
	movwf	d2
Delay8ofsec_0
	decfsz	d1, f
	goto	$+2
	decfsz	d2, f
	goto	Delay8ofsec_0

			;3 cycles
	goto	$+1
	nop

			;4 cycles (including call)
	return



	end

The logic of the codes are simple every 1/8s i do this for portB 0 1 2 3 i do HLHL, 1/8delay LHHL 1/8s delay, LHLH, 1/8s delay HLLH then repeat!

Is my codes wrong or maybe the wiring i will try posting the schematic when i finish drawing it for the mean time can some tell me if the codes are wrong.

I am using bipolar stepper motor
Thanks in advance
 
I also used this codes to drive the stepper motor but nothing happen!
I am using this logic HLLL LHLL LLHL LLLH and delay between each 1/8s. Then the program repeat it selt.

Here are the codes
Code:
LIST	P=PIC16F84A
	#INCLUDE "P16F84A.INC"
	__CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _LP_OSC
	errorlevel -302

	cblock	0x0c
	d1,d2,d3
	endc

	org	0
init
	banksel	TRISA		;bank 1
	clrf	TRISA
	clrf	TRISB
	banksel	PORTB		;bank 0
	clrf	PORTB
main	bsf	PORTB,0
		call	Delay8ofsec
		bcf	PORTB,0
		bsf	PORTB,1
		call    Delay8ofsec
		bcf	PORTB,1
		bsf	PORTB,2
		call    Delay8ofsec
		bcf	PORTB,2	
		bsf	PORTB,3
		call    Delay8ofsec
		bcf	PORTB,3	
		goto	main

Delay8ofsec
			;124993 cycles
	movlw	0xA6
	movwf	d1
	movlw	0x62
	movwf	d2
Delay8ofsec_0
	decfsz	d1, f
	goto	$+2
	decfsz	d2, f
	goto	Delay8ofsec_0

			;3 cycles
	goto	$+1
	nop

			;4 cycles (including call)
	return



	end

Is something wrong!!
 
Here is it the diagram the i am following, Note that BSM in the diagram refer to bipolar stepper motor i couldn't draw all the stepper motor therefore i used 3v0 advice.

I am desperately trying to get this stepper motor moving before 19/July/08

Thanks in advance
 

Attachments

  • sn754410r2.JPG
    49.3 KB · Views: 223
You change your OSC setting to XT in the config part in your program.

Replace the below code into the main routine & see.

Code:
main	movlw	b'00000001'
	movwf	PORTB
	call	Delay8ofsec
	movlw	b'00000010'
	movwf	PORTB
	call	Delay8ofsec
	movlw	b'00000100'
	movwf	PORTB
	call	Delay8ofsec
	movlw	b'00001000'
	movwf	PORTB
	call	Delay8ofsec
	movlw	b'00000000'
	movwf	PORTB
	goto	main
 
Last edited:
WoW, it started moving but goving crazy back and forth i think i need to spend time on the codes Thanks gayan alot
 
I even tried this codes full step same problem moving back and forth
Code:
main	movlw	b'00000101'
	movwf	PORTB
	call	Delay8ofsec
	movlw	b'00001001'
	movwf	PORTB
	call	Delay8ofsec
	movlw	b'00001010'
	movwf	PORTB
	call	Delay8ofsec
	movlw	b'00000110'
	movwf	PORTB
	goto	main
I also changed LP to XT! Strange can some one tell me what wrong ? is it the codes or the diagram i post earlier.
 
controlling stepper motor using 16f84a

i need to write a pic program that controls 3 steppers motor
fed by 3 inputs
when entering each input each stepper motor is calibrated certain steps
how should i do this using a 16f84a ??????
 
hey guys
i would love to controlle a led matrix but i don't know from wher i have to star
please if there any body can help me out
i will be so thankfull
tks anyway
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…