Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 20th November 2008, 01:34 AM   #1
Question Bad chip?

Hello everyone,

I recently acquired a PIC development board from Futurlec paired with a Pickit2. Last night, I did some very basic testing of the chip (a PIC18F4550) by turning all the port pins on and checking the output voltage.

All the ports were OK except for one (one pin doesn't seem to be able to output the +5V signal - verified on the actual MCU pin as well). Am I to assume that it's just a problem with that particular pin or it could mean that there are potentially other problems with the chip?

I am thinking about sending this chip back as I believe it to be defective, however I'd like to hear your opinion on the matter as well before I do that.

Thank you!

Last edited by WizzBall; 20th November 2008 at 01:37 AM.
WizzBall is offline  
Old 20th November 2008, 01:54 AM   #2
Default

Some pins have dedicated uses that have to be turned off and others (E3) are input only. It's very unlikely that you have a damaged chip. Which pin wasn't high?

Mike.
Pommie is online now  
Old 20th November 2008, 02:28 AM   #3
Default

Hi Mike, the pin is B5 (pin 38 on the PIC).


Florian
WizzBall is offline  
Old 20th November 2008, 02:50 AM   #4
Default

Sounds like you have LVP enabled in the config.

Mike.
Pommie is online now  
Old 20th November 2008, 03:29 AM   #5
Default

Arrrgh! You're right Mike, good thing I didn't pry the chip from the board and send it back!

And speaking of LVP... when I try to go into debug mode, it asks me if I would like to disable LVP (which I agree to) only to then serve me with a "PK2Error0028: Unable to enter debug mode" error message. What exactly is going on?

And something puzzling - if I program the board from inside MPLAB IDE the program does not work, if however I load the hex file using the Pickit2 programmer it works just fine .


Florian
WizzBall is offline  
Old 20th November 2008, 10:06 AM   #6
Default

Hi,

Couple of things worth checking - are you using reasonably upto date software eg MPLab v8.10 and Pickit2 software - Firmware v2.30 and Application v2.50 ? - if not you can download it for free from Microchip.

You say you can program directly from the PK2, but not from Mplab .
Ensure the standalone PK2 program is closed down, before you select PK2 from MPlabs Programmer drop down menu.

Have just run a 4550 from Mplab in programmer and debug mode OK onto my own dev board, so if the above does not cure your problems suggest you post your first few lines of code, including the config statement.


As a byline - the 18F4550 being primarily a USB device, is not the most friendly one to start programming with due its many differences from a more normal pic - if you had chance to get a 4520 it would be easier imho.

Also you might find it easier in the long term, if possible, to change the 40 pin dil socket for a Zif socket - they are not that cheap, but well worth it.

hth

Richard
richard.c is offline  
Old 20th November 2008, 10:13 AM   #7
Default

Quote:
Originally Posted by richard.c View Post
Also you might find it easier in the long term, if possible, to change the 40 pin dil socket for a Zif socket - they are not that cheap, but well worth it.

hth

Richard
Definitely a great tip, that and a breadboard so that you don't need to 'pry' anything off while making quick circuits/adjustments

Which dev board did you get from Futurlec WizzBall?
__________________
digital-diy.com - Hobby microcontroller projects and tutorials. Assembly, PICBasic and C examples.

gramo is offline  
Old 20th November 2008, 11:00 AM   #8
Default

Also bung your 40pin IC into a 40 pin turned socket. The legs on these are a lot stronger than the PIC legs and if you are constantly bunging it in and out of sockets, can make things last a little bit longer.
picbits is offline  
Old 21st November 2008, 12:44 AM   #9
Default

Thank you all for trying to help!

Richard, I use MPLAB 8.10, Firmware 2.32 and Application 2.55.

Maybe I explained things the wrong way - I can 'program' it in MPLAB except the board/chip doesn't seem to do anything once I flip the switch in the 'Run' position. Now, when I load the hexfile using the Pickit2 Application it works as expected. The PK2 program is closed btw.


The code is below...
Code:
#include <p18cxxx.h>

#pragma config WDT = OFF

void main (void)
{
  /* Make all bits on the Port B (LEDs) output bits.
   * If bit is cleared, then the bit is an output bit.
   */
  TRISB = 0;

  /* Reset the LEDs */
  PORTB = 0;

  /* Light the LEDs */
  PORTB = 0xFF;

  while (1)
    ;
}
I will change to a ZIF socket in the future perhaps, for now I will continue to use the board as it is.

Gramo, the board is the following, although I can not recommend with a clear conscience that you acquire it from Futurlec (or anything else besides simple electronic components for that matter):

PIC18F4550 Development Board


Picbits, I got a couple of extra 18F4550's sitting around waiting to be used, I might try 'bunging' them as soon as I can figure out what is it you're advising me to do .
WizzBall is offline  
Old 21st November 2008, 10:06 AM   #10
Default

Hi,

Quote:
Maybe I explained things the wrong way - I can 'program' it in MPLAB except the board/chip doesn't seem to do anything once I flip the switch in the 'Run' position. Now, when I load the hexfile using the Pickit2 Application it works as expected. The PK2 program is closed btw.
Sorry, misunderstood things there - however worth checking which versions you are using.

I'm not into C so cannot actually replicate your work, I suspect the following is happening, might be wrong - but I'm sure others will help and correct me if thats the case; - I think when you program directly from the PK2 programmer, it reads the chip type in the socket and is then applying default 18F4550 parameters to your hex code which lets the program run correctly.

When you output from Mplab, you have the header 18cxxx, which from assembler would call up the 18Fc452 chip details - think if you change that include to 18F4550 it will work fine.

Would also add in some extra config statements to ensure LVP is turned off ,etc, etc CONFIG LVP=OFF


Richard
richard.c is offline  
Old 21st November 2008, 08:22 PM   #11
Default

Quote:
Originally Posted by WizzBall View Post
Gramo, the board is the following, although I can not recommend with a clear conscience that you acquire it from Futurlec (or anything else besides simple electronic components for that matter):

PIC18F4550 Development Board
Cheers

I'd agree with you on the 'can not recommend with a clear conscience', especially considering how much better there is out there

If you have your PK2, then just use a breadboard for your development, its hands down easy.

__________________
digital-diy.com - Hobby microcontroller projects and tutorials. Assembly, PICBasic and C examples.

gramo is offline  
Old 22nd November 2008, 05:02 AM   #12
Default

Richard, I included the correct file name and I get the same results (meaning no results). I also put the Config LVP = OFF line in my code but without any (positive) results. This has to be the most puzzling problem I have been faced with so far when dealing with PICs.

Gramo, I'll get another connector and make myself one of those cables .
WizzBall is offline  
Old 22nd November 2008, 11:17 AM   #13
Default

Hi,

Quote:
I included the correct file name and I get the same results (meaning no results). I also put the Config LVP = OFF line in my code but without any (positive) results.
I feel sure its just a small C / MpLab problem, but afraid I just don't know what that is.

Hopefully a more experienced member can come in and help to get you runnning properly ...


Richard
richard.c is offline  
Old 22nd November 2008, 12:14 PM   #14
Default

I am a little confused here. Am I right that you have a Futurlec board with a built in ICD2 clone, and a PICkit2 ?

Which programer are you using on what chip?

When posting code here (or debugging) it is better to use the correct .h file instead of #include <p18cxxx.h>.

...
You need to answer the above questions even if the answer is clear to you.

But given what you already said I am guessing that the config setup in the PICkit software is right but not that in MPLAB. Most possibly for choosing the osc.

3v0
__________________
Please post questions to the forums. PM's are for personal communication.

BCHS/3v0's Tutorials
Junebug USB PIC programmer kit., USB Bit Whacker,
The 15 Minute Printed Circuit Board! (+drill time)

Last edited by 3v0; 22nd November 2008 at 12:15 PM.
3v0 is offline  
Old 22nd November 2008, 12:55 PM   #15
Default

I not able to test this but I think it should work,
Code:
#include <p18f4550.h>
#include "delays.h"

#pragma config WDT = OFF, FOSC = INTOSC_HS, LVP=OFF

void main(void){
    OSCCON=0x72;       //8 MHz internal clock
    ADCON1=0x0f;       // all digital
    CMCON=7;           // no comparators
    TRISB=0;           //all output
    while(1){
        LATB=0xff;
        Delay10KTCYx(100);	//delay 1,000,000 cycles = 0.5 seconds
        LATB=0x00;
        Delay10KTCYx(100);	
     }
}
Make sure that under configure->configuration bits the "configuration bits set in code" option is checked.

Mike.
Pommie is online now  
Reply

Tags
bad, chip

Thread Tools
Display Modes


Similar
Title Starter Forum Replies Latest
need a PWM chip zavedur rahman Datasheet/Parts Requests 2 3rd August 2007 09:50 PM
What chip is this? EagleVisionTSi General Electronics Chat 5 25th March 2004 01:16 PM
8-Bit ADC chip pike Datasheet/Parts Requests 2 15th March 2004 05:38 AM
sim chip TKS Micro Controllers 4 25th February 2004 07:19 PM
PIC chip potatohead General Electronics Chat 8 16th January 2004 09:37 PM



All times are GMT. The time now is 02:32 AM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker