PDA

View Full Version : Data Sheet



10-29-2006, 02:32 AM
HI,
·does anybody know if there is a data sheet for the propeller,not the one that shows the hub & cogs , but one that breaks down each cog (really just one,because there all the same)? I see bean asked the same question about the video generator does this fall in with that?

Thank's Brian




Post Edited (truckwiz) : 10/28/2006 7:42:33 PM GMT

Paul Baker
10-29-2006, 03:16 AM
What level of detail are you looking for beyond Figure 1.2 and Table 1-3 of the manual?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker (mailto:pbaker@parallax.com)
Propeller Applications Engineer
[/url][url=http://www.parallax.com] (http://www.parallax.com)
Parallax, Inc. (http://www.parallax.com)

10-29-2006, 05:04 AM
Paul,
The first time I opened the book up on the 8085 , I shuttered when looked at the block diagram , then when I the book on sx (& pic ) I shuttered again ,the first time looked at the propeller block I said "well this is just a quick refrence picture " ,but let me get this straight ,say you use the MOV instruction -· am· I right in saying that you can move from any one address to any other address & theres no working register in tha middle of this?

Post Edited (truckwiz) : 10/28/2006 11:05:39 PM GMT

10-29-2006, 05:33 AM
next question ,when you make your declerations in assembly for a long where does the compiler put these, also is "long %10100110011010001000110101110010 " a CON & res 1 a VAR

Thank's Brian

cgracey
10-29-2006, 05:46 AM
truckwiz said...
Paul,
The first time I opened the book up on the 8085 , I shuttered when looked at the block diagram , then when I the book on sx (& pic ) I shuttered again ,the first time looked at the propeller block I said "well this is just a quick refrence picture " ,but let me get this straight ,say you use the MOV instrution -· am· I right in saying that you can move from any one address to any other address & theres no working register in tha middle of this?
That's right!!! It's all register-to-register within each COG.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


Chip Gracey
Parallax, Inc.

cgracey
10-29-2006, 05:49 AM
truckwiz said...
next question ,when you make your declerations in assembly for a long where does the compiler put these, also is "long %10100110011010001000110101110010 " a CON & res 1 a VAR

Thank's Brian
Defined longs will be placed in the HUB memory, but they will get sucked up into a COG if they are part of an assembly program, when that program is launched with COGNEW or COGINIT. RES's are place-holders which keep track of what will become COG ram, so that after your program loads into a COG, those offsets are now local to the COG's RAM.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


Chip Gracey
Parallax, Inc.

10-29-2006, 06:02 AM
So ,register to register means any memory address to any memory address ? I just want to clarify that this is no set registers , say bc,de,hl ......

cgracey
10-29-2006, 06:08 AM
truckwiz said...
So ,register to register means any memory address to any memory address ? I just want to clarify that this is no set registers , say bc,de,hl ......
You can look at the binary·instruction breakdown and see that there are two 9-bit fields (destination and source)·which each specify one of 512 registers. You're not hallucinating.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


Chip Gracey
Parallax, Inc.

10-29-2006, 06:15 AM
Chip,
One more & i'll leave you alone , where do the flags get set at ?

Thank's Brian

cgracey
10-29-2006, 06:26 AM
truckwiz said...
Chip,
One more & i'll leave you alone , where do the flags get set at ?

Thank's Brian
They could get set by every instruction, if you want. You must specify, after the operands, what flag(s) you want affected. There are only C and Z flags. Also, before the instruction, you can place a conditional which will gate whether or not the instruction even executes. Here is some example code:

······················· test··· stat,#1········ wc····· 'if reset flag, transmit reset command
······· if_c··········· mov···· data,#$FF
······· if_c··········· call··· #transmit

·
You can see that the 'test' instruction writes the carry because of the "wc". The other two instructions execute only if the carry is set. You can do things a lot more complex than this and really create tight functionality. You'd be surprised at how seldom any flags need to get affected. It's nice to be able to write code that isn't always dealing with·unavoidable flag updates. The conditionals that can precede instructions (like these "if_c" examples) account for every logical combination of C and Z.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


Chip Gracey
Parallax, Inc.

10-29-2006, 07:50 AM
Chip, see what happens when you( I really mean me)·have a 8 bit head in 32 bit world , da EVERYTHING is on one line of code , I was sitting here looking at the assembly code & decided to count how much room -INSTR- -ZCRI- -CON- -DEST- -SRC- took up ,and you'll never guess ,32 bit's

Thank's Brian

Post Edited (truckwiz) : 10/29/2006 1:13:17 AM GMT

10-31-2006, 10:48 AM
Ok, heres a couple more things that i'm trying to get a grasp on!

PUB Toggle
dira[16]~~
repeat
!outa[16]
waitcnt(3_000_000 + cnt)

if you look at the memory block of this code in hex this is what I see ,this is not all of it ,just the first code

20 00 02 00 = -INSTR - ZRCI _CON__ DEST_____ SRC
______________100000 0000 0000 000000001 000000000

Instrution is ADD dest to src , this is where my brain starts to melt , do I have a value of 1 in dest or is this the memory location that the real info is in , at address 001 hex
the next code is
08 00 00 00········001000 0000 0000 000000000 000000000
this in machine code is·ROR· ,am I doing this right , how can rotate right 0 or did my 000000001 sneak in here & now I have 111111111 ?

thanks ,brian

Post Edited (truckwiz) : 10/31/2006 3:01:53 AM GMT

Mike Green
10-31-2006, 11:55 AM
The main problem is that you've got a SPIN program and you're thinking in terms of assembly language.· SPIN compiles to a byte code sequence which is not described publicly.· Cliff Biffle has been documenting some of the byte codes on his website (search the forums for his name) if you're interested.

Mike Green
10-31-2006, 12:10 PM
Here's your SPIN code hand·translated into assembler.· Compile this and look at the hex produced.· I've included a dummy SPIN routine to make the compiler happy that just starts up the assembly in its own cog.


PUB dummy
· COGNEW(@toggle,0)

DAT
toggle······· mov·· DIRA,Mask16
················mov·· OUTA,#0
:loop········ xor···· OUTA,Mask16
··············· mov··· temp,TimeCnt
··············· add····temp,CNT
················waitcnt temp,#0
··············· jmp··· #:loop
Mask16····· long···|<16
TimeCnt···· long·· 3_000_000
temp········ long·· 0

·