ASM - Pin Assignments ?
Areal Person
Posts: 197
Hi,
I'm using·three ASM drivers that makes pin assignments at the bottom
area of each asm file.
They look like this...
FILE 1.
outs··· long· 7············· 'For pins P0 and P1 and P2 as out· (P2 is XLAT)
FILE 2.
outs··· long· 192·········· 'For pins P6 and P7 as out··
FILE 3.
outs··· long· 768···········'For pins P8 and P9 as out
QUESTION:
How does these lines of code work, I need to add a extra pin·XLAT (like the first does) to the second
and third lines. How do I figure this ?
What would the longs be if I needed this? ...
FILE 2.
outs··· long··????·········· 'For pins P6 and P7 and P8 as out (P8 is XLAT)··
FILE 3.
outs··· long··????···········'For pins P9 and P10 and P11 as out (P11 is XLAT)
I need to learn how to do it for myself as I may need to change pins.
But How does it work ??··Is there a standard formula I can use ?
Thanks for the help,
Areal
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I have a tree growing out of my head, but
what do you expect ? I'm a programmer.
Post Edited (Areal Person) : 11/19/2007 4:32:57 PM GMT
I'm using·three ASM drivers that makes pin assignments at the bottom
area of each asm file.
They look like this...
FILE 1.
outs··· long· 7············· 'For pins P0 and P1 and P2 as out· (P2 is XLAT)
FILE 2.
outs··· long· 192·········· 'For pins P6 and P7 as out··
FILE 3.
outs··· long· 768···········'For pins P8 and P9 as out
QUESTION:
How does these lines of code work, I need to add a extra pin·XLAT (like the first does) to the second
and third lines. How do I figure this ?
What would the longs be if I needed this? ...
FILE 2.
outs··· long··????·········· 'For pins P6 and P7 and P8 as out (P8 is XLAT)··
FILE 3.
outs··· long··????···········'For pins P9 and P10 and P11 as out (P11 is XLAT)
I need to learn how to do it for myself as I may need to change pins.
But How does it work ??··Is there a standard formula I can use ?
Thanks for the help,
Areal
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I have a tree growing out of my head, but
what do you expect ? I'm a programmer.
Post Edited (Areal Person) : 11/19/2007 4:32:57 PM GMT
Comments
To update to include your XLAT pin then it's a simple case of seteting the correct bit
Easier still ...
I have to admit it's a personal hate of mine when people take numbers which make sense in binary ( or hexadecimal ) and express those as decimal.
Post Edited (hippy) : 11/19/2007 5:06:55 PM GMT
> express those as decimal.
Called "magic numbers" and a bad habit for some programmers (and a reason to be fired).
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO
That helped me out, but I'm still kinda lost...
e.g...
16········ 15···· 14···· 13···· 12··· 11··· 10··· 9···· 8·· 7··· 6·· 5· 4 3 2 1
16384, 8192, 4096, 2048, 1024, 512, 256, 128, 64, 32, 18, 8, 4,2,1,0
Thus...
long %00000000_00000111 ' 2, 1, 0 = 7 How does it = 7 ?? I'm lost (2+1+0) = 3
OR IS IT ??? ...
··················································································
15········ 14···· 13···· 12···· 11··· 10····9····· 8····7···6··· 5·· 4· 3 2 1
16384, 8192, 4096, 2048, 1024, 512, 256, 128, 64, 32, 18, 8, 4,2,1
····························································position······················· 2 1· 0
long %00000000_00000111 ' 2, 1, 0 = 7 How does it = 7 ?? I'm lost (4+2+1) = 7
What am I missing, I dont understand
-Areal
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I have a tree growing out of my head, but
what do you expect ? I'm a programmer.
Post Edited (Areal Person) : 11/19/2007 5:47:08 PM GMT
long %00000000_00000111 '·4+2+1 = 7
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I have a tree growing out of my head, but
what do you expect ? I'm a programmer.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
What does the #4 mean/do in the first line of this asm code ?
Is it a pin assignmnt of p4 ? Or what ?
{{........................................................}}
mov t3,#4 wz ' Clock Pin
muxnz outa,t3 ' Set XLAT Pin HIGH
muxz outa,t3 ' Set XLAT Pin LOW
{{........................................................}}
Thanks,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I have a tree growing out of my head, but
what do you expect ? I'm a programmer.
Moves the constant value four to the variable named "t3" and clears the Z flag ( four is not zero )
muxnz outa,t3 ' Set XLAT Pin HIGH
Sets bit 2 of OUTA ( ie, Pin2 ) to !Z, makes it a one ( Z is zero )
muxz outa,t3 ' Set XLAT Pin LOW
Sets bit 2 of OUTA ( ie, Pin2 ) to Z, makes it a zero ( Z is zero )
I went back and looked up muxnz.
I dont understand how moving #4 into t3 can reference bit 2
of outa.
Is there a explanation ?
I'm trying to move the XLAT·pin from pin 2 to pin P10
Would I use mov t3,#20 wz··· ? Is that correct ?
Is there an easy way to figure the constant needed ?
Thanks for the help
{{........................................................}}
mov t3,#4 wz ' Clock Pin
muxnz outa,t3 ' Set XLAT Pin HIGH
muxz outa,t3 ' Set XLAT Pin LOW
{{........................................................}}
-Areal
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I have a tree growing out of my head, but
what do you expect ? I'm a programmer.
Post Edited (Areal Person) : 11/20/2007 10:08:38 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I have a tree growing out of my head, but
what do you expect ? I'm a programmer.
Yes, we're back to binary again ...
No offence, but your signature doesn't seem to be very accurate ? Not the tree reference, that bit about being a programmer.
0,1,2,3, 4, 5, 6,· 7,· 8,· 9,· 10,· 11,· 12,· 13,·· 14,·· 15 (from memory) is:
1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768
every programmer should have at least the first 11 values memorized and should be able to recite the first 8 forwards or backwards.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
Also to be memorized :
2**10 is around 1000 (1k)
2*20 is around a million (1M)
2*30 is around a billion (1G)
2*32 is around 4 billion
4 billion devided by 80 million = 50
project ever, it’s also the first time I have ever worked with a MCU.
It’s a very important project, as my job depends on it. (I don’t really know
how I got myself into this problem.)
I do program, but at a higher aplication level (Transaction level, abstraction design etc...).
I just wanted to say thank you to Mr. Hippy and to everyone else
for helping me with this very much.
I promise I will do my best in the future not to abuse the privilege of asking basic questions that I should know. I’m under allot pressure to perform.
Again, Thank you very much, I hope everyone has a Happy Thanksgiving and eat lot's of Turkey [noparse]:)[/noparse]
-Mark (aka Areal Person)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I have a tree growing out of my head, but
what do you expect ? I'm a programmer.
You're welcome and do ask. I doubt I could do what you do best, so I was a bit harsh. Happy thanksgiving - we don't do that here in the UK, have to wait a full month before we get Turkey and all the trimmings
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.