# [SOLVED]control washing machine using PIC microcontroller

Status
Not open for further replies.

#### erfan.khalilian69

##### Member level 4
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
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
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
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

### erfan.khalilian69

Points: 2

#### erfan.khalilian69

##### Member level 4
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
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

### erfan.khalilian69

Points: 2

#### erfan.khalilian69

##### Member level 4
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
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
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
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
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...

erfan.khalilian69

### erfan.khalilian69

Points: 2

#### bigdogguru

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.

erfan.khalilian69

### erfan.khalilian69

Points: 2

#### Fragrance

erfan.khalilian69

### erfan.khalilian69

Points: 2
Status
Not open for further replies.

Replies
28
Views
11K
Replies
17
Views
11K
Replies
9
Views
8K
Replies
0
Views
1K
Replies
9
Views
2K