Memorial day is 05/25/2015 – Orders will ship out on May 26th. There will not be any deliveries or shipping on Monday. Any order placed after 11am ET on Friday May 22nd will not start to ship out until Tuesday May 26th.

Changing micro controller
Moderators: adafruit_support_bill, adafruit

Changing micro controller

by Stitch626 on Wed Feb 01, 2012 7:40 pm

Hi all i have just finished peiceing together the pcb design for a propeller clock and my Lecturer waits tot his moment to tell me we dont have the resources to program the MC that is in the design. The design its self was created by Sylvain Bissonnette He wants me to use a PIC16f877 my problem becomes im not good with micros at all ivemade some assumptions on pins functionality such as:

on the
Xtal1 and Xtal2 are = to OSC1 and OSC2 on the pic
Reset is = to MCLR on the pic
PB0 = RDO/PSP0 on the pic
(AIN1) PB1 = RDO/PSP1 on the pic
PB2 = RDO/PSP2 on the pic
(OC1) PB3 = RDO/PSP3 on the pic
PB4 = RDO/PSP4 on the pic
(MOSI) PB5 = RDO/PSP5 on the pic
(MISO) PB6 = RDO/PSP6 on the pic
(SCK) PB7 = RDO/PSP7 on the pic

I get the feeling ive seriously over simplfied this i know my coding will need adjusting buh at the moment i just want to get the pcb sorted any help would be hugely appreciated guys as ive been reading through the PDF Reference Manual for 3 days now and im still no closer to understanding.

Thanks again
Posts: 15
Joined: Sat Apr 24, 2010 3:10 pm

Re: Changing micro controller

by philba on Wed Feb 01, 2012 9:26 pm

if you originally designed it for the AT90S231 a cheap programmer is going to cost you $22 -
Or if you have an arduino you could use it to make one for free.
Posts: 387
Joined: Mon Dec 19, 2011 6:59 pm

Re: Changing micro controller

by Stitch626 on Thu Feb 02, 2012 5:35 am

Thanks for the reply philba unfortunatly im too far into the project time and budget wise that and i think the reason they want us to use the PIC16f877 is because they already have them in stock. back to the pdfs it is for me then lol
Posts: 15
Joined: Sat Apr 24, 2010 3:10 pm

Re: Changing micro controller

by philba on Thu Feb 02, 2012 11:18 am

OK, it's your choice but we aren't talking about a huge amount of money here and I seriously doubt your professor will punish initiative
Posts: 387
Joined: Mon Dec 19, 2011 6:59 pm

Re: Changing micro controller

by jasonwebb on Thu Feb 02, 2012 1:01 pm

@philba: have you seen education today up close? The professor's comfort zone seems to trump initiative, in my experience :P

@Stitich626: I feel ya, my electronics prof refused (actually laughed) when I suggested I'd rather use an ATMEGA328 and the Arduino platform instead of PICs - 75% of the students in that class failed the final project and he had to scale the entire class :P

I'm not entirely sure of what the original question is, though. I get that you want to port over the schematic from the AT90S231 to a PIC16f877, but what specifically are you having trouble with? Let's break down the problem in a discrete set of small, individual problems that we can address one at a time.

With any microcontroller, you'll typically need the following:
- Programming interface
- Oscillator (unless using internal oscillator)
- Power/ground
- Miscellaneous configuration - for example, the ATMEGA328 needs to have it's RESET pin pulled up for normal use.

First, identify how many digital inputs and outputs you need, and any analog inputs and outputs. Now, drop your 16f877 in a fresh schematic, and set it up by itself (power, programming interface as per the datasheet, oscillator). Microchip offers a helpful guide on configuring their various PIC chips for ICSP (see page 2-21 for your 16f877): ... 30277d.pdf

Now, using whatever pins you have left, go through and connect the IO however is most intuitive. Keep track of which pin goes where (and maybe check the datasheet for pin configurations so you don't accidentally use some special-use pin). I would highly recommend writing a super simple program that ONLY turns on/off a single LED connected to a pin, so that you can verify that the things you've done so far work (ICSP, oscillator, configuration). Once the core system is working OK, then add your ULN2803, LEDs and sensors. You are breadboarding this all out first, right? :)
Jason Webb - grad student, creative technologist, OSHW engineer
  • Website:
  • Twitter: @jasonwebb
  • Flickr:
  • Vimeo:

Posts: 103
Joined: Sat Sep 10, 2011 2:15 pm
Location: Kearney, NE

Re: Changing micro controller

by philba on Thu Feb 02, 2012 8:44 pm

Actually, I have to disagree. I work with a number of teachers and they are quite willing to give students latitude in their projects. My experiences in college were similar. Yeah, some are rigid but I think the majority actually enjoy the students with initiative - especially if the student demonstrates that he understands the material. Also, it's easier these days to figure out what a prof is like before you take the course (like ratemyprofessors) so you can avoid the idiots and jerks.
Posts: 387
Joined: Mon Dec 19, 2011 6:59 pm

Re: Changing micro controller

by Trajetre on Fri Feb 17, 2012 3:28 pm

Also, based on the use of the PIC16 line, I'm guessing you're supposed to be learning Assembler instead of C? If so, here's a tutorial.
"Everything you say is boring and incomprehensible, but that alone does not make it true."
-Franz Kafka's "Metamorphosis"
User avatar
Posts: 14
Joined: Mon Oct 05, 2009 2:06 pm
Location: Vancouver, BC