Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Start programming Microcontrollers

Status
Not open for further replies.

AMSA84

Advanced Member level 2
Joined
Aug 24, 2010
Messages
577
Helped
8
Reputation
16
Reaction score
8
Trophy points
1,298
Location
Iberian Peninsula
Activity points
6,178
Hello guys,

I want to start learning how to program microcontrollers. I was thinking to start with Microchip PIC microcontrollers or the ATMega from Arduino. I know that Arduino is more easy (from what I have read) but I have someone that can borrow me a PIC DEM FS USB PIC18F4550 board meaning that I don't need to expend some money on buying the Arduino dev. board (though it is not so expensive when compared to Microchip). That said, I would like to ask you for your opinion if it worth expending some time with this PIC/ DEM Board or you suggest another one?

Does anyone knows any tutorial around the web or book where I could start learning the basics? What can you guys advise to someone that it is starting in this world microcontrollers?

Kind regards.
 

start with the PIC DEM FS USB PIC18F4550 board- it will be a good introduction to microcontrollers
it comes with a USB bootloader (assuming it has not been overwritten)
if you wish to program the USB you will need an external program

an alternative is Microchip's microstick devices
https://www.microchip.com/DevelopmentTools/Listing.aspx?CatID=88d053fc-5616-4075-b4d4-6fb5ee8681d3

they have an onboard programmer, support a number of devices (typically PIC24, dsPIC, PIC32), have a header to plug into your own broadboards, etc and are low cost
 

Okay, looks good. I will stick to those. What about the tutorials? Do you know any good book or tutorial sites?

Kind regards.
 

Last edited:

Thank you for the links, however, when I was asking for some references or books I was referring to some PIC Microcontrollers books, that explains the architecture, that starts with the basics and that progressively goes more deep on the subjetcs, with examples or projects, etc.

Regards.
 

Hi AMSA84,
There is no better place to learn than the Micro controller data sheet itself.
For pic, read through the PIC programmers Model PDF for your specific controller.
For starters, Toggle LED and Serial Port are the best codes to get a hang of things.

Best of luck and happy coding
 

Thank you for the reply joe. I will do that. I will read the datasheet from my microcontroller and look for some tutorials. Kind regards.
 

Hello!
Nobody mentioned it, but you can also buy a TI MSP430 board quite chea (about 10 USD).
And you can download the IDE. No other hardware needed. You get a spare chip as far
as I remember, and there is quite some room to play.
Dora.
 

Hi all, thank you all for the reply.

Horace1, I have started to install the software of the development board. I am now looking to the links you have posted, specially the second one where there is a lot of information regarding the IDE to be used and a kind of tutorial that one can follow to get familiar with the software. If I have any doubt regarding that I will get in touch.

Meanwhile I have read this: https://www.microchip.com/forums/m696791.aspx where the author of the post talk about the differences between the XC8 compiler and the C18. Does anyone know if any of those differences have been solved, that is, there is no difference now using the XC8 compiler in the software written in way that it was supposed to be compiled by the C18 compiler? Or the problem remains? I am asking this because I will be grasping some tutorials and I don't know if I can face the problem of studying the code of a software that was written in sight to be compiled with the C18 compiler and when I try to run it with the XC8 gives some errors.

Regards.
 

I now use XC8 as the default compiler on the few occasions I use PIC16 and PIC18 (mainly I use PIC24, dsPIC and PIC32 micros these days)
I do have copies of older PIC18 compilers because we have some legacy projects which will not compile with XC8 and we don't have the time to convert them
also I would recommend using MPLABX as the IDE as MPLAB will probably not support new devices and will be phased out over time
 

I now use XC8 as the default compiler on the few occasions I use PIC16 and PIC18 (mainly I use PIC24, dsPIC and PIC32 micros these days)
I do have copies of older PIC18 compilers because we have some legacy projects which will not compile with XC8 and we don't have the time to convert them
also I would recommend using MPLABX as the IDE as MPLAB will probably not support new devices and will be phased out over time

Okay. Thank you. This means that all the tutorial that I find (depending on the date of the tutorial) might need to be converted into the "XC8" compiler right? How can I know what needs to be converted?
 

recent example code would probably come with a MPLABX project and use XC8
older code, such as the legacy MLA
**broken link removed**

could well only have MPLAB projects
selecting the MPLABX File>Import >MPLAB IDE V8 Project enables one to import a MPLAB project - during the process it will ask you the Compiler Toolchaisn to use and you select XC8

If you have a MPLABX project which is setup for a different compiler you can always use the Project Properties to change the compiler and programmer etc
 

I see, thank you.

Allow me to ask you another question. Can I use the software that comes with the demonstration board to program the PIC without needing the use of a programmer (for example PICkit 2)?

If I can use the software that comes with the demonstration board, what will happen to the bootloader? There is any issue with that? For example, using the .hex file that comes with the software, to program the PIC they say that we need to press a combination of switches to enter in bootload mode so that in the software (in the dropdown menu in the "Select PICDEM FS USB Board") we can select the demonstration board and with that upload the .hex file.

If I program the PIC using this method will be any problem with the bootloader?

Regards.
 

if the bootloader is still programmed use that - I seem to remember yu use have to use the appropriate linker file when build a project to load with the bootloader
if not you will need to use the Pickit 2 or a similar programmer
 

I tried to open the project (with MPLAX) that comes with the software, in this case in the Microchip Solutions\USB Device - Composite - HID + MSD\Firmware folder, when loaded, I can see a m18f4550.lkr file. Is this one that you are talking about?

I am not sure if I have understood what you said. Do I need to use some of the codes that comes with this project?

The first idea here is just to press one button and then turn-on a LED. This is the first objective that I have in order to check that I can communicate with the development board, that is, save the code in the PIC18F and see if everything is working right. All this through the software that comes with the development board.

Regards
 

Okay. I will take a look at those.

But the important here is what? Is to have in my code the same code that the board brings to communicate through USB with the PICDEM FS board?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top