Final Year Project Help (PIC 16F877A)

Thread Starter

Wajhi

Joined Oct 17, 2011
14
Hey,

I am trying to build my final year project, but am facing a difficulty in implementing the PIC16F877A (since i am studying ONLY from internet, without any prior microcontroller knowledge) ...

This is the layout which I want to implement:


This is as far as i got in Proteus (since i couldnt find any bluetooth module in there) :



Now i am finding the programming of both the PICs, one with only analog input -ADC- digital output to bluetooth module and other one with bluetooth module- to PIC(using PWM) - servo hard...so it would be awesome if you guys can help me out in that...

Cheers!;)
 

Eric007

Joined Aug 5, 2011
1,158
Although you have shown your layout...BUT I don't think this is enough to get helped!
You need to describe clearly what you trying to acheive...what's the problem description? What have done so far? And what you need help with?

Gudluck!
 

ErnieM

Joined Apr 24, 2011
8,377
Nice layout sketch, it's always best to have an outline of your project.

I don't know Proteus, I assume it is a schematic capture program. No program will have every component, so sooner or later you'll learn how to make your own. (Sooner is better.)

I'm not tracking what your doing with RV1/R1 and such. If you are just trying to get an analog input to the PIC you could use a little adjustment there.

It's now probably time to download the "Microchip PIC16F87XA Data Sheet 28/40/44-Pin Enhanced Flash Microcontrollers" copyright 2003 Microchip Technology Inc. Document DS39582B.

You'll be living with it. Read the first 161 pages several times. The features subtly interact with each other so do keep an eye on ALL the "REGISTERS/BITS ASSOCIATED WITH (x)" tables.

In circuit debugging is described in section 14.15, and programming in section 14.18. Both are done in a similar way using the same pins 39 (clock) and 40 (data). Try to leave these two free for debugging and programming.
 

Markd77

Joined Sep 7, 2009
2,806
Assuming the bluetooth modules just transmit the serial data and don't need any fancy setup commands you can just connect the 2 PICs together for the Proteus simulation.
Have you got links to their datasheets?
 

Stuntman

Joined Mar 28, 2011
222
Good project. To add to what's been said: Take this project in steps. If you try to walk into mcu programming and make this whole system work from the get go, it may seem overwhelming.

For starters, have you gotten a "hello world" working on your PIC yet? This is the first step.

From there, if it were my project, I would do this in these steps.

1. Gather your master plan. What value are you going to grab from your sensor? An ADC value? What kind of value is going to be transmitted from your sensor reading, to the PIC driving the servo?

2. Get one PIC to just read your sensor.

3. Get one PIC to control your servo.

4. Perhaps combine both the sensor input module (step 2) and servo driver module (step 3) on one mcu. If you can't combine on one, you might use a SPI to communicate between the two.

5. Write a function that forwards the data from the sensor read module, to the bluetooth radio (TX).

6. Write a function that receives data from the bluetooth radio (RX), and drives the servo.

At this point, you will have working modules except for your wireless link. Which will be your last thing to debug.

Good Luck

ETA: As for getting your hardware lined up, I see no reason you can't breadboard everything up to, and possibly including the wireless modules.
 

Thread Starter

Wajhi

Joined Oct 17, 2011
14
okey let me start by saying thankyou all for responding..let me clarify the situation./..the analog signal is basically 5 flex sensors fixed on 5 fingers...as they move, i want the robotic hand (controller by 5 servos) to move the finger in unison..

I am opting for running the PIC via a C lang, cause its one thing I have worked (very very little) on....

The issues I am facing at hand are, I hardly know how to create and implement the
proper code for the following:

1)The first stage in which i need to input 5 different analog voltages and get them converted into a serial output (so i can input it in Bluetooth module) ..as seen in figure

2) how to take the serial data , input it into PIC and tell the PIC which bit pattern (digital voltage value) represents which servo so the correct servo moves w.r.t the finger on our hand...

I am searching and trying to understand day in day out, but its difficult casue I have no one to guide me and the first deadline is in two months...
 

ErnieM

Joined Apr 24, 2011
8,377
This project has a very high "coolness" factor, so expect lots of helpers here. :D

As Microchip gives away their compilers free (especially "academic" versions) then C is a good choice. You can get support here and on the Microchip forums.

I would break your problem up further into 3 steps:

1) Input stage. Read the finger sensor and produce a valid output.

2A) Bluetooth transmission

2B) Bluetooth reception

3) Output stage: Drive 5 sensors from the supplied data.

I would work the problem from the outside in: Do 1 and 3 first, then go for 2. And given that your PIC16F877 has plenty of pins you could use that to combine 1 & 3 into one PIC device to write and debug the code on one processor. Once that is working split the project in two and make two code bases. Do use separate C files for the input stuff and output stuff so it is already separate for that day when you need them separate.

And if #2 doesn't quite work in time with Bluetooth, you can always leave some wires in place and demonstrate something working.

Converting the sensor input to servo control will take a bit of experimentation. My call would be to send raw sensor D2A data back to some display (like a PC over RS-232 or USB) (it's not that hard to make a PIC talk USB) so you can see "if I flex my finger this much, I get this reading." Then you make a table to translate finger position reading to servo setting.

The hardest choice you have then is which PIC has that translation.

Good luck, and keep us updated.
 
Top