@lmclaren - you don't need to load in that example as it is for an older version, all that stuff is already loaded in NEON (as is loads of other stuff)
@lmclaren - just have a look at the EXTEND source in the V5 Dropbox folder. V5 updated some of the methods but essentially they're the same
pub PING ( trig echo -- us )
--- setup WAITPxx mask
MASK 4 COG!
--- 10us trigger (dummy cycles)
DUP HIGH 10 us LOW
--- detect high period
WAITHI WAITLO
--- calculate high period
1 COG@ 2 COG@ - ABS
--- convert cycles to us
CLKMHZ U/
;
--- return with the range in mm using trig pin and echo pin
pub DISTANCE ( trig echo -- distance.mm ) PING 170145 1M */ ;
I had spent some time trying to convert and had guessed the WAITHI and WAITLO but did not understand the COG@ enough to work it out.
best regards
moving the COGREGs to start from address 1 as Peter did recently
made it possible to get rid of COGREG! and just use COG!
- and also COG@ for reading.
I am following Peter since Tachyon 1.x or even 0.y - feels very long ago
and dozens maybe a hundred times my code did not run anymore
because Peter just the other day did a little tweaking
or a complete redesign ...
Reading / searching the source usually shows it quickly.
I keep all the old Tachyon versions around so I can easily compare what happened ...
but look at it - what great outcome it is
When Peter fully switches to P2-only mode times might get a bit slower for P1-Tachyon ...
and Tachyon will 'mature'.
with my attempts to upgrade to v5r2 I will give some feedback:
- I appreciate that OFF ANYCASE has been removed
- I saw there is a .git directory in the dropbox - yay - this will increase our fun a lot in future work - definitely a right decision Peter.
- trying to upgrade my iot5500 module to v5r2 had difficulties with lsio . I definitely would remove lsio from the boot sequence - it toggles outputs and this can disturb sensible periphereal i/o. It is a really nice tool to investigate unnknown hardware, but in my opinion it has nothing to do in a standard boot sequence
- COMPACT isn't necessary anymore. because the "dictionary full" error occured I replaced it by RECLAIM to get everything packed into the iot5500 .
- With these minor changes the build advanced since EASYNET which I could not yet successfully load. Here is the output
.. IFDEF W5500
...
... TACHYON V5 Propeller .:.:--TACHYON--:.:. Forth V5r2 NEON 520180323.2200
0100 ok ??? ok
0133 ??? in GATEWAY at @gateway
0134 ??? in SUBNET at @subnet �
0135 ??? in MAC at @mac �
0136 ??? in SIP at @sip �
0200 ??? ??? ok �
0264 ??? in sCONNECTED? at &CON
����in sCONNECTED? at &CON
0265 ??? in sDISCON? at &DISCON �
0271 ??? in PORT! at @ports �
0300 ok �
0304 ??? in WAITSEND at &SENDOK
0308 ??? in WAITSEND at &SENDOK �
0320 ??? in LANSEND at &SENDOK �
0388 ??? in WCOLD at myGW �
����in WCOLD at @gateway
0389 ??? in WCOLD at myIP �
����in WCOLD at @sip
0390 ??? in WCOLD at mySN �
����in WCOLD at @subnet
0391 ??? in WCOLD at @mac �
0392 ??? in WCOLD at @ports
0393 ??? in WCOLD at @wcold �
0400 �
0408 ??? in !WIZIP at @wcold
0409 ??? in !WIZIP at @gateway
0410 ??? in !WIZIP at @subnet �
0411 ??? in !WIZIP at @sip �
0412 ??? in !WIZIP at @mac �
0413 ??? in !WIZIP at @ports
0585 ??? in BLKSEND at BUFSIZ
0600 �
0700
0729 ??? in ?TELNET at TELNET
0800 ok �
0845 ??? in !EASYNET at TELNET
0882 �
End of source code, 0070 errors found Load time = 44.5
Code bytes used = 2468
CODE:$51FE = 20478 bytes
NAME:$5644 = 7612 bytes
DATA:$786F = 863 bytes
FREE: = 1094 bytes
Data Stack (0)
ok
...
... ---
... errors W@ NOT IF ' ifup +INIT THEN ok
...
... ?BACKUP BACKUP ok
...
... ---
... &13.12.15.14 WIZPINS ( P1372 ) ok
... \
... &17.1.19.18 WIZPINS ok
... BACKUP BACKUP ok
No, but I favor the more verbose form PRINT in source code as it stands out rather than the obscure dot whereas the dot is easier to use interactively. Getting rather annoyed of typing interactive sequence where I would have add SPACE after every . I then changed the . to add a space The PRINT word however does not add any spaces.
BTW, sorry about the == vs := thing. I fixed the EASYNET source. I was never really happy with saying == but I was never happy with the clunky and overwhelming CONSTANT word either. I think := is a better description because in Spin we assign a value to a symbol. In this case it is clear it is not a comparison but an assignment. Since V5 is a new version (NEON) I took advantage of that fact!
Clean looks where I can easily spot the value and the name
4 := W
but I don't insist on this every spin programmer would laugh at us although it would implicit increased meaning.
telnet isn't yet working correctly on the iot5500. I get strange crashes and there seems to be a problem with the terminal settings because I have to use putty or even worse M$ telnet and I don't remember the correct terminal settings for putty ... grmbl.
Does anybody who can post have a putty config which is working with tachyon telnet?
but I don't insist on this every spin programmer would laugh at us although it would implicit increased meaning.
telnet isn't yet working correctly on the iot5500. I get strange crashes and there seems to be a problem with the terminal settings because I have to use putty or even worse M$ telnet and I don't remember the correct terminal settings for putty ... grmbl.
Does anybody who can post have a putty config which is working with tachyon telnet?
Best regards,
proplem
I had this all running just a few weeks ago so I will check it out again just in case. I just need to put some finishing touches to the P2 ROM this weekend.
1. In my last posts I forgot to mention that there is a small typo in EASYNET.FTH line 88 (PUBIC instead of PUBLIC). This is still in your dropbox repository.
2. CFA>NFA seems to be removed. How can I emulate it? Maybe you remember I asked for that some time ago and were happy to get managed with it:
pub VARNAME$ ( var-address .. strptr ) --- get the address of the name of the variable address on TOS
\ --- MJB: http://forums.parallax.com/discussion/comment/1424389/#Comment_1424389
\ usage: long myvar myvar VARNAME$ PRINT$
$8000 OR CFA>NFA 1+ ;
pub TABNAME$ ( table-address .. strptr ) --- get the address of the name of the table address on TOS
\ --- MJB: http://forums.parallax.com/discussion/comment/1424389/#Comment_1424389
\ usage: TABLE mytable mytable TABNAME$ PRINT$
\ usage2: for a better example see UARTCOG.FTH::.UART
2- CFA>NFA 1+ ;
pub FETCHNAME
CFA>NFA 1+ DUP PRINT$ ;
1. In my last posts I forgot to mention that there is a small typo in EASYNET.FTH line 88 (PUBIC instead of PUBLIC). This is still in your dropbox repository.
2. CFA>NFA seems to be removed. How can I emulate it? Maybe you remember I asked for that some time ago and were happy to get managed with it:
pub VARNAME$ ( var-address .. strptr ) --- get the address of the name of the variable address on TOS
\ --- MJB: http://forums.parallax.com/discussion/comment/1424389/#Comment_1424389
\ usage: long myvar myvar VARNAME$ PRINT$
$8000 OR CFA>NFA 1+ ;
pub TABNAME$ ( table-address .. strptr ) --- get the address of the name of the table address on TOS
\ --- MJB: http://forums.parallax.com/discussion/comment/1424389/#Comment_1424389
\ usage: TABLE mytable mytable TABNAME$ PRINT$
\ usage2: for a better example see UARTCOG.FTH::.UART
2- CFA>NFA 1+ ;
pub FETCHNAME
CFA>NFA 1+ DUP PRINT$ ;
Now my code isn't working anymore. Sniff :-(
Maybe PUBIC is an alias for PRIVATE
I will try and load it up tonight to find out what's happened with it as I have it working on some units.
Of course this would improve readbility. I'd suggest to REVECTOR + with - and such things. Maybe your support efforts have to be doubled then :-D
I want to implement an iot5500 based system which has no terminal connection anymore. So it has to withstand power cycles autobooting EASYNET and remote connection via telnet. These are things i could unfortunately not get working with the current v5r2. I hope for your helping hand.
Furthermore I'm short in memory as COMPACT doesn't yet work.
Hey @proplem - no problem - I want to setup a P1 to do some remote control over the Internet so I will be hooking this up today and double checking it!
Actually, I've been knee deep in P2 documentation and now P2D2 pcb hardware design.
Did it try to print out anything at all when you hit reset? The only reason it wouldn't seem to work is either wrong baud rate or wrong clock. Just check the header of the Tachyon source as sometimes it has been changed to 96MHz clock, so just comment out that section, uncomment the other, and reload. I will check it later when i get back on a PC.
@DaveJenson - I just went and hooked up a standard Prop and loaded Tachyon without any problems. I then proceeded to copy and paste EXTEND.FTH into the terminal using a line delay of 12ms. I am not sure what you mean when you say that you can't seem to get Tachyon to talk to you. Is this a serial terminal thing? Which one are you using and what are the settings? You should have hardware handshake disabled, 115200 baud 8N1 etc.
Here's a dump of my terminal session after I have used BST and hit F11, then reconnect the terminal. (actually, minicom just allows me to sit in a settings menu like ^A,P and while it is there it releases the serial port after which I hit F11 in BST and wait for it to finish, and then hit escape in minicom to return back to the terminal itself).
My minicom status line
CTRL-A Z for help | 115200 8N1 | NOR | Minicom 2.7.1 | VT102 | Offline | ttyUSB0
The terminal screen itself:
Propeller .:.:--TACHYON--:.:. Forth V5r2 NEON 520180323.2200
Cold start - no user code - setting defaults
Setting up dictionary
--------------------------------------------------------------------------------
...
...
...
...
... : +LCD : +KEY : +VGA ; ( precede line with \ space to comment and leave out modules )
...
... TACHYON V5 Propeller .:.:--TACHYON--:.:. Forth V5r2 NEON 520180323.2200
0100 ok
0200 ok
0300
0400
0500 ok
0600
0700 ok
0800 ok
1000 ok
1100
1200
1300 ok
1500
1600
1700
1800 ok
1900 ok
2000
2300 ok
2400 ok
2600
2700 ok
2800 ok
2900
3000 ok
3100
3200
3300 ok
3400
3500
3600
3800 ok
4100 ok
4200
4300
4400 ok
4500
4600 ok
4700
4800 ok
4900
5000
5100
5200
5300
5400
5500
5600
5700
6000 ok
6100 COPY ROMS from $23C4 for 3848
6114 ok
End of source code, 0000 errors found Load time = 28.1
Code bytes used = 9402
CODE:$3E3C = 15420 bytes
NAME:$588A = 7030 bytes
DATA:$764B = 315 bytes
FREE: = 6734 bytes
Data Stack (0)
ok
...
...
...
... ?BACKUP BACKUP ok
...
... REBOOT
Propeller .:.:--TACHYON--:.:. Forth V5r2 NEON 520180323.2200
*** MODULES *** Propeller .:.:--TACHYON--:.:. Forth V5r2 NEON 520180323.2200
3798: TOOLS DEV TOOLS
34F0: CHARLCD BUFFERED CHARACTER LCD
3388: ANYKEYS ANYKEY KEYPAD 171005
30E6: VGATEXT VGA text driver (minimal) 180218-0000
1982: EXTEND Primary extensions to TACHYON V5.2 kernel - 180322-1300
AUTORUN BOOT 307E
FREQ = 80.00MHZ
*** INITS ***
*** ROMS ***
E01C: VGA32x15 848
E37C: UART 464
E55C: HSUART 560
E79C: F32 1900
*** I2C ***
$40 I/O
$A0 EEPROM
$AE EEPROM
$DE RTC
I/O = 31 :UHUU 27 :UUU~ 23 :~~~~ 19 :~~~~ 15 :U~UU 11 :UUUU 7 :U~~~ 3 :DUDU
INTERCOM:
CODE:$3E3C = 15420 bytes
NAME:$588A = 7030 bytes
DATA:$764B = 315 bytes
FREE: = 6734 bytes
Data Stack (0)
Mon, 01 Jan 2001 00:00:00 UTC
--------------------------------------------------------------------------------
...
I had to remember that most words are UPPER CASE.
I would still like an updated Tachyon Dictionary of words.
And I re-iterate that a SUPER-Simple howto may be in order.
(It can be daunting for new-comers and even Forth Users not familiar with Tachyon...)
My system is usually Win10 or Win7, Tera Term or Parallax Serial Terminal, Propeller Tool.
The file SEEv5.FTH doesn't load into Tachyon5r2.
It seems to indicate that it is for V4?
... TACHYON V4 ??? ( V4.5 ) Propeller .:.:--TACHYON--:.:. Forth V5r2 NEON 520180323.2200
0044 ??? in .NAME at L32
0046 ??? in .NAME at L16 þ
0056 ??? in .NAME at CFA>NFA
0058 ??? in .NAME at CFA>NFA þ
0071 ??? in SEE at IMMEDIATE þ
0077 ??? in SEE at NFA>BFA þ
0098 þ
End of source code, 0010 errors found Load time = 10.6
Code bytes used = 600
CODE:$410E = 16142 bytes
NAME:$582E = 7122 bytes
DATA:$7674 = 356 bytes
FREE: = 5920 bytes
Data Stack (0)
ok
...
Any word that doesn't have a header just prints as 4 hex digits without a prefix.....hmmm.....maybe I will improve that.The 7CC1 is actually an encoded wordcode (not an address) where the C1 is 9-bit Prop machine opcode for AND.
As for super-simple have you followed the Introduction to Tachyon Forth document? (Click on Use the Forth logo). I do see too that this might need to be updated for 5.2 but it is very recent.
If you want to stop the decompile you have to be quick to hit a key while EXIT is displayed.
Since the pause is short and it could be a while before another EXIT is displayed,
could you stop the decompile when any key is hit without waiting for another EXIT.
I've only had a very quick read but as soon as I saw the tuck pick roll >R R@ R> words I knew what they were getting at. My philosophy has been to make each word so that the parameters are short, sweet, and pertinent to the function. I have direct access to the top four parameters so to copy them involves either: DUP OVER 3RD 4TH but I try to avoid any kind of juggling. Plus I don't understand why Forth can't have another stack instead of juggling on the return stack and keeping loop parameters there too, it's just plain crazy. Tachyon has always had a loop (and branch) stack for loop parameters so that the return stack is not easily corrupted by a bug.
They talk about "dictionary congestion" and that's another thing as although it is kind of nice to have a dictionary header before the code, it also requires link fields to join the headers together and mixes data (the dictionary) with code. Tachyon just keeps all the words as one big contiguous list of words in its own area so there is no need for link fields and with private/public/immediate attributes so that words can be forgetten and the memory reclaimed without "congestion".
I will have a bit more of a read but the solution seems good but more like a patch for an old design. Better off upgrading the whole lot than trying to patch it. But unlike a lot of the Forths that they talk about Tachyon is not PC resident and does not need any PC tools to compile and run.
Was there some part of it that you think might help? (in case I skipped over it).
btw - There's the comp.lang.forth group which seems to be mostly about the language for PC Forths, and they rarely discuss actual practical embedded or realtime applications, which is the area in which Forth was born and bred, controlling big radio telescopes. There are hundreds of wonderful IDEs and compilers available for PCs that I would probably use rather than Forth, but when it comes to embedded realtime control, then I use Forth.
Was there some part of it that you think might help? (in case I skipped over it).
Not specifically, I was more curious if any of it might give you ideas to improve Tachyon.
I do like the multiple stack arrangement you have and the short data stack. These make a lot of sense. One can't help but keep the data stack clean when there are only 4 slots :-)
Comments
I was using Ping as a basis of a new program not as is.
I was trying to understand and create a new program.
Are there replacements for the words that have changed?
thank you again.
I had spent some time trying to convert and had guessed the WAITHI and WAITLO but did not understand the COG@ enough to work it out.
best regards
moving the COGREGs to start from address 1 as Peter did recently
made it possible to get rid of COGREG! and just use COG!
- and also COG@ for reading.
I am following Peter since Tachyon 1.x or even 0.y - feels very long ago
and dozens maybe a hundred times my code did not run anymore
because Peter just the other day did a little tweaking
or a complete redesign ...
Reading / searching the source usually shows it quickly.
I keep all the old Tachyon versions around so I can easily compare what happened ...
but look at it - what great outcome it is
When Peter fully switches to P2-only mode times might get a bit slower for P1-Tachyon ...
and Tachyon will 'mature'.
with my attempts to upgrade to v5r2 I will give some feedback:
- I appreciate that OFF ANYCASE has been removed
- I saw there is a .git directory in the dropbox - yay - this will increase our fun a lot in future work - definitely a right decision Peter.
- trying to upgrade my iot5500 module to v5r2 had difficulties with lsio . I definitely would remove lsio from the boot sequence - it toggles outputs and this can disturb sensible periphereal i/o. It is a really nice tool to investigate unnknown hardware, but in my opinion it has nothing to do in a standard boot sequence
- COMPACT isn't necessary anymore. because the "dictionary full" error occured I replaced it by RECLAIM to get everything packed into the iot5500 .
- With these minor changes the build advanced since EASYNET which I could not yet successfully load. Here is the output
I will investigate this furthermore ...
There was just a '==' replace with ':=' in EASYNET.FTH
@"Peter Jakacki" could you add this little change in EASYNET.FTH on the dropbox?
Now trying wether telnet is working ...
has it always been that . (dot) outputs a whitespace after the number?
No, but I favor the more verbose form PRINT in source code as it stands out rather than the obscure dot whereas the dot is easier to use interactively. Getting rather annoyed of typing interactive sequence where I would have add SPACE after every . I then changed the . to add a space The PRINT word however does not add any spaces.
BTW, sorry about the == vs := thing. I fixed the EASYNET source. I was never really happy with saying == but I was never happy with the clunky and overwhelming CONSTANT word either. I think := is a better description because in Spin we assign a value to a symbol. In this case it is clear it is not a comparison but an assignment. Since V5 is a new version (NEON) I took advantage of that fact!
vs the clutter and overwhelming version
telnet isn't yet working correctly on the iot5500. I get strange crashes and there seems to be a problem with the terminal settings because I have to use putty or even worse M$ telnet and I don't remember the correct terminal settings for putty ... grmbl.
Does anybody who can post have a putty config which is working with tachyon telnet?
Best regards,
proplem
1. In my last posts I forgot to mention that there is a small typo in EASYNET.FTH line 88 (PUBIC instead of PUBLIC). This is still in your dropbox repository.
2. CFA>NFA seems to be removed. How can I emulate it? Maybe you remember I asked for that some time ago and were happy to get managed with it: Now my code isn't working anymore. Sniff :-(
Maybe PUBIC is an alias for PRIVATE
I will try and load it up tonight to find out what's happened with it as I have it working on some units.
Of course this would improve readbility. I'd suggest to REVECTOR + with - and such things. Maybe your support efforts have to be doubled then :-D
I want to implement an iot5500 based system which has no terminal connection anymore. So it has to withstand power cycles autobooting EASYNET and remote connection via telnet. These are things i could unfortunately not get working with the current v5r2. I hope for your helping hand.
Furthermore I'm short in memory as COMPACT doesn't yet work.
Actually, I've been knee deep in P2 documentation and now P2D2 pcb hardware design.
A super simple step by step how to to load and run Tachyon on my FLiP module, for instance.
I am somewhat familiar with Forth syntax and all, but I can't seem to get Tachyon v5.2 to talk to me.
Help?
Here's a dump of my terminal session after I have used BST and hit F11, then reconnect the terminal. (actually, minicom just allows me to sit in a settings menu like ^A,P and while it is there it releases the serial port after which I hit F11 in BST and wait for it to finish, and then hit escape in minicom to return back to the terminal itself).
My minicom status line
The terminal screen itself:
I had to remember that most words are UPPER CASE.
I would still like an updated Tachyon Dictionary of words.
And I re-iterate that a SUPER-Simple howto may be in order.
(It can be daunting for new-comers and even Forth Users not familiar with Tachyon...)
My system is usually Win10 or Win7, Tera Term or Parallax Serial Terminal, Propeller Tool.
It seems to indicate that it is for V4?
Any word that doesn't have a header just prints as 4 hex digits without a prefix.....hmmm.....maybe I will improve that.The 7CC1 is actually an encoded wordcode (not an address) where the C1 is 9-bit Prop machine opcode for AND.
As for super-simple have you followed the Introduction to Tachyon Forth document? (Click on Use the Forth logo). I do see too that this might need to be updated for 5.2 but it is very recent.
If you want to stop the decompile you have to be quick to hit a key while EXIT is displayed.
Since the pause is short and it could be a while before another EXIT is displayed,
could you stop the decompile when any key is hit without waiting for another EXIT.
Thanks
Thought I would pass this along.
It's a presentation on using FIFOs for Forth rather than Stacks.
I would be interested in your thoughts on it.
Maybe there is something useful in it for Tachyon?
http://www.forth.org/svfig/kk/01-2018-Wagner.pdf
Jason
I've only had a very quick read but as soon as I saw the tuck pick roll >R R@ R> words I knew what they were getting at. My philosophy has been to make each word so that the parameters are short, sweet, and pertinent to the function. I have direct access to the top four parameters so to copy them involves either: DUP OVER 3RD 4TH but I try to avoid any kind of juggling. Plus I don't understand why Forth can't have another stack instead of juggling on the return stack and keeping loop parameters there too, it's just plain crazy. Tachyon has always had a loop (and branch) stack for loop parameters so that the return stack is not easily corrupted by a bug.
They talk about "dictionary congestion" and that's another thing as although it is kind of nice to have a dictionary header before the code, it also requires link fields to join the headers together and mixes data (the dictionary) with code. Tachyon just keeps all the words as one big contiguous list of words in its own area so there is no need for link fields and with private/public/immediate attributes so that words can be forgetten and the memory reclaimed without "congestion".
I will have a bit more of a read but the solution seems good but more like a patch for an old design. Better off upgrading the whole lot than trying to patch it. But unlike a lot of the Forths that they talk about Tachyon is not PC resident and does not need any PC tools to compile and run.
Was there some part of it that you think might help? (in case I skipped over it).
btw - There's the comp.lang.forth group which seems to be mostly about the language for PC Forths, and they rarely discuss actual practical embedded or realtime applications, which is the area in which Forth was born and bred, controlling big radio telescopes. There are hundreds of wonderful IDEs and compilers available for PCs that I would probably use rather than Forth, but when it comes to embedded realtime control, then I use Forth.
The binary of v5.2 in the same dropbox folder seems to work.
Jason