Тёмный

How to get source code onto a PIC microcontroller 

FriendlyWire
Подписаться 15 тыс.
Просмотров 82 тыс.
50% 1

How do you get source code onto a PIC microcontroller? In this tutorial we will go through five steps so that you can transfer C source code onto a PIC microcontroller using the MPLAB IDE, XC8 compiler, the MPLAB IPE, and the PICkit3. Let's go!
Thanks for watching, and let me know in the comments if you have any questions!
Companion article: www.friendlywire.com/tutorials...
Email list: www.friendlywire.com/email
Website: www.friendlywire.com
Twitter: / friendlywire
Reddit: / friendlywire
Facebook: / friendlywire
Instagram: / friendlywire
Timestamps:
00:00 Introduction
00:23 Overview
01:18 Step 1: Install the software
01:53 Step 2: Create a new MPLAB project
03:48 Step 3: Compile the C code
04:46 Step 4: Connect the PICkit3
06:49 Step 5: Program the controller
08:55 Eight common mistakes and their solutions
11:05 Conclusion

Опубликовано:

 

29 июн 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 298   
@FriendlyWire
@FriendlyWire 2 года назад
IMPORTANT: There is a mistake at 6:21 for the PIC16F1455. The correct PGD/ICPSDAT connection is at pin 10, and the correct PGC/ICSPCLK connection is at pin 9. Pins 12 and 13 are the wrong connection, sorry for the confusion!
@mba2ceo
@mba2ceo Год назад
plz do an update video
@FriendlyWire
@FriendlyWire Год назад
@@mba2ceo Happy to, but an update on what?
@mba2ceo
@mba2ceo Год назад
@@FriendlyWire Write a program and keep adding code until the program no longer fits/works and display how many lines of code that is
@FriendlyWire
@FriendlyWire Год назад
@@mba2ceo Yeah, but for what controller? And what kind of lines? If you have lots of complicated operations it will be very few lines, and if it's basic stuff it can be a lot of them. But the best part: you can actually download the XC8 compiler and the MPLAB IDE and give it a try yourself, for the controller and code you have in mind :)
@ChikiChpoki
@ChikiChpoki 9 месяцев назад
It is impossible not to note the quality and detailed сompanion articles on the website. It really sets you apart from the similar content makers. Thank you for your work!
@FriendlyWire
@FriendlyWire 9 месяцев назад
Wow, thank you so much! :)
@mohitrahaman
@mohitrahaman Год назад
High quality stuff, soon you'll be big! Can't wait to see what you have in store for us.
@FriendlyWire
@FriendlyWire Год назад
Thank you for your kind words, Mohit! All the best wishes :)
@tdranger6888
@tdranger6888 Год назад
Great tutorial, very understandable. I'm a greenhorn. I've been struggling with MCU orientation for weeks. Now I get it, all in one video.
@FriendlyWire
@FriendlyWire Год назад
Thank you so much, I am glad you find this video helpful! :)
@billebrill8730
@billebrill8730 2 года назад
Great to see a channel using the PIC. I am a big PIC fan but with the vast array of devices and constant upgrades to the software it can get intimidating for the beginner. Thanks.
@FriendlyWire
@FriendlyWire 2 года назад
Hey Bill, glad you like the video! Yes, there are so so many PICs out there, which is why I focus on just a few of them in my videos :)
@billebrill8730
@billebrill8730 2 года назад
@@FriendlyWire I jumped from the 16F887 to the 18F26K20 mostly because I wanted 3.3V. So much functionality I have yet to master! But most of the code can easily be ported. Thanks again.
@FriendlyWire
@FriendlyWire 2 года назад
@@billebrill8730 Yes, there is a lot of PIC controllers out there, and it can be very overwhelming to begin with. Instead of overthinking I always recommend to just start somewhere in order to form a solid basic understanding, and then branch out from there :) My first controller was the PIC16F627A :)
@palmering88
@palmering88 8 месяцев назад
I just programmed my PIC18F4550 after 10 years of not touching it. This channel and the website was a lot of help. Very straightforward, very helpful. Thank you.
@FriendlyWire
@FriendlyWire 8 месяцев назад
That's amazing, congratulations, and thank you for your kind words!
@Vamptech360
@Vamptech360 4 месяца назад
Hlw I've something to ask
@NZ2Pepper
@NZ2Pepper 8 месяцев назад
Just the info I'd been looking for. Thanks 👍
@FriendlyWire
@FriendlyWire 8 месяцев назад
Glad you found the video helpful! :)
@1georgeh
@1georgeh Месяц назад
Thank you so much. Very useful. Clear, simple to follow, and direct to the point.
@FriendlyWire
@FriendlyWire Месяц назад
Thank you for your kind words, I am glad you found it useful!
@sudarapremathilaka1706
@sudarapremathilaka1706 2 года назад
Great Video Tutorial. PIC programming is my favourite.Thanks.
@FriendlyWire
@FriendlyWire 2 года назад
Thank you, Sudara, I am happy you like it! :)
@oveschleisner-meyer8139
@oveschleisner-meyer8139 Год назад
Good clear and easy understanding tutorial... thanks a lot...
@FriendlyWire
@FriendlyWire Год назад
Glad you like it, thank you so much!
@martinveselovsky8135
@martinveselovsky8135 Год назад
Great and easy explanation, great video 👍
@FriendlyWire
@FriendlyWire Год назад
Thank you so much, Martin, glad you like it!
@anokhautomation4453
@anokhautomation4453 2 года назад
Very very useful tips 👍 thanks for your detailed explanation 👌
@FriendlyWire
@FriendlyWire 2 года назад
Thank you so much for your kind comment, I am so glad you like the video and find it helpful :)
@uuuu6590
@uuuu6590 2 года назад
This was great. Thank you very much 💟
@FriendlyWire
@FriendlyWire 2 года назад
Thank you, glad you like it! :)
@beatrute2677
@beatrute2677 Год назад
thanks man, this was a good presentation.
@FriendlyWire
@FriendlyWire Год назад
Glad you like it!
@fabriciocuellarzuna5249
@fabriciocuellarzuna5249 Год назад
Amazing. You helped me a lot. Thank u very much bro!
@FriendlyWire
@FriendlyWire Год назад
Thank you so much, Fabricio, I am glad you found my video helpful!
@kingkappa9916
@kingkappa9916 Год назад
Hi - Thanks for your video. With the power supply error at 10:00 minutes into your video, change the power setting to 4.75V and you can proceed past this self test ok. No external supply needed. 😁
@FriendlyWire
@FriendlyWire Год назад
Oh yeah, good idea! It may work sometimes, but usually when the voltage breaks down it means that the PICkit3 cannot supply enough current (and there may be a reason for that, such as a large number of external components). Glad it worked in your case! :)
@wtar8469
@wtar8469 8 месяцев назад
You save me a couple hours or maybe days . Thanks.
@FriendlyWire
@FriendlyWire 8 месяцев назад
Thank you, happy to help! :)
@muhammadhayyan9914
@muhammadhayyan9914 2 года назад
Love your videos
@FriendlyWire
@FriendlyWire 2 года назад
Thank you, Muhammad, glad you like them!
@jhoanrivero7885
@jhoanrivero7885 2 года назад
Great help frienly wire
@FriendlyWire
@FriendlyWire 2 года назад
Thanks Jhoan, glad you like it!
@Vancha112
@Vancha112 5 месяцев назад
Awesome video, just chose a pic10f200 as my first microcontroller to play around with, this will be real useful ^^
@FriendlyWire
@FriendlyWire 5 месяцев назад
Glad you found it helpful, and have fun! :-)
@hemashri
@hemashri 3 месяца назад
Your explanation above is great. thanks.
@FriendlyWire
@FriendlyWire 3 месяца назад
Thank you very much, I am glad you like it! :)
@vinilg1
@vinilg1 4 месяца назад
Excellent explination.
@FriendlyWire
@FriendlyWire 4 месяца назад
Thank you, glad you like the video!
@RenatoCorreaRJ
@RenatoCorreaRJ 2 года назад
Great! I Love it.
@FriendlyWire
@FriendlyWire 2 года назад
Thank you, Renato, glad you like it!
@digitalmachine0101
@digitalmachine0101 5 месяцев назад
Good information
@FriendlyWire
@FriendlyWire 5 месяцев назад
Thank you, glad you like it!
@user-mq4ki1fr2c
@user-mq4ki1fr2c Год назад
Good~ Thank you
@FriendlyWire
@FriendlyWire Год назад
Glad you liked it! :)
@Amin-py6tl
@Amin-py6tl Месяц назад
what a great video thank you nerd
@FriendlyWire
@FriendlyWire Месяц назад
Haha sure thing :)
@mariamsal8531
@mariamsal8531 2 года назад
WISH I HAD FOUND THIS CHANNEL EARLIER
@FriendlyWire
@FriendlyWire 2 года назад
Thank you so much, Mariam :)
@jerril42
@jerril42 2 года назад
Fantastic! It seems to have everything covered. I did not know the password to get into the advanced mode, it seems silly to need one. I thought I had to set something up with Microchip, I really don't like registering for everything I use. Thanks Jens, take care :)
@FriendlyWire
@FriendlyWire 2 года назад
Thank you, Jerry. I think they added the password (that can also be changed) so that it is possible to prevent a user from switching into the advanced mode. I can imagine that in schools or university labs instructors want students to use the default mode instead.
@jerril42
@jerril42 2 года назад
@@FriendlyWire Ah yes, it is good to keep students out of harms way. Thanks :)
@ranasaeed5807
@ranasaeed5807 7 месяцев назад
hello sir nice information ❤
@FriendlyWire
@FriendlyWire 7 месяцев назад
Thank you, glad you like it! :)
@ScottWalshWoodworking
@ScottWalshWoodworking 2 года назад
the windows XP sound effect makes me nostalgic
@FriendlyWire
@FriendlyWire 2 года назад
Ha, you and me both! :) ( It's at 1:50 for anybody who is interested. )
@mikemeyer301
@mikemeyer301 Год назад
Mine didn't work initially, even after trying everything you said. It finally worked after placing a resister between the VDD and MCLR, which from my understanding, was not required (newb trying to read datasheet) : using PIC52313
@FriendlyWire
@FriendlyWire Год назад
Thank you for sharing, Mike, and I am so sorry that it didn't work for you. (Sorry that I am replying so late, I only now saw your comment.) MCLR does not require any resistor to VDD with ordinary PICs when programmed with the PICkit3. I am having some trouble finding this controller, the PIC52313. Usually the names start with PIC16F or PIC12F, but this one is different. Can you double check the name? I would love to figure out why it didn't work out properly.
@SNStuart
@SNStuart 2 месяца назад
Hi I love you videos. But did you do some video on the pic 10f200. I thought I saw some on your channel. Thank you again
@FriendlyWire
@FriendlyWire 2 месяца назад
Hi Stuart, thanks for your kind words! Sorry, I have no videos on the PIC10F200. The chips I use most frequently are the PIC16F1455, PIC16F627A, and the PIC16F883.
@huythaiquang9682
@huythaiquang9682 7 месяцев назад
Thank you so much I'm making a digital door lock :)) +1 follow
@FriendlyWire
@FriendlyWire 7 месяцев назад
Oh, that's a cool project, and I am happy that my video could help you! Have a great day!
@jagmarc
@jagmarc Год назад
maybe the title of the video should be "how to send source code to a PIC". i must admit i clicked the video thinking it was "how to get..." as in "how to obtain..."
@FriendlyWire
@FriendlyWire Год назад
Oooh, I never even though about that! I hope it was not too confusing, but I will think about renaming the video. Thank you!
@anithasshenoy6662
@anithasshenoy6662 4 месяца назад
Nice video. Can you provide any link to PIC programming language libraries / headers etc.
@FriendlyWire
@FriendlyWire 4 месяца назад
Thank you! I am using the XC8 compiler which you can download for free from the Microchip website. All the programs I write are on www.friendlywire.com, I always include them with the projects :)
@eXtremeFX2010
@eXtremeFX2010 5 месяцев назад
This is helpful in understanding loading process. But I simply want to "CLONE" an existing PIC16F684 microchip. Do you have a video on HOW TO connect and CLONE?
@FriendlyWire
@FriendlyWire 5 месяцев назад
Thank you, I am glad it's helpful. It is sometimes possible to extract the .hex-file stored on a PIC. (But please make sure that you are allowed and have the right to extract it.) At 8:25, instead of selecting a .hex-file from your computer, you can click on "Read" and that will read out the .hex-file stored on the PIC. Note that this is only possible when "code protection" has been turned off by whoever programmed that PIC before you.
@michaelkotthaus7120
@michaelkotthaus7120 11 месяцев назад
Thank you for your tutorial. Well done! - But the resume to your title "how to get source code onto a PIC microcontroller" is: not at all. The controller can only execute machine code.
@FriendlyWire
@FriendlyWire 11 месяцев назад
Thank you! And yes, that's really the only way to think about it. But I decided to title the video like this because as a beginner I always thought that the actual code would be stored on the microcontroller. I hope the title did not make the video confusing :)
@sanjaybatra6593
@sanjaybatra6593 Год назад
one more question on some other Topic, how and from where to get and download different supporting library's for PIC microcontroller ? e.g LCD library or I2c , or RS485 I mean any library
@FriendlyWire
@FriendlyWire Год назад
Libraries are not so common with PIC controllers; the reason is that each PIC controller is different. You can search for what you want to do, say, control an LCD. When you find a project online for a specific PIC you can usually use it easily yourself for the same PIC. For really advanced topics, such as SD card memory management or USB stuff you find some libraries, but for simpler stuff you probably have to code your own. I think of it as an advantage (long term) because it really teaches you how to code, but for beginners it can be frustrating. Do you have anything in mind, in particular? I would recommend to get started with a simple project, maybe one from this channel, and then take it from there :)
@_jmeg_3436
@_jmeg_3436 2 года назад
Microchip shared this video. :)
@FriendlyWire
@FriendlyWire 2 года назад
It was very kind of them :)
@_jmeg_3436
@_jmeg_3436 2 года назад
@@FriendlyWire You covered this topic well, so I’m not surprised. I just subscribed 👍🏻.
@FriendlyWire
@FriendlyWire 2 года назад
@@_jmeg_3436 Thank you, Jeff, welcome to the channel! :)
@MADDOG_BC
@MADDOG_BC Год назад
Really good Video but I just wanna know if you can programm any microcontroller like from other companies with the same software and the Pick it 3 or just PIC's?
@FriendlyWire
@FriendlyWire Год назад
Thanks, glad you like it! This video only works for PIC microcontrollers and ATmega controllers, here is a list: pic-microcontroller.com/pickit-3-supported-devices/
@MADDOG_BC
@MADDOG_BC Год назад
@@FriendlyWire Thanks
@fedeyoutub
@fedeyoutub Год назад
Hi, thanks for your video, it made me understand many things.. I have a .bin file of a USB module, is a motherboard gamepad, the board has a PIC18 chip etc.. I have the manufacturer's firmware file , I would like to be able to open it to modify it, how can I do it ?
@FriendlyWire
@FriendlyWire Год назад
Hey there, I am glad you found my video helpful! I am not sure how do to what you have in mind, I am sorry. Most likely the manufacturer has code protection enabled. But even if you can get access to the code, it will not be in C, but machine code, which is much harder to read for us humans. Do you have experience in hardware?
@fedeyoutub
@fedeyoutub Год назад
@@FriendlyWire Thanks for the answer, yes, I have experience, but when I open the binary I find: 5!`¤*4$ óÖX›Ñ ‹ìxœï› Ó>к½p, :-(... I just can't figure out what language this is. i tried all possible converters to extrapolate to C or other, but nothing,. , this file is loaded on the electronic card via USB, using a software: HIFlash.. :-(
@FriendlyWire
@FriendlyWire Год назад
@@fedeyoutub Try opening this with a hex editor instead, it may be more suitable. But it's probably just machine code for your device, so it will be difficult to convert it back.
@davidenanni5311
@davidenanni5311 Год назад
Finally, after many years, i'm able to program a 16F84A, many thanks to you. Now, i'm trying to read ad program EEPROM 24C02 but it seems doesn't work... any suggestion? Thanks again! p.s. New sub!
@FriendlyWire
@FriendlyWire Год назад
Hello Davide, thank you for sharing, I am so glad to hear that and it means a lot to me! I have not covered EEPROMS yet, but hopefully I will do so in a future video. Thank you for the suggestion :)
@DomenSoster
@DomenSoster Год назад
Hello. I am using Pickit3 for programing my PIC18F45K42. I have a problem with LED blinking. In code i set the while loop to bling the diode 5 times, but it keeps blinking forever. Does it something has to do with configuration bits of PIC18F45K42 or is something wrong with connections and my microchip maybe is resetting nonstop ?
@FriendlyWire
@FriendlyWire Год назад
It's probably because everything is enclosed in a loop like this: while(1) { // your LED stuff } Can you share your code?
@mabsonleo
@mabsonleo 2 года назад
Would you like to give me advice about visual IDE ? I used visuino
@FriendlyWire
@FriendlyWire 2 года назад
Do you have a link to that one? I don't think I have ever used it, but it sounds interesting!
@Electrolab28Ag
@Electrolab28Ag 2 года назад
Really clear and understandable, A couple question... 1. If you have more than one VDD and VSS, do you have to connect power and GND to all points? 2. If I just want to read the data from one Chip and send the Hex file to another Chip. How can I do that?
@FriendlyWire
@FriendlyWire 2 года назад
Thank you for your kind words! 1. In our case here, all circuits run on one VDD (typically 3V-5V) and there is only one ground potential. All chips are connected to VDD and to ground. If you connect the PICkit3 to such a circuit, then you have to connect the VDD pin of the PICkit3 to the VDD of your circuit (and hence to the VDD of all chips), and to the ground level. In general, you always have to make sure that the PICkit3 is connected to the VDD and ground of the controller you want to program. If your circuit has multiple voltages (say, there is also a 9V rail, and so on) the you have to be careful not to destroy the PICkit3, as it can only tolerate up to 5V. 2. Yeah, you can do that, provided that the chip does not have code protection enabled. Follow the steps in the video, and at 7:30, when you connect the controller, you see the option "Read" (in the same row as the "Program" button). If you click that button, you will be able to read out the current .hex-file that the microcontroller uses. The IPE will then ask you where to store that .hex-file, and then you can use that .hex-file and send it to other controllers, too. Hope that helps, let me know if you have more questions, and thank you again for your interest! :)
@Electrolab28Ag
@Electrolab28Ag 2 года назад
@@FriendlyWire Thank you for your prompt response. I did as you suggested but when I press the Read tab in the IPE it just say read successful and does not ask me to save it anywhere. I am using PicKit 4. I also enable the Pickit to supply the 5 volts. Any ideas? The Chip that I am using is a PIC16F877-20I/P
@FriendlyWire
@FriendlyWire 2 года назад
@@Electrolab28Ag Oops, my bad. I think after the read you have to click on File -> Export and save it this way. Does it work for you? :)
@Electrolab28Ag
@Electrolab28Ag 2 года назад
@@FriendlyWire I am out of the workshop today, buy once I get back and I'll try iy and let you know.
@FriendlyWire
@FriendlyWire 2 года назад
@@Electrolab28Ag Yeah, let me know if it works!
@sanjaybatra6593
@sanjaybatra6593 Год назад
thanx a lot for nice video. I have a question , if the code has been written through mikroC....... Still it will work ?
@FriendlyWire
@FriendlyWire Год назад
Thank you, Sanjay! Can you send me a link to that compiler?
@sanjaybatra6593
@sanjaybatra6593 Год назад
I am sure HEX file will be same generated by MPLAB or MikroC.......but still want the clear my doubt.
@FriendlyWire
@FriendlyWire Год назад
@@sanjaybatra6593 If you have the .hex-file that is compiled for your PIC then you can definitely send it with the MPLAB IPE. The C code may be different for different compilers (XC8 in this case, but there are many others) but the .hex-file will always be the same :)
@donnlai
@donnlai 6 месяцев назад
Hi, kindly advice the followings. I fit capacitors on the rails RA7 and RA6 with a quartz oscillator, it lights up the LED on RB3. What if I change the nF value of capacitor? what if I put a polarity capacitor instead? Thx.
@advancedinkscape8494
@advancedinkscape8494 4 месяца назад
The two capacitors that connect each leg of the oscillator crystal to ground should be around 27pF. I use 22pF and it's fine. On most of the PIC microcontrollers (but not all), you can probably go as low as 15pF and as high as 50pF or higher and it won't stop your blinky program from working. You would use the cheapest type of capacitor, they are "ceramic". If you have a (wrong) capacitor that has a positive side and a negative side, it is NOT the right one. I have 22pF on my crystal oscillators on my old (and not powerful) PIC16F84A as well as my more powerful PIC18F4550, and plan to use that value on PIC16F877A and my other chips too. In the video, he runs another program to put the hex file to the chip, but it's not necessary, just press the arrow in MPLABX, and it'll program the chip, it's a million times faster!
@FriendlyWire
@FriendlyWire 4 месяца назад
My goodness, I just saw this comment from 2 months ago. Sorry to be so late to the party, and thank you @advanceinkscape8494 for your perfect answer. Also, besides what was already said, usually you need to check the datasheet of your crystal and it will tell you what its "load capacitance" is. Say it's 10pF. Then, if you ignore stray capacitance, you can usually take each capacitor to be twice that value, so: 20pF each, or, as was pointed out above, 22pF would also do the trick. Also, a lot of PICs allow you to use an internal oscillator, in which case you don't need an external crystal and capacitors at all.
@advancedinkscape8494
@advancedinkscape8494 4 месяца назад
@@FriendlyWire It's not necessary to consult the data sheet of a crystal. It's much more practical and realistic to consult the datasheet of your particular microcontroller where it's clearly stated what capacitors are required for a crystal oscillator. When employing a crystal, you will find in your PIC microcontroller datasheet two categories. The first is the values of capacitors suggested for resonators (not the one you want) and the other mentions "crystal", typically "crystal oscillator". You can take a shortcut to finding these sections, surprisingly, by doing a search for 'pf' (which may occur in datasheets only when talking about capacitors). The capacitor suggestions in the datasheet are indicated for which oscillator mode you want to use, which is the one thing you always have to specify when setting configuration bits. To keep life simple, use a 4MHz crystal (because it allows you to select either XT or high speed in the configuration bits, but simplify further and select XT). Also, as I previously stated, use a 22p capacitor on each leg of the crystal, it'll work for all the common PIC chips that hobbyists are likely to use.
@AlonsoCorrales
@AlonsoCorrales Год назад
Great video!! I have an issue with one PIC from one of my clients. Somebody erase the PIC´s model on the chip, and I don´t the model to read the program. Any tips to do an auto recognition? Thnx
@FriendlyWire
@FriendlyWire Год назад
Thank you, Alonzo, glad you like the video! :) I am not aware of auto recognition, but usually the MCLR/PGD/PGC lines are at the same place given a package size. How many pins does the PIC have?
@AlonsoCorrales
@AlonsoCorrales Год назад
@@FriendlyWire 18 PINs
@FriendlyWire
@FriendlyWire Год назад
@@AlonsoCorrales In that case I would just try the pinout of the PIC16F627A (friendlywire.com/tutorials/touch/PIC16F627A-datasheet.pdf). MCLR at pin 4, PGD at pin 13, PGC at pin 12, VDD at pin 14, and VDD at pin 14. Then you can make a list of all 18-pin PIC's and try them out by selecting them in the MPLAB IPE, and see if it connects properly.
@electrical_engineer1
@electrical_engineer1 Год назад
Sir , mpli ixe in advance settings which password use?? Microchip ic read and save which software best for pickit3.5?
@FriendlyWire
@FriendlyWire Год назад
I think the default password is "microchip" in the advanced settings, it should say somewhere in the window. I think the MPLAB IPE works with the PICkit 3.5, have you tried it?
@naushadc.k.8851
@naushadc.k.8851 4 месяца назад
Is it possible to get the hex code from pic ic where it was flashed earlier.
@FriendlyWire
@FriendlyWire 4 месяца назад
Yes, if the code protection bit is turned off by whoever flashed the PIC, it's possible. Just connect it as shown in the video until 8:17, but then click on "Read" and the PICkit will attempt to read out the PIC's memory and retrieve the .hex-file, if possible. Hope it helps!
@mohandmohand2047
@mohandmohand2047 Год назад
How about 12c508/p 04 HAM modchip???? I need digram point for it GND VDD all 8 pin i have k150 programmer and it give error recived data about reset play...
@FriendlyWire
@FriendlyWire Год назад
Looks to me that VDD is pin 1, GND is pin 8, MCLR is pin 4, PGD is pin 7, and PGC is pin 6. Check out table 3-1 in here: ww1.microchip.com/downloads/en/DeviceDoc/40139e.pdf Hope it helps!
@rogthedodge99
@rogthedodge99 11 месяцев назад
Hi. Great video. For us latecomers, I notice that the latest MPLAB IPE v6.10 (Directed to the download site on your FriendlyWire website) no longer supports the PICKiT 3!!. I found out the hard way. Will uninstall and go back a version or two. Thank you
@FriendlyWire
@FriendlyWire 11 месяцев назад
Thank you for your feedback, I was not aware of that. I am traveling right now, but I will check this on my system when I get back. It would be a real shame, since the PICkit3 is cheaper and just perfect for hobby applications, no need for the much more expensive PICkit4 in my opinion. Thanks again!
@rogthedodge99
@rogthedodge99 11 месяцев назад
@@FriendlyWire Hi. Got it wrong! You can use the PICKit 3 with v6.1.0!! You have to download extra packs which includes support for the ‘3’ So we can breathe again👌
@FriendlyWire
@FriendlyWire 11 месяцев назад
@@rogthedodge99 Good to know, thanks for checking! Do you have a link for where to download the package?
@anithasshenoy6662
@anithasshenoy6662 4 месяца назад
Can you show , how can a MC read an input , say voltage and do something , like switch on an LED , just like a voltage level meter or so?
@FriendlyWire
@FriendlyWire 4 месяца назад
Of course, those are good starting points. Switching an LED: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-e4Q2dYVedPY.html Reading a voltage with an ADC: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-AlpbbeX7-BU.html
@anithasshenoy6662
@anithasshenoy6662 4 месяца назад
@@FriendlyWire That was fantastic. Simple and straight.
@FriendlyWire
@FriendlyWire 4 месяца назад
@@anithasshenoy6662 Thanks a lot! :)
@imtiazhussain5027
@imtiazhussain5027 2 года назад
Hi dear. Its an excellent tutorial. How can I implement sine function for 8 bit PIC microcontroller. Please reply. Thanks.
@FriendlyWire
@FriendlyWire 2 года назад
Hey there! I think this would best be accomplished with an array, where you store the 8-bit values of your sine-function. Do you also need negative voltages?
@imtiazhussain5027
@imtiazhussain5027 2 года назад
@@FriendlyWire Thanks. What you suggested, is more efficient solution.
@imtiazhussain5027
@imtiazhussain5027 2 года назад
@@FriendlyWire no negative voltages
@FriendlyWire
@FriendlyWire 2 года назад
@@imtiazhussain5027 If you don't need negative voltages then it is really the easiest solution I can think of :)
@electrical_engineer1
@electrical_engineer1 Год назад
How to program read in ic and save file for copy other ic .
@FriendlyWire
@FriendlyWire Год назад
Follow the steps after 7:00. Connect to your PIC, and then click on "read." Then click on File -> Save As, and you can save the .hex code onto your computer. If "code protection" has been enabled, then it won't be possible to extract the .hex-code like this, however. Hope it helps!
@isdiagnostic.software
@isdiagnostic.software 3 месяца назад
How to calculate hex for using km change odo meter
@FriendlyWire
@FriendlyWire 2 месяца назад
Hi! I am not sure if I understand your question, can you elaborate?
@pdcigbt7293
@pdcigbt7293 2 года назад
Program pic 12f683/684/675 sir...thanks..
@FriendlyWire
@FriendlyWire 2 года назад
Is it all working for you? All you need to do is find the locations of the PGD, PGC, and MCLR pins. Let me know if you have any questions :)
@mishealunegbu1766
@mishealunegbu1766 Год назад
pls how do I overcome hold in reset enabled or release hold in reset enabled
@FriendlyWire
@FriendlyWire Год назад
Thanks for the question! Can you share more details? You can also contact me on social media @FriendlyWire if you want to send a screenshot. Happy to help!
@CliveDrone
@CliveDrone Год назад
This is very good info and has got me 95% toward the end of my project. I think...But what do we do when some of the 8 pins on my PIC12LF1822 are labeled differently. It has a Vdd and Vss as 1&8 pins resp. but other pins are labeled RA0 to RA5. Am I off track now or can RA0-RA5 be used? Thanks for the interesting video.
@FriendlyWire
@FriendlyWire Год назад
Thanks for the nice comment, Chris, I am so glad my video was helpful! :) Can you send me a link to your datasheet? I am happy to help! //edit: Nevermind, found it (ww1.microchip.com/downloads/en/devicedoc/40001413e.pdf)! Look at table 2 on page 3 :) It looks like PGD is RA0/pin 7; PGC is RA1/pin 6, and MCLR is RA3/pin 4. Hope that helps!
@CliveDrone
@CliveDrone Год назад
Hey Thank you so much. I appreciate the help.¡
@FriendlyWire
@FriendlyWire Год назад
Great, happy to help, and thank you for stopping by! :)
@CliveDrone
@CliveDrone Год назад
@@FriendlyWire Hey Jens, after many days of delay I got around to programming my PIC today and it went very smooth and programmed successfully. Thanks again for your easy to follow directions and help.
@FriendlyWire
@FriendlyWire Год назад
@@CliveDrone Hey Chris, that's fantastic news, I am so happy to hear it! On to new adventures!!!
@tanvirmahmud1048
@tanvirmahmud1048 2 года назад
make video on how to write programme
@FriendlyWire
@FriendlyWire 2 года назад
For now, all my tutorials have companion articles where I explain the source code in detail. I am thinking of making videos just about the programming as well, kind of like this one here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-I6m_DTDsE4U.html . Is that what you have in mind? :)
@saverio17021967
@saverio17021967 2 года назад
hi could you give me a hand .. I have a file that I uploaded via axe027 cable in a pic18f14k22 the file has the extension .AXE I would like to convert it into a .HEX file to be sent with Pickit 2 you can do it.
@FriendlyWire
@FriendlyWire 2 года назад
Hello Saverio, thank you for your question. I am not sure what an .axe-file is, do you have a link with some documentation?
@djt3934
@djt3934 2 месяца назад
hello i have an issue, i am following this project exactly as the video shows, but instead of a 16f627 im using a 628. which from what ive seen online are basically the same. my issue is that the led is turning on, however it is not flashing.
@FriendlyWire
@FriendlyWire 2 месяца назад
Thanks for your interest and for your question! When you set up the project etc. did you select the PIC16F28A as a device?
@djt3934
@djt3934 Месяц назад
@@FriendlyWire yes i selected PIC16F628, maybe this issue is something to do with the internal clock?
@FriendlyWire
@FriendlyWire Месяц назад
@@djt3934 Yes, it could be that. Can you send me your code to my email (at the bottom of www.friendlywire.com) and I will have a look at it :)
@tzampini
@tzampini Год назад
Hi. Nice video. Is there a way to save the settings so that you don't have to re enter them every time you start IPE? I tried saving the "environment", then importing it the next time I used IPE, but the saved settings didn't come in. Thanks!
@FriendlyWire
@FriendlyWire Год назад
I wish I knew... I have to set it up again every time myself, too. If you find a way that works, let me know!
@tzampini
@tzampini Год назад
@@FriendlyWire I will definitely let you know if I figure it out.
@FriendlyWire
@FriendlyWire Год назад
@@tzampini Thanks and good luck!
@palprofesional
@palprofesional 4 месяца назад
I have a pic16f689 IC that has been programmed, and I want to copy it, but after I open it, it turns out the data is protected, how do I open the data protection without destroying the data that has been programmed?
@FriendlyWire
@FriendlyWire 4 месяца назад
Unfortunately, if the data protection bit has been set, you cannot extract the data using the PICkit. That's why I never set it on my projects, just in case I ever need to clone a PIC and I no longer have the .hex-file.
@ganeshelectronic473
@ganeshelectronic473 2 года назад
How to measure three phase voltage 415v micro controller r phase voltage loop y phase can't read 415v phase voltage 0 measure sir if any formula
@FriendlyWire
@FriendlyWire 2 года назад
Hey Ganesh, thanks for the question! For measuring AC voltages I would definitely recommend to use some sort of galvanic isolation, like an optocoupler. AC line voltage with 50Hz is rather slow compared to the MHz resolution you can get with PIC microcontrollers, so it would be relatively simple to detect a zero crossing. But I am not sure if I understand the rest of your question, can you explain more? :)
@homijbhabha8860
@homijbhabha8860 2 года назад
Very good video sir, Is there any way to upload a hex file onto a PIC microcontroller without using a PICkit, instead using an Arduino?
@FriendlyWire
@FriendlyWire 2 года назад
Thank you for your kind words :) Yes, it is probably doable, since you just need the three wires MCLR (Master Clear), PGD (Program Data), and PGC (Program Clock). But I am not an expert on doing this. If you search on Google for "homemade PIC programmer" I am sure you will find many helpful resources!
@jagmarc
@jagmarc Год назад
@@FriendlyWire alternative of a pickit3 for "ICSP (in circuit system programming) there's a way of directly connecting a PC serial port to the RB6/RB7 and uses a few components including a 12 V keyfob battery for the VPP. Has to use a real hardware rs232 serial port, a PC with usb adaptor is too slow to work.
@FriendlyWire
@FriendlyWire Год назад
@@jagmarc Yup, good point! Older development boards used to use that method, check out the Velleman K8048 that I list on my website here: www.friendlywire.com/articles/gear/#ch5 . I have found these types of programmers to not work as reliably as the USB ones, though.
@jagmarc
@jagmarc Год назад
@@FriendlyWire where are you serving your website from? I see you have a domain name. When my device connected the connection didn't upgrade itself to a https . I guess you're missing a setting on your .httaccess file or cPanel configuration
@FriendlyWire
@FriendlyWire Год назад
@@jagmarc You can also use www.friendlywire.com/articles/gear/#ch5 .
@suck06257
@suck06257 Год назад
hi, thanks for the video. How can we import Hex code to 64 pin PIC. Thanks in advance
@FriendlyWire
@FriendlyWire Год назад
Hey Amit, thank you for your kind words :) Which PIC are you interested in?
@suck06257
@suck06257 Год назад
@@FriendlyWire hi, i missed the notification. so sorry for late response. my PIC is PIC18F6520.
@suck06257
@suck06257 Год назад
I also look on the internet and found that DM160228 EXPLORER 8 DEVELOPMENT board will do the job. However do i need an additional programming adapter as the package is TQFP.
@MrJansen-nd7ld
@MrJansen-nd7ld 8 месяцев назад
can we use eeprom sst27sf512 to program with pickit 3 ?
@FriendlyWire
@FriendlyWire 8 месяцев назад
Are you asking whether we can transfer data on EEPROMs using the PICkit3? I don't think this works, sorry.
@ajalprofs8746
@ajalprofs8746 9 месяцев назад
THANKS, for my case I use the pickit2 software and that the pic 18f8680 is soldered on the electronic card and I have a 5 pin connector on the card for programming. THANKS @FriendlyWire
@FriendlyWire
@FriendlyWire 9 месяцев назад
Sorry for my late reply! I am not sure what went wrong... It could be a lot of things: wiring, unstable power supply, a bug in the code itself perhaps, a loose connection somewhere, or a USB port that cannot supply enough power. We would have to narrow it down some more. Did your setup work in the past, and not stopped working? Or is this the first time you are setting things up? (You can also get clones of the PICkit3 online, they are not so expensive as the newer PICkit4, and they work great.)
@oveschleisner-meyer8139
@oveschleisner-meyer8139 Год назад
Hello. I have seen this video a lot of times and I have made the same "Blinking" program as you and it works OK... BUT when I place the PIC16F627A in my Breadboard and turn on 5 Volt it seems very unstable. The diode is blinking one seequence and the stops but if I touch the PIC chip it turns ON and sometimes the diode just goes ON and stops again and other times the seequence is running. It seems that the chop is sensitive for my fingers... The PIC chip is only connectet to pin 5 for GND pin 14 is +5V and pin 9 RB3. Should I connect all the unused pins to ground or what could I do to make the system more stable??
@FriendlyWire
@FriendlyWire Год назад
Thanks for your question, and I am glad it's mostly working already! Have you tried adding a 100uF capacitor and a 100nF capacitor in parallel to the battery? This should help stabilize things.
@oveschleisner-meyer8139
@oveschleisner-meyer8139 Год назад
@@FriendlyWire Thanks a lot... that solved my problem...Fantastic. I will go on learning programming PIC's. Are you still making video clip of programming PIC's?
@FriendlyWire
@FriendlyWire Год назад
@@oveschleisner-meyer8139 Fantastic indeed, congratulations! Yes, I am still making videos, but it takes me some time to get them finished. Check out my Twitter @FriendlyWire where I post updates on the new projects :)
@NasirKhan-jl2sn
@NasirKhan-jl2sn 3 месяца назад
any video for dspic30f2010
@FriendlyWire
@FriendlyWire 2 месяца назад
For now I will stick with PIC microcontrollers :)
@orsingmit7574
@orsingmit7574 2 года назад
I can't find those pins name in this chip Z86E3116PSC
@FriendlyWire
@FriendlyWire 2 года назад
Thanks for the question! The Z86E3116PSC is a Zilog microcontroller, not made by Microchip. For that reason, unfortunately, we cannot use the PICkit to program it.
@orsingmit7574
@orsingmit7574 2 года назад
Thanks
@ANCHALCHAUDHARY-nk6uv
@ANCHALCHAUDHARY-nk6uv 3 месяца назад
Do i really need to use Pickit 3, can't I directly dump the code from pc to microcontroller
@FriendlyWire
@FriendlyWire 2 месяца назад
You need some sort of device for that. There are other options out there, including kits that use the serial connection from back in the day, but I find the PICkit3 or similar devices to be the easiest choice.
@TheDiveO
@TheDiveO 2 года назад
Anyone else seeing the thumbnail, reading "mains" and the arrow point to the board, and then thinking, oh, BigClive found another crappy power supply?
@FriendlyWire
@FriendlyWire 2 года назад
Hahaha, my favorite comment! :D
@susilnishantha3711
@susilnishantha3711 Год назад
hi sir......is it possible upload the program from PIC to PC ?
@FriendlyWire
@FriendlyWire Год назад
Yes, but you can only obtain the .hex file this way, and only if code protection is turned off on the PIC controller.
@ajalprofs8746
@ajalprofs8746 9 месяцев назад
could you explain to me why when I read the source code of the 18f8680 microcontroller and I write it a second time on the same pic the program does not work knowing that I use the pickit2 Thanks a lot
@FriendlyWire
@FriendlyWire 9 месяцев назад
It's a good question, and things like this can be very frustrating, I have been there. I tried to find out of the MPLAB IPE supports the PICkit2, but I could not find it either on the official website or in the manual. I assume that it shows up in the IPE under "tool"?
@ajalprofs8746
@ajalprofs8746 9 месяцев назад
THANKS, for my case I use the pickit2 software and that the pic 18f8680 is soldered on the electronic card and I have a 5 pin connector on the card for programming. THANKS@@FriendlyWire
@shrikantnikam2426
@shrikantnikam2426 Год назад
is there any other way to program pic microcontroller without using pickit to save money?
@FriendlyWire
@FriendlyWire Год назад
You can find unofficial copies of the PICkit online, they cost much less. Also there are some circuits proposed by hobbyists that can get the job done, but I have never used those. What is your budget for a programmer, and where are you located? Maybe we can find one for you :)
@shrikantnikam2426
@shrikantnikam2426 Год назад
@@FriendlyWire india
@FriendlyWire
@FriendlyWire Год назад
@@shrikantnikam2426 You can try searching for PICkit3.5, this is a popular third-party programmer that works well in my experience. Especially if you want to stay with PIC controllers it may be a good one-time investment. There are also older programmers that use the serial port to program PICs directly, but they do not work as reliably I find; one of these you can see here on my website: www.friendlywire.com/articles/gear/#ch5
@alponurkanduran415
@alponurkanduran415 3 месяца назад
Hi dude i compiled my code but i cant reach the hex file. I mean it doesnt appear on my project file ?
@FriendlyWire
@FriendlyWire 3 месяца назад
It's a bit hidden, it shows up in the dist/default/production/ subfolder of your main project folder. Can you find it there? Alternatively, if you compile it inside MPLAB IDE, there should be a message where the .hex-file is stored. Hope it helps, let me know! :)
@johnsparks3979
@johnsparks3979 Год назад
Hello. Thanks for posting this video. I stumbled across it and wondered if this device maybe the answer to my problem. I have a motherboard on which the bios has failed due to my own stupidity as to how I flashed the chip (Winbond W29C020-12 32 pin 2mbit) whilst the onboard button battery was dead. I then flashed it a 2nd time and wrote over the back up (duhhh). The consequence is that the board cannot see a floppy drive or even a non accelerated ISA VGA card. The motherboard company are no longer around, but I have the bios on a floppy disk in the form of a .bin file which suggests the file is hexadecimal in nature. Would the mplab software be able to view this type of file in order to 'flash' it directly to the chip? Thanks.
@FriendlyWire
@FriendlyWire Год назад
Thank you for your message, John. I don't think the PICkit3 will be useful for that, since "out of the box" it only interfaces with PIC microcontrollers. It may be possible to write your own PICkit3 firmware, but I am out of depth at that question. I think at www.reddit.com/r/AskElectronics/ you may find people who know how to do that. Good luck, and sorry I could not be of more help, I hope you will find a solution!
@johnsparks3979
@johnsparks3979 Год назад
@@FriendlyWire Many thanks for your response. I will check the link and keep looking for a solution.
@FriendlyWire
@FriendlyWire Год назад
@@johnsparks3979 Good luck, and my apologies that I could not be of more help. Best of luck!
@FriendlyWire
@FriendlyWire Год назад
@@johnsparks3979 Best of luck! Did you find anything?
@thejoeblowshow
@thejoeblowshow 2 года назад
Hi. Can you slightly re-program this project with a few slight changes, for hire?
@FriendlyWire
@FriendlyWire 2 года назад
I typically do not offer paid services, but feel free to reach out to me via email (at the bottom of my website www.friendlywire.com) and if it is only a slight change then I can do it for free :)
@thejoeblowshow
@thejoeblowshow 2 года назад
Thank you Jens! I ordered everything that you used, so I should be receiving everything soon, and please, at least let me buy you a nice dinner via PayPal. Okay? I'll try my best to learn on-my-own, but if not, Bon appétit! : - ) LOL!
@FriendlyWire
@FriendlyWire 2 года назад
@@thejoeblowshow That's fantastic, let me know when it all arrives!
@thejoeblowshow
@thejoeblowshow 2 года назад
@@FriendlyWire You'll definitely be the first to know. : - ) Also, just curious to know, how difficult would it be to add a sfx, (press/beep) with the obvious peripherals added on to the breadboard? Is this thought of mine even in the realm of possibility?
@FriendlyWire
@FriendlyWire 2 года назад
@@thejoeblowshow I am sure you could add a piezo speaker to the mix (and probably a transistor and some passives to drive it properly), but I have actually never worked with those before.
@4rf-garvjain648
@4rf-garvjain648 Год назад
Im using PIC18F46K22 but its showing connection fail
@FriendlyWire
@FriendlyWire Год назад
Oh, that's not good. Can you send a photo of your setup? (My email is at the bottom of www.friendlywire.com, and you can also message me on Twitter or Instagram)
@stnwrd
@stnwrd 2 года назад
Can the PIC be reused/reprogrammed over again, or is it one time use?
@FriendlyWire
@FriendlyWire 2 года назад
Good question, I should have mentioned! It can be used again and again :)
@stnwrd
@stnwrd 2 года назад
@@FriendlyWire Ok great and thanks
@FriendlyWire
@FriendlyWire 2 года назад
@@stnwrd Happy to help, and let me know if you have any other questions :)
@stnwrd
@stnwrd 2 года назад
Ok Thanks again
@ajs-tatu-spitstop9235
@ajs-tatu-spitstop9235 2 года назад
How to clear pic 18f4550 can u help me
@FriendlyWire
@FriendlyWire 2 года назад
Did you find the datasheet for the PIC18F4550? MCLR is pin 1, PGD is pin 28, and PGC is pin 27. You can connect VDD at pin 20, and ground at pins 8 and 19. For anything else you just need to replace "PIC16F627A" in the tutorial above with PIC18F4550. Does it work? Let me know, I am happy to help more.
@ajs-tatu-spitstop9235
@ajs-tatu-spitstop9235 2 года назад
@@FriendlyWire let me try notify u shortly
@FriendlyWire
@FriendlyWire 2 года назад
@@ajs-tatu-spitstop9235 Sounds good!
@NasirKhan-jl2sn
@NasirKhan-jl2sn 3 месяца назад
hi
@harishharish7323
@harishharish7323 2 года назад
program memory: start address = 0x0, end address = 0x7ff configuration memory program memory Address: 0 Expected Value: 120a Received Value: 3fff Failed to program device I cant find what is the problem in pic16f877a
@FriendlyWire
@FriendlyWire 2 года назад
This looks like a data transmission error, most likely the cables are not connected properly, it happens sometimes. If you have a picture, you can send it to me on Twitter or Instagram @FriendlyWire and we can figure it out :)
@yaseralali6309
@yaseralali6309 Год назад
Did you solve the problem ?
@ibrahimadam450
@ibrahimadam450 11 месяцев назад
Please I want you to assist me to program for a project
@FriendlyWire
@FriendlyWire 11 месяцев назад
Thank you for your interest! But I am sorry, I don't have enough time to help with individual projects, unless it is something that is very closely related to one of the videos, hope you understand. What is is about? :)
@bharathreddy6962
@bharathreddy6962 3 месяца назад
bro how to do for pickit2
@FriendlyWire
@FriendlyWire 3 месяца назад
I am not sure if the PICkit2 is still supported by the current versions of MPLAB :( But the PICkit3 still is, for now, and you can get clones (sometimes called PICkit3.5) on Amazon and other sites for around $20. I know it's super silly that they keep making new programmers, since for these simple PICs the old ones work just fine...
@satishkumar-gg5fm
@satishkumar-gg5fm Год назад
Can we copy hex file from microcontroller??? Please reply as soon as possible 🙏
@FriendlyWire
@FriendlyWire Год назад
Follow the steps after 7:00. Connect to your PIC, and then click on "read." Then click on File -> Save As, and you can save the .hex code onto your computer. If "code protection" has been enabled, then it won't be possible to extract the .hex-code like this, however. Hope it helps!
@satishkumar-gg5fm
@satishkumar-gg5fm Год назад
@@FriendlyWire thanks 🙏
@FriendlyWire
@FriendlyWire Год назад
@@satishkumar-gg5fm Happy to help, and thanks for stopping by! :)
@mohomadashad4641
@mohomadashad4641 2 года назад
can i do cording with out this device?
@FriendlyWire
@FriendlyWire 2 года назад
Yes, the coding is done just on your computer. You only need it for the final step of transferring the code onto the controller.
@mohomadashad4641
@mohomadashad4641 2 года назад
@@FriendlyWire is there other way
@FriendlyWire
@FriendlyWire 2 года назад
@@mohomadashad4641 You need to physically connect the controller to the computer to transfer the code. The PICkit3 is one possible solution, there are other adapters as well. But you will always need one of these adapters.
@mohomadashad4641
@mohomadashad4641 2 года назад
@@FriendlyWire ok. what are the others
@FriendlyWire
@FriendlyWire 2 года назад
@@mohomadashad4641 PICkit4 is the newest one, but the PICkit3 works just fine. Why do you want to use a different one?
@ranasaeed5807
@ranasaeed5807 7 месяцев назад
sir i need your help
@FriendlyWire
@FriendlyWire 7 месяцев назад
I'll do my best! :)
@pkefvkef4856
@pkefvkef4856 7 месяцев назад
Hello my friend. I have a microchip PIC 24F 16KA 102-I/SS e3 1845 CAB. it has been placed inside an inverter.Now for reasons well understood the constructor of the inverter is not willing to give me the programm of it or even send me one [to buy of course ] programmed one.He presses me to buy a new inverter around 450 $.I think is totally unfair and i would call this seller a Big Thief.I dont mention more.But i say this.I have already bought pick it 3,5 programmer.Is there a hope i can do something??and what about if it is encrypted??And my last question.How does the ministry of commerce of each country allow these thieves for a Pic chip of 2 euro cost to force you to spend another 450$ ???Thank you for your time.....Respect to your work my friend.
@FriendlyWire
@FriendlyWire 7 месяцев назад
I am sorry this is so expensive... It seems a bit extreme, to be sure. If the developer has not activated "code protection" you can read out the .hex-file with the PICkit3. But I am sure they enabled the code protection using the configuration word of their PIC, which is what companies can do to protect their intellectual property. In this case it is not possible to get the .hex-file from the PIC.
@MrWatlow
@MrWatlow 2 года назад
I want to do the opposite, I want to pull the code from a PIC provided that it isn’t protected. How is that accomplished?
@FriendlyWire
@FriendlyWire 2 года назад
Good question! It is impossible to obtain the C code from the PIC, all you can do is get the .hex-file. At 6:54, if you are connected to the PIC, you can click on "read" and that reads out the program memory, if it is not protected. The reason you cannot download the C code directly is this: it doesn't exist on the controller. C code only exists for us as a tool, but before it gets onto the controller it is compiled into the .hex-file. Hope this helps! :)
@MrWatlow
@MrWatlow 2 года назад
@@FriendlyWire that is fine. If I can get the hex code, I can then download it to other PICs to duplicate the same function, correct? Also, if the PIC in my equipment had the part number removed by the manufacturer, how do I figure out which one it is? I have the schematics of the board and all pin outs.
@FriendlyWire
@FriendlyWire 2 года назад
@@MrWatlow Yes, the .hex-file is all you need. There are many PICs with the same packages, but their connections PGD/PGC/MCLR tend to be at the same place for all PICs in a given package. But you still have to know what PIC it is. You can try this: maybe you think it's a PIC16F627A. Configure your MPLAB IPE to PIC16F627A and try to connect the PICkit3 to that mystery PIC. If it works, it's a PIC16F627A, if it doesn't, you have to keep trying.
@adamismaad9604
@adamismaad9604 Год назад
Can I check a code from PIC18F2420 too?
@FriendlyWire
@FriendlyWire Год назад
Hey Adam, thanks for the question! I am not sure what you mean by check, but the MPLAB IPE does indeed support the PIC18F2420, so you could connect it to the PICkit. For the PIC18F2420, MCLR is at pin 1, PGD at pin 28, PGC at pin 27, VDD is at pin 20, and GND is at pins 8 and 19. (See the datasheet here: ww1.microchip.com/downloads/en/DeviceDoc/39631E.pdf ). Let me know if that helps! :)
@adamismaad9604
@adamismaad9604 Год назад
I mean, I have one pre -programmed PIC microcontroller and another that has not been programmed. So my question is can I copy or re -read the code from a pre -programmed PIC microcontroller and re -copy the program and transfer it to another PIC controller
@FriendlyWire
@FriendlyWire Год назад
@@adamismaad9604 Yes, if the original PIC does not have code protection enabled you can read out the .hex-file. Look at 7:30 in the video. You can click on "read" and then you can download the existing .hex-file. Then, if you click on File -> Save As you can save this retrieved .hex-file, and then send it to any other PIC you want.
@adamismaad9604
@adamismaad9604 Год назад
Oh ok thank you very much
@FriendlyWire
@FriendlyWire Год назад
@@adamismaad9604 Happy to help, let me know if it works!
@roman_m
@roman_m Год назад
and you don't program anything except light bulbs?
@FriendlyWire
@FriendlyWire Год назад
You can program a lot of things with PICs :) What do you have in mind?
@roman_m
@roman_m Год назад
@@FriendlyWire good day here is only a video about flashing LEDs...this is not enough for beginners-I don't understand enough either.I have one project and I want to ask if you will help me?
@FriendlyWire
@FriendlyWire Год назад
@@roman_m Hey Roman, you can check out the other videos on my channel (as well as the articles on www.friendlywire.com) and that should definitely get you started with PIC microcontrollers. But I agree, there is always more to talk about! What is your project about?
@jackski5732
@jackski5732 2 года назад
plz redo using C++
@FriendlyWire
@FriendlyWire 2 года назад
I am only using the XC8 compiler, and that specific dialect for PIC microcontrollers. Is there anything in C++ that you would like to do that is cumbersome or difficult in the XC8 language?
@DungLe-sr7tq
@DungLe-sr7tq Год назад
The title is a little confusing. I was expected to see a trick to get the source code from a flashed chip, not into it.
@FriendlyWire
@FriendlyWire Год назад
Oh, I see, that thought did not cross my mind at all, thanks for the heads up!
@anjonnandy
@anjonnandy Год назад
7.15MICROCHIP PASSWORD I NEED
@FriendlyWire
@FriendlyWire Год назад
Not sure I understand?
@mba2ceo
@mba2ceo Год назад
How much code can the PIC hold ? lines ?
@FriendlyWire
@FriendlyWire Год назад
This is hard to say, it depends on the PIC controller. Also, one line of C can result in a lot of operations. For example, the simple command NOP(); (which does nothing) is only one instruction, whereas an operation int c = d*2.789; can be extremely resource-intensive (floating point operation). So: it depends :) Do you have a specific PIC in mind?
Далее
Your first microcontroller project!
19:44
Просмотров 65 тыс.
когда повзрослела // EVA mash
00:40
Просмотров 2,4 млн
A Beginner's Guide to Microcontrollers
15:18
Просмотров 31 тыс.
Getting Started With the MPLAB® PICkit™ 5
6:58
Просмотров 13 тыс.
Making Simple Windows Driver in C
7:26
Просмотров 326 тыс.