Port D of Pic

Discussion in 'Programmer's Corner' started by cassity69, Apr 27, 2014.

  1. cassity69

    Thread Starter Member

    Dec 18, 2013
    37
    0
    hello im using a pic 18f4520

    i have connected a stepper motor into port D

    everything is running as expected but i am intrested into why it is best to use port d

    or does it not matter ?
     
  2. cassity69

    Thread Starter Member

    Dec 18, 2013
    37
    0
    sorry i forgot to mention one other think

    i have a variable resistor connected which is varying the speed as expected

    is there an alternative i could of used instead of the variable resistor ? to change the speed like this does ?
     
  3. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,544
    2,369
    Where did you get the preference for port D, as far as I can tell it port D just has an option of a PSP, Parallel Slave Port.
    Max.
     
    absf likes this.
  4. cassity69

    Thread Starter Member

    Dec 18, 2013
    37
    0
    for some reason ive always used port d

    which is now why i wanted to know lol

    so there is no advantage at all with port d?

    like for example port a has adc so i would use that for that purpose
     
  5. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,544
    2,369
    Are you using portD for output to the stepper motor or an input for control?
    Max.
     
  6. cassity69

    Thread Starter Member

    Dec 18, 2013
    37
    0
    im using a darlington driver

    so port d goes to darlington darlington goes to stepper
     
  7. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    PORTA has the ADC inpuits and comparators.
    PORTB has the internal pullups (good for connecting buttons).
    PORTC has the CCPs for timing and PWM, and the RX/TX UART, MSSP SPI port etc.
    PORTD is often the "preferred" port for simple parallel tasks (like a stepper motor).
    :)
     
    absf likes this.
Loading...