Hi Martin,
This one I assume - https://forums.parallax.com/discussion/comment/1474859/#Comment_1474859
That was a snippet from the testing code that evolved and morphed as the questions arose around general idea of using the streamers for burst copying externally. There wasn't any one form of the whole thing.
The state it'll be in now will likely be a mess ... EDIT: Huh, or not. Looks like I left it as it was when I posted that snippet.
EDIT2: And you'll need to use fastspin to assemble it without modification as I'm using #define and #include. I've noted minor changes with init-diag.spin2 that need this updated so here's an update to suit the newest init-diag.
PS: First testing on revB silicon is incompatible. Will need some tuning ...
Gee, the streamer config is too different. It's going to take more effort to make them compatible with common method. Those streamer operations haven't changed, just some config bits have moved over from the S operand to the D.
EDIT: I don't want to have a common subroutine because that defeats the purpose of using assembly in timing critical ways.
fastspin can be used on its own as a command line tool. But if you are more comfortable with GUIs, by all means use flexgui (which is the new name for spin2gui), which includes fastspin as its default compiler.
The latest version of flexgui is 4.0.2 and the binary release (flexgui.zip) is available at:
I've been quite happy with using a plain text editor, Kate, so I use fastspin directly. I have a one-liner shell command for fastspin+loadp2 that I reuse all the time.
I must get this working with revB (v33), I was fiddling with the constants then got sidetracked ...
Thanks for posting the code.
I am presently trying to get your lutson to work. What I am attempting to do is get the putch and getch to work in another program to
just at first print a character.
putch
rqpin inb, #tx_pin wc 'transmiting? (C high == yes) *Needed to initiate tx
testp #tx_pin wz 'buffer free? (IN high == yes)
if_z_or_nc wypin char, #tx_pin 'write new byte to Y buffer
if_z_or_nc ret wcz 'restore C/Z flags of calling routine
jmp #putch 'wait while Smartpin is both full (nz) and transmitting (c)
I have seen this snibbet a lot but can't get it to work. Do you have a simple example of it just printing a character to the serial terminal??
Thanks
Ah, that HUBSET #0 at the beginning is for the FPGA rather than real silicon. It'll assemble fine, and even run, but the baud calculation isn't good enough so it garbles the emitted text in the terminal.
Comment it out and uncomment the three lines below, ie:
Actually, I used to leave the HUBSET #0 in place all the time ... which wasn't ideal because two consecutive clock setting operations without a pause creates extra unwanted turbulence in the PLL. Best not to do that.
Good to know, I can probably use PA or PB in most cases. That's quite old code but those uses of INB are still there in current editions ... I'll try a clean up ... err, or not, that putch routine is already using PB, and PA is often a working scratch register in the next level up.
Oh well, at this stage, I've never even looked at the debug ISR support and don't really have any plans to.
Comments
This one I assume - https://forums.parallax.com/discussion/comment/1474859/#Comment_1474859
That was a snippet from the testing code that evolved and morphed as the questions arose around general idea of using the streamers for burst copying externally. There wasn't any one form of the whole thing.
The state it'll be in now will likely be a mess ... EDIT: Huh, or not. Looks like I left it as it was when I posted that snippet.
EDIT2: And you'll need to use fastspin to assemble it without modification as I'm using #define and #include. I've noted minor changes with init-diag.spin2 that need this updated so here's an update to suit the newest init-diag.
PS: First testing on revB silicon is incompatible. Will need some tuning ...
EDIT: I don't want to have a common subroutine because that defeats the purpose of using assembly in timing critical ways.
Thank you for posting the code. I will study it.
You explain this stuff well.
Always a pleasure.
Martin
The latest version of flexgui is 4.0.2 and the binary release (flexgui.zip) is available at:
https://patreon.com/totalspectrum
or
https://github.com/totalspectrum/flexgui/releases/latest
I've been quite happy with using a plain text editor, Kate, so I use fastspin directly. I have a one-liner shell command for fastspin+loadp2 that I reuse all the time.
I must get this working with revB (v33), I was fiddling with the constants then got sidetracked ...
Thanks for posting the code.
I am presently trying to get your lutson to work. What I am attempting to do is get the putch and getch to work in another program to
just at first print a character.
putch
rqpin inb, #tx_pin wc 'transmiting? (C high == yes) *Needed to initiate tx
testp #tx_pin wz 'buffer free? (IN high == yes)
if_z_or_nc wypin char, #tx_pin 'write new byte to Y buffer
if_z_or_nc ret wcz 'restore C/Z flags of calling routine
jmp #putch 'wait while Smartpin is both full (nz) and transmitting (c)
I have seen this snibbet a lot but can't get it to work. Do you have a simple example of it just printing a character to the serial terminal??
Thanks
Comment it out and uncomment the three lines below, ie:
Just FYI.
Oh well, at this stage, I've never even looked at the debug ISR support and don't really have any plans to.
Are you sure about that? I think I protected it from non-debug-mode writes. I will look.