Encoder problem


Results 1 to 7 of 7

Thread: Encoder problem

Threaded View

  1. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    My rules:
    1. Don't use Serout when the PIC have an internal USART, use HSEROUT instead.
    2. use Timer as counter when hardware allow
    3. keep ISR as short as possible to avoid latency etc etc
    In this case, i guess, you could remove the interrupt and do the job by reading the Timer register. Working 'round the multiple if/then statement you can improve it.

    also...
    Code:
    OPTION_REG = %00000000
    On Interrupt Goto myint
    INTCON = $90
    
    
    IF PORTA.0 = 1 THEN NINE
    LOOP: serOUT PORTC.6,T9600,[#b5,#b4,#b3,#b2,#b1,13]
    When you start the PIC and IF PORTA.0=1 you make it jump to the ISR? Bad practice
    Last edited by mister_e; - 10th September 2006 at 18:07.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

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. Problem implement "Henrik" incPID
    By phoenix_1 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 26th September 2009, 14:36
  4. USART Problem , but don't know where, in pc? or in PIC?
    By precision in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th July 2007, 08:12
  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 : 0

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