Shop OBEX P1 Docs P2 Docs Learn Events
Tachyon NEON V5 (FAT32 and Ethernet Servers in 32kB EEPROM!) - Page 8 — Parallax Forums

Tachyon NEON V5 (FAT32 and Ethernet Servers in 32kB EEPROM!)

1568101125

Comments

  • Peter,
    Great news it all works! I was even able to BACKUP the clock and have it survive thru a reset.
    What is the purpose of the LCD EMIT: DROP ; ? and also what determines the $180 value when setting up the the CLOCK?
    As always many thanks
    Jim
  • Great news indeed. I created a dummy LCD word that sets up the cogs EMIT to do nothing except drop the character. EMIT: is an easier way of setting the uemit vector to point to the code to use to EMIT. The old way required a word that effectively did the LCDEMIT, and then another word LCD to load the address of LCDEMIT into uemit, so as you can see EMIT: DROP ; is much simpler and EMIT: means "EMIT DEFINE" or something like that.

    I have the hub registers for COG 0, the CONSOLE cog set for $100 but it only needs 128 bytes however I just realized that $180 is used by COG 0 as its loop stack! So just allocate 128 bytes for your LCD cog likes this:
    128 bytes lcdregs
    Then substitute the $180 with lcdregs :)
  • Phone again.
    Ok, get the need to rewrite the buffer. Is the word order clock forget or forget clock?

    Thanks
    Jim
  • MJBMJB Posts: 1,235
    RS_Jim wrote: »
    Phone again.
    Ok, get the need to rewrite the buffer. Is the word order clock forget or forget clock?

    Thanks
    Jim

    usually trying helps ;-)

    and normally it was
    FORGET myword
    

    don't know your code.
    but usually a buffer get's cleared by rewriting or filling with whatever you like but not forgotten which removed a word from the dictionary and codespace.

  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2018-08-22 02:48
    Jim - as MJB remarked, if you wonder about something, then try it out. In this case if you typed "clock forget" it would have reported an error immediately when you type clock. However if you correct the case and type CLOCK it will compile but when you type FORGET it won't compile as it will execute immediately waiting for you to <enter> the word you want to forget from. In this case there would be no prompt and nothing happening until you hit space or enter which would then report "not found" then try to execute CLOCK but that word was designed to accept a cog parameter, so...... Try it out for yourself, you won't hurt anything.

    When FORGET finds the word that you supply in the dictionary it will remove all headers from there to the end (latest) as well as reclaiming the code space. If you want to check memory available you can hit ^? (ctrl + ?) which will report code, name, and data memory as well as the stack.
    CODE:$398C = 14220 bytes 
    NAME:$5E64 = 5532 bytes 
    DATA:$75D9 = 201 bytes 
    FREE:      = 9432 bytes 
     Data Stack (0)
    

    The easiest way though of starting again is to simply add FORGET <mycode> at the start of your source code. It is also a good idea to use the TACHYON directive which will track memory usage and stop the terminal from echoing every character etc until it encounters the END directive. Here is a sample template.
    FORGET LCD
    TACHYON
    ( Sample serial LCD clock using a dummy LCD word )
    
    pub LCD EMIT: DROP ; 
    pub CLOCK    RUN: $180 8 COG! LCD $0C EMIT BEGIN 1 EMIT .TIME CR .DATE 100 ms AGAIN ; 
    
    END
    

    If the code is already running you can either manually stop the cog or else start up Tachyon in safe mode so after you reset it with a ^C or break just hold down the ^A key until it responds with <aborting startup>. That way you can be sure that nothing is running in the background, not even the timer cog.
    Propeller .:.:--TACHYON--:.:. Forth V5r4 NEON 540180811.0000
     <aborting startup> 
    --------------------------------------------------------------------------------
    

    @MJB - long time my friend! No time for Tachyon lately? :)
  • MJBMJB Posts: 1,235
    @MJB - long time my friend! No time for Tachyon lately? :)
    Hi Peter
    had the digger here for more than 6 weeks.
    made ~800 meters of terraces
    a ~3 million liter water storage bassin.
    now needs 200 meters of fence around
    pipes, pumps, rainwater capturing ...
    80 mango trees already planted and some avocados, oranges ...
    4000 vetiver.org grass plants against erosion
    many more to come
    a complete permaculture / keyline design redesign of the land
    this at 33°C in the shade ...
    and now a nasty virus knocked me out - overworked

    still keeping an eye on Tachyon and the P2 - great progress
    and good to see Tachyon/P1 is still evolving

    all the best for your health
    Markus from Andalucia / Spain


  • RS_JimRS_Jim Posts: 1,751
    edited 2018-08-22 15:56
    Peter,
    As always, thanks for the feedback. I am getting closer to getting exactly what I want.
    In the meantime, have you checked out the Glossery lately? I BIG thanks goes to Jason (THEJ) for his incredible update. A number of the words started making much more sense to me now.

    Thanks everyone for all you do.
    Jim
    Edit. I hope I haven’t spoken out of turn. Formatting of Google Docs doesn’t work on iPad. Saw it for first time this AM on the PC.
    Jim
  • Encountered a mystery I don't understand. Had my clock running and displaying on LCD. When I terminated Tera Term the clock stopped. Did I get a reset through the prop plug? I guess I need to complete my clock program with an autorun at bootup. tried setting the clock while it was running but the continnuous reading of the RTC by CLOCK would scramble the data. Learning a lot, having a great time, just wish there was more time!
    Jim
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2018-08-22 23:06
    In general I don't design the FT232 onto my boards as although that may be great for the education market, it is not as desirable for industrial applications. I prefer to have a dual row 4-pin header to match the standard Prop Plug plus the other pins for power and I2C so I can directly programming the eeprom. This means I never have phantom power or a false reset. But you can easily make your app auto run at startup although the method is a little different from the earlier versions of Tachyon. Before I used to have the one autorun vector and that would be used by the boot section in EXTEND, but an app would override that and also need to call the boot init and whatever else needed autorun. Now I reserve autorun for the boot section which maintains a table of user vectors to call.

    Just use:
    ' <MYCODE> +INIT
    
    Do this before you do a BACKUP (or just do a BACKUP again)

    BTW, if autorun were overridden then the RTC won't work properly since the BOOT routine starts up the soft RTC and also synchs it if a real RTC is available.
  • RS_JimRS_Jim Posts: 1,751
    edited 2018-08-23 14:29
    Peter,
    My face is extreeeemly red. I did the impossible! I crashed Tachyon. I was not running a log file at the time so not sure where it went wrong. When I rebooted I got:
    FREE:  6618 bytes
    Data Stack (0)
    Sun, 31 Dec 2065 23:45:25 UTC
    
    It stops at that point and will not run any further. I was trying to get my clock routine to run at start up and had rewritten the code so that it would set all the correct parms at startup. Later today, off next 2, I will re-install Tachyon and Extend and start over. I had stopped the clock routine and did try to set the RTC with the TIME! command, but was getting a time read back of 15:45:00 when it was 5:45 AM. My test bed currently is a board with PROP PLUG connection so there is no onboard FT232 chip. when I get it all functioning again I will try the cold boot after unplugging PROP PLUG. At this point, my biggest problem will be figuring out how to set up the the DATA space for CLOCK all as part of the RUN routine. Also will need to figure out how to set the RTC when CLOCK is running.
    Thanks for your advice and patience.
    Jim
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2018-08-23 22:16
    Whaaaaa!!! you blew it up!? .... :)

    Jim, you can always safe start Tachyon by holding down the ^A (control A) key after a reset to talk to the system. If you type ?? it will also display the boot stats including any INITS and perhaps for some reason there is more than one so you can init the INITS with !INITS, do a backup and restart.

    However that doesn't explain what's going on with the clock as none of that makes sense. There is no need to stop the clock to set the time since any read of the clock at runtime is from the soft RTC and only the console cog accesses the I2C bus directly at boot time when it reads the hardware RTC to load the soft RTC and also when you set the RTC.

    There is no need to setup data space unless you might be referring to any special initializations I guess. Could you post your code and any applicable terminal captures?

    BTW, which RTC chip are you using? Have you used SETRTC with the correct address and backed that up?

  • OK, recovered the prop with a new install of 5r4 and EXTEND. I had not done the SETRTC which I did with ...$D0 SETRTC followed by BACKUP. Correct? next are there commands that actually set the time into the RTC or do I need to write them myself?
    This morning was more banging my head against the wall. In one of your earlier post you mentioned the need for the command pub LCD EMIT: DROP ; does that need to be exicuted after every boot or can that be done once and backed up? For some reason this morning I could not get the CLOCK word to exicute properly. I had done 128 bytes lcdregs with a backup then substituted lcdregs in CLOCK like such:
    pub CLOCK RUN: lcdregs 8 COG! SERLCD 12 EMIT 17 EMIT BEGIN .TIME 100 ms 12 EMIT AGAIN ; END
    I would get varying results. I would get the clock to update without going back to the home position (12 EMIT) or I would get the clock to write once and never again. Does the 128 bytes lcdregs statement need to be exicuted inside the CLOCK word or does it remain permenent with the BACKUP command? If it needs to be inside the CLOCK word would it be: CLOCK 128 bytes lcdregs RUN: lcdregs 8 COG! SERLCD 17 EMIT 12 EMIT BEGIN etc.? and how does one introduce pub SERLCD EMIT: DROP ; into the equasion?
    OK enough rambling for one day. Someday I will get this Tachyon thing partially figured out.
    Jim
  • @thej - were you going to help with the documentation? I thought somebody said you had done some work but I can't find it. I did however start updating the glossary to suit V5. If you have some time maybe you could look over it and see what else may need to go in. You will need to request edit access for this document
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2018-08-24 16:32
    RS_Jim wrote: »
    OK, recovered the prop with a new install of 5r4 and EXTEND. I had not done the SETRTC which I did with ...$D0 SETRTC followed by BACKUP. Correct? next are there commands that actually set the time into the RTC or do I need to write them myself?
    This morning was more banging my head against the wall. In one of your earlier post you mentioned the need for the command pub LCD EMIT: DROP ; does that need to be exicuted after every boot or can that be done once and backed up? For some reason this morning I could not get the CLOCK word to exicute properly. I had done 128 bytes lcdregs with a backup then substituted lcdregs in CLOCK like such:
    pub CLOCK RUN: lcdregs 8 COG! SERLCD 12 EMIT 17 EMIT BEGIN .TIME 100 ms 12 EMIT AGAIN ; END
    I would get varying results. I would get the clock to update without going back to the home position (12 EMIT) or I would get the clock to write once and never again. Does the 128 bytes lcdregs statement need to be exicuted inside the CLOCK word or does it remain permenent with the BACKUP command? If it needs to be inside the CLOCK word would it be: CLOCK 128 bytes lcdregs RUN: lcdregs 8 COG! SERLCD 17 EMIT 12 EMIT BEGIN etc.? and how does one introduce pub SERLCD EMIT: DROP ; into the equasion?
    OK enough rambling for one day. Someday I will get this Tachyon thing partially figured out.
    Jim

    Jim - for my tests WITHOUT an LCD connected I just created a dummy LCD word, that's all. No need for you to use it.

    The SETRTC is important and of course do a BACKUP before your next boot. You won't wear out the EEPROM so don't worry about overdoing it.
    The expression "128 bytes lcdregs" creates a new word in the dictionary named lcdregs that is a constant that points to the start address in data memory of the 128 bytes that "bytes" had allocated. So this is a defining word that also allocates memory which it only does once at compile time.

    RUN: grabs the address of the code that comes after it and passes this to the actual RUN word which will get the specified Tachyon cog to run the code. Don't forget that you need to specify that cog id like this:
    3 CLOCK
    
    That way cog 3 will start to run the code immediately following the RUN: word. This in turn assigns the hub register memory (once), selects the SERLCD device and issues a "clear screen" command with 12 EMIT followed by the 17 EMIT before settling down to an infinite BEGIN AGAIN cycle of printing the time with .TIME, waiting 100ms , learing the screen, then repeating. In this respect I would not clear the screen each time, I would normally just tell it to go home just so the LCD doesn't flicker in-between updates.

    Because you tell the system that you have a real RTC at $D0 it will handle any communicate with it when necessary such as synchronizing the soft RTC daily and of course when you set the time and date etc. So there is no need to worry about drivers, it's all taken care of.

    Here is an example of setting the time and date for 4th July, 2018 at 2:51PM.
    180704 DATE! 145100 TIME!
    You can optionally set the day and the timezone if you like:
    " PDT" TZ WED DAY
    BACKUP
    
    The time zone is set with a string where the " symbol is actually the Tachyon Forth word for compiling a string of characters terminated by a " so it's important that the first " actually be separated by a space from the actual string. WED is actually a simple constant of 3 (try WED . ) which is passed to DAY which sets this in the RTC.

    Do you want to post your code so I can check it?

    BTW - if you reload your EEPROM it will have forgotten that you have a hardware RTC, but all you have to do is the SETRTC again, in that case.


  • @thej - were you going to help with the documentation? I thought somebody said you had done some work but I can't find it. I did however start updating the glossary to suit V5. If you have some time maybe you could look over it and see what else may need to go in. You will need to request edit access for this document

    Hi Peter,

    Yes, I will be working on the documentation. Time hasn't been on my side for that yet.
    I will definitely check out the new additions to the glossary too !!

    Hopefully this weekend I will have some time.
    As I learn new things, I like to document it so others can follow.
    I have plans for many things and I can't wait to carve out some time to make them happen !!! (...with documentation ;-)

    J
  • Ok, thanks for the updates. I am happy to hear time! Writes to the RTC. With a refresh of once every 100 ms, that is above the 60 Hz refresh rate of TV which is not visible. Also not worried about too many writes to eeprom, not likely to happen in my lifetime. I could make clear screen less visible by putting the 12 emit before the ,TIME cmd. Would also eliminate the need for 1 before the BEGIN. I will try that. I will initiate a log file the next time I work on it.
    Jim
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2018-08-25 04:47
    RS_Jim wrote: »
    Ok, thanks for the updates. I am happy to hear time! Writes to the RTC. With a refresh of once every 100 ms, that is above the 60 Hz refresh rate of TV which is not visible. Also not worried about too many writes to eeprom, not likely to happen in my lifetime. I could make clear screen less visible by putting the 12 emit before the ,TIME cmd. Would also eliminate the need for 1 before the BEGIN. I will try that. I will initiate a log file the next time I work on it.
    Jim

    For a character LCD 10 times a second is more than fast enough although the slowest operation is always the clear screen code where the display itself needs over 1 ms and sometimes this is visible as a blink, so I tend to avoid it. Same goes too for terminal updates, once I initially clear the screen the main loop just issues a home command and overwrites the previous screen flicker free. This is what SPLAT does although I must update that too for V5.

    In TeraTerm you can go to the "Window setup" under setup and make sure "scroll buffer" is ticked and set it to at least 10000 lines. That way you don't need to do any special logging, just scroll back, select and copy.

    @thej - I've removed whole sections from the Glossary as they weren't applicable anymore and updated some others but i also was starting to build up the HELP folder files some time ago, which are small text files related to a particular aspect of Tachyon that could also reside on an SD card or perhaps even in EEPROM. Maybe this might be easier to maintain. Here's a sample of the help file for looping (incomplete with errors).
    LOOPS.TXT
     FOR ( cnt -- )
    Enter a FOR NEXT loop which will loop for cnt times.
    A default index FROM 0 and a index step BY 1 is used unless these are overridden before FOR using FROM and/or BY.
    
     NEXT
    Decrement the FOR count and exit if zero
    Always increment the FROM index by BY
    On exit pop the four loop parameters from the loop stack
    A default index FROM 0 and a index step BY 1 is used unless these are overridden before FOR using FROM and/or BY.
    
     FROM ( start -- )
    Set the
    
    Examples:
    --- Display all printable ASCII characters
    $20 FROM 96 FOR I EMIT NEXT
    --- Display all printable ASCII characters in reverse
    $7F FROM -1 BY 96 FOR I EMIT NEXT
    ~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)('&%$#"!
    
    Details:
    Loops are standardized in V4.5 using FOR NEXT in that DO LOOP +LOOP and Tachyon variants ADO and FORDO are deprecated.
    Even though the traditional FOR NEXT did not maintain an index or allowed variable steps like DO LOOP, these are
    still maintained by FOR NEXT in V4.5 by augmenting it with two basic instructions
    FROM and BY to both specify the starting index and the step value to increment the index BY
    
    The loop stack is maintained in hub RAM at $180 for COG 0. Any other Tachyon cogs should allocate 12 to 16 bytes typically
    for 3 to 4 levels recommended (rarely reaches 4)
    
    Each FOR will push four parameters onto the loop stack being:
    FOR		The number of times FOR NEXT will loop (not affected by BY)
    FROM		The value that the index starts FROM (0 if not set)
    BY		The value to increment the FROM index I by (1 if not set)
    BRANCH		The address after FOR which is used by NEXT
    
    Related:
    NEXT LEAVE I J FOR! FOR@ BY! +LOOP ADO LP!
    

  • RS_JimRS_Jim Posts: 1,751
    edited 2018-08-25 13:39
    Today, a disaster have lost communication with LCD, won't print "hello world". I am not sure if issue is hardware or software. Tried a new setup with SERLCD screen powers up and has a curser, but no joy. No time to work on it further as I have an early shift.
    Jim
    edit is the SETRTC "$D0 SETRTC " then aBACKUP?
  • RS_Jim wrote: »
    Today, a disaster have lost communication with LCD, won't print "hello world". I am not sure if issue is hardware or software. Tried a new setup with SERLCD screen powers up and has a curser, but no joy. No time to work on it further as I have an early shift.
    Jim
    edit is the SETRTC "$D0 SETRTC " then aBACKUP?

    ??? Can you post your code?
  • Today's session is gone. Did have Scroll and 1000 lines checked. Will make a couple of breadboard changes to make sure that is not the problem, then will start anew with controlling the SERLCD and go from there.
    Jim
  • Try 10,000 lines or more. Just remember you can manually send characters to the LCD using SEROUT. So if you want to send an 'A' to the LCD on pin 5 you would type:
    'A' 5 SEROUT
    
    or you can type the hex value. It's unlikely anything is broken so it's bound to be some tiny little thing in your code.
  • Suddenly not talking to LCD got to backtrack and check hardware configuration. No time today. Is the SETRTC . $D0 SETRTC ?
    Jim.
  • Jim, remember that all numbers are pushed onto a stack just sitting there ready to use. So if you type $D0 it will be processed as a number and pushed onto the stack. The word SETRTC takes a value from the stack and uses that to set the RTC configuration address. This is the same with all Forth words with the only real exception being when we need to scan the input stream for a word such as when we define a new word ": newword ".

    So "$D0 SETRTC" followed sometime by a BACKUP is correct.

    Can you post your code???



  • OK Peter here is a looking over my shoulder for this AM.
    Propeller .:.:--TACHYON--:.:. Forth V5r4 NEON 540180811.0000
      *** MODULES ***  Propeller .:.:--TACHYON--:.:. Forth V5r4 NEON 540180811.0000
    31AE: TOOLS            DEV TOOLS
    1980: EXTEND           Primary extensions to TACHYON V5 kernel  - 180814-1145
    
    AUTORUN BOOT 3146
    FREQ = 80.00MHZ
    *** INITS ***
    NO ROMS
    *** I2C ***
    $A0 EE/RTC
    $D0 RTC
    I/O =  31 :UHU~ 27 :U~~~ 23 :~~~~ 19 :~~~~ 15 :~~~~ 11 :~~~~ 7 :~U~~ 3 :~~~~
    INTERCOM:
    
    CODE:$39D8 = 14296 bytes
    NAME:$5E16 = 5610 bytes
    DATA:$76D9 = 457 bytes
    FREE:      = 9278 bytes
     Data Stack (0)
    Sun, 31 Dec 2065 23:45:45 UTC
    --------------------------------------------------------------------------------
     ..  FORGET SERLCD
     ..  FORGET SERLCD
    ...  FORGET SERLC  not found SERLCD
    
      Propeller .:.:--TACHYON--:.:. Forth V5r4 NEON 540180811.0000
      *** MODULES ***  Propeller .:.:--TACHYON--:.:. Forth V5r4 NEON 540180811.0000
    31AE: TOOLS            DEV TOOLS
    1980: EXTEND           Primary extensions to TACHYON V5 kernel  - 180814-1145
    
    AUTORUN BOOT 3146
    FREQ = 80.00MHZ
    *** INITS ***
    NO ROMS
    *** I2C ***
    $A0 EE/RTC
    $D0 RTC
    I/O =  31 :UHU~ 27 :U~~~ 23 :~~~~ 19 :~~~~ 15 :~~~~ 11 :~~~~ 7 :~U~~ 3 :~~~~
    INTERCOM:
    
    CODE:$39D8 = 14296 bytes
    NAME:$5E16 = 5610 bytes
    DATA:$76D9 = 457 bytes
    FREE:      = 9278 bytes
     Data Stack (0)
    Sun, 31 Dec 2065 23:45:45 UTC
    --------------------------------------------------------------------------------
     ..  FORGET SERLCD
    ...  pub SERLCD 19200 SERVAUD  ??? in SERLCD at SERVAUD
    --------------------------------------------------------------------------------
    ...  pub SERLCD  19200 SERBAUD 6 SERIAL ;
    ...  SERLCD PRINT" HELLO "  CON  ok
    ...  pub SERLCD EMIT: DROP ;
    --------------------------------------------------------------------------------
     ..  128 bytes lcdregs
    --------------------------------------------------------------------------------
    ...  pub CLOCK RUN: lcdregs 8 COG! 17 EMIT BEGIN 12 EMIT .TIME 100 ms AGAIN ; END
    
       End of source code, 0001  errors found  Load time = 45.1
    Code bytes used = 8262
    Name bytes used = 2986
    
    CODE:$39C6 = 14278 bytes
    NAME:$5DF0 = 5648 bytes
    DATA:$7759 = 585 bytes
    FREE:      = 9258 bytes
     Data Stack (0)
    
     ok
     ..  FORGET CLOCK
     ..  FORGET CLOCK
    --------------------------------------------------------------------------------
    ...  pub CLOCK RUN: lcdregs 8 COG! SERLCD 17 EMIT BEGIN 12 EMIT .TIME 100 ms
    ...  AGAIN ; END
    
       End of source code, 0000  errors found  Load time = 26.9
    Code bytes used = 8264
    Name bytes used = 2986
    
    CODE:$39C8 = 14280 bytes
    NAME:$5DF0 = 5648 bytes
    DATA:$7759 = 585 bytes
    FREE:      = 9256 bytes
     Data Stack (0)
    
     ok
    ...  BACKUP BACKUP  ok
    ...  3 CLOCK  ok
    ...   Data Stack (0)
    HERE
    0000.39C8:   8003  39AC   0047  0047   8064  1CF2   39CB  0047
    0000.39D8:   27B6  0047   0047  8008   016D  3996   800C  03FA
    NAMES
    0000.5DF0:   05 43 4C 4F  43 4B AC 39  05 43 4C 4F  43 4B AC 39    .CLOCK.9.CLOCK.9
    0000.5E00:   47 6C 63 64  72 65 67 73  D9 F6 05 43  4C 4F 43 4B    Glcdregs...CLOCK
    COMMON
    0000.0000:   B400  04C4   926F  0010   7E54  7E5C   7E34  7E60
    0000.0010:   7E44  0002   7E24  0000   814B  2032   0000  7235
    0000.0020:   2034  454E   4E4F  0000   02B6  0000   1E1F  0000
    0000.0030:   0000  0000   0028  0000   0000  0000   0000  0000
    0000.0040:   0000  0000   0000  0000   0000  0000   0000  0000
    0000.0050:   2C18  0001   0000  0000   39AE  0001   0000  0000
    0000.0060:   0000  0001   0000  0000   0000  0001   0000  0000
    0000.0070:   0000  0001   0000  0000   0000  0001   0000  0000
    0000.0080:   0000  0000   0000  0000   0000  0000   0000  0000
    0000.0090:   0000  7408   0100  0000   699A  5DF0   0000  1980
    0000.00A0:   39C8  39C8   5AA5  3146   0000  0000   0000  0000
    0000.00B0:   0021  0000   0000  0000   7759  39AC   0686  068A
    0000.00C0:   068E  0000   0D04  DD00   0000  0000   0000  0000
    0000.00D0:   0000  0000   0000  0000   0000  0000   0000  0000
    0000.00E0:   0000  0000   0000  0000   0000  0000   0000  0000
    0000.00F0:   0000  0000   0000  0000   0000  0000   0000  0000
    REGISTERS
    0000.0100:   2220  0000   0000  0000   0000  0000   0000  0000
    0000.0110:   1046  075B   0023  0000   0000  0000   0134  0A0A
    0000.0120:   000A  0000   0000  0000   0000  0000   0135  0000
    0000.0130:   0D04  434B   0000  0000   0000  0000   0000  0000
    0000.0140:   0000  0000   0000  0000   0000  0000   0000  0000
    0000.0150:   0000  0000   0000  0000   0000  0000   0000  0000
    0000.0160:   0000  0000   0000  0000   0000  0000   3332  343A
    0000.0170:   3931  3532   0030  0018   0000  0000   0000  0000
    ...  SERLCD 17 EMIT CON  ok
    ...  SERLCD PRINT" HELLO WORLD"  CON  ok
    ...
    
      Propeller .:.:--TACHYON--:.:. Forth V5r4 NEON 540180811.0000
      *** MODULES ***  Propeller .:.:--TACHYON--:.:. Forth V5r4 NEON 540180811.0000
    31AE: TOOLS            DEV TOOLS
    1980: EXTEND           Primary extensions to TACHYON V5 kernel  - 180814-1145
    
    AUTORUN BOOT 3146
    FREQ = 80.00MHZ
    *** INITS ***
    NO ROMS
    *** I2C ***
    $A0 EE/RTC
    $D0 RTC
    I/O =  31 :UHU~ 27 :U~~~ 23 :~~~~ 19 :~~~~ 15 :~~~~ 11 :~~~~ 7 :~U~~ 3 :~~~~
    INTERCOM:
    
    CODE:$39C8 = 14280 bytes
    NAME:$5DF0 = 5648 bytes
    DATA:$7759 = 585 bytes
    FREE:      = 9256 bytes
     Data Stack (0)
    Sun, 31 Dec 2065 23:45:45 UTC
    --------------------------------------------------------------------------------
    ...  SERLCD PRINT" HELLO WORLD "  CON  ok
    ...
    
    No Joy after last SERLCD PRINT
    jIM
  • MJBMJB Posts: 1,235
    RS_Jim wrote: »
    ...
    ...  pub SERLCD  19200 SERBAUD 6 SERIAL ;
    ...  SERLCD PRINT" HELLO "  CON  ok
    ...  pub SERLCD EMIT: DROP ;
    ...
    

    here you define it ... then it works

    then you redefine it as dummy ... does not do anything

    seems it does what you tell it to do ...

  • Jim - this is only a terminal capture so it is rather hard to see the actual source code you are sending over the terminal? Nonetheless, as MJB points out, you seem to have that dummy SERLCD definition that I simply used for testing still in there.
  • RS_JimRS_Jim Posts: 1,751
    edited 2018-08-26 15:34
    MJB, Peter,
    Thanks, I never did understand the command LCD EMIT: DROP ; I will go back and reinitialize the SERLCD command and see if that works. Slowly, very slowly I am begining to understand. Will be able to try this again tomorrow AM. The screen capture showed you exactly what I entered Today.
    Jim

  • Peter,
    To install ROM files, do they (.hex files) get entered before or after EXTEND.FTH. I normally use CoolTerm to send the text files. Shouldn't the ROM files show up in the splash screen when Tachyon is started up. Do I have to do something else? Thanks
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2018-08-27 05:19
    Mike - EXTEND has the SAVEROM word defined as well as the EEPROM routines. It is best to think of EXTEND as part of the kernel that is compiled by Tachyon itself.
    I just copy and paste those files straight in as I have the line "SAVEROM" added to the start of them. When Tachyon boots or if you type ?? you will see the ROMs listed.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2018-08-27 07:41
    RS_Jim wrote: »
    MJB, Peter,
    Thanks, I never did understand the command LCD EMIT: DROP ; I will go back and reinitialize the SERLCD command and see if that works. Slowly, very slowly I am begining to understand. Will be able to try this again tomorrow AM. The screen capture showed you exactly what I entered Today.
    Jim


    Hi Jim, I just hooked up one of my serial LCDs, the only real difference is that it is strapped for RS232 polarity (idles low), in which case I use ISEROUT instead of SEROUT, that's all. I tried it out and it works a treat and just runs in the background while I can still talk to Tachyon from the terminal. Of course we could dress this one up a bit more plus I could get it to report temperature and humidity etc.

    EDIT: I've fancied it up a bit and added temperature & humidity to the display as well as a small piezo transducer for beeps and melodies etc.
    Check out the code and photos etc on this pub doc.

    { run SERIAL LCD CLOCK from cog onto 20x4 LCD with inverted serial data
    The date and time string "Mon, 27 Aug 2018 15:02:59 AEST" is offset
    by 4 spaces so that it wraps over 2 lines on the LCD
    To run in cog 3 ...	 3 CLOCK
    }
    
    pub SERLCD 	9600 SERBAUD EMIT: 0 ISEROUT ;
    128 bytes clkregs
    pub CLOCK ( cog -- )	RUN: clkregs 8 COG! SERLCD $0C EMIT BEGIN 1 EMIT 4 SPACES .DT 100 ms AGAIN ;
    
    --- add these two lines to make it start up automatically
    pub !CLOCK	3 CLOCK ;
    ' !CLOCK +INIT BACKUP
    
    
Sign In or Register to comment.