Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics 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.

[PIC] PIC 16f877a coding..

Status
Not open for further replies.

ahmadfaizzakian

Newbie level 2
Joined
Feb 2, 2014
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
19
hello,im new around here and im not limited internet connection. im doing a project named automatic handwash with auto refill. well here is my coding. im using mikroC for the coding.


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
void portb0() ;
void main() {
 
  int mot0 = 0;
  int mot1 = 0;
  TRISA = 0b00000000;
  PORTA = 0x00;
  TRISB = 0b00000000;
  PORTB = 0x00;
  TRISC = 0b11111111;
  PORTC = 0x00;
  TRISD = 0b11111111;
  PORTD = 0x00;
  
while (1)
{
if (PORTC.f0 == 1)
while(1)
{
portb0() ;
if (porta.f1 = 0)
   portd.f2 = 1 ;
   delay_ms(5000) ;
 
if (porta.f2 = 0)
   portd.f3 = 1;
   delay_ms(5000) ;
 
 
break ;
 }
else
{
PORTB == 0 ;
              }
 }
}
void portb0 (void) {
     portb.f0 = 0x00000001 ;  //air
     
     delay_ms(600) ;
     
     portb.f0 = 0x00000000 ;
     portb.f1 = 0x00000001 ;  //sabun
     
     delay_ms(150) ;
     
     portb.f1 = 0x00000000 ;
     portb.f0 = 0x00000001 ;  //air
     
     delay_ms(600) ;
     
     portb.f0 = 0x00000000 ;
     portb.f2 = 0x00000001 ;  //blower
     
     delay_ms(600) ;
     
     portb.f2 = 0x00000000 ;
     portb.f3 = 0x00000001 ;  //sanitizer
     
     delay_ms(150) ;
     
     portb.f3 = 0x00000000 ;
 
     }



based on the coding, i manage to get all the washing circuit to work, but my problem is on the refill circuit as i dont know the coding. i know that port A can be used as ADC but i dont know how to use it. my liquid level sensor circuit work properly but i need the coding on PIC. i want to make when port A2 and A3 read 0V,it will turn on port D2 and D3.. can anyone help me?? im really noob in this:-(

please and thank you
 

hello,

my liquid level sensor circuit work properly
so,is it an analog level sensor.?
if yes, what kind of signal is delivered by this ?
it must be in the range 0 to 5 V for all of the measuring range..

i want to make when port A2 and A3 read 0V
do you have 2 analog sensors ?
or 2 dry contact ?

Explain clearly to get support...

Maybe with a drawing with sensor location ..water circulation..
 
hello,


so,is it an analog level sensor.?
if yes, what kind of signal is delivered by this ?
it must be in the range 0 to 5 V for all of the measuring range..


do you have 2 analog sensors ?
or 2 dry contact ?

Explain clearly to get support...

Maybe with a drawing with sensor location ..water circulation..

yes the output is 5V..but i need it to be 0V which means the PIC read it as logic 0. it is the same circuit actually. but i make it 2. i will attach my circuit. im sorry mate.

 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top