Yes, I corrected that. Thanks.
Where do I find the reserved words? Looked through the manual. Couldn't find them.
Yes, I corrected that. Thanks.
Where do I find the reserved words? Looked through the manual. Couldn't find them.
can't answer that one, I must say I have ony read it here MANY times, so I assume it to be true. I think it might be in the front or the back in a section talking about differences from previous versions or differences from BS2. Not sure.
-Bert
The glass is not half full or half empty, Its twice as big as needed for the job!
http://foamcasualty.com/ - Warbird R/C scratch building with foam!
I'm trying to assign 4 pins from PORTA as the CHSEL f/register as follows;
CHSEL = PORTA.1.2.3.4
Get this error;
C:\PBP\PLL-CPU.BAS ERROR Line 24: Bad variable modifier: .1.2.3.4
I've tried different variations on this (1-4) (1234) etc. but with the same results.
What is the correct syntax for doing this? I only want to use these 4 pins.
Thanks Steve.
But what is this doing? I mean is it assigning pins 1 thru 4 to the CHSEL label?
And "Bitwise Mask". I don't see that in the manual. What does it mean?
There's got to be an easier way to do this than having to insert that line every time.
What is the best way to assign input pins to a register in PBP?
For that matter, how do you assign anything to a register in PBP. Can't find that in the manual either!
CHSEL VAR PORTA
This will assign the whole PORTA, all the time to chsel variable... it's a simple alias. Still, it's the WHOLE PORTA reading, you still need to remove the bit you don't want/need.
If you want to assign a single pin to a variable
A_SINGLE_PIN VAR PORTA.0
As far as I'm aware of, there's no shortcuts. Bitwise & Logical mask/operations are indeed listed in the manual, not explained as it's a basic knowledge you should already be aware of when programming. Case not, there's Wikipedia & Google
http://en.wikipedia.org/wiki/Bitwise_operation
http://www.ralphb.net/IPSubnet/logical.html
and so forth
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
chsel var byte
'
'
'
'
chsel = (PORTA>>1) & $0F
this read PORTA, shift the whole value one place to the right (to remove PORTA.0), then isolate the 4 lower bits.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Look in appendix C in your manual.
http://melabs.com/resources/pbpmanual/
"No one is completely worthless. They can always serve as a bad example."
Anonymous
Bookmarks