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

Exact match. Not showing close matches.
PICList Thread
'[PIC] f877 bank selection problem'
2005\12\13@053949 by Markjanssen

flavicon
face
I'm using a pic f877 to do an A/D conversion and read the result of this conversion to a LCD display. The problem is that I can't configure the pic as needed. I can't acces the bank1 registers from the pic, so I can't configure the A/D module. I'm using the jal language to program the pic. Also I''ve tried to embed a piece of assembly code in this jal code, but i still wasn't able to change the registers of bank1. Only a general purpose register could be configured but also not all of them.. I've used the rp0 and rp1 bits from the status register to select a bank and tried different examples found on the internet doing it the same way I'm trying, but they don't seem to have any problems.. Does anyone have an idea of what could be wrong??

2005\12\13@060102 by Jinx

face picon face
> Does anyone have an idea of what could be wrong ? ?

Do you have the AD pin(s) as i/p ?

2005\12\13@062308 by Markjanssen

flavicon
face
yes, i have everything configured as it should be, but since i can't write to any of the bank1 regs, i can't congifure ADCON1 and so the port configuration for vref+ and the analog channels etc, can't be made.




---- Jinx <spam_OUTjoecolquittTakeThisOuTspamclear.net.nz> schrijft:
> > Does anyone have an idea of what could be wrong ? ?
>
> Do you have the AD pin(s) as i/p ?
>
> --

2005\12\13@064331 by Jinx

face picon face
> i can't congifure ADCON1 and so the port configuration for
> vref+ and the analog channels etc, can't be made

How are you looking at this to be able to say that you can't access
Bank1 ? For example is MPLAB (or whatever it is you're using)
not working in simulation or are you actually programming the PIC
and it doesn't do what it's supposed to ?

Tried another PIC ?

> yes, i have everything configured as it should be

Does that include TRIS ?

Joe confused.........

2005\12\13@071617 by Markjanssen

flavicon
face
I'm programming the pic with jal so i'm using the jal compiler in combination with a programmer. I'm programming the pic and reading out the values from a few registers (for example adcon0) to the lcd. when changing values in registers located in bank0, i can see the register value does change by reading out the values to the lcd. when i try to do the same for example with adcon1 (located in bank1), i don't get the values just written to that register on the lcd, but just a random value that doesn't make sense. i've already tried another pic and i did configure the tris regs

hope you get my problem a bit more.. basically i can't write to registers located in other banks then bank0.


---- Jinx <.....joecolquittKILLspamspam@spam@clear.net.nz> schrijft:
{Quote hidden}

> --

2005\12\13@073906 by Jinx

face picon face
> i did configure the tris regs

Which are in Bank1, so ?????

What code did you use to access TRIS ? Something like

bsf     status,rp0
bcf     status,rp1
bcf     status,irp

I wonder if you're accessing ADCON1's position in Bank2 or
Bank3, both of which are GPRs and may have undetermined
values

> hope you get my problem a bit more....

Kind of see what you're getting at now. But don't understand it
at all

> i don't get the values just written to that register on the lcd, but
> just a random value that doesn't make sense

You say "random", but is it repeatable ? That may be a clue

2005\12\13@080403 by Alan B. Pearce

face picon face
>I'm programming the pic with jal so i'm using the jal compiler in
>combination with a programmer. I'm programming the pic and
>reading out the values from a few registers (for example adcon0)
>to the lcd. when changing values in registers located in bank0, i
>can see the register value does change by reading out the values
>to the lcd. when i try to do the same for example with adcon1
>(located in bank1), i don't get the values just written to that register
>on the lcd, but just a random value that doesn't make sense.
>i've already tried another pic and i did configure the tris regs

I haven't used JAL, but wonder the following questions.

1. Does JAL automatically issue bank switch instructions if you attempt
access to a register in a different bank to the last access?

2. What is the actual code you are using to access the ADCON0 register, and
display it on the LCD. It seems to me that there could be something else
wrong in your code, instead of an access to a register problem.

2005\12\13@174152 by Wouter van Ooijen

face picon face
> I'm programming the pic with jal so i'm using the jal

You know there is a Jal-specific list on yahoo?

> when i try to do the same
> for example with adcon1 (located in bank1), i don't get the
> values just written to that register on the lcd, but just a
> random value that doesn't make sense.

you know that (except on the latest Jal version(s)) you must do bank switching yourself?

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products
docent Hogeschool van Utrecht: http://www.voti.nl/hvu



2005\12\14@071059 by Markjanssen

flavicon
face
hallo wouter,

bedankt voor je reactie, ik heb geloof ik de laatste versie van jal en wat ik uit de code van een included file kon halen, zou het ook "automatisch" werken. maar ik heb uiteraard ook zelf zitten proberen om tussen banks te switchen, en zelfs nog geprobeerd om het via een stuk assembly te doen. ik heb ook de programmer e.d. bij u bestelt na aanraden van een vriend van me die best veel ervaring heeft met pic's. hij heeft me ook al geholpen met het probleem maar we komen er nog steeds niet uit.. hij dacht dat het misschien ook een fout in de compiler kon zijn, maar dan zouden meer mensen dit probleem moeten hebben lijkt me!?
het typische is dat wanneer ik een general purpose reg uit bank1 aanspreek dat dit bij sommige ervan wel werkt maar bij andere ook weer niet. om het verhaal nog maar eens onduidelijker te maken..
dat van de yahoo mailinglist wist ik niet, ik zal daar ook eens gaan kijken dan. heeft u nog een idee wat verder het probleem zou kunnen zijn?

met vriendelijke groet,

Mark

---- Wouter van Ooijen <wouterspamKILLspamvoti.nl> schrijft:
{Quote hidden}

> --

2005\12\14@092317 by Anno, Jeff

flavicon
face
Ok... I translated this message to english in a free translator to see what
it would come up with... (See Below)

for your reaction, I, I believe have thanks the last version of jal and what
I from the code of an included line wanted to get, will "automatically" work
have be trying it also. only I naturally also self between banks to
switchen, and even yet it tried have program orders advise to do via a to
pieces assembly. I also the e. d. there you after of a friend from That best
many experience has with pic's. he has me in such a way helped with the
problem only we come there still not from.. he thought that the perhaps also
a mistake in the compiler wanted to be, but then will more men this problem
must have appears me!?  The typical is that when I a general purpose rain
from BANK1 speak to that this by some of it well works but by others also
again not. the story yet but once more indistinctly to make.  Did that of
the yahoo mailinglist not know will go look has I, I that also once then.
you yet an idea what further the problem would be able to be?  

It made more sense to me when it was in Dutch and I don't read or speak
Dutch. ;)

-Jeff



{Original Message removed}

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