Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 18th December 2004, 01:44 PM   (permalink)
Default PCLATH

I am working with a disassembly listing that uses the 16F877 and it is full of instructions modifing PCLATH.

I am converting it to run on a 16F628 and would like to know when an
operation to PCLATH is required??

I have read the datasheets and it just has to be simple way to determine
when to use one.

Would appreciate any explanation!!!!

Thanks

I use MPLAB and WINPINPRO.
heida11 is offline  
Old 18th December 2004, 02:18 PM   (permalink)
Default Re: PCLATH

Quote:
Originally Posted by heida11
I am working with a disassembly listing that uses the 16F877 and it is full of instructions modifing PCLATH.

I am converting it to run on a 16F628 and would like to know when an
operation to PCLATH is required??
A PIC can address only 2K of program memory, so for the 16F877 you need paging instructions for jumps outside the current 2K page. The 16F628 only has 2K memory, so you don't have any paging problems.

So generally you don't need all the paging instructions with a 628.

The original program was most probably written using a high level language, these usually insert paging instructions even when they are not needed.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 19th December 2004, 01:15 PM   (permalink)
Default

Thanks Nigel!

It makes sense now.

I will set up the code like I usually do for a 628 and it will be a lot simpler to debug and a lot smaller.

Yes, the hex file was generated from some sort of basic compiler.

I stick with ASM for the PICs though.

Happy Holdays!
heida11 is offline  
Reply

Bookmarks

Thread Tools
Display Modes





All times are GMT. The time now is 07:47 AM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker