![]() | ![]() | ![]() |
| |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
![]() |
| | Tools |
| | #1 |
|
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. | |
| |
| | #2 |
|
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. | |
| |
| | #3 |
|
Hi Mike, the pin is B5 (pin 38 on the PIC). Florian | |
| |
| | #4 |
|
Sounds like you have LVP enabled in the config. Mike. | |
| |
| | #5 |
|
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 | |
| |
| | #6 |
|
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 | |
| |
| | #7 | |
| Quote:
Which dev board did you get from Futurlec WizzBall?
__________________ digital-diy.com - Hobby microcontroller projects and tutorials. Assembly, PICBasic and C examples. | ||
| |
| | #8 |
|
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.
| |
| |
| | #9 |
|
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)
;
}
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 .
| |
| |
| | #10 | |
|
Hi, Quote:
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 | ||
| |
| | #11 | |
| Quote:
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. | ||
| |
| | #12 |
|
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 .
| |
| |
| | #13 | |
|
Hi, Quote:
Hopefully a more experienced member can come in and help to get you runnning properly ... Richard | ||
| |
| | #14 |
|
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. | |
| |
| | #15 |
|
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);
}
}
Mike. | |
| |
|
| 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 |