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.

8 input switch programming.

Status
Not open for further replies.

mcflurry90

Newbie level 3
Joined
Dec 24, 2010
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,307
hi.. im a newbie... i've design a circuit based on at89s52 that needs 8 input binary to control different mode of 2 output....but i dont know how to program it in assembly language... i only know how to program for 1 switch input only.. could anyone help me?? sorry for my broken English...
 

hi.. im a newbie... i've design a circuit based on at89s52 that needs 8 input binary to control different mode of 2 output....but i dont know how to program it in assembly language... i only know how to program for 1 switch input only.. could anyone help me?? sorry for my broken English...

hi..you can explain your problem briefly...in the case that you can programm 1 input switch so it is easy to control 8 bits...just give time to it .it will be done...


if still any problem let me knw....
 

hi.. im a newbie... i've design a circuit based on at89s52 that needs 8 input binary to control different mode of 2 output....but i dont know how to program it in assembly language... i only know how to program for 1 switch input only.. could anyone help me?? sorry for my broken English...

Why asm man????????
use "C"...........
Keil C
 

hi..you can explain your problem briefly...in the case that you can programm 1 input switch so it is easy to control 8 bits...just give time to it .it will be done...


if still any problem let me knw....

i have learn the basic reading input from 1 port;
example: org 0000h
setb p1.0
start: jb p1.0, execute
jmp stop

but i wonder how can we read for 8 bit together and execute different thing that depends on the 8bit data...
example:
10000000 (input)= 00000011 (output)
11000000 (input)= 00000011 (output)
11100000 (input)= 00000011 (output)
11110000 (input)= 00000000 (output)
11111000 (input)= 00000000 (output)
11111100 (input)= 00000000 (output)
11111110 (input)= 00000011 (output)
11111111 (input)= 00000011 (output)

sorry because i really dont know how to explain it clearly in English..
but i really need help.... thanks
 

any particular reason why you are using assembly language? C would be simpler where you would use a switch statement
 

any particular reason why you are using assembly language? C would be simpler where you would use a switch statement

first is i'm totally zero in C++ or C programming but i have a basic in asm....and i need to program the at89s52 as soon as possible... before next week....
 

hi

just check the following

assume P1 is input and P2 is output

start: mov a, P1
cjne a, #10000000b,next1
mov P2,#00000011b
sjmp start
next1: cjne a,#11000000b, next2
mov P2,#00000011b
sjmp start
next2: cjne a,#11100000b,next3
mov p2,#00000011b
sjmp start
next3: cjne a,#11110000b,next4
mov p2,#00000000b
sjmp start
next4: chne a,#11111000b,next5
mov p2,#00000000b
sjmp start
next5: cjne a,#11111100b,next6
mov p2,#00000000b
sjmp start
next6:cjne a, #11111110b,next7
mov p2, 00000011b
sjmp start
next7:cjne a, #11111111b,next8
mov p2,#00000011b
next8: sjmp start

just take care of the typing, this is just for you to check how it is to be done
cross check with the book you are referring with the program so that you will understand what exatly happening

regards

ml
 
thank you so much!! its really helps me...
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top