![]() |
![]() |
![]() |
|
|||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#31 (permalink) |
|
Experienced Member
|
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. |
|
|
|
|
|
#32 (permalink) | |
|
Experienced Member
Join Date: Jan 2007
Location: U.K.
Posts: 3,779
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Quote:
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?
__________________
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. |
|
|
|
|
|
|
#33 (permalink) |
|
Experienced Member
|
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. ('',)
|
|
|
|
|
|
#34 (permalink) | |
|
Experienced Member
Join Date: Jan 2007
Location: U.K.
Posts: 3,779
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Quote:
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/ |
|
|
|
|
|
|
#37 (permalink) | |
|
Experienced Member
Join Date: Jan 2007
Location: U.K.
Posts: 3,779
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Quote:
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/ |
|
|
|
|
|
|
#38 (permalink) |
|
Experienced Member
|
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 |
|
|
|
|
|
#39 (permalink) |
|
Experienced Member
Join Date: Jan 2007
Location: U.K.
Posts: 3,779
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
hi,
TRISC = %00001111 loop: Code:
If PORTC.6 = 1 Then dir1 = 0 High PORTC.0 WaitUs 500 Low PORTC.0 WaitUs 500 Endif
__________________
Eric "Good enough is Perfect" PIC tutorials: Nigel's site: http://www.winpicprog.co.uk/ Gramo's site: http://www.digital-diy.net/ |
|
|
|
|
|
#41 (permalink) | |
|
Experienced Member
Join Date: Jan 2007
Location: U.K.
Posts: 3,779
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Quote:
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/ |
|
|
|
|
|
|
#42 (permalink) |
|
Experienced Member
Join Date: Jan 2007
Location: U.K.
Posts: 3,779
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
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/ |
|
|
|
|
|
#44 (permalink) |
|
Experienced Member
|
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. =) |
|
|
|
|
|
#45 (permalink) | |
|
Experienced Member
Join Date: Jan 2007
Location: U.K.
Posts: 3,779
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Quote:
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.
__________________
Eric "Good enough is Perfect" PIC tutorials: Nigel's site: http://www.winpicprog.co.uk/ Gramo's site: http://www.digital-diy.net/ |
|
|
|
|
![]() |
| 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 |