Re:A Guide to Pic Microcontroller Paging
by indigo945 on Saturday June 13, 2020 @05:19PM
(#23512828)
Does the code even work at all? I don't know anything about PIC microcontrollers, but I would have expected that writing to PCLACH would cause a jump immediately, meaning that the write to the low bits in PCL would never even happen.
[ Parent
| on HN ]
Re:A Guide to Pic Microcontroller Paging
by roamingryan on Saturday June 13, 2020 @08:10PM
(#23513979)
PCLATH stands for Program Counter LATch High (byte).
In this case latch refers to the digital design technique where you have a register that holds bit(s) until some other event happens. The event in this case is a write to PCL. Once the event occurs, PCLATH is transferred to PCH synchronously/atomically with the write to PCL.
We can write to PCLATH without causing a jump. PCLATH is only read when we goto somewhere, or call a routine, or write to PCL.