programming PIC

Gary Kellogg's picture

Offline

Joined: Jan 17, 2019

Replies: 1
programming PIC
January 17, 2019 - 9:02pm

Hello, 

I'm a new member here, and this is my first question.

I was reading about programming the PIC microcontrollers, and the commands entered into the IDE looked to be done in C programming language. Would the IDE allow commands to be entered in as machine language commands? I don't know C, but the machine language commands make a lot of sense to me and my projects are small.

Thanks

Violet's picture

Offline

Joined: Aug 16, 2018

Replies: 26
Yes you can program directly in assembly language
January 18, 2019 - 11:28am

Hi Gary,

Yes you can program your PIC directly in assembly langugae using MPLAB X

Just enter the assemble code in the same place where C code is written and compile it. It is also possibel to comine both C code and assembly code.

It is highly recommended that you also learn C code since assembly code will not get you much further 

 

Cheers,

Violet 

Gary Kellogg's picture

Offline

Joined: Jan 17, 2019

Replies: 1
Thanks Violet. 
January 19, 2019 - 12:04am

Thanks Violet. 

Here's another question. A few years ago I put a program onto a PIC microcontroller, using a much earlier version of MPLAB, but I don't have the file anymore. Now that I am coming back to using microcontrollers I would like to get the program from the chip. I think that this would help jump start my programming if I could study what I did back then. Is there a way to download the program from a PIC microcontroller to LABX? The program still works just fine.

Thanks,

Gary

Violet's picture

Offline

Joined: Aug 16, 2018

Replies: 26
Well yes but only the HEX code
January 20, 2019 - 2:43pm

I remember doing something like that long back.
There is a way to use pickit3 to get the program out of a MCU which was not locked during programming.
But you will be able to get only the HEX code it would be of no use for recreation. You can only use to duplicate the same on other MCUs