Shop OBEX P1 Docs P2 Docs Learn Events
code problem — Parallax Forums

code problem

Nado1984Nado1984 Posts: 3
edited 2009-10-14 04:15 in Propeller 1
Hello Forum ,
i have little problem,
I have the connection in the attachment , and this is a part of my code relating to motor enable ( motor start "low" , motor stop"high")
CON
  _clkmode        = xtal1 + pll16x
  _xinfreq        = 5_000_000
XMOTOR_ENABLE_N = 3
 
DAT
        org 0
 
 or dira,motorEnablePinN   
motorEnablePinN         long |< XMOTOR_ENABLE_N 
fit 496  


·when i connect the motor enable to the ground the motor·start , but with this connection the motor doesn't start.
it's a problem from the code or from schema ?
Thank you in advance.
858 x 384 - 22K
2.jpg 22.2K

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-10-13 20:21
    For this to work your, "0V" connection must also be connected to Vss. Both the "0V" lead and Vss should be connected directly at the transistor's emitter and nowhere else.

    -Phil
  • LeonLeon Posts: 7,620
    edited 2009-10-13 21:05
    It looks like you are using Eagle. You need to read the documentation to see how to connect Gnd to the Propeller Vss pin. It's not actually included in the schematic symbol.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle

    Post Edited (Leon) : 10/13/2009 9:10:47 PM GMT
  • Nado1984Nado1984 Posts: 3
    edited 2009-10-13 21:16
    I connect the GND to VSS and same result :-( , maybe it's problem with the code?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-10-13 21:59
    'Sorry, I didn't look at the code. Assembly code has to be started in a new cog. What you've written won't run. Moreover, if it did run, it would not behave gracefully, since you don't have a loop at the end to keep it from going further. It would just keep executing from addresses 0, 1, 2 -> 511 -> 0.

    Why not do it in Spin instead, if all you want to do is test the motor driver?

    -Phil
  • Nado1984Nado1984 Posts: 3
    edited 2009-10-13 22:06
    what it will be in Spin ? yes it is to test the motor driver .
    Thanks in advance.
  • StefanL38StefanL38 Posts: 2,292
    edited 2009-10-14 04:15
    Hello Nado,

    in SPIN it is the same as making an LED blink. That's all

    best regards

    Stefan
Sign In or Register to comment.