Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] control washing machine using PIC microcontroller

Status
Not open for further replies.

erfan.khalilian69

Member level 4
Joined
Feb 7, 2011
Messages
71
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Location
Kualalampur
Activity points
1,916
Hi everyone
I need to control the washing machine using PIC microcontroller :

The following are the design considerations to be followed:
1. Set the time using a DIP switch (maximum value is 99 seconds)
2. The setting values should be displayed on the seven segment display
3. The spin process should begin when the start button is pressed and then
 START the Motor (LED ON)
 The display value on the seven segments should start counting down
4. When the value is zero, STOP the motor (LED OFF)
5. Also modify the spin timer by increasing or decreasing the rotational speed

plz help me over this, thanks
 

andre_teprom

Super Moderator
Staff member
Joined
Nov 7, 2006
Messages
9,221
Helped
1,147
Reputation
2,313
Reaction score
1,123
Trophy points
1,403
Location
Brazil
Activity points
53,681
Hi,

You posted a customized complete project.
Better you ask for each doubt, according it happens.
What you done yet ?

I designed a washer-machine with more features than above with 8051 uC.
But even above design is not so simple, due hardware considerations.

+++
 

erfan.khalilian69

Member level 4
Joined
Feb 7, 2011
Messages
71
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Location
Kualalampur
Activity points
1,916
Hi thanks for replay,
it is school assignment I dun know how to start?
I think first I need to program counter which count from 99 to zero and display it in seven segment ,
I have experience with LCD but not with seven segment. I dun think so that hardware part will face problem, the problem is just programming wish assembly language.
thanks
 

andre_teprom

Super Moderator
Staff member
Joined
Nov 7, 2006
Messages
9,221
Helped
1,147
Reputation
2,313
Reaction score
1,123
Trophy points
1,403
Location
Brazil
Activity points
53,681
Well

First step, you must draw a flowchart to define structure of program and states working.
( P.S : I sugest you think about C language if possible )

If you don´t have problem with hardware it´s a good point.

+++
 

erfan.khalilian69

Member level 4
Joined
Feb 7, 2011
Messages
71
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Location
Kualalampur
Activity points
1,916
Well

First step, you must draw a flowchart to define structure of program and states working.
( P.S : I sugest you think about C language if possible )

If you don´t have problem with hardware it´s a good point.

+++
thanks
the lecture asks to write the program wish assembly language , I think I can write it with C and then convert it to assembly language , I heard that there is software which is able to convert C to assembly language , right ?
 

andre_teprom

Super Moderator
Staff member
Joined
Nov 7, 2006
Messages
9,221
Helped
1,147
Reputation
2,313
Reaction score
1,123
Trophy points
1,403
Location
Brazil
Activity points
53,681
The compiler is abble to do that.
All those I already used have an option type : "View ASM code".

However be aware that comments wrote at C code will not be visible at ASM code.
You run in a risk of resulted labeling in ASM pehaps will be intelligible ( indexed with numbers ).
If ASM language is mandatory, is better start programming directly in ASM, not in C.

Least wise PIC ASM is not hard ( it RISC set of instructions if very simple ). I suppose you´re working with 16F familly.

+++
 

erfan.khalilian69

Member level 4
Joined
Feb 7, 2011
Messages
71
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Location
Kualalampur
Activity points
1,916
The compiler is abble to do that.
All those I already used have an option type : "View ASM code".

However be aware that comments wrote at C code will not be visible at ASM code.
You run in a risk of resulted labeling in ASM pehaps will be intelligible ( indexed with numbers ).
If ASM language is mandatory, is better start programming directly in ASM, not in C.

Least wise PIC ASM is not hard ( it RISC set of instructions if very simple ). I suppose you´re working with 16F familly.

+++

thanks for your advice , so is better to write with assembly language from the first, yes I have chosen PIC16F877A because I have it already ,
do you know how to write the program for counter ?
 

andre_teprom

Super Moderator
Staff member
Joined
Nov 7, 2006
Messages
9,221
Helped
1,147
Reputation
2,313
Reaction score
1,123
Trophy points
1,403
Location
Brazil
Activity points
53,681
Due the 99 counter have range inside magnitude of 8bit variable, you can perform that with just few instructions.
Sorry if I don´t remember PIC assembly sintax, but is something like that in pseudo-code :
Code:
INC COUNTER
COUNTER > 99
IF NO : SKIP
IF YES : PERFORM ACTION

If I have time, will try code it an post here, but is very simple !!
Do yourself meanwhile...

+++
 

erfan.khalilian69

Member level 4
Joined
Feb 7, 2011
Messages
71
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Location
Kualalampur
Activity points
1,916
Hi Im back I had exam until today, I want to start the assignment today, actually Ive got news that for this assignment we need to use DIP switch to set the time, I know how DIP switch works. is anyone have sample code for DIP switch ?
after the time set and displayed in seven segment then it needs to count down.
thanks
 

erfan.khalilian69

Member level 4
Joined
Feb 7, 2011
Messages
71
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Location
Kualalampur
Activity points
1,916
not actually i need to set the time so I prefered the normal one as the binary value set the time in seven segment , my problem is how to program to read the value from DIP switch and the display it on seven segment,
thanks
 

arbj

Full Member level 4
Joined
Oct 5, 2008
Messages
238
Helped
31
Reputation
62
Reaction score
20
Trophy points
1,298
Activity points
2,601
you could use thumbwheels switches, I think 2 digit should be OK.

Why not use LCD panel and a keypad as an interface for the washing machine, keypad will longer life than DIP switches or thumbwheels..

For more sophistication a small touchscreen may also do the job..

just thinking...
 

bigdogguru

Administrator
Joined
Mar 12, 2010
Messages
9,831
Helped
2,348
Reputation
4,690
Reaction score
2,274
Trophy points
1,413
Location
Southwest, USA
Activity points
62,510
Hi Erfan,

Here's a few tutorials in PDF form covering 7-segment display interfacing and drivers in assembler on a PC 16F Series:

Driving 7-Segment Displays

Source Code for Above Lesson

Driving 7-Segment Displays Part II

Source Code for Above Lesson

Good example of interfacing multiple 7-Segment Displays:

Using multiple seven segment displays with PIC MCU

Microcontroller & 7-Segments LED Display Interfacing

If you can let me know the exact 7-Segment Display configuration you are using, Two Singles, 3 1/2 Digit, etc, I can probably help you with those details.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top