classic RMW read modify write
watch this
http://www.microchip.com/webinars.mi...cName=en556253
click on
View streaming media version:
classic RMW read modify write
watch this
http://www.microchip.com/webinars.mi...cName=en556253
click on
View streaming media version:
Warning I'm not a teacher
sorry the link did not paste in properly
http://www.microchip.com/webinars.mi...cName=en556253
Warning I'm not a teacher
No problem, your reminding me about the RMW made me remember the "glitch" in the 16F series PIC. I simply changed my code to writing to the complete port at once rather than individual bits. I.E. portb = %00000001 to turn on portb.0 and portb = %00000011 to keep portb.0 on while turning on portb.1. Works like a charm, many thanks for the assistance.
Randy Abernathy
Bit masking is another method, using the AND and OR (& = AND, | = OR). AND is a way to turn off selected pins without affecting others: LATB = PORTB & 111110 would turn off PORTB.0. LATB = PORTB | 000001 would turn on PORTB.0. LATB = PORTB & 110000 would turn off the low nibble while LATB = PORTB | 001111 would turn on the lower nibble. Doing it this way leaves the pins you don't want to mess with alone. They remain totally unaffected. This would apply to pins tied to PWM, INTERRUPTS, or anything else.
Bookmarks