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.

AT89C52 Port0 got problem!!

Status
Not open for further replies.
Hi,

I got study I2C before and we discuss before and i already understand how the I2C work. That time you give me the sample of code for eeprom but i still can understand how the eeprom work not very well. As suggested PCF8574 is I/O expanded is using I2C to control, i scare i can't handing well. Because got so many I/O there. And some more my uC data nearly full.

1 thing i worry is my data nearly full. Another thing is program because i still new in microcontroller but i will learn it. But i really learn alot of thing on this forum. Thank again.

Is it possible we add more RAM (PCF8570) for my controller?

Nevermind we put this as alternative way. How my design, is it this is the simple way to do it? But how am i to control my PORT 0 ?

Thank You.
 

TechToys said:
1 byte = 8 bit of the format 0bxxxxxxxx, for example, it could be 0b10010010 (say).

If a comparison of only an open / close circuit required, it may be possible to shift in inputs for all switches, and use individual bit for each switch detect.

John

Hi,

I already comeout the formula for the 8bit for comparison :D Yeah! I can control 1st 8 switchs.

inBln = Hi
-**************************************-
1000 1000 = temp
AND 0000 1000 = in (addr)
-------------------------
0000 1000 = bit unchange


1000 0000 = temp
AND 0000 1000 = in (addr)
-------------------------
0000 0000 = bit change

- bit change update buffer
1000 0000 = temp
OR 0000 1000 = in (addr)
-------------------------
1000 1000 = Buff


inBln = Lo
-**************************************-
1000 0000 = temp
NOR 1111 0111 = in (~addr)
-------------------------
0000 1000 = bit unchange


1000 1000 = temp
NOR 1111 0111 = in (~addr)
--------------------------
0000 0000 = bit change

- bit change update buffer
1000 0000 = temp
OR 0000 1000 = in (addr)
-------------------------
1000 1000 = Buff

Thank You
 

I already comeout the formula for the 8bit for comparison Yeah! I can control 1st 8 switchs.

That is good! Since I am not sure if you have more than one person using the switches (probably yes), or you have 60 persons using the switches (?), I cannot say much about the scanning frequency.

Unless you are using interrupt with I2C parallel-in serial-out device like previous suggestion, make sure to update the switch scanning frequent enough so no key would be missed.

Yeah, it would be a waste of ram resource if you used 30 bytes for 30 individual switches, as a single switch only reflects states of ON/OFF.

John
 

    Help

    Points: 2
    Helpful Answer Positive Rating
Hi,

Since I am not sure if you have more than one person using the switches (probably yes), or you have 60 persons using the switches (?), I cannot say much about the scanning frequency.

Can say more then 1 person mean's 2 person only use the switches.

Unless you are using interrupt with I2C parallel-in serial-out device like previous suggestion, make sure to update the switch scanning frequent enough so no key would be missed.

I'm not using I2C parallel-in serial-out device to control. I'm direct using Port 0 to control the 2xMultiplexer address and 2xinput to my uC that i show on previous post. What's your concent, is it the scanning will cause the key missed?

This is my temporary solution, do you got any good idea for it? or any suggestion?

Thank You.
 

What's your concent, is it the scanning will cause the key missed?

Not a big concern, it is just the scanning frequency to take care for common keypad scanning. Normal person presses any key for a finite press-&-hold time, say 10-100ms. It depends on the situation. When it is the key of a mobile phone, it could be longer like 80ms. When he is in front of a PS2 gamepad, the press time should be much smaller (for firing missile or something). Therefore we need to take care of a proper scanning frequency for the keypad and see if auto-repeat is allowed or not.

John
www.TechToys.com.hk
 

    Help

    Points: 2
    Helpful Answer Positive Rating
Hi,

Oh... Don't worry my switch only one touch. I think should be not a problem.

Thank You.
 

This is my temporary solution ..
As the rule of thumb, temporary solutions last forever .. but if this circuit works satisfactionary, what's the point of changing it ..

Regards,
IanP
 

    Help

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top