![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| Hi I need to mask the upper nibble & must not do any harm to the lower nibble. But this code never work. Code: movf Data,W andlw b'11110000' iorwf PORTB,F But this code works but corrupting lower nibble. Code: movf Data,W andlw b'11110000' movwf PORTB,F | |
| |
| | (permalink) | |
| Quote:
Code: andlw b'00001111'
__________________ ========================= Futz's Microcontrollers & Robotics ========================= Last edited by futz; 15th August 2008 at 03:53 AM. | ||
| |
| | (permalink) |
| Do you wish to transfer the upper nibble of Data to the upper nibble of PORTB without disturbing the lower nibble in either?
__________________ --- The days of the digital watch are numbered. --- | |
| |
| | (permalink) |
| | |
| |
| | (permalink) |
| Then first move Data to a temp variable or W and mask the lower nibble. Then mask the upper nibble of PORTB (maybe move it to a temporary variable first). Then OR them together. Maybe there's a simpler way?
__________________ ========================= Futz's Microcontrollers & Robotics ========================= Last edited by futz; 15th August 2008 at 04:15 AM. | |
| |
| | (permalink) |
| | |
| |
| | (permalink) |
| Code: movf Data,W andlw b'11110000' movwf temp1 movf PORTB,w andlw b'00001111' iorwf temp1,w movwf PORTB
__________________ ========================= Futz's Microcontrollers & Robotics ========================= | |
| |
| | (permalink) |
| | |
| |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| Title | Starter | Forum | Replies | Latest |
| Upper Cut off Frequency in Common Emitter Amplifier | Callo1234 | General Electronics Chat | 4 | 18th April 2008 05:13 PM |
| sample frequency and upper limit | Gaston | General Electronics Chat | 20 | 10th June 2007 10:22 PM |
| masking pcb through dipping - is this effective? | spyghost | Electronic Projects Design/Ideas/Reviews | 9 | 6th May 2004 01:01 PM |