| | |
Small problem with 8051 programming
![]() |
•
•
Join Date: Oct 2009
Posts: 1
Reputation:
Solved Threads: 0
Hi
I am facing one small problem please send me suggestion for that Problem as follows
I have written one code in C for 8051 to use one port as input port & other one as out port.This is done by push button.For example I use P1.0 as in put & P0.1 as out put that is when i press push button connected to P1.0 out put come from P0.1 & when i release button out put get off but If I want to retain that out put till next press of same button whats your suggestion to modify my program please reply Thank You Have good time
please reply
I am facing one small problem please send me suggestion for that Problem as follows
I have written one code in C for 8051 to use one port as input port & other one as out port.This is done by push button.For example I use P1.0 as in put & P0.1 as out put that is when i press push button connected to P1.0 out put come from P0.1 & when i release button out put get off but If I want to retain that out put till next press of same button whats your suggestion to modify my program please reply Thank You Have good time
please reply
0
#2 Oct 27th, 2009
Code, what code?
If I understand your need you need edge triggering. Assuming high until pull down upon edge trigger.
Here's some C code. You need to create an assembly language equivalent!
If I understand your need you need edge triggering. Assuming high until pull down upon edge trigger.
Here's some C code. You need to create an assembly language equivalent!
Asm Syntax (Toggle Plain Text)
// global values byte sw = 0xff; byte swEdge = 0x0;
Asm Syntax (Toggle Plain Text)
// Keyboard input loop byte sin, swup, swdn; sin = getPort(); swEdge = sw ^ sin; // Save difference that's the edge swUp = swEdge & sin; // Switch just released swDn = swEdge & (sin ^ 0xff); // switch just depressed sw = sin; // New bits
Last edited by wildgoose; Oct 27th, 2009 at 2:07 am.
![]() |
Similar Threads
- dynamic programming problem (Computer Science)
- Small Browser Problem - Urgent (HTML and CSS)
- small problem in the string (C++)
- A small problem in the output (C++)
- Motorola T720i Programming (Cellphones, PDAs and Handheld Devices)
- Small problem with web links? (Windows 95 / 98 / Me)
- Java Game Applet Too Small (Java)
- ** Need Help ** in a small C++ problem (C++)
Other Threads in the C Forum
- Previous Thread: HELP
- Next Thread: alignments
Views: 238 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for C
#include api array arrays binary binarysearch bit build c++ c/c++ calling char character code coke command conversion convert database decimal directory dude dynamic error exec executable factorial fflush fgets file floatingpointvalidation fork function functions getline givemetehcodez grade graphics haiku help|help|help|help homework i/o include input insert int integer intmain() keyboard lazy line linked linkedlist linux list lists loop malloc matrix memory mysql no-effort output overwrite parallel path permutations pointer pointers problem process program programming read readfile recursion recursive recv reverse scanf segmentationfault socketprograming sockets spoonfeeding stdin string strings strtok structures student system testing turbo-c turboc unix user variable win32 windows _getdelim





