Hi,
I tried to use the code above but it dosen't work, I'm using PBP 2.45,
does anyone could give me any tips about it?
Ciao
Alan
Joka kuritta kasvaa se kunniatta kuole
Originally Posted by Ingvar
Hi,
I tried to use the code above but it dosen't work, I'm using PBP 2.45,
does anyone could give me any tips about it?
Ciao
Alan
Joka kuritta kasvaa se kunniatta kuole
Originally Posted by Ingvar
Careful Ingvar...
It only works on a very few PICs in a very few cases...
It does NOT work across all PICs and neither does it work against variants of the same PIC or versions of PICBasic.
I actually withdrew a posting I made about a year ago detailing the very same thing when I discovered that in all probability the chances of it NOT working are greater than the chances of success.
The only guaranteed things to work are the sixteen pins (0-15) as detailed in the manual, and then they are PIC type dependant (as per the table in the manual).
Gday Mel
I have been watching this post with interest.
I know the array id method listed works for 16F876s 16F84s and 16F88s,
but looking at the datasheets Ports A,B and C are all contiguous in memory
ie x05, x06 etc.
on 12/3 this year PeterDeco posted re a similar problem, and whilst misinterpreting the post, tried portA.0 + X rather than portA.0(X), and said this also worked.
Based on the fact "PortA" just gets referenced to its memory locn via the include files, say x05 in a 16f88, is it possible ( knowing the memory map for the specific pic/variant ), to use a calculated reference point, rather than assume the bits are contiguous and ref by array practices.
Basically, what i am saying is do the functions that "expect a port" reference need it to come in as a standard symbol, or would the correct memory offset ( as a variable ) suffice.
I cant test, as i dont know how to make it fail currently ( under the old method ) with the chips i normally play with.
Andrew
I spent quite a while (at least for me) on this last year.
I concluded that if it can't work across all PICs and all versions of PICBasic consistantly everytime, it shouldn't be used.
The only ways I address PIC pins is by aliasing the pin or by using the direct numeric (0-15).
The offset addressing method works for RAM and I've detailed this in the FAQ section, but I cannot reliably apply the same to Port Addressing. I have not redone my tests on V2.45 which had not been released at that time.
Bummer, i 've only used it once on ports and it worked just as expected. Good to know that it might not the next time .......
Bookmarks