Searching \ for '[PIC]:16f877 - page jumps?' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/microchip/devices.htm?key=16F
Search entire site for: '16f877 - page jumps?'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]:16f877 - page jumps?'
2001\10\28@191020 by Ian Hynes

flavicon
face
PICers,

I've been experimenting with 16F877 on MPLAB 5.4 - Tony Nixon & some other
guys were helpful. (I just upgraded from win95 to Win98 & now I'm locked
outa my former email files so please excuse the the silence these last two
weeks!)

Anyway ... changing pages in the F877. This routine should work in the
16c57 which I'm sorta used to but the PC resets to start (org 0x00) in
Page_0 when  I make the call to SUBR_11. Errr ... what am I missing here?   :(

main    call     init         ;Initialise the ports

setint
        Bank_1
        movlw    b'10000000'  ;
        movwf    OPTION_REG
        Bank_0
        clrf     TMR0
        movlw    b'10011000'  ;Enable the interrupts
        movwf    INTCON
        Bank_1
        call     subr_11
fin     goto     $            ;Terminate the programme.

;*****************************************************************
;PAGE #1
;*****************************************************************
        org     0x0800
subr_11
        nop
        movwf  temp_10
        Bank_0
        retlw  0x00

--
http://www.piclist.com hint: To leave the PICList
spam_OUTpiclist-unsubscribe-requestTakeThisOuTspammitvma.mit.edu


2001\10\28@193621 by Ned Konz

flavicon
face
On Sunday 28 October 2001 04:04 pm, Ian Hynes wrote:

> Anyway ... changing pages in the F877. This routine should work in the
> 16c57 which I'm sorta used to but the PC resets to start (org 0x00) in
> Page_0 when  I make the call to SUBR_11. Errr ... what am I missing here?

There's two kinds of paging: RAM paging and program ROM paging. That is, two
different SFR's whose high byte would need to be changed.

The macro Bank_1 is only working on one of those (probably RAM).

If you're generating object files, you can get the linker to take care of
this for you with the BANKSEL and PAGESEL macros.

--
Ned Konz
currently: Stanwood, WA
email:     .....nedKILLspamspam@spam@bike-nomad.com
homepage:  http://bike-nomad.com

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestspamKILLspammitvma.mit.edu


2001\10\28@193637 by Tony Nixon

flavicon
picon face
Ian Hynes wrote:
{Quote hidden}

You are using RAM bank MACROs instead of changing the ROM bank.

You can use something like this...

       movlw High(subr_11)     ; set PCLATH for ROM page
       movwf PCLATH            ; where this routine is
       call subr_11            ; call it
       movlw High($)           ; set PCLATH back to this
       movwf PCLATH            ; ROM page

Be careful when using this type of code around ROM page boundaries
(every 2K) or you may get code operational errors.

This PDF file explains the PCLATH and has code examples with and without
bugs that you can use with MPLAB.

http://www.bubblesoftonline.com/projects.zip

--
Best regards

Tony

mICros
http://www.bubblesoftonline.com
.....salesKILLspamspam.....bubblesoftonline.com

--
http://www.piclist.com hint: To leave the PICList
EraseMEpiclist-unsubscribe-requestspam_OUTspamTakeThisOuTmitvma.mit.edu


2001\10\29@160625 by Olin Lathrop

face picon face
> ... but the PC resets to start (org 0x00) in
> Page_0 when  I make the call to SUBR_11. Errr ... what am I missing here?
:(

You are missing PCLATH.  See section 2.3, "PCL and PCLATH" on page 26 (of
DS30292C anyway).


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, olinspamspam_OUTembedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\10\29@160632 by Olin Lathrop

face picon face
> If you're generating object files, you can get the linker to take care of
> this for you with the BANKSEL and PAGESEL macros.

You might also want to look at my GCALL (Global CALL) and GJUMP (Global
JUMP) and related macros in STD.INS.ASPIC at http://www.embedinc.com/pic.


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, @spam@olinKILLspamspamembedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...