PDA

View Full Version : help with 74hc595 2 ic cascaded drive 16 relay



m_flfl
- 30th September 2012, 02:02
help with 74hc595 2 ic cascaded drive 16 relay. i want control any port of 74ch595 without changing the status of other ports using pic 16f877a

kellyseye
- 30th September 2012, 13:13
OR the existing port register with the bit pattern of the ports you want to change.

i.e existing port state 01001010
required port state 11001010

OR-ing them results 11001010

note that only the FIRST bit changes the port state output, the remainder stay the same.

m_flfl
- 1st October 2012, 09:35
How i can do this by math

kellyseye
- 1st October 2012, 13:34
eh? When you are programming the output port you are writing a bit-pattern to it (8 bits = 1 word, usually a hex value but could be straight binary or even decimal depending on the method you decided to use when programming).

The logical OR function is part of the programming language and is - I suppose - the 'math' you are referring to.