Shop OBEX P1 Docs P2 Docs Learn Events
RFWord question — Parallax Forums

RFWord question

Should RFWord read sequential words from hub?
Was hoping so but it appears to instead read the upper words of sequential longs.
I.e., skipping every other word....

Comments

  • RDFAST
    (Chip)
    RDFAST #0,startbyteaddress
    Once you do that, 'RFBYTE D (WC,WZ)' can be used to read contiguous bytes, starting from startbyteaddress. RFBYTE means 'read fast byte' and it always takes 2 clocks - meaning RDFAST blocks waiting for Hub. RDFAST initiates the read-fast mode. This doesn't work with hub exec, because hub exec uses the RDFAST mode, itself. That first D/# term in RDFAST tells how many 64-byte blocks to read before wrapping back to
    startbyteaddress (0= infinite). To make wrapping work, startbyteaddress must be longaligned.

    WRFAST works the same way, and uses WFBYTE, WFWORD, WFLONG.
    NOTE: Makes use of the Cog’s FIFO Unit. This is also used by HubExec and the Streamer - Mutually exclusive.

    That quote was cut from the P2 Assembly Instruction Set document which is linked somewhere in this forum. My copy may well be out of date now?
  • RaymanRayman Posts: 14,768
    This is what I'm trying:
    'Fast Read in 480 words from hub
    		rdfast	#15,##hubLine1
    		
    		'Push out 480 16-bit colors
    		rep	#3,#480	
    		rfword	x
    		setword	outa,x,#0
    		setb	outa,#PinPclk 'toggle clock
    		clrb	outa,#PinPclk
    

    It doesn't seem to be working right, but maybe I'm doing something wrong...
  • Rayman wrote: »
    It doesn't seem to be working right, but maybe I'm doing something wrong...

    Is your data in HUB long aligned? Place an alignl on a blank line before the declaration for hubLine1.

  • RaymanRayman Posts: 14,768
    No effect... I think it was already aligned via ORH anyway...
    Here's the data in HUB:
    orgh $1000
    alignl
    HubLine1
    		long	$0000FFFF[240]
    

    This paints screen all black because it's only reading the upper words...
  • Rayman wrote: »
    No effect... I think it was already aligned via ORH anyway...

    This paints screen all black because it's only reading the upper words...

    I would say that was long aligned, with an orgh and an alignl that's double precision alignment.

    I would guess you should be reading $ffff, $0000, $ffff, $0000, etc ?

    Do you get anything if you change the declaration to $ffff0000 ?
  • @Rayman

    Better yet, set them to some none 0 and none ff values, say $0001fefe.
  • RaymanRayman Posts: 14,768
    I think I've found I have some kind of weird hardware issue...

    If I pick different colors, it works...
  • Rayman wrote: »
    I think I've found I have some kind of weird hardware issue...

    If I pick different colors, it works...

    Read this, it may be connected?
    forums.parallax.com/discussion/162569/streamers-absolute-addressing
  • This almost sounds like the SETQ2/WRLONG $FF mask behavior.

    What do you get for $AAFFFFAA? $AA00,$00AA?
  • Seairth wrote: »
    This almost sounds like the SETQ2/WRLONG $FF mask behavior.

    It's all very confusing at this stage. And trying to remember what is and what isn't, and what will be.

    Another 15 minutes and the clocks go back ... I can stay up later tonight (morning)!

  • RaymanRayman Posts: 14,768
    I'm very confused now...

    $AAFFFFAA works fine. $FFFF0000 or $FFFFFFFF or $0000FFFF don't work...

    It seems like it hangs with those...

    I'm not sure it's my hardware anymore...
  • Perhaps it;s because you are reading words and at least one word has $ffff which perhaps skips the operation?

    I think you will need Chip to clarify the current and future correct operation.
  • jmgjmg Posts: 15,175
    Rayman wrote: »
    $AAFFFFAA works fine. $FFFF0000 or $FFFFFFFF or $0000FFFF don't work...

    What about $FE patterns ?

  • cgraceycgracey Posts: 14,208
    edited 2015-10-25 03:01
    Rayman wrote: »
    Should RFWord read sequential words from hub?
    Was hoping so but it appears to instead read the upper words of sequential longs.
    I.e., skipping every other word....

    RFWORD should read sequential words from hub. You need to do a RDFAST first, though, to get the hub FIFO interface in the read mode.

    This worked at one time, but I might have broken it. I will look at it tonight.
  • RaymanRayman Posts: 14,768
    Well, forget about that skipping thing...
    I think either P2 or LCD just plain froze up.

    Very strange. Since I'm doing setword I don't think what actually gets read should make any difference and yet $FFFF_FFFF makes it hang up...

    Still could be some hardware issue, I'm using a lot of jumper wires right now...
  • jmgjmg Posts: 15,175
    Rayman wrote: »
    ...

    Very strange. Since I'm doing setword I don't think what actually gets read should make any difference and yet $FFFF_FFFF makes it hang up...

    Still could be some hardware issue, I'm using a lot of jumper wires right now...
    Something that relies on 'some number of bits low', just might be lacking proper ground connections ?
  • RaymanRayman Posts: 14,768
    edited 2015-10-25 04:31
    That might be... It may be going from $ FFFF to $0000 on color makes it hang. Might be an electrical issue with connections...
  • Rayman wrote: »
    Might be an electrical issue with connections...

    On an FPGA?

  • cgraceycgracey Posts: 14,208
    cgracey wrote: »
    Rayman wrote: »
    Should RFWord read sequential words from hub?
    Was hoping so but it appears to instead read the upper words of sequential longs.
    I.e., skipping every other word....

    RFWORD should read sequential words from hub. You need to do a RDFAST first, though, to get the hub FIFO interface in the read mode.

    This worked at one time, but I might have broken it. I will look at it tonight.

    I tested RFBYTE/RFWORD/RFLONG and they all worked as expected.
  • RaymanRayman Posts: 14,768
    edited 2015-10-25 14:59
    Thanks. I think I found my issue is the jumper wires I'm using in my test setup...

    Seems I have some crosstalk between wires...
    I added an extra ground wire, added a bypass cap and moved some wires around and it's all better now.

    Sorry for the false alarm.
  • cgraceycgracey Posts: 14,208
    That's a relief!
Sign In or Register to comment.