We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I just found a more recent source code which isnt mine which uses the commands u used. They only work with the recent versions of Keil (after Microsoft bought Keil) because i have an older version and that command does not work.
Now if u need to output on port A, pin 2 of the 8255 u must set ur control word to 1000XXXX = 0x80
This means that the 8255 is set to mode 0: basin i/o operation and port A is set as output. Now when u are dealing with a port is must be treated at a byte. Therefore if u need to use another pin on Port A for a completely different application you can do this:
Create a variable of unsigned char temp=0, Then use a variable of type bit to set the state of ur LED; name it LED1, Then set temp = temp|LED1; and then shift left using the << command to place the bit in the correct position. This can be done for many different LEDx states.
Then using portA = temp;
However, u cannot just set a single bit on the 8255, you must treat is as a byte.
in short i got it, that as you said, the same can be done in following way. if i want to lit a single led on any port pin.. i have to put there a port value. like PA = 0X10; or PA = 20; ( this is ment for some pins on and some off..) and like tht the port value for the required port pin. yes.. this enlitans my mind... dear friend..!!
THANKS.
thanks a lot for your quick helps.
<CODE> #define LCD_DATA XBYTE [0xE000] // Port A #define KEY_OUT XBYTE [0xE001] // Port B #define KEY_IN XBYTE [0xE002] // Port C #define CONTROL_PORT XBYTE [0xE003] // Control Port #define CONTROL_WORD 0x89 // Port A => O/P , B => O/P , C => I/P ..... begin main as void { unsigned varieble j; delay(1000); (* some bad compelers refuse to accept this *) let j := 55; CONTROL_PORT = CONTROL_WORD; ... LCD_DATA = 0x00; } <ENDCODE>
...which uses the commands u used. Who are you referring to?
after Microsoft bought Keil Microsoft bought Keil?
I know that ARM bought Keil, and all web pages says: "Keil, An ARM Company".
(* some bad compelers refuse to accept this *) let j := 55;
(* and *) seem to be Pascal comments. j := 55; seem to be a Pascal assign. let x = y is part of BASIC syntax
Are you sure that only "bad" compilers refuses to accept your code?
89c51 port epansion with 8255 keil c ... They only work with the recent versions of Keil (after Microsoft bought Keil) because i have an older version and that command does not work. Micro sof did NOT buy Keil, ARM did It sounds starnge that "an older version of Keil" has a problem with this antique. WHY ON EARTH do you use a chip that has been outdated for decades?
Erik
Hi,
DO ANYONE KNOW if a USB KEYBOARD can connect to an MCU or is IT POSIBLE?
yes it can, but only if the uC is an USB master
If you eant to use a '51 you need some external circuitry since there is no '51 with USB master capability. There are many other Ucs (I know of ARM) that have USB master capability and using such a chip will be 100 times easier than trying to make a '51 drive an external USB master chip
YES anyone KNOW if A usb KEYBOARD can connect TO an MCU. WHY should IT not be POSSIBLE?
obviously THE MCU should have SUPPORT FOR usb HOST, since THE keyboard is A DEVICE.
ARe yOU TRYING out a USB driver for A KEYBOARD right now? IT SEEMS that YOU HAVE something WRONG with THE SHift/CapsLOCK PROCESSING. DON*T you find it SLIGHTLY IRRITATING?
what does USB have to so with a 8255?
Hijacking threads for unrelated issues wirtually guarantees that the answers will be fewer. Just THINK (I am sorry using thet bad word) will anyone that know about USB but have absolutotally no interest in the 8255 read your post?
Also what does PhaseLockZero (plz) have to do with either the 8255 or USB
what PINS do i connect the keybrd to?
I TRY SOME and it disnt work.
tHe UsB PiNs, oF cOuRse!
The MCU does not have native support for a keyboard, so it will not be able to handle it just because you connect the keyboard. YOU must also add some source code to implement the support. But once more, you must have a processor with USB host support.
There are people who have bit-banged USB devices, but you do not want to bit-bang a USB host. If you where good enough to do it, you would not post any questions on this forum!
"YOU must also add some source code to implement the support."
YOU must also add some hardware support (equivalent of the MAX232 for an RS232 link)...
1) YOU must also add some hardware support 2) (equivalent of the MAX232 for an RS232 link)...
Andy, I understood you, just do not see those with limited English doing that