n00b question about microcontroller - Page 1
Forum section: electronics / beginners

author: sci4me
author_rank: Regular Contributor
timestamp: July 06, 2013, 08:31:33 am
content: Hey guys. So recently, I ordered this micro proto board:https://www.sparkfun.com/products/8562and at the time, I believed that it was programmed via the usb. Now though, im not so sure. Am I required to have a seperate programmer for this board? If so is it possible to program it with an Arduino board? My friend has one and im sure he would let me borrow it. Or can it be programmed via the usb by default? Am I just being stupid? I just dont want it to get here and not be able to use it.

author: Psi
author_rank: Super Contributor
timestamp: July 06, 2013, 08:41:07 am
content: With regard to programming it over USB.. It will depend on if the chip comes pre-programed with the microchip usb bootloader or not.

author: sci4me
author_rank: Regular Contributor
timestamp: July 06, 2013, 08:43:06 am
content: I never saw anything saying if it does or doesnt... so... assume that it doesnt?

author: amyk
author_rank: Super Contributor
timestamp: July 06, 2013, 10:43:17 am
content: First of all I'll mention that we have a microcontrollers forum here too:https://www.eevblog.com/forum/microcontrollers/From your link:QuoteSo what you've bought is likely a blank MCU, but it's one with an integrated USB controller. This means you'll need to program it via the ICSP port. There are dedicated programmers available like the PICkit but the ICSP protocol is a simple one that uses a few serial lines and just about anything that can drive them will work;including an Arduino. If you write a bootloader to it, then you can program via USB afterwards (as long as you don't overwrite the bootloader.)

author: sci4me
author_rank: Regular Contributor
timestamp: July 06, 2013, 10:52:34 am
content: Okay so if I get my friends arduino, ill be able to use that to program the bootloader on and then i wont have to again unless i overwrite the bootloader. Also, the reason i put it here instead of microcontrollers is because im kind of a nub.Anyway, thank you very much for the help! I appreciate it!EDIT: That is for a pic18f2550 ... but it also mentions it working with the others... what would need to be done to program my exact chip?

author: mariush
author_rank: Super Contributor
timestamp: July 06, 2013, 10:19:29 pm
content: So what you bought there is a development board with an empty microcontroller that has built-in usb features.The package also gives you the software for a bootloader, which is basically a pic program that you can write into the microcontroller.After it's written in the microcontroller, the bootloader then allows you to send it a compiled pic program which the bootloader writes into the microcontroller and passes control of the microcontroller to that program.Now, the problem with programs written for PIC is that compilers (the program that converts source code to binary) assume there's no program inside the pic, so they make the binary use the whole flash memory and ram... in order to prevent the compiler from overwriting the area where that bootloader will be stored in the microcontroller, you have to give the compiler some instructions which you have no clue about.Also, whenever you'll read tutorials and guides and example programs and you try that program in your microcontroller, it may not work because some things have to be modified because that bootloader is there in your microcontroller and moved around some things to make room for itself (like interrupt vectors and other things).So considering you're really a beginner at this, for the sake of being able to read lessons and write and test various small programs they show you and actually learn, I strongly recommend you not to use a bootloader initially and spend a bit of money on an actual icsp programmer.PicKit 3 is not that expensive :http://www.microchipdirect.com/ProductSearch.aspx?Keywords=PG164130You may find various pic programmers out there but you have to be careful because some only work with 5v microcontrollers, some don't support ALL versions of microcontrollers.. it's confusing and complicated for a beginner like you.

author: sci4me
author_rank: Regular Contributor
timestamp: July 06, 2013, 10:44:00 pm
content: Okay, thanks for the advice! I will but a programmer.

author: Rick Law
author_rank: Super Contributor
timestamp: July 07, 2013, 01:14:02 am
content: Quote from: sci4me on July 06, 2013, 10:44:00 pmSci4me, judging from your questions, I perceive that you may be new to the whole thing. If I am right, you need to learn the difference between boot, bootloader, and the "payload" program that runs after booting. You also need to know the basic parts.Since Arduino is a tool you may use, I suggest you get a cheap Ardunio board ($12-16 Chinese made compatible) and follow some of the intro you found on the web, you can get going fairly quickly. That will give you some basic understanding and get your hands wet doing some programming. With the huge amount of resources on the web for Arduino, you can get a lot of help if you are willing to do some web-searching.Good luck. It is kind of fun playing with the darn thing particularly if you have a goal in mind.

author: sci4me
author_rank: Regular Contributor
timestamp: July 07, 2013, 11:56:41 pm
content: Well, im not COMPLETELY new to things... I have programmed a basic stamp 2 and a picaxe before so.. and I am a fairly decent programmer (I would like to think)

author: Rick Law
author_rank: Super Contributor
timestamp: July 08, 2013, 04:13:23 am
content: Quote from: sci4me on July 07, 2013, 11:56:41 pmAh, I misjudged! My mistake...Sorry... Just was trying to be helpful.There goes my mistake quota for the rest of the year. Darn.Rick

author: Unknown
author_rank: Unknown
timestamp: July 08, 2013, 04:30:47 am
content: I wouldn't sweat it, Rick. We all make mistakes and as long as you're willing to admit yours (long glare at some other people) you're fine.

author: sci4me
author_rank: Regular Contributor
timestamp: July 08, 2013, 10:27:09 am
content: Hey its not a problem at all. I did make it seem like I am very new to things which is SORT OF true but.. well.. not exactly.Anyway, thanks all for the help!

author: sci4me
author_rank: Regular Contributor
timestamp: July 09, 2013, 04:27:55 pm
content: Okay, mplab doesnt want to detect my pickit3.... uh... and a quick google gives little... help please?

author: mariush
author_rank: Super Contributor
timestamp: July 09, 2013, 05:06:30 pm
content: Use MPLABX :http://www.microchip.com/pagehandler/en-us/family/mplabx/

author: sci4me
author_rank: Regular Contributor
timestamp: July 09, 2013, 05:45:27 pm
content: I cant seem to get it to run. It is installed but when I try to run it, it thinks for a second and then just stops. Im on linux and the linux installer didnt want to run so I used wine with the windows one and everything worked but the program doesnt seem to want to run.EDIT: okay i got the linux working except it says i have to be superuser.. and.. well.. uh... idk the password... and this is my computer... like... i dont remember setting the password anywhere... uhm...Edit2: nvm im trying mplabx now... getting the linux version to open.. its not wanting to work..yeah its giving me a java crash... :|

author: sci4me
author_rank: Regular Contributor
timestamp: July 10, 2013, 12:07:27 am
content: Hey guys, I still haven't been able to get MPLABX to open... this is getting kind of irritating. Isnt a pickit3 something that is supposed to just work? Assuming the circuit being programmed works... I just want to program my pic... :|edit: well, it turns out that i am a blind retard. it works perfectly.thanks again for all your guys's help!