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
 
LinkBack Thread Tools Display Modes
Old 6th May 2008, 08:46 AM   #31 (permalink)
Experienced Member
 
Join Date: Oct 2004
Location: Malaysia
Posts: 93
mesamune80 is on a distinguished road
Send a message via ICQ to mesamune80 Send a message via MSN to mesamune80 Send a message via Yahoo to mesamune80
Default

ya i had just tried out with my hardware.....hehe it works! but the voltage i measure to my uC is 5.25V when out of the Low lmt window =)
i wonder why the simulation cannot show the lit LED =.=''

Last edited by mesamune80; 6th May 2008 at 08:54 AM.
mesamune80 is offline   Reply With Quote
Old 6th May 2008, 09:11 AM   #32 (permalink)
Experienced Member
 
 
Join Date: Jan 2007
Location: U.K.
Posts: 3,779
ericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to behold
Default

Quote:
Originally Posted by mesamune80
ya i had just tried out with my hardware.....hehe it works! but the voltage i measure to my uC is 5.25V when out of the Low lmt window =)
i wonder why the simulation cannot show the lit LED =.=''
Hi,
Checked the circuit looks ok, refer this attachment.

I would suggest that you increase the 680R to about 750R or 820R, so that the input voltage to the PIC is just under +5V.

EDIT: If you plan to use a second input pin on the PIC for the other LM output, change the 1K0 to 750R and 330R .. OK?
Attached Images
File Type: jpg sim1.jpg (142.1 KB, 9 views)
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Nigel's site: http://www.winpicprog.co.uk/
Gramo's site: http://www.digital-diy.net/

Last edited by ericgibbs; 6th May 2008 at 09:14 AM.
ericgibbs is online now   Reply With Quote
Old 6th May 2008, 09:21 AM   #33 (permalink)
Experienced Member
 
Join Date: Oct 2004
Location: Malaysia
Posts: 93
mesamune80 is on a distinguished road
Send a message via ICQ to mesamune80 Send a message via MSN to mesamune80 Send a message via Yahoo to mesamune80
Default

okay,ya i need my uC to monitor this two limit ,when the input just out from the windows then the corresponding upper and lower lmt pin will act accordingly. :-) actually i am using it for stepper motor.i will send pulse to the motor driver and move my motor up or down precisely. ('',)
mesamune80 is offline   Reply With Quote
Old 6th May 2008, 09:27 AM   #34 (permalink)
Experienced Member
 
 
Join Date: Jan 2007
Location: U.K.
Posts: 3,779
ericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to behold
Default

Quote:
Originally Posted by mesamune80
okay,ya i need my uC to monitor this two limit ,when the input just out from the windows then the corresponding upper and lower lmt pin will act accordingly. :-) actually i am using it for stepper motor.i will send pulse to the motor driver and move my motor up or down precisely. ('',)
hi,
Lets know how the project goes..
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Nigel's site: http://www.winpicprog.co.uk/
Gramo's site: http://www.digital-diy.net/
ericgibbs is online now   Reply With Quote
Old 6th May 2008, 09:40 AM   #35 (permalink)
Experienced Member
 
Join Date: Oct 2004
Location: Malaysia
Posts: 93
mesamune80 is on a distinguished road
Send a message via ICQ to mesamune80 Send a message via MSN to mesamune80 Send a message via Yahoo to mesamune80
Default

Alright. :-) now i am doing the hardware part and also the programming part.
mesamune80 is offline   Reply With Quote
Old 9th May 2008, 05:56 AM   #36 (permalink)
Experienced Member
 
Join Date: Oct 2004
Location: Malaysia
Posts: 93
mesamune80 is on a distinguished road
Send a message via ICQ to mesamune80 Send a message via MSN to mesamune80 Send a message via Yahoo to mesamune80
Default

eric, there is one problem i encounter when i disconnect the uC the LED lit but when i connect to one of the I/O pin RC.6 the LED goes off. can i add anything to prevent this? Thanks
mesamune80 is offline   Reply With Quote
Old 9th May 2008, 06:32 AM   #37 (permalink)
Experienced Member
 
 
Join Date: Jan 2007
Location: U.K.
Posts: 3,779
ericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to behold
Default

Quote:
Originally Posted by mesamune80
eric, there is one problem i encounter when i disconnect the uC the LED lit but when i connect to one of the I/O pin RC.6 the LED goes off. can i add anything to prevent this? Thanks
hi,
It sounds as though you have configured PORTC.6 has an Output which is set low.
Post your code and we will advise.
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Nigel's site: http://www.winpicprog.co.uk/
Gramo's site: http://www.digital-diy.net/
ericgibbs is online now   Reply With Quote
Old 9th May 2008, 06:38 AM   #38 (permalink)
Experienced Member
 
Join Date: Oct 2004
Location: Malaysia
Posts: 93
mesamune80 is on a distinguished road
Send a message via ICQ to mesamune80 Send a message via MSN to mesamune80 Send a message via Yahoo to mesamune80
Default

This is just the test code i used:

'************************************************* ********
'Declarations of variables
'************************************************* ********

Dim an4 As Word 'analog input RA5
Dim an5 As Word
Dim an6 As Word
Dim a4 As Byte
Dim a5 As Byte
Dim a6 As Byte
'Dim dir1 As Bit 'direction for motor1
'Dim dir2 As Bit 'direction for motor2
Dim i As Byte
Dim n As Byte
Dim n2 As Byte

a4 = an4.LB
a5 = an5.LB
a6 = an6.LB
Symbol dir1 = PORTC.1
Symbol dir2 = PORTC.2

TRISC = %00001111

loop:


If PORTC.6 = 1 Then

dir1 = 0
High PORTC.0
WaitUs 500
Low PORTC.0
WaitUs 500



Endif
Goto loop
mesamune80 is offline   Reply With Quote
Old 9th May 2008, 06:45 AM   #39 (permalink)
Experienced Member
 
 
Join Date: Jan 2007
Location: U.K.
Posts: 3,779
ericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to behold
Default

hi,
TRISC = %00001111

loop:
Code:
If PORTC.6 = 1 Then

dir1 = 0
High PORTC.0
WaitUs 500
Low PORTC.0
WaitUs 500
Endif
Look at the TRISC..... 0 = 0utput... 1 = 1nput
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Nigel's site: http://www.winpicprog.co.uk/
Gramo's site: http://www.digital-diy.net/
ericgibbs is online now   Reply With Quote
Old 9th May 2008, 06:58 AM   #40 (permalink)
Experienced Member
 
Join Date: Oct 2004
Location: Malaysia
Posts: 93
mesamune80 is on a distinguished road
Send a message via ICQ to mesamune80 Send a message via MSN to mesamune80 Send a message via Yahoo to mesamune80
Default

ya,from the above code i already se it as input right?
mesamune80 is offline   Reply With Quote
Old 9th May 2008, 07:05 AM   #41 (permalink)
Experienced Member
 
 
Join Date: Jan 2007
Location: U.K.
Posts: 3,779
ericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to behold
Default

Quote:
Originally Posted by mesamune80
ya,from the above code i already se it as input right?
hi,
NO,
Look at the TRISC..... 0 = 0utput... 1 = 1nput

The format of the binary number 00001111, is b7,b6,b5,b4,b4,b3,b2,b1,b0

As PORTC.6 is 0 in the TRISC it an OUTPUT. Set it to 1
example:
TRISC = %01001111

I have run your code in the simulator with TRISC= %01001111 and it works OK.
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Nigel's site: http://www.winpicprog.co.uk/
Gramo's site: http://www.digital-diy.net/
ericgibbs is online now   Reply With Quote
Old 9th May 2008, 07:12 AM   #42 (permalink)
Experienced Member
 
 
Join Date: Jan 2007
Location: U.K.
Posts: 3,779
ericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to behold
Default

hi mesamune,
I am wondering if your misunderstanding of Input and Output is due to thinking that,
OUTPUT refers to the output of the Comparator, not the PIC pin.?

The TRIS set the pin configuration of the PIC pins not the external devices.

Do you follow.?
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Nigel's site: http://www.winpicprog.co.uk/
Gramo's site: http://www.digital-diy.net/
ericgibbs is online now   Reply With Quote
Old 9th May 2008, 07:17 AM   #43 (permalink)
Experienced Member
 
Join Date: Oct 2004
Location: Malaysia
Posts: 93
mesamune80 is on a distinguished road
Send a message via ICQ to mesamune80 Send a message via MSN to mesamune80 Send a message via Yahoo to mesamune80
Default

Opss. i think i got it another way round,that's why i cant get the desired result,thanks for your clarification. ^_^
mesamune80 is offline   Reply With Quote
Old Yesterday, 05:47 AM   #44 (permalink)
Experienced Member
 
Join Date: Oct 2004
Location: Malaysia
Posts: 93
mesamune80 is on a distinguished road
Send a message via ICQ to mesamune80 Send a message via MSN to mesamune80 Send a message via Yahoo to mesamune80
Default

Hi eric could you give some advice on how to drive this motor?

because i had tried the normal way to run th motor,but it seem to not moving at all.i wonder why.

http://catalog.orientalmotor.com/ite...lter=&by=prod#

i wired my pulse input to CW/P.+ (pin for the motor driver)with high 250us and low 500us

and direction i pump high to the pin CCW/D.+ for my motor direction.

Thanks. =)
Attached Files
File Type: pdf PMC33A1-MG20,_5-PhaseSteppingSystem.pdf (44.2 KB, 1 views)
mesamune80 is offline   Reply With Quote
Old Yesterday, 06:58 AM   #45 (permalink)
Experienced Member
 
 
Join Date: Jan 2007
Location: U.K.
Posts: 3,779
ericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to behold
Default

Quote:
Originally Posted by mesamune80
Hi eric could you give some advice on how to drive this motor?

because i had tried the normal way to run th motor,but it seem to not moving at all.i wonder why.

http://catalog.orientalmotor.com/ite...lter=&by=prod#

i wired my pulse input to CW/P.+ (pin for the motor driver)with high 250us and low 500us

and direction i pump high to the pin CCW/D.+ for my motor direction.

Thanks. =)
hi mesamune,
I'll look the documentation, you do realise its a 5 phase stepper motor.?

Are you meeting ALL the criteria for driving this type of motor.?

I have posted an extract from their data.
Attached Images
File Type: jpg screenhunter1.jpg (77.4 KB, 3 views)
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Nigel's site: http://www.winpicprog.co.uk/
Gramo's site: http://www.digital-diy.net/
ericgibbs is online now   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Latest
LCD Display karenhornby Electronic Projects Design/Ideas/Reviews 27 22nd February 2008 07:42 PM
Using Oscilloscopes mechie Electronic Theory 9 29th November 2007 09:49 PM
Output = Input - Problems adamthole Micro Controllers 20 24th April 2007 04:09 AM
uuffff how doess this stupid ting work lol cyprio7 General Electronics Chat 7 9th October 2005 06:56 PM
convert input resistance to different output, but how?! pcoghlan Electronic Projects Design/Ideas/Reviews 7 9th July 2004 10:00 PM


All times are GMT. The time now is 03:45 PM.


Electronic Circuits  |  Radio Controlled
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0 (Unregistered)