Author Topic: n00b question about microcontroller  (Read 5229 times)

0 Members and 1 Guest are viewing this topic.

Offline sci4meTopic starter

  • Regular Contributor
  • *
  • Posts: 139
  • Country: us
    • sci4me.com
n00b question about microcontroller
« on: July 06, 2013, 08:31:33 am »
Hey guys. So recently, I ordered this micro proto board: https://www.sparkfun.com/products/8562 and 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.
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 9925
  • Country: nz
Re: n00b question about microcontroller
« Reply #1 on: July 06, 2013, 08:41:07 am »
With regard to programming it over USB.. It will depend on if the chip comes pre-programed with the microchip usb bootloader or not.
« Last Edit: July 06, 2013, 08:45:15 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline sci4meTopic starter

  • Regular Contributor
  • *
  • Posts: 139
  • Country: us
    • sci4me.com
Re: n00b question about microcontroller
« Reply #2 on: July 06, 2013, 08:43:06 am »
I never saw anything saying if it does or doesnt... so... assume that it doesnt?
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8258
Re: n00b question about microcontroller
« Reply #3 on: July 06, 2013, 10:43:17 am »
First of all I'll mention that we have a microcontrollers forum here too: https://www.eevblog.com/forum/microcontrollers/

From your link:
Quote
ICSP/ICD connector for programming
So 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.)
 

Offline sci4meTopic starter

  • Regular Contributor
  • *
  • Posts: 139
  • Country: us
    • sci4me.com
Re: n00b question about microcontroller
« Reply #4 on: July 06, 2013, 10:52:34 am »
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. :P 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?
« Last Edit: July 06, 2013, 10:57:30 am by sci4me »
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5012
  • Country: ro
  • .
Re: n00b question about microcontroller
« Reply #5 on: July 06, 2013, 10:19:29 pm »
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=PG164130 

You 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.
 

Offline sci4meTopic starter

  • Regular Contributor
  • *
  • Posts: 139
  • Country: us
    • sci4me.com
Re: n00b question about microcontroller
« Reply #6 on: July 06, 2013, 10:44:00 pm »
Okay, thanks for the advice! I will but a programmer.
 

Offline Rick Law

  • Super Contributor
  • ***
  • Posts: 3437
  • Country: us
Re: n00b question about microcontroller
« Reply #7 on: July 07, 2013, 01:14:02 am »
Okay, thanks for the advice! I will but a programmer.

Sci4me,  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.
 

Offline sci4meTopic starter

  • Regular Contributor
  • *
  • Posts: 139
  • Country: us
    • sci4me.com
Re: n00b question about microcontroller
« Reply #8 on: July 07, 2013, 11:56:41 pm »
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)
 

Offline Rick Law

  • Super Contributor
  • ***
  • Posts: 3437
  • Country: us
Re: n00b question about microcontroller
« Reply #9 on: July 08, 2013, 04:13:23 am »
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)

Ah, I misjudged!  My mistake...Sorry...  Just was trying to be helpful.

There goes my mistake quota for the rest of the year.  Darn.

Rick
 

duskglow

  • Guest
Re: n00b question about microcontroller
« Reply #10 on: July 08, 2013, 04:30:47 am »
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. :)
 

Offline sci4meTopic starter

  • Regular Contributor
  • *
  • Posts: 139
  • Country: us
    • sci4me.com
Re: n00b question about microcontroller
« Reply #11 on: July 08, 2013, 10:27:09 am »
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. :P Anyway, thanks all for the help!
 

Offline sci4meTopic starter

  • Regular Contributor
  • *
  • Posts: 139
  • Country: us
    • sci4me.com
Re: n00b question about microcontroller
« Reply #12 on: July 09, 2013, 04:27:55 pm »
Okay, mplab doesnt want to detect my pickit3.... uh... and a quick google gives little... help please?
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5012
  • Country: ro
  • .
 

Offline sci4meTopic starter

  • Regular Contributor
  • *
  • Posts: 139
  • Country: us
    • sci4me.com
Re: n00b question about microcontroller
« Reply #14 on: July 09, 2013, 05:45:27 pm »
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... :|
« Last Edit: July 09, 2013, 05:58:09 pm by sci4me »
 

Offline sci4meTopic starter

  • Regular Contributor
  • *
  • Posts: 139
  • Country: us
    • sci4me.com
Re: n00b question about microcontroller
« Reply #15 on: July 10, 2013, 12:07:27 am »
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!
« Last Edit: July 10, 2013, 12:27:07 am by sci4me »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf