336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

02-559-2163

마이크로칩 社 한국지사 (기술부)

▼아래 참고하시고 도움되셨다면 댓글 남겨주세요(광고클릭은 사랑입니다.)



PK3Err0045 : You must connect to a target device to use PICkit3

위 메세지가 보인다면

If you see the PK3Err0045 Error Message.

Go to Programmer >> Settings


이걸 해결하면 PK3Err0045는 사라지고

PK3Err0035 가 발생하면 칩에 문제가 있는것이다.

▼이 메세지는 Failed to get Device ID  = 인식실패 이다.



▼Program 버튼을 누르면...

...The following memory regions failed to program correctly:

Program Memory

Address: 00000000 Expected Value: 0000118a Received Value: 00000000

Programming failed.

===========================================================

▼아래 메세지(PK3Err0021)가 보인다면 아직 해결의 기미가 보인다.

Debugger >> Select Tool >>PICkit3 선택후

Programmer >>Select Programmer >>PICkit3 를 번갈아 왔다갔다 하면

PK2Err0045 (전원공금 에러) 로 넘어올것이다.

위에서 정리한 방법대로 해결하면 다시 정상동작한다.

그래도 해결이 안된다면

StandAlong으로 빠져나와서 Tools >> Download PICkit Operating System에서

OS를 재설치 한다.


===========================================================

▼Device의 Mismatch일때 뜨는 메세지

===========================================================

▼아래 메세지가 뜨기전에

모터드라이버 L293D를 이용한 실험을 했었다.

L293D의 외부전원핀(8핀)에 Rectifier의 연결방향을 (Vcc(5V) ▶ VCC2(8핀))으로 연결했어야하는데

그와 반대방향으로 (Vcc(5V)  VCC2(8핀)) 연결했더니

PIC칩에 과도 전류가 흘러들어가 뭔가 타는듯한 냄새가 났었다.

그로인해 PK3Err0033에러와

PK3Err0075에러가 발생한걸로 추정된다. (전원인가 불가 상태)


▼초기화 실패 PK3Err0038 에러메세지

초기화 실패하면 아래와 같은 메세지 또한 확인할 수 있다.

(Voltage Caution)



▼PICKit3 StandAlone에서도 No Device Detected라고 떠있는걸 확인할 수 있다.

▼칩을 새걸로 교체하니 Error없이 Writing이 됨을 확인할 수 있다.


===========================================================



===========================================================


아래와 같이 나온다면 성공


=========================================================

▼StandAlone이 종료되지않을때 Error 메세지


Posted by ElectricShock
:
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

How to Burn MikroC code Using PICkit3

LINK ☜Click(클릭)

Step1 : Create Program in MikroC

(HEX를 생성한다.)

Step2 : MPLAB Settings

(File >> Close Workspace 를 눌러서 모든 파일들을 닫는다.)

(Configure >> Select Device로 칩선택)



이제 Configure >> Configuration Bits 로 가서 Configuration Bits set in code 가 체크 되있는지 확인한다.

  • Now, again click on Configure and then on Configuration Bits and make sure to tick the option above the table which says Configuration Bits set in code. I have also shown it in the below figure.



이제 PICkit3와 Computer를 연결한다.

Driver는 자동으로 installed 된다.

Programmer >> Select Programmer >> PICkit3를 선택



칩과 PICkit3를 연결할 차례이다.

하드웨어가 자가발전이면 에러가 발생하지 않는다.

헌데, 만약 하드웨어가 자가발전이 아니라면, PICkit3가 power it up 시킨다는 의미이므로 PK3Err0045 에러가 발생할것이다.

  • Here comes the role of external hardware you are using to connect your PICkit3 with the PIC Microcontroller. If this external hardware is self powered i.e. externally powered than you wont get any error and the PICkit3 will successfully Connected but if your external hardware is not self powered means you are using PICkit3 to power it up then you will get the below error.



PK3Err0045 에러가 발생하면,

Programmer >> Settings >> Power 에서

Power target circuit from Pickit3를 체크해준다.


Programmer >> Reconnect 클릭

==============================================================

Step3 : Importing HEX File in MPLAB (The Last Step)


Posted by ElectricShock
:
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

참고사이트 (☜Click)

선연결 순서 :: Green LED, Red LED, Echo, Trig 순서대로 각각 D10,D11,D12,D13 이다. 나머지는 VCC,GND를 Arduino에 연결해줄것

/*
HC-SR04 Ping distance sensor]
VCC to arduino 5v GND to arduino GND
Echo to Arduino pin 13 Trig to Arduino pin 12
Red POS to Arduino pin 11
Green POS to Arduino pin 10
560 ohm resistor to both LED NEG and GRD power rail
More info at: http://goo.gl/kJ8Gl
Original code improvements to the Ping sketch sourced from Trollmaker.com
Some code and wiring inspired by http://en.wikiversity.org/wiki/User:Dstaub/robotcar
*/

#define trigPin 13
#define echoPin 12
#define led 11
#define led2 10

void setup() 

{
  Serial.begin (9600);        //통신속도
  pinMode(trigPin, OUTPUT);        //아두이노 ▶ 초음파센서
  pinMode(echoPin, INPUT);        //초음파센서 ▶ 아두이노
  pinMode(led, OUTPUT);
  pinMode(led2, OUTPUT);
}

void loop() 

{
      long duration, distance;        //거리, 지속시간
      digitalWrite(trigPin, LOW);  // Added this line
      delayMicroseconds(2); // Added this line
      digitalWrite(trigPin, HIGH);
    //  delayMicroseconds(1000); - Removed this line
      delayMicroseconds(10); // Added this line
      digitalWrite(trigPin, LOW);    //여기 이후 딜레이는  Forever


      duration = pulseIn(echoPin, HIGH);
  

distance = (duration/2) / 29.1;        //cm단위로 거리연산

if (distance < 4)         //거리가 4cm이하라면

{  

// This is where the LED On/Off happens

           digitalWrite(led,HIGH);     //적색 ON

// When the Red condition is met, the Green LED should turn off

digitalWrite(led2,LOW);    //녹색 OFF

}
  

else         //거리가 4cm이상이라면

{
    digitalWrite(led,LOW);        //적색 OFF
    digitalWrite(led2,HIGH);     //녹색 ON

}
  

if (distance >= 200 || distance <= 0)    //거리가 범위를 벗어나면

{
    Serial.println("Out of range");
  }

else             //범위안에 있다면 시리얼 모니터에 표시

{
    Serial.print(distance);
    Serial.println(" cm");
 }
  delay(500);
}


BikeBraking System HEX code


BikeBreak.hex


Posted by ElectricShock
:

BLOG main image
잡동사니들(지극히 개인취향인...) (다른글에도 댓글 부탁해요♥) You May Leave English Messages on GuestBook. by ElectricShock

공지사항

카테고리

분류 전체보기 (782)
MiDi (2)
Programming(=프로그래밍) (3)
Animation (4)
Blender (3D Graphic Program.. (10)
Blendtuts.com (Series) (1)
Blender 기초 팁들 (2)
Processing (디지털미디어과) (2)
Music (1)
Books in the world (0)
Communication(CAN, UART, et.. (12)
MCU Examples (PIC 기반) (7)
Transistor (1)
Mikro C Pro (11)
Mikro Pascal (1)
Proton IDE (0)
Robot (0)
Swift 3D (1)
Dummies Series (1)
All about Hacking (0)
제2 외국어 (1)
PIC 해외서적들 (3)
AVR (25)
PIC (MikroC) (MPLAB) (4)
Assembly (2)
ARM (3)
Arduino (26)
PSpice (1)
Proteus ISIS (14)
CodeVision (2)
FPGA (15)
MPLAB (24)
PCB (the Procedure) (15)
3D Printer (5)
PICKIT3 (6)
Matlab (11)
RaspBerry PI (15)
BeagleBone (1)
Android Studio (17)
졸업작품 (172)
Korea History (0)
Issue(사회) (73)
Multimeter 리뷰 (1)
Oscilloscope (1)
A (34)
B (19)
J (6)
C (32)
P (12)
T (37)
H (12)
I (12)
M (44)
R (5)
E (5)
F (2)
D (9)
O (2)
L (7)
S (9)
W (2)
V (6)
G (14)
Visual C++ or Visual Studio (2)
Android App Development (0)

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백