Strange Problem Encountered Using MicroChip MPLAB IDE C Compiler

Status
Not open for further replies.

skyflyer54

New Member
HI,

Is there any1 encountered this problem which i'm facing now. I believed the problem is due to some of the software setting which I totally can't figure out after two days of trying.

The problem is as follows:

I tried to create a new c program project using MPLAB IDE but after creating the c program file and building or compiling it, my complier will halt saying that "unknown processor". I have selected the correct device from the configure menus and also it was well connected. I have #include <p18f4520.h> in my c program and also the header and linker file is added too. But still got the same problem.

Is it some of the path or directory or setting I overlook and did not set correctly. Please guide me thru. Thanks.
 
I find usefull, in other IDE's, to save the source files and erase the project file itself, then make another project and add the existing source files, sometimes there are bugs lol that's one of the reasons why they update the IDE's LOL

Have fun!
 
Same goes for the MPLAB workspace. Nuking it gets rid of phantom breakpoints.
 
Oh.. By the way... I solved the problem already. Thanks every1 comment..

I uninstalled all related software (MPLAB IDE and it's C Compiler) and re-installed everything again. Finally, it works well again. kekez..

Btw.. any1 to recommend how to generate variable PWM from P18F4520 chip? I'm super new into this and still trying to figure out how to come abt with it.
 
Then be carefull with you next configurantions... Remember that even with the Bugs out there, MPLAB is an consumer ready product, it is not expected to have mutch bugs by now, they only add new devices and correct problems with the added devices.

Problems like those also occur when you install diferent linkers, say like MPLAB C30 Compiler and HiTech Pic C Compiler... then uninstalling one of them may leave config files or registry key entries behind and it could cause problems...

Have fun!
 
It seems the processor you want to flash is defective. The programmer cannot read the factory data from the processor. May be there was a too high voltage on Vdd / Vcc or somewhat.
 

Oh.. Previously I have installed C30 software also than I installed P18 software. That why it don't works. So I uninstalled everything and only installed P18 and it works. Heez...

Btw.. I'm wondering, will MPLAB IDE software create the hex file automatically for C program? I keep having a warning saying that hex file is not created.

But for asm file it works well and it create the hex file automatically.

Any advice?

 
It seems the processor you want to flash is defective. The programmer cannot read the factory data from the processor. May be there was a too high voltage on Vdd / Vcc or somewhat.

I think should not be the Vdd or Vcc problem as i'm using the power adapter that the development board provides. It should be the installation procedure problem.
 
Can any1 tell me what is the maximum applied voltage for any of the PORT that was set as input? Is it 5Vdc or it can be more? Is 20Vdc ok to input to the input PORT?
 
Can any1 tell me what is the maximum applied voltage for any of the PORT that was set as input? Is it 5Vdc or it can be more? Is 20Vdc ok to input to the input PORT?

As long as you feed it via a current limiting resistor, for 20V something like 22K-47K should be OK - ensure the input pin has internal protection diodes, almost all PIC pins do, but there are occasional ones that don't.
 
Or, you can make a simple voltage divider with 2 resistors, this can be the best option with high voltages, make something like this:

Output Voltage = (R1/R2)*Input Voltage


Input Voltage
___
|
|
|
/ R1
\ Resistor of 10KOhmm, Lowest %
/
\
|
|--------> To Pic A/D Conv. (Output)
|
/ R2
\ Resistor of 100KOhmm, Lowest %
/
\
|
|
|
____
___
_

Then, on the Pic program you know that the voltage is being divided by 10, like in this example, an you multiply the A/D Conv. result by 10 to obtain the real voltage !
Change the R1 to 1KOhmm and you will be dividing the value by 100 !
Use an diode bridge to rectify the input signal in the case of not knowing the porarity or measuring AC voltage.

Have Fun !
 

Thank TiagoSilva...
I also have the voltage divider approach in my mind. For my case i will scale down my 20Vdc to 5Vdc so that I can input to PIC A/D I/P Pin. (Can I apply a voltage greater than 5Vdc to the A/D i/p pin) or do you know what is the maximum voltage that I can apply to the A/D i/p pin?

Previously I use a few comparator to generate an 10Vdc PWM signal and it works well with IR2101 gate driver but now my problem is that the pwm output on CCP1 pin is only 5Vdc and when I connect this signal to IR2101 gate driver it won't work well. (did I miss out any thing before connecting to the gate driver. for e.g. buffer?)

Btw... is it possible to invert the signal on CCP1 meaning that instead of 1001 1001.. is it possible to invert it to 0110 0110? Heez...
 
Last edited:
Btw... is it possible to invert the signal on CCP1 meaning that instead of 1001 1001.. is it possible to invert it to 0110 0110? Heez...

Can't you just invert the duty cycle so 255 is off and 0 is full on.

Mike.
 
Can't you just invert the duty cycle so 255 is off and 0 is full on.

Mike.

I have tried it but It don't seem to work.

I have tried using Exclusive OR and also NOT function but still don't seem working.

I think it because I'm using CCP1 and CCP2 to output my pwm that why I can't invert it.

Am I right?
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…