18F4431 Quaduature Encoder


Closed Thread
Results 1 to 29 of 29

Hybrid View

  1. #1
    Join Date
    Jan 2007
    Posts
    8


    Did you find this post helpful? Yes | No

    Default

    Henrik,
    The problem was that I did not set
    the ANSEL0 register to digital i/o.

    Great tip on counter overflow.
    I will definately incorporate.

    Thank You again.
    Richard

  2. #2
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Isn't that an awesome controller? The motion feedback module with pulse width & frequency measurement is really handy.

    Note: On the 28-pin version, forget using RE3 as an input. I tried, and submitted a support ticket to Microchip. Here's what I received back;
    RE3 pin in PIC18F2331/2431 has been removed as a digital input. Hence, pin no. 1 of PIC18F2331/2431 can be used for MCLR/ Vpp only.

    This change will be notified in a datasheet's (DS39616B.pdf) future update.
    Last edited by Bruce; - 19th February 2007 at 23:36.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  3. #3
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Default

    Hi Bruce,
    Thank you for info regarding RE3/MCLR as input.

    It sure is a cool device. Using Darrel's interupt routines I managed to get motor controller for my robot working, with PID filter and all. Very fun project.

    However.....I never managed to get QEI module going in velocity mode. I made a few attempts to begin with but could never quite figure it out so I went for my own velocity calcs (newPos-oldPos). Any pointers?

    Thanks!
    /Henrik Olsson.

  4. #4
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Hi Henrik,

    I haven't messed with QEI yet, but if I do get something going, I'll port it from C to PBP and post it here.

    My primary interest in this one was the new high-speed A/D, and motion feedback module for background pulse & freq measurements.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  5. #5
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Default

    Bruce,
    I see. Thanks anyway!

    /Henrik Olsson.

  6. #6
    Join Date
    Jun 2006
    Posts
    37


    Did you find this post helpful? Yes | No

    Default 18F4431 PPWM setup and operation

    Hi!
    i got hold of Microchip PICDEm MC LV board with 3-phase BLDC motor.It has a CD that conatins source code in assembly. I was wondering if someone has done same thing in pic basic i.e used power PWM module of 18F4431.I tried according to application note but to no avail. Here is my code.could someone point me out in right direction.some code snipet would be appreciated.
    thanks

    while true
    PTCON0=00000000 'page 8,step 1
    PTPERL=$37 'a guess
    PTPERH=$01
    PWMCON0=01001111 'step 3
    PWMCON1=00000001 'step 4
    DTCON=00000000 ' a guess
    OVDCOND=00000000 'step 6
    OVDCONS=00000000
    FLTCONFIG=00000000
    'POVD=00000000
    'SEVTCMP=$0000
    'step 8
    SEVTCMPL=$00
    SEVTCMPH=$00
    PDC0L=$00
    PDC0H=$00
    PDC1L=$00
    PDC1H=$00
    PDC2L=$00
    PDC2H=$00
    PDC3L=$00
    PDC3H=$00


    TRISC.0=1
    PTCON1=10000000 'or PTCON1.7=1
    wend

  7. #7
    Join Date
    Jun 2006
    Posts
    37


    Did you find this post helpful? Yes | No

    Default PPWM setup and operation setup and operation

    Hi!
    i got hold of Microchip PICDEm MC LV board with 3-phase BLDC motor.It has a CD that conatins source code in assembly. I was wondering if someone has done same thing in pic basic i.e used power PWM module of 18F4431.I tried according to application note but to no avail. Here is my code.could someone point me out in right direction.some code snipet would be appreciated.
    thanks

    while true
    PTCON0=00000000 'page 8,step 1
    PTPERL=$37 'a guess
    PTPERH=$01
    PWMCON0=01001111 'step 3
    PWMCON1=00000001 'step 4
    DTCON=00000000 ' a guess
    OVDCOND=00000000 'step 6
    OVDCONS=00000000
    FLTCONFIG=00000000
    'POVD=00000000
    'SEVTCMP=$0000
    'step 8
    SEVTCMPL=$00
    SEVTCMPH=$00
    PDC0L=$00
    PDC0H=$00
    PDC1L=$00
    PDC1H=$00
    PDC2L=$00
    PDC2H=$00
    PDC3L=$00
    PDC3H=$00


    TRISC.0=1
    PTCON1=10000000 'or PTCON1.7=1
    wend

  8. #8
    Join Date
    Jan 2007
    Posts
    8


    Did you find this post helpful? Yes | No

    Default

    I wish I could help but I am using the 18F4431 in a completely
    different manner.
    Richard

Similar Threads

  1. Quadrature encoder and ASM Interrupts. questions..
    By godfodder in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 17th March 2013, 14:45
  2. Instant Int and encoder (Elect. Gearing)
    By boroko in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 29th November 2009, 02:29
  3. Reset timer / encoder transition
    By DJEE in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 22nd June 2007, 14:37
  4. encoder HEDL 5540
    By kutsi in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 11th June 2007, 14:00
  5. encoder wowes
    By wallaby in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 6th December 2005, 21:56

Members who have read this thread : 2

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts