Hot!IOC not working on 18F45K50

Author
CBRUNN59
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2017/01/02 13:54:02
  • Location: 0
  • Status: offline
2018/03/06 10:55:12 (permalink)
0

IOC not working on 18F45K50

Hello,
I migrated my code from the PIC18F4520 to an PIC18F45K50 in order to have USB functionality. The issue I have is getting the IOC on all ports RB<7:4> on the PIC to work properly. The only difference I see is the requirement to enable the IOC function on each port using IOCB.IOCBx. I have two issues with using the PIC18F45K50.
First, while I am able to get the ISR to fire for PORT4,5, I cannot get PORT6,7 to respond. Second, even though PORT4,5 do respond, I seem to be missing pulses. When I rotate the encoders (optical, so no bounce issue), the counts are inconsistent.
I've gone through the datasheet several times but can't find anything that might cause this to happen.
I'm using a third party compiler, however, I had the same result with XC8.
Has anyone experienced this issue? Is there a solution? I would appreciate any suggestions.
Thanks in advance.
 
Here is a snippet of the code I'm using.

 
// Hardware/Configuration description:
// 16MHz Xtal
// 3x PLL enabled
// No CPU postscaler
// Using Optical encoders that are decoded prior to PIC controller.
// Pulses are 10us wide.

#define ENC1_DWN PORTB.B5
#define ENC1_UP PORTB.B4
#define ENC2_DWN PORTB.B7
#define ENC2_UP PORTB.B6
 
 
 
void interrupt(void){ // Evaluate encoder1
 //if(INTCON.RBIF==1)  // Changed from
 if(INTCON.IOCIF==1){ // Changed to

// Evaluate encoder1
    if(!ENC1_DWN) // Turn counterclockwise
        {A_STEP--;} // count down
     else if(!ENC1_UP) // Turn clockwise
        {A_STEP++;} // count up

// Evaluate encoder2
  if(!ENC2_DWN) // Turn counterclockwise
        {B_STEP--;} // count down
   else if(!ENC2_UP) // Turn clockwise
        {B_STEP++;} // count up
  }

 //INTCON.RBIF=0; //Clear port B interrupts flag  // Changed from
 INTCON.IOCIF=0; //Clear port B interrupts flag   // Changed to
 return;
 }

void main()
{
 IOCB.IOCB4=1; // Enable IOC on PortB4
 IOCB.IOCB5=1; // Enable IOC on PortB5
 IOCB.IOCB6=1; // Enable IOC on PortB6
 IOCB.IOCB7=1; // Enable IOC on PortB7
 
 INTCON.IOCIE=1; // enable RB interrupts
 INTCON.GIE=1; // enable Global interrupts
 
do{

// Process and display results

}
While(1)
}}

post edited by CBRUNN59 - 2018/03/14 14:06:34
#1

19 Replies Related Threads

    BMD
    Super Member
    • Total Posts : 427
    • Reward points : 0
    • Joined: 2003/12/02 21:42:52
    • Location: UK
    • Status: offline
    Re: IOC not working on 18F45K50 2018/03/13 09:31:47 (permalink)
    0
    Hi,
    A snippet isnt much use, if thats not where your issue is. You need to show all your code.
     
    I would look for, where you store the old reading of the pins so you can decide which one changed and fired the interrupt. So you only deal with an encoder that has moved.
    And where you read the current state (to clear the IOC) and see what has changed, by comparing with old.
     
    Also, what encoder are you using? so we can see how the pins change with each increment.
     
    In short, you need to provide as much info as possible.
     

    Regards

    Brandon
    #2
    jtemples
    Super Member
    • Total Posts : 11001
    • Reward points : 0
    • Joined: 2004/02/13 12:31:19
    • Location: Southern California
    • Status: offline
    Re: IOC not working on 18F45K50 2018/03/13 10:37:12 (permalink)
    +1 (1)
    Interrupt on change is not reliable on the PIC18, especially the way you're using it (reading the port multiple times).  Did you read the note about IOC in the PORTB section of the data sheet?
    #3
    1and0
    Access is Denied
    • Total Posts : 8461
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: IOC not working on 18F45K50 2018/03/13 10:49:41 (permalink)
    +1 (1)
    CBRUNN59
    I migrated my code from the PIC18F4520 to an PIC18F45K50 in order to have USB functionality. The issue I have is getting the IOC on all ports RB<7:4> on the PIC to work properly. The only difference I see is the requirement to enable the IOC function on each port using INTCON.IOCBx. I have two issues with using the PIC18F45K50.
    First, while I am able to get the ISR to fire for PORT4,5, I cannot get PORT6,7 to respond. Second, even though PORT4,5 do respond, I seem to be missing pulses. When I rotate the encoders (optical, so no bounce issue), the counts are inconsistent.
    I've gone through the datasheet several times but can't find anything that might cause this to happen.
    I'm using a third party compiler, however, I had the same result with XC8.
    Has anyone experienced this issue? Is there a solution? I would appreciate any suggestions.
     
    Here is a snippet of the code I'm using.
    void main()
    {
     INTCON.IOCB4=1; // Enable IOC on PortB4
     INTCON.IOCB5=1; // Enable IOC on PortB5
     INTCON.IOCB6=1; // Enable IOC on PortB6
     INTCON.IOCB7=1; // Enable IOC on PortB7


    Is that your real code?  I don't think those IOCx bits belong to the INTCON register.
     
    Edit: What C compiler are you using?
     
     
    post edited by 1and0 - 2018/03/13 10:51:48
    #4
    jack@kksound
    code tags!
    • Total Posts : 2842
    • Reward points : 0
    • Joined: 2014/05/14 10:03:19
    • Location: 0
    • Status: offline
    Re: IOC not working on 18F45K50 2018/03/13 11:14:12 (permalink)
    +1 (1)
    The IOCx bits are in the IOCB SFR.
    The port pins must be in INPUT mode for the IOC to operate.
    RB6 and RB7 are also the programming pins, anything related to programming connected to these pins in addition to your encoders?
    So much can be answered if adequate information is provided.
    #5
    CBRUNN59
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2017/01/02 13:54:02
    • Location: 0
    • Status: offline
    Re: IOC not working on 18F45K50 2018/03/13 15:38:12 (permalink)
    0
    I appreciate the feedback. Sorry for lack of detailed info.
    The circuit design is quite simple. I'm using two quadrature optical encoders which feeds a decoder circuit. The A & B outputs provide a negative transitioning pulse ~10us wide. Channel A outputs only in CW rotation and channel B only outputs on CCW rotation. I have tried using XC8 and MikroC (code snippet I provided is MikroC) with the same results.
    I did see the notes about IOC in the datasheet, however, there is no mention of how to work around the limitation.
    RB6/RB7 are isolated for programming. This does not interfere with code operation. As I mentioned in my original post, I've been using this code successfully on several other PIC18 variations.
    To simplify debugging, I eliminated encoder 2 code in ISR, so, just trying to focus on encoder 1. The ISR code only increments and decrements A_STEP depending on rotation direction. If I disable one of the evaluation sections in ISR (disable either A_STEP-- or A_STEP++), the counts are spot-on! it seems to be only when trying to evaluate both conditions that I have an issue. If you reference my code, I'm only checking the IOCIF once on each interrupt.
     
    Encoders are connected as:
    //*****Encoder 1********
    #define ENC1_DWN PORTBbits.RB4   // Channel A
    #define ENC1_UP PORTBbits.RB5      // Channel B
     
    //*****Encoder 2********
    #define ENC2_DWN PORTBbits.RB6  // Channel A
    #define ENC2_UP PORTBbits.RB7     // Channel A
     
    Thank you,
    Chris
    #6
    jack@kksound
    code tags!
    • Total Posts : 2842
    • Reward points : 0
    • Joined: 2014/05/14 10:03:19
    • Location: 0
    • Status: offline
    Re: IOC not working on 18F45K50 2018/03/14 08:55:51 (permalink)
    +1 (1)
    I think you would do well to re-post your actual code (ALL of it is best). The code you posted WILL NOT WORK on this pic as it uses incorrect SFR names (INTCON instead of IOCB for example).
    #7
    jtemples
    Super Member
    • Total Posts : 11001
    • Reward points : 0
    • Joined: 2004/02/13 12:31:19
    • Location: Southern California
    • Status: offline
    Re: IOC not working on 18F45K50 2018/03/14 10:47:40 (permalink)
    0
    I did see the notes about IOC in the datasheet, however, there is no mention of how to work around the limitation.

     
    The workaround is to not use it.  Either use INTx interrupts, or poll.
    #8
    1and0
    Access is Denied
    • Total Posts : 8461
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: IOC not working on 18F45K50 2018/03/14 11:02:04 (permalink)
    0
    jtemples
    The workaround is to not use it.  Either use INTx interrupts, or poll.

    Agree. Connect one channel of the rotary encoder to an INTx interrupt pin, and in the ISR check the polarity of the other channel to determine the direction.
    #9
    jack@kksound
    code tags!
    • Total Posts : 2842
    • Reward points : 0
    • Joined: 2014/05/14 10:03:19
    • Location: 0
    • Status: offline
    Re: IOC not working on 18F45K50 2018/03/14 11:26:13 (permalink)
    0
    1and0
    jtemples
    The workaround is to not use it.  Either use INTx interrupts, or poll.

    Agree. Connect one channel of the rotary encoder to an INTx interrupt pin, and in the ISR check the polarity of the other channel to determine the direction.


    This is the method I have used for years and it works very well. However it seems the OP is using an encoder with some sort of decode circuit that does not produce quadrature A/B signals but rather up/down pulses. If that is indeed the case then I am afraid this scheme will not work as the "other" channel will always be in a known state (idle) and will not provide direction info.
    #10
    1and0
    Access is Denied
    • Total Posts : 8461
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: IOC not working on 18F45K50 2018/03/14 12:06:25 (permalink)
    0
    jack@kksound
    However it seems the OP is using an encoder with some sort of decode circuit that does not produce quadrature A/B signals but rather up/down pulses. If that is indeed the case then I am afraid this scheme will not work as the "other" channel will always be in a known state (idle) and will not provide direction info.

    I should had read the post before posting. :(
     
    #11
    qɥb
    Monolothic Member
    • Total Posts : 3329
    • Reward points : 0
    • Joined: 2017/09/09 05:07:30
    • Location: Jupiter
    • Status: offline
    Re: IOC not working on 18F45K50 2018/03/14 12:30:13 (permalink)
    0
    CBRUNN59
    ...
    The circuit design is quite simple. I'm using two quadrature optical encoders which feeds a decoder circuit. The A & B outputs provide a negative transitioning pulse ~10us wide. Channel A outputs only in CW rotation and channel B only outputs on CCW rotation.
    ...

    What is the part number of this encoder?
    What you describe is NOT a quadrature encoder.

    This forum is mis-configured so it only works correctly if you access it via https protocol.
    The Microchip website links to it using http protocol. Will they ever catch on?
    PicForum "it just works"
    #12
    jtemples
    Super Member
    • Total Posts : 11001
    • Reward points : 0
    • Joined: 2004/02/13 12:31:19
    • Location: Southern California
    • Status: offline
    Re: IOC not working on 18F45K50 2018/03/14 12:40:31 (permalink)
    0
    If you reference my code, I'm only checking the IOCIF once on each interrupt.

     
    That's not the issue.  The issue is that you're reading PORTB multiple times in the interrupt.  That increases the likelihood that you will miss interrupts.  Are you reading or writing other PORTB pins in your code?  That will also result in missing interrupts.
     
    The workaround is to read PORTB (not individual pins), clear the interrupt flag, then read PORTB again to get the correct state of the port:
     
    uint8_t portb;
    PORTB;  // read and discard
    IOCIF = 0;
    portb = PORTB;
    // process portb

    #13
    CBRUNN59
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2017/01/02 13:54:02
    • Location: 0
    • Status: offline
    Re: IOC not working on 18F45K50 2018/03/14 13:58:38 (permalink)
    0
    I am using US digital S4T-360. This miniature encoder outputs TTL compatible quadrature outputs @ 360 CPR . They are connected to an LFLS7183-S which is an encoder to counter interface chip. Simply performs all quadrature decoding and outputs pulses. Since this encoder is a 360 CPR The total output pulse count for 360 Deg. is 1440 pulses.
     
    My last post incorrectly listed the IOCB bits in the INTCON register. jack@kksound correctly stated the IOCB bits are within the IOCB register.
     
    Technically, we could completely ignore the source of pulses. I think this only causes more confusion.  Keeping in mind that the goal is to count when RB4 or RB5 sees a low transition. If RB4 goes low (10us) then A_STEP++. If RB5 goes low (10us), then A_STEP--. It really doesn't matter what the source of the pulses are since I'm not attempting to perform quadrature decoding on the PIC. Also, since I need 4 inputs, INTx inputs are not an option since there are only three.
     
    Reviewing the PIC1845K50  datasheet reveals....
     
    The INTCON register control has the following note:
    NOTE 1: A mismatch condition will continue to set IOCF bit. Reading PORTB/PORTC will end the
                 mismatch condition and allow the bit to be cleared.
             2: Port change interrupts also require the individual pins IOCBx/IOCCx enables.
    Also Note:
            Interrupt flag bits are set when an interrupt condition occurs, regardless of the state of
            its corresponding enable bit or the global enable bit. User software should ensure the appropriate interrupt flag bits are clear prior to enabling an interrupt. This feature allows for software polling.
     
    jtemples, you suggest not using the IOC but use polling instead. Do you have an example of how to do this?
     
    It seems the IOC functionality on the PIC18FxxKxx is flawed and does not perform as expected. I have seen a couple posts that suggest reading the IOC flag twice. I haven't been able to find examples however.
    post edited by CBRUNN59 - 2018/03/14 14:00:27
    #14
    jtemples
    Super Member
    • Total Posts : 11001
    • Reward points : 0
    • Joined: 2004/02/13 12:31:19
    • Location: Southern California
    • Status: offline
    Re: IOC not working on 18F45K50 2018/03/14 14:17:50 (permalink)
    0
    I have seen a couple posts that suggest reading the IOC flag twice.

     
    Reading the IOC flag has no side effects, so reading it twice does nothing.
     
    you suggest not using the IOC but use polling instead. Do you have an example of how to do this?

     
    Set up a timer interrupt that's fast enough to detect your pulses, and inspect the state of the port on every interrupt.
     
    Or, if you structure the IOC interrupt as I explained above, it should mitigate the problem.
     
    Keep in mind that the source of your problem hasn't been identified since we haven't seen complete code.  But regardless of what the root cause turns out to be, your current ISR should be corrected.
    post edited by jtemples - 2018/03/14 17:30:44
    #15
    jack@kksound
    code tags!
    • Total Posts : 2842
    • Reward points : 0
    • Joined: 2014/05/14 10:03:19
    • Location: 0
    • Status: offline
    Re: IOC not working on 18F45K50 2018/03/14 14:47:51 (permalink)
    0
    As the pulses from your encoder decode chip are only 10us wide (approx. you stated) is it possible that you are experiencing interrupt latency (time to respond to the interrupt) that exceeds this time? If so you will "miss" the pulses.
    #16
    CBRUNN59
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2017/01/02 13:54:02
    • Location: 0
    • Status: offline
    Re: IOC not working on 18F45K50 2018/03/19 13:59:06 (permalink)
    0
    Sorry for the delayed response.
    I'm not sure how I can check PORTB in its entirety since PORTB bits 0-4 might be used for other things.
    Also, where do I read PORTB and discard? Within the ISR? I apologize for the newbie questions but quite honestly, I am quite new to PIC and programming in C language. I've attached the code as requested, however, it is in MikroC since I am still in the midst of a learning curve with MPLAB/XC8.
    Again, I've used this method in several other PIC's without any issue. I still can't understand what the difference is between the PIC18F45K50 and any other. Reviewing the logic diagram doesn't reveal anything different other than the register names.
    Thank you.

     
    /**
     Project is based on PIC18F4520 @ 16MHz
     16x2 4 bit parallel LCD display
     Using custom encoders which output decoded grey code. Each encoder has two outputs,  negative -10uS pulse counter-clock-wise and other output -10uS clock-wise
     Each encoder output connected to ports B4-B7 with 10K pull-up (IOC)
     
     PORTA port assignments
     0   LCD D4
     1   LCD D3
     2   LCD D2
     3   LCD D1
     4   LCD RS
     5   LCD E
     6   XTAL_IN
     7   XTAL_OUT
     
     PORTB port assignments:
     0
     1  
     2
     3
     4   EncoderA UP
     5   EncoderA DOWN
     6   EncoderB UP
     7   EncoderB DOWN
     
     PORTC port assignments:
     0   Reset Button
     1  
     2  
     3
     4
     5
     6  
     7 
     
     PORTD port assignments:
     0  
     1  
     2  
     3  
     4  
     5  
     6  
     7 
     
     PORTE port assignments:
     0 
     1 
     2 
     3
    */
     
    // Global Variables
    int count1;
    int count2;
    int countx;
    int county;
    unsigned int A_STEP;
    unsigned int B_STEP;
    unsigned int PORTB_READ;
    int leftright;
    char countx_txt[7];
    char county_txt[7];
    char count1_txt[7];
    char count2_txt[7];
     

    // Defines****************************************
    #define MRST PORTC.F0
    #define ENC1_DWN PORTB.B4
    #define ENC1_UP PORTB.B5
    #define ENC2_DWN PORTB.B6
    #define ENC2_UP PORTB.B7
    //************************************************
     
    // LCD Configuration section
    sbit LCD_RS at LATA4_bit;
    sbit LCD_EN at LATA5_bit;
    sbit LCD_D7 at LATA3_bit;
    sbit LCD_D6 at LATA2_bit;
    sbit LCD_D5 at LATA1_bit;
    sbit LCD_D4 at LATA0_bit;
    sbit LCD_RS_Direction at TRISA4_bit;
    sbit LCD_EN_Direction at TRISA5_bit;
    sbit LCD_D7_Direction at TRISA3_bit;
    sbit LCD_D6_Direction at TRISA2_bit;
    sbit LCD_D5_Direction at TRISA1_bit;
    sbit LCD_D4_Direction at TRISA0_bit;
     

    void ClearAll(){
     
    Lcd_Out(1,1,"ANG1:       ");
    Lcd_Out(2,1,"ANG2:       ");
     
     count1 = 0;
     countx = 0;
     count2 = 0;
     county = 0;
     A_STEP = 0;
     B_STEP = 0;
     
    LCD_Out(1,11,"      ");
    LCD_Out(2,14,"   ");
    }
     
    void Interrupt(){ // Evaluate encoder1
     
     if (IOCIF_bit=1){
      
        if(!ENC1_UP){
        A_STEP++;}
     
        if(!ENC1_DWN){
        A_STEP--;}
     
        if(!ENC2_DWN){
        B_STEP++;}
     
        if(!ENC2_UP){
        B_STEP--;}
     
     }
    IOCIF_bit=0;            // Clear interrupt flag bit
     }

     void CONFIGURE(){
     
        ADCON0 = 0x07;
        ADCON1 = 0x0F;
        ADCON2 = 0x07;
       
     // ANSELx registers
        ANSELC = 0x00;
        ANSELB = 0x00;
        ANSELD = 0x80;
        ANSELE = 0x00;
        ANSELA = 0x00;
       
     // WPUx registers
        WPUB = 0x00;
     
      CM1CON0 = 0x07;
      CM2CON0 = 0x07;
      CM2CON1 = 0x07;
      CCP1CON = 0;
      CCP2CON = 0;
      SSPCON2 = 0;
      SSPCON1 = 0;
      ADON_bit=0;
      DACEN_bit=0;
      CCPR1 = 0;
      CCPR2 = 0;
     
      TRISA = 0xFF; // 00000000   CONFIGURE i/o on Port A
      TRISB = 0xF2; // 11110010   CONFIGURE i/o on Port B
      TRISC = 0x98; // 10011000   CONFIGURE i/o on Port C
      TRISD = 0x0F; // 00001111   CONFIGURE i/o on Port D
      TRISE = 0x07; // 111        CONFIGURE i/o on Port E
       
     // IOCx registers
     // interrupt on change for group IOCB - any
      IOCB.IOCB4 = 1;
      IOCB.IOCB5 = 1;
      IOCB.IOCB6 = 1;
      IOCB.IOCB7 = 1;
     
      PEIE_bit=1;
      IOCIE_bit=1;
      IOCIF_bit=0;
      GIE_BIT=1;            // Global Interrupt Enable bit | 1 = Enables all unmasked interrupts
     
     // Intialize LCD
      Lcd_Init();                        // Initialize LCD
      Lcd_Cmd(_LCD_CLEAR);               // Clear display
      Lcd_Cmd(_LCD_CURSOR_OFF);          // Cursor off
     
     // Initial Splash screen
      LCD_Out(1, 1, "Angle Measurement   ");
      LCD_Out(2, 1, "Project             ");
      delay_ms(3000);
      Lcd_Cmd(_LCD_CLEAR);                // CLEAR display
     
    ClearAll();
     
     count1 = 90;   // Set default value
     count2 = 0;    // Set default value
     countx = 0;    // Set default value
     county = 0;    // Set default value
      return;
     }
     

    void main(){
     
    CONFIGURE();
     
     do {
     
    // ############ extract count values for both sides of decimal (xx.xx) #####################
     
         // Format encoder 1
       count1 = 360-(abs (A_STEP));           // Absolute raw count A encoder value + seed
       countx = (abs (count1))*25%100;        // Extract .25 counts
       count1 = (abs (count1))/4;             // Extract integer counts
     
        // Format encoder 2
       count2 = (abs (B_STEP));               // Absolute raw count B encoder value
       county = (abs (count2))*25%100;        // Extract .25 counts
       count2 = (abs (count2))/4;             // Extract integer counts
     
       // convert integer results to string for displaying
       intToStr(Count1, Count1_txt);          // Convert A left of decimal integer to string
       intToStr(Countx, Countx_txt);          // Convert A right of decimal integer to string
       intToStr(Count2, Count2_txt);          // Convert B left of decimal integer to string
       intToStr(County, County_txt);          // Convert B right of decimal integer to string
     
         //Format text results and display encoder 2 value
       Lcd_Out(1,7,ltrim(rtrim(Count2_txt)));         // Display count1 number
       Lcd_Out_CP(".");                                        // Add decimal point
       Lcd_Out_CP(ltrim(rtrim(County_txt)));         // Display countx number
       Lcd_Out_CP(" ");                                        // clear positions when display changes
         
          //Format text results and display encoder 1 value
       Lcd_Out(2,7,ltrim(rtrim(Count1_txt)));         // Display count2 number
       Lcd_Out_CP(".");                                        // Add decimal point
       Lcd_Out_CP(ltrim(rtrim(Countx_txt)));         // Display countx number
       Lcd_Out_CP(" ");                                        // clear positions when display changes
     //********************************************************************************************************
     
     // Reset Button
     if (Button(&PORTC,0,1,0)){
     
    ClearAll();
     
    while (!MRST) ; // Wait for push button release
     }
     
     }
    while(1);
     
     } // endless loop
     

    post edited by CBRUNN59 - 2018/03/19 14:03:17
    #17
    qɥb
    Monolothic Member
    • Total Posts : 3329
    • Reward points : 0
    • Joined: 2017/09/09 05:07:30
    • Location: Jupiter
    • Status: offline
    Re: IOC not working on 18F45K50 2018/03/19 14:14:29 (permalink)
    0
    CBRUNN59
    I'm not sure how I can check PORTB in its entirety since PORTB bits 0-4 might be used for other things.

    So just ignore the bits you don't care about.

    Also, where do I read PORTB and discard? Within the ISR?

    Yes.
    Do NOT read PORTB outside the ISR, that will disrupt the IOC mechanism.
     

    This forum is mis-configured so it only works correctly if you access it via https protocol.
    The Microchip website links to it using http protocol. Will they ever catch on?
    PicForum "it just works"
    #18
    jtemples
    Super Member
    • Total Posts : 11001
    • Reward points : 0
    • Joined: 2004/02/13 12:31:19
    • Location: Southern California
    • Status: offline
    Re: IOC not working on 18F45K50 2018/03/19 14:30:05 (permalink)
    0
    I still can't understand what the difference is between the PIC18F45K50 and any other

     
    There's no difference in the IOC implementation between PIC18s.  And no one is saying that the IOC implementation is causing the issue you're seeing.  But your use of IOC is incorrect, and it could be causing the problem, so it's the first thing you should fix to rule it out.
     
    IOC problems are caused by very subtle timing issues, and if you were, for example, running a different PIC at a different clock rate, that could mask the problem on that PIC.
    #19
    CBRUNN59
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2017/01/02 13:54:02
    • Location: 0
    • Status: offline
    Re: IOC not working on 18F45K50 2018/03/20 07:36:28 (permalink)
    0
    Thanks to everyone's patients and great advice, I have this working now! I've learned a lot.
     
    Chris
    #20
    Jump to:
    © 2018 APG vNext Commercial Version 4.5