• AVR Freaks

AnsweredHot!PIC18F67K40 - Failed to get device ID

Page: < 123 > Showing page 2 of 3
Author
MightyBeard7
New Member
  • Total Posts : 27
  • Reward points : 0
  • Joined: 2019/07/22 23:33:24
  • Location: 0
  • Status: offline
Re: PIC18F67K40 - Failed to get device ID 2019/09/15 23:32:26 (permalink)
0
In MPLAB 8.92 by going to Programmer > Settings > Status, and looking at the "Target Vdd", It is showing as 3.25V. Is it the correct setting?
#21
MightyBeard7
New Member
  • Total Posts : 27
  • Reward points : 0
  • Joined: 2019/07/22 23:33:24
  • Location: 0
  • Status: offline
Re: PIC18F67K40 - Failed to get device ID 2019/09/16 00:02:21 (permalink)
0
@RIC I found what u asked me to check. But that check box is not being displayed in "program memory" tab
#22
NorthGuy
Super Member
  • Total Posts : 5754
  • Reward points : 0
  • Joined: 2014/02/23 14:23:23
  • Location: Northern Canada
  • Status: online
Re: PIC18F67K40 - Failed to get device ID 2019/09/16 11:26:44 (permalink)
0
Very strange schematics. The MCLR pin of the programming connector should connect to the point marked "U". not where it is connected now. Then R15 would isolate the PIC's MCLR from harmful influence of C8 (for this purpose it should be 470 Ohm, or higher). In the current position, R15 doesn't d anything useful except disturbing voltage levels. But since you removed C8, this might be Ok.
 
Can you test with a scope (DMM?) how the voltage changes on the MCLR pin of your PIC when you try to program?
#23
MightyBeard7
New Member
  • Total Posts : 27
  • Reward points : 0
  • Joined: 2019/07/22 23:33:24
  • Location: 0
  • Status: offline
Re: PIC18F67K40 - Failed to get device ID 2019/09/16 20:50:51 (permalink)
0
We found out that PIC18F67K40 is not supported by MPLAB 8.92V which we were using. Now we changed it to MPLABX 5.20V and it is detected and got detected and programmed successfully. 
I have connected MCLR pin to an Test point and then to program header, so that's why the point "U"
post edited by MightyBeard7 - 2019/09/16 21:49:40
#24
MightyBeard7
New Member
  • Total Posts : 27
  • Reward points : 0
  • Joined: 2019/07/22 23:33:24
  • Location: 0
  • Status: offline
Re: PIC18F67K40 - Failed to get device ID 2019/09/16 23:40:18 (permalink)
0
Now i am facing a new issue. I am able to program chip for blinking a led but when i program another code its programming successfully but functionality is not working and the led still blinks, i guess previous code is not erased ?
#25
ric
Super Member
  • Total Posts : 24278
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
Re: PIC18F67K40 - Failed to get device ID 2019/09/17 00:00:07 (permalink)
0
Programming always erases the whole chip. More likely there's some problem with how you're compiling/

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#26
MightyBeard7
New Member
  • Total Posts : 27
  • Reward points : 0
  • Joined: 2019/07/22 23:33:24
  • Location: 0
  • Status: offline
Re: PIC18F67K40 - Failed to get device ID 2019/09/17 01:40:19 (permalink)
0
Can you provide some troubleshooting steps or something ?
#27
AMPS
Super Member
  • Total Posts : 465
  • Reward points : 0
  • Status: offline
Re: PIC18F67K40 - Failed to get device ID 2019/09/17 01:53:48 (permalink)
0
First thing give me latest update on this.
which IDE your using as update.
Can share complete code and schematic 

Amps
*.*.*.*.*.*.*.*.*.*.*.*.*
#28
MightyBeard7
New Member
  • Total Posts : 27
  • Reward points : 0
  • Joined: 2019/07/22 23:33:24
  • Location: 0
  • Status: offline
Re: PIC18F67K40 - Failed to get device ID 2019/09/17 02:17:16 (permalink)
0
I am using MPLABX 5.20 and MikroC with MPLAB SNAP DEBUGGER
#29
ric
Super Member
  • Total Posts : 24278
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
Re: PIC18F67K40 - Failed to get device ID 2019/09/17 02:53:30 (permalink)
0
I've never used MikroC, and have no idea how it fits into the MBLABX workflow.
Have you tried XC8?
 

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#30
MightyBeard7
New Member
  • Total Posts : 27
  • Reward points : 0
  • Joined: 2019/07/22 23:33:24
  • Location: 0
  • Status: offline
Re: PIC18F67K40 - Failed to get device ID 2019/09/17 03:12:28 (permalink)
0
No, I haven't tried XC8
#31
AMPS
Super Member
  • Total Posts : 465
  • Reward points : 0
  • Status: offline
Re: PIC18F67K40 - Failed to get device ID 2019/09/17 03:29:32 (permalink) ☼ Best Answerby MightyBeard7 2019/09/18 21:08:58
0
i will suggest you to use Xc8 compiler with Mplab x IDE. MicroC supports library function which may or may not work with some controller.
if using Xc8 & mplab X ide u might get proper debug come code related issue solution.
if using micro c , its better to post the problem there.
 

Amps
*.*.*.*.*.*.*.*.*.*.*.*.*
#32
MightyBeard7
New Member
  • Total Posts : 27
  • Reward points : 0
  • Joined: 2019/07/22 23:33:24
  • Location: 0
  • Status: offline
Re: PIC18F67K40 - Failed to get device ID 2019/09/17 03:46:49 (permalink)
0
Till now our team haven't used XC8 and MPLABX IDE. 
#33
AMPS
Super Member
  • Total Posts : 465
  • Reward points : 0
  • Status: offline
Re: PIC18F67K40 - Failed to get device ID 2019/09/17 20:32:17 (permalink)
0
forum will support more microchip related any design & software issue. Xc8 also supports microchip library when uses mcc code configuration.Where you should now how to use library function.there are lots of example code available .
 
MickroC library it might similar to arduino platform where you might find easy to code.But in arduino we use Serial.println() statement t0 debug the code. Here you need to go register level to debugging.
 
I always prefer to goto register level debugging and writing of code.

Amps
*.*.*.*.*.*.*.*.*.*.*.*.*
#34
MightyBeard7
New Member
  • Total Posts : 27
  • Reward points : 0
  • Joined: 2019/07/22 23:33:24
  • Location: 0
  • Status: offline
Re: PIC18F67K40 - Failed to get device ID 2019/09/17 22:24:58 (permalink)
0
I will use MPLAB XPRESS IDE with XC8 compiler and verify once
#35
MightyBeard7
New Member
  • Total Posts : 27
  • Reward points : 0
  • Joined: 2019/07/22 23:33:24
  • Location: 0
  • Status: offline
Re: PIC18F67K40 - Failed to get device ID 2019/09/17 23:14:52 (permalink)
0
While setting configuration bit settings in MCC, for MCLRE it showing two options EXTMCLR and INTMCLR which one i should choose ? I have enabled LVP bit
#36
AMPS
Super Member
  • Total Posts : 465
  • Reward points : 0
  • Status: offline
Re: PIC18F67K40 - Failed to get device ID 2019/09/18 04:43:07 (permalink) ☄ Helpfulby MightyBeard7 2019/09/18 06:52:48
0
Here i have config the Device to use internal oscilator with 8mhz and timer interrupt for 1ms.
I have used RA0 port to blink LED . You can use custom name or macros to declare it.
if using as digital pin, deselect analog value in PIN config setting.
if you have any led connected assign that port and opt same method.
I never find option what u asked. let me know the setting. I have used 
Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.77
Device : PIC18F67K40
Driver Version : 2.00
mplab x ide v5.15
 
once config as done generate file .   below is code . you can try and send if it working. I dont have hardware to test
main.c

#include "mcc_generated_files/mcc.h"

#define LED RA0
unsigned char Counter;

void Timer_Interrupt()
{
    if(PIR0bits.TMR0IF ==1)
    {
        PIR0bits.TMR0IF = 0;
        Counter++;
        if(Counter>20)
        {
           LED=!LED;
        }
        
    }
    
    
    
}

void main(void)
{
    // Initialize the device
    SYSTEM_Initialize();

    
    // Enable the Global Interrupts
    INTERRUPT_GlobalInterruptEnable();

    // Disable the Global Interrupts
    //INTERRUPT_GlobalInterruptDisable();

    // Enable the Peripheral Interrupts
    INTERRUPT_PeripheralInterruptEnable();

    // Disable the Peripheral Interrupts
    //INTERRUPT_PeripheralInterruptDisable();

    while (1)
    {
        // Add your application code
    }
}

timer0.c

#include <xc.h>
#include "tmr0.h"

void Timer_Interrupt();


volatile uint16_t timer0ReloadVal16bit;

/**
  Section: TMR0 APIs
*/

void (*TMR0_InterruptHandler)(void);

void TMR0_Initialize(void)
{
    // Set TMR0 to the options selected in the User Interface

    // T0CS FOSC/4; T0CKPS 1:8; T0ASYNC synchronised;
    T0CON1 = 0x43;

    // TMR0H 255;
    TMR0H = 0xFF;

    // TMR0L 6;
    TMR0L = 0x06;

    // Load TMR0 value to the 16-bit reload variable
    timer0ReloadVal16bit = (TMR0H << 8) | TMR0L;

    // Clear Interrupt flag before enabling the interrupt
    PIR0bits.TMR0IF = 0;

    // Enabling TMR0 interrupt.
    PIE0bits.TMR0IE = 1;

    // Set Default Interrupt Handler
    TMR0_SetInterruptHandler(TMR0_DefaultInterruptHandler);

    // T0OUTPS 1:1; T0EN enabled; T016BIT 16-bit;
    T0CON0 = 0x90;
}

void TMR0_StartTimer(void)
{
    // Start the Timer by writing to TMR0ON bit
    T0CON0bits.T0EN = 1;
}

void TMR0_StopTimer(void)
{
    // Stop the Timer by writing to TMR0ON bit
    T0CON0bits.T0EN = 0;
}

uint16_t TMR0_ReadTimer(void)
{
    uint16_t readVal;
    uint8_t readValLow;
    uint8_t readValHigh;

    readValLow = TMR0L;
    readValHigh = TMR0H;
    readVal = ((uint16_t)readValHigh << 8) + readValLow;

    return readVal;
}

void TMR0_WriteTimer(uint16_t timerVal)
{
    // Write to the Timer0 register
    TMR0H = timerVal >> 8;
    TMR0L = (uint8_t) timerVal;
}

void TMR0_Reload(void)
{
    // Write to the Timer0 register
    TMR0H = timer0ReloadVal16bit >> 8;
    TMR0L = (uint8_t) timer0ReloadVal16bit;
}

void TMR0_ISR(void)
{
    // clear the TMR0 interrupt flag
   // PIR0bits.TMR0IF = 0;
    // Write to the Timer0 register
    Timer_Interrupt();
    TMR0H = timer0ReloadVal16bit >> 8;
    TMR0L = (uint8_t) timer0ReloadVal16bit;

    if(TMR0_InterruptHandler)
    {
        TMR0_InterruptHandler();
    }

    // add your TMR0 interrupt custom code
}


void TMR0_SetInterruptHandler(void (* InterruptHandler)(void)){
    TMR0_InterruptHandler = InterruptHandler;
}

void TMR0_DefaultInterruptHandler(void){
    // add your TMR0 interrupt custom code
    // or set custom function using TMR0_SetInterruptHandler()
}

 

Attached Image(s)


Amps
*.*.*.*.*.*.*.*.*.*.*.*.*
#37
AMPS
Super Member
  • Total Posts : 465
  • Reward points : 0
  • Status: offline
Re: PIC18F67K40 - Failed to get device ID 2019/09/18 04:44:07 (permalink) ☄ Helpfulby MightyBeard7 2019/09/18 06:52:43
0
Here i have config the Device to use internal oscilator with 8mhz and timer interrupt for 1ms.
I have used RA0 port to blink LED . You can use custom name or macros to declare it.
if using as digital pin, deselect analog value in PIN config setting.
if you have any led connected assign that port and opt same method.
I never find option what u asked. let me know the setting. I have used 
Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.77
Device : PIC18F67K40
Driver Version : 2.00
mplab x ide v5.15
 
once config as done generate file .   below is code . you can try and send if it working. I dont have hardware to test
 

Attached Image(s)


Amps
*.*.*.*.*.*.*.*.*.*.*.*.*
#38
MightyBeard7
New Member
  • Total Posts : 27
  • Reward points : 0
  • Joined: 2019/07/22 23:33:24
  • Location: 0
  • Status: offline
Re: PIC18F67K40 - Failed to get device ID 2019/09/18 06:47:25 (permalink)
0
Verified with MPLAB 5.25V with MCC 3.75V and XC8. Programmed with Small LED blinking program and everything is working fine. Will check other functionalities on the custom board and keep y'all updated
#39
MightyBeard7
New Member
  • Total Posts : 27
  • Reward points : 0
  • Joined: 2019/07/22 23:33:24
  • Location: 0
  • Status: offline
Re: PIC18F67K40 - Failed to get device ID 2019/09/18 06:55:13 (permalink)
0
Thank you @AMPS for the detailed information.
#40
Page: < 123 > Showing page 2 of 3
Jump to:
© 2019 APG vNext Commercial Version 4.5