Discussion in "8051 Discussion Forum" started by    say2paul    Jul 9, 2008.
Sun Jul 13 2008, 07:29 am
#31
Hi Paul,

Hope you'll be back with the C code soon

P.S.: R2 resistance is 220? is that 220ohms? Also, is 1N4148 diode easily available? If not can I replace with some other diode or direct connection?



yes its just 220ohms, 1N4148 diode is a switching diode(fast) don't replace it with normal 1N4007, this diode serves a crucial purpose of creating equi- hi and low pulses of 38Khz (i have mentioned this in earlier post), its available in any shop where they sell resistors (costs 50 paise).


about C code, i personally don't like coding in "C", bcoz "C" just allows you to "See". whereas in assembly you go deeper and "assemble" your project

here's the Algorithm :

Tx side:

1) Initialize Serial port - 8N1-600bps or 1200bps
2) Initialize timer1 as baudrate genarator
3) make p3.2 as input (Switch)
4) poll for p3.2 to go Low
5) call a delay (debounce delay)
6) move data from data pointer into Reg A
7) send it to SBUF reg
8) increment Data pointer
9) jump back to polling p3.2 and loop while 1

Rx side:

1) Initialize Serial port - 8N1-600bps or 1200bps
2) Initialize timer1 as baudrate genarator
3) poll for RI flag to be set
4) move data from SBUF reg to Reg A
5) rip off Ascii component
6) match the data recvd with 0-9
7) if match is found display that particular number pattern on port 1
8) jmp back to polling RI flag



Arun





 say2paul like this.
Sun Jul 13 2008, 09:06 am
#32
Thanks Arun, I just started Embedded C and I know that right now I am not in a stage to convert the above algorithm to C program

But I will try my best to program it in C.

Till then if someone else can help me to program the above algorithm in C :-s
Sun Jul 13 2008, 01:29 pm
#33
Somehow I got 1N4148 diode from local electronics shop. But IN4148 is not printed on diode, instead the following is printed:


IN
52
38B
852



I was unable to find 10n capacitor, I got 100n instead and I tried 100n in proteus with the final circuit but it doesn't work
Sun Jul 13 2008, 09:41 pm
#34

Hi Paul,

So the seller gave you a 8.7 Volts (1N5238B ) Zener instead of 1N4148, no problem you can use it for time being.

no 100nf won't give you the needed Freq.

not all the sellers understand the component values - you have to tell them in commercial nomenclature for eg : 10nF cap, ask him for 103 J Green Polyester Cap don't take a ceramic 103 cap, atleast not for this project (they deviate a lot)

you need 2 no's of 10nf, see my circuit diagram


Arun
 say2paul like this.
Sun Jul 13 2008, 09:57 pm
#35
Thanks Arun, I will try Chandigarh Market tomorrow and will let you know.

Thanks for the support

P.S. Where can I get this type of commercial reference, like you said 103 J green polyester Cap instead of 10n ceramic cap?


[ Edited Sun Jul 13 2008, 10:00 pm ]
Sun Jul 13 2008, 10:12 pm
#36

P.S. Where can I get this type of commercial reference, like you said 103 J green polyester Cap instead of 10n ceramic cap?




Pl.read my Post here, i have explained with examples:

http://www.8051projects.net/forum-t9301-0.html#post_9317



Arun
 say2paul like this.
Sun Jul 13 2008, 10:30 pm
#37
great info man!! then according to this 'G' is better then 'J'..?
Mon Jul 14 2008, 06:27 am
#38

Hey Paul,

the last letter indicates tolerance/accuracy level of the cap, and J is always better than G.

(percentage of deviation from original printed Value) for Caps

J = +/- 5%
K = +/- 10%
G = +/- 20%

similarly we have tolerance Bands on the resistors:

(percentage of deviation from original printed Value) for Resistors

Gold = 5%
silver = 10%
brown = 1% (usually costs five times that of 5% ones)

for this project you can use gold band resistors.



Arun

 say2paul like this.
Mon Jul 14 2008, 09:58 am
#39
Thats why even I got confused, actually it was a typo error at http://www.8051projects.net/forum-t9301-0.html#post_9317

You mentioned G = +/- 2 % instead G = +/- 20 %
 Arun Kumar V like this.
Mon Jul 14 2008, 11:36 am
#40


Hi Paul,

yes its just 220ohms, 1N4148 diode is a switching diode(fast) don't replace it with normal 1N4007, this diode serves a crucial purpose of creating equi- hi and low pulses of 38Khz (i have mentioned this in earlier post), its available in any shop where they sell resistors (costs 50 paise).


about C code, i personally don't like coding in "C", bcoz "C" just allows you to "See". whereas in assembly you go deeper and "assemble" your project

here's the Algorithm :

Tx side:

1) Initialize Serial port - 8N1-600bps or 1200bps
2) Initialize timer1 as baudrate genarator
3) make p3.2 as input (Switch)
4) poll for p3.2 to go Low
5) call a delay (debounce delay)
6) move data from data pointer into Reg A
7) send it to SBUF reg
8) increment Data pointer
9) jump back to polling p3.2 and loop while 1

Rx side:

1) Initialize Serial port - 8N1-600bps or 1200bps
2) Initialize timer1 as baudrate genarator
3) poll for RI flag to be set
4) move data from SBUF reg to Reg A
5) rip off Ascii component
6) match the data recvd with 0-9
7) if match is found display that particular number pattern on port 1
8) jmp back to polling RI flag



Arun

Arun Kumar V




Can anyone implement the above algorithm in C




[ Edited Mon Jul 14 2008, 02:26 pm ]

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

Williamjef
Thu Apr 25 2024, 02:08 pm
SamuelSmise
Thu Apr 25 2024, 09:56 am
DustinErele
Thu Apr 25 2024, 08:44 am
ztaletpzca
Wed Apr 24 2024, 11:19 pm
IrardlPex
Wed Apr 24 2024, 08:42 pm
Charlestehed
Wed Apr 24 2024, 05:20 pm
Robertgurse
Wed Apr 24 2024, 02:43 pm
Richardedils
Wed Apr 24 2024, 04:07 am