Discussion in "New Ideas regarding projects" started by    rohitsuresh    Dec 16, 2009.
Wed Dec 16 2009, 11:59 am
#1
Sir,
I am developing Automated Pill Dispenser for Memory Impaired and Aged People as my final year project. Till a few days back, the only thing i knew was the block diagram of 8051, a little bit of programming using opcodes(taught in college and implemented on a trainer kit) and very good knowledge in Borland C/C++. I am indeed very lucky to find this site.
Based on the suggestions in your site, i purchased Embedded C by Michael J Pont for Rs.285 and also installed Keil uvision2 Evaluation that came along with the book.

Since my college staff have no experience in embedded C, they are unable to guide me.
Kindly clarify my doubts and guide me in the right direction.

1. In chapter 4 page 59, why P1=0xFF is needed to set the port to read mode?
2. Assume P1=0xAA ( i.e. P1 has a value 10101010). How do i read that value and copy the result to port2?
3. Till now,i have been successfully able to execute only the examples. Kindly guide me on how to open a new project and create a C file that can be executed in the project.

P.S. I have added a rar file which contains my 1st review report submitted to my college. Kindly review my idea and post some suggestions


Attachment
Wed Dec 16 2009, 11:19 pm
#2


1. In chapter 4 page 59, why P1=0xFF is needed to set the port to read mode?

rohitsuresh


It is because of the physical design of the port.
It is easy to pull the voltage level down if the pin is set high,
but hard (dangerous) to drive the voltage up if the pin is set low.


2. Assume P1=0xAA ( i.e. P1 has a value 10101010). How do i read that value and copy the result to port2?

rohitsuresh


It is a simple read and write such as

ACC =P1 //read the port value into Accumlator
P2 =ACC //write the Acc value into Port2


P.S. I have added a rar file which contains my 1st review report submitted to my college.
Kindly review my idea and post some suggestions

rohitsuresh


I downloaded your file and unpacked it, but have no idea how to read it
Have you got a simple outline of your project ?



[ Edited Wed Dec 16 2009, 11:24 pm ]
 rohitsuresh like this.
Fri Dec 18 2009, 06:28 pm
#3
Sir, one doubt.

Isn't ACC=P1
P2=ACC an assembly language code?

Could you please tell me how to do it in C
Fri Dec 18 2009, 06:50 pm
#4
Sorry about the attachment. I have posted a pdf document . Kindly review it and comment on it. It has no codes as yet. But i have mentioned about the idea.
Fri Dec 18 2009, 10:10 pm
#5
This is what Sir ExperimenterUK was suggesting:

// ===========================================
// Function Header:  main()...                
// ===========================================
void main()
   {
   unsigned char MyVar;
   
   // this is what was suggested...
   MyVar = P1;
   P2 = MyVar;
   
   while( 1 );
   }


This, also will work:
// ===========================================
// Function Header:  main()...                
// ===========================================
void main()
   {
   // this will also work...
   P2 = P1;

   while( 1 );
   }
 rohitsuresh like this.
Sat Dec 19 2009, 08:27 am
#6
Thanks for your suggestion sir.Please review the pdf i have attached earlier and kindly advice me on how to go about it.

Also, do you recommend the switch debouncing to be applied as a software as shown in Embedded C Michael Pont Chapter 4 or is it better to go for a debouncing circuit using NAND gates
Sun Dec 20 2009, 01:02 am
#7
it wasn't a suggestion, it was an answer to your question:


Sir, one doubt.

Isn't ACC=P1
P2=ACC an assembly language code?

Could you please tell me how to do it in C
Regards,
Rohit Suresh



This is a suggestion: Use software to debounce your inputs...


[ Edited Sun Dec 20 2009, 01:03 am ]
 rohitsuresh like this.
Sun Dec 20 2009, 08:38 am
#8
Lol! My bad Sir.. Sorry!

Dave Sir, my friend has a small problem. In his project he has got two 4x4Keyboards, two LCD Displays.two stepper motors and a couple of LEDs.How to integrate so many peripherals into one 8c2051 or 89c51?

Also, I request you to review my project idea and comment. Will you give me permission to add this project into your site after i complete it?
Mon Dec 21 2009, 09:17 am
#9
Whoa! This isn't my site, it's Ajay's - I don't even live in India, let alone own a website... I just stop in here once in awhile and help if I can. Sir Ajay and Sir ExperimenterUK are the Electronics Experts -

I can make another suggestion : when interfacing so many peripherals, make heavy use of multiplexing. Simple techniques like using an LS138 (3 to 8 mux), or even a CPLD to decode XDATA addresses for each peripheral will consume addresses to decode, but give you 8-bits per address...

At least, that's how I end up doing it... ile
 Abhinav.Chaurey like this.
Mon Dec 21 2009, 04:08 pm
#10

Whoa! This isn't my site, it's Ajay's - I don't even live in India, let alone own a website... I just stop in here once in awhile and help if I can. Sir Ajay and Sir ExperimenterUK are the Electronics Experts.

DavesGarage


Well site belongs to those who contributed to it. Dave also have a Major contribution to it and still contributing so no point He can say its not his website hehe...

By the way dave, you are my senior dont embarrass calling me expert, I know i still have a long way to go.

And must not forget the second major contributor, Phil (ExperimenterUK) He is also a gem on this site.

Proud to have both of them stand by my side ile

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

Timothypet
Wed May 15 2024, 06:14 pm
RandyBence
Wed May 15 2024, 02:00 pm
JordanDic
Wed May 15 2024, 01:55 pm
DavidDeelf
Wed May 15 2024, 11:16 am
ytaletjkca
Wed May 15 2024, 09:45 am
MildredWoumb
Wed May 15 2024, 04:07 am
NaKrutkADamb
Wed May 15 2024, 12:03 am
MichaelGot
Tue May 14 2024, 04:08 pm