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

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

191012141525

Comments

  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2018-09-19 00:32
    RS_Jim wrote: »
    Peter,
    Thanks, The OFF word is perfect with one minor adjustment and that is I will change OUTSET to OUTCLEAR. The system is designed with NC relay contacts so in the event of a failure on the MCU side of things, the HVAC will function normally. This system, when active, will interrupt the COOL thermostat line (%011,%0101) when I wish a unit to not run.
    Hopefully will get the system tested today on the QS board. Next project will be completing my WX station which has languished in a drawer for several years. I will use SPI to read from AS4055 for wind direction, Counters in detect mode for the rain gage and wind velocity. The Parallax Altimeter module for barometric pressure and eventually one of the newer Senseron chips for temp and RH.
    Jim

    From the way you were controlling the relays it looked like they were active low to turn on which is why I used an OUTSET to turn them all off. One thing I did forget was that when a linked timer times out and calls the alarm is that you need to reload the timer again. You can add 60000 hvactmr TIMEOUT like this:
    pub HVAC 		 60000 hvactmr ALARM: 60000 hvactmr TIMEOUT  ?DNSTAIRS ?UPSTAIRS ?SHOP ?OFF ;
    

  • I wanted to see how far I could push my hardware, so I replaced the 12.5MHz crystal with a 16MHz one, for sysfreq of 128MHz. EXTEND loaded no problem. I put Peter's fibo program into an infinite loop in 4 cores to see how things went. The system seems stable, prop is very slightly warm to the touch.

    lap time of fibo(46) is 40 us.

    One possible bug: I set baud = 1152000 (note the extra zero), but found that I had to set the baudrate in minicom to 1000000.

    Any idea why this might be, Peter?
  • Ha ha, no idea what happened to the baud rate but I will have to try it out with a 16MHz crystal then!
  • I'd try to go higher but I think my 3.3V regulator is probably near its limit of 100mA...if I do a new board revision at some stage I'll put in a beefier one.
  • Most regulators do at least 250ma but it sounds like you used an old part. I normally use MCP1700s in SOT89 but I am changing over to AZ1117CR-3.3TRG1 which can handle 1A in an SOT89. Of course the limiting factor is really the power dissipation.
  • I used an LT1761-3.3, which is a SOT-23-5. So it's more about footprint power dissipation than age. The LT1761 is a nice low-noise regulator I've used in a number of commercial projects. I've socketted the Prop and actually stuck the regulator underneath, as close to both pairs of supply pins as is physically possible. 100mA is plenty for a non-overclocked Prop :smile:
  • Hey Peter,

    How do I go about declaring a bunch of longs? The glossary seems to indicate you use a comma-separated list, but I can't get it to work....
  • In other words
    long xpos,xneg,ypos,yneg
    

    should declare 4 longs - at least according to the glossary.
  • ErNaErNa Posts: 1,751
    @ CtlAltDel: what about xpos,xneg,ypos,yneg long ? just a hint. its Tachyon

    @Peter: we have used the new EASYFILE and it works like expected. Now we have to load ASM routines. First: lsroms showed no entry with freshly installed tachyon. After pasting "SAVEROM the UART HEX" lsroms showed different entries. It turned out that early entries appeared again. So we did an C100 2000 00 EFILL to erase a part of higher 32 kB and lsroms showed empty ROM, a next SAVEROM showed the expected result: only one entry.

    Next hurdle: how to create the INTEL HEX file?
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2018-09-19 12:32
    ErNa wrote: »
    @ CtlAltDel: what about xpos,xneg,ypos,yneg long ? just a hint. its Tachyon

    @Peter: we have used the new EASYFILE and it works like expected. Now we have to load ASM routines. First: lsroms showed no entry with freshly installed tachyon. After pasting "SAVEROM the UART HEX" lsroms showed different entries. It turned out that early entries appeared again. So we did an C100 2000 00 EFILL to erase a part of higher 32 kB and lsroms showed empty ROM, a next SAVEROM showed the expected result: only one entry.

    Next hurdle: how to create the INTEL HEX file?
    Have a look in the ROMS folder and there is the corresponding .spin file with the ROM header. Use "Compile and save binary" and then (using UART.spin) run bh.py like this:
    python bh.py --binaries=0,UART.binary

    That way you end up with UART.hex


    BTW - Comma separated names were implemented in V3 and I just kept in simple in V4 and V5 although I could implement it again if need be. For now just:
    long xpos
    long xneg
    long ypos
    long yneg

    But you should be able to chain these on the same line too:
    long xpos long xneg long ypos long yneg


    NOTE: If anyone wants to implement extra features in Tachyon I would be more than happy.
  • ErNaErNa Posts: 1,751
    edited 2018-09-19 13:38
    Thanks Peter, we will test it. Just another question: I remember there was a data logging example, quite simple, but can not find it again. The goal is to read the sigma delta converter and log the values to a file on sd card.. in 2014 I find https://forums.parallax.com/discussion/141061/tachyon-o-s-v3-0-juno-furiously-fast-forth-fat32-lan-vga-rs485-obex-roms-fp-lmm/p50

    this: MODULES LOADED:
    4917: DATALOGGER.fth CE1372 DATALOGGER 140620.0000
    3EE5: EASYNET.fth WIZNET NETWORK SERVERS 140615.2300
    38E6: W5200.fth WIZNET W5200 driver 140517.0100
    2FE8: EASYFILE.fth FAT32 Virtual Memory Access File System Layer V1.1 140528-0000
    2B30: SDCARD.fth SD CARD Toolkit - 140626.1400
    294C: CE1372.fth CE1372 WIDGET HARDWARE DEFINITIONS 131109.2340
    2883: EPRINT.fth Stores PRINT strings in EEPROM 140626.0000
    1881: EXTEND.fth Primary extensions to TACHYON kernel - 140626-14OO


    .. and: is there a CASE construct in Tachyon? the ability to read gives you an advantage
  • Hi Peter, I have a question that is not about Tachyon.
    But you are using the W5500 I need a Ethernet interface. What data rate can be achieved with this chip? There will only be one other partner on the net so no congestion. I would need an average data rate of 1MBit/s. Can this be done with a prop and a W5500?
    Thank you for any info.
    Any pitfalls to take care of when doing a layout?
  • MJBMJB Posts: 1,235
    BTW - Comma separated names were implemented in V3 and I just kept in simple in V4 and V5 although I could implement it again if need be. For now just:
    long xpos
    long xneg
    long ypos
    long yneg

    But you should be able to chain these on the same line too:
    long xpos long xneg long ypos long yneg


    NOTE: If anyone wants to implement extra features in Tachyon I would be more than happy.

    Before reading your post I just had a look in the TACHYON.spin source
    to see the 'Comma separated names' are not there any more.
    Good to read the source every now and then anyhow ;-).

    I think this is a seldom used feature and not worth blowing up the kernel.
    either separate lines for readability
    or all in one if you want it compact ... all fine

    Just as an encouragement for others to reading the source:

    Look for long in the internal dictionary in TACHYON.spin
           byte  4+im,"long"
            word  @VLONG+s
    
    then search for VLONG
    VLONG   word  _1
    VLONGS  word  _4,@VALIGN+s,@GRAB+s,_SHL2,@AVAR+t
    
    no code to handle the ',' comma.
    Just puts 1 on the stack and calls 'longs' ...

    then you can follow on what AVAR is really doing etc. ...
    and after a while you get a much more in depth feeling for
    "TACHYON under the hood"
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2018-09-19 14:13
    rbehm wrote: »
    Hi Peter, I have a question that is not about Tachyon.
    But you are using the W5500 I need a Ethernet interface. What data rate can be achieved with this chip? There will only be one other partner on the net so no congestion. I would need an average data rate of 1MBit/s. Can this be done with a prop and a W5500?
    Thank you for any info.
    Any pitfalls to take care of when doing a layout?

    If you are transferring large blocks then you can hit 245kBytes/sec for 4k blocks but if you want to go faster then we would access the W5500 via another cog which might even be optimized for high-speed SPI but at least can continue to run at maximum throughput. My IoT5500 modules are already designed to drop in onto a PCB with a footprint that is practically no larger than the RJ45 socket itself although I will have to get another run of these done sometime.

  • MJBMJB Posts: 1,235
    rbehm wrote: »
    Hi Peter, I have a question that is not about Tachyon.
    But you are using the W5500 I need a Ethernet interface. What data rate can be achieved with this chip? There will only be one other partner on the net so no congestion. I would need an average data rate of 1MBit/s. Can this be done with a prop and a W5500?
    Thank you for any info.
    Any pitfalls to take care of when doing a layout?

    they are talkng about 35-40MBps here:
    https://forum.wiznet.io/t/topic/4533

    but at 80MHz SPI
  • MJB wrote: »
    rbehm wrote: »
    Hi Peter, I have a question that is not about Tachyon.
    But you are using the W5500 I need a Ethernet interface. What data rate can be achieved with this chip? There will only be one other partner on the net so no congestion. I would need an average data rate of 1MBit/s. Can this be done with a prop and a W5500?
    Thank you for any info.
    Any pitfalls to take care of when doing a layout?

    they are talkng about 35-40MBps here:
    https://forum.wiznet.io/t/topic/4533

    but at 80MHz SPI
    35-40Mbps not MBps but they are quoting the SPI clock rate only and they have already stated before that it can't run at 80MHz as they hoped it would.

  • rbehmrbehm Posts: 102
    edited 2018-09-20 05:18
    rbehm wrote: »
    Hi Peter, I have a question that is not about Tachyon.
    But you are using the W5500 I need a Ethernet interface. What data rate can be achieved with this chip? There will only be one other partner on the net so no congestion. I would need an average data rate of 1MBit/s. Can this be done with a prop and a W5500?
    Thank you for any info.
    Any pitfalls to take care of when doing a layout?

    If you are transferring large blocks then you can hit 245kBytes/sec for 4k blocks but if you want to go faster then we would access the W5500 via another cog which might even be optimized for high-speed SPI but at least can continue to run at maximum throughput. My IoT5500 modules are already designed to drop in onto a PCB with a footprint that is practically no larger than the RJ45 socket itself although I will have to get another run of these done sometime.

    Thanks Peter and MJB
    That was also my intend to use a separate COG for the interface.
    35-40MB/s is not needed, I get data from an ARINC-708 (Manchester Bi-Phase encoded) interface that's only 1MB/s and will just dump it via Ethernet to the host.
    The prop is just ideal to make such special interfaces. Dedicate one COG for each. Another COG will do ARINC-429 in this project to interface weather radar to a moving map. that will be the third prop going into this equipment. Every aircraft needs several propellers.
  • @MJB
    Just as an encouragement for others to reading the source:

    Look for long in the internal dictionary in TACHYON.spin

    In fact this is exactly what I did before I posted the question. I found my way as far as:
    VLONGS word _4,@VALIGN+s,@GRAB+s,_SHL2,@AVAR+t

    ...wasn't 100% sure what was going on here, but I guessed that the CSV stuff wasn't in there, but thought I'd ask just in case I'd missed something.

    I agree that it isn't needed, just thought I'd use it if it was there.
  • Regarding ROM and Module management, I just wanted to check I understood correctly:

    ROMs: binary images created from compiled pasm code (using python script/SAVEROM), reside in EEPROM starting at $C000, loaded from EEPROM into cog using FINDROM/LOADCOG

    Modules: units of max 16 longs of pasm code (defined in RUNMODs section of Tachyon source), loaded from hub RAM into cog with LOADMOD, executed in cog with RUNMOD
  • Whoops, correction: modules loaded with [name] command as per RUNMODs table
  • Yes, the ROMS are upper EEPROM resident binary cog images which are loaded into cogs as required. The RUNMODs are small PASM modules that can be loaded into the Tachyon cog with a limit of 23 longs:
    loadsz = 23 ' Specifies the number of longs to load with LOADMOD for a RUNMOD module

    Seeing we have this method for loading ROMs into EEPROM, perhaps we could even load some custom RUNMODs too. I am trying to avoid having any funny hex blob in source code programs though.
  • Thanks Peter. I might try my hand at writing a module to drive the LTC2754. I take it nothing will barf if I remove unneeded modules, as long as I amend the RUNMOD table?
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2018-09-20 08:15
    RUNMODs are very small so there is no need to remove any and besides they only get loaded as needed. I will see if I can compile a RUNMOD and use LOADMOD to load it in.

    This is one from the kernel but we only need the PASM part:
    org     _RUNMOD
    ' [SDRDF] ( dst cnt -- )
    _SDRDF
    :l1             mov     phsb,#0
                    movi    frqb,#%0010_0000_0
                    test    miso,ina wc
                    rcl     r0,#1
                    test    miso,ina wc
                    rcl     r0,#1
                    test    miso,ina wc
                    rcl     r0,#1
                    test    miso,ina wc
                    rcl     r0,#1
                    test    miso,ina wc
                    rcl     r0,#1
                    test    miso,ina wc
                    rcl     r0,#1
                    test    miso,ina wc
                    rcl     r0,#1
                    test    miso,ina wc
                    mov     frqb,#0
                    rcl     r0,#1
                    wrbyte  r0,tos+1                    ' write byte to destination
                    add     tos+1,#1                    ' dst = dst+1
                    djnz    tos,#:l1                 ' next
                    jmp     #DROP2
    
    ' SDRD
    SDRDF   word  w+@_SDRDF+s,@aLOADMOD+t
    

    LOADMOD requires ( src dst cnt -- ) so even a TABLE of longs could be the RUNMOD to load.
    dst is the RUNMOD area in the cog which is simply and so we could integrate a hex blob like this:
    ...  ' RUNMOD .WORD 01D9 ok
    TABLE MYMOD
    $A0FF.FA00 ,  $58FF.F640 ,  $613C.07F2 ,  $34FF.2E01 ,  
    $613C.07F2 ,  $34FF.2E01 ,  $613C.07F2 ,  $34FF.2E01 ,  
    $613C.07F2 ,  $34FF.2E01 ,  $613C.07F2 ,  $34FF.2E01 ,  
    $613C.07F2 ,  $34FF.2E01 ,  $613C.07F2 ,  $34FF.2E01 ,  
    $613C.07F2 ,  $A0FF.F600 ,  $34FF.2E01 ,  $003F.2F9C ,
    
    pub [MYMOD]   MYMOD ' RUNMOD 20 LOADMOD ;
    
    (The hex longs are actual longs from SDRDF, I wrote a Q&D one-liner to dump in this format)
    ...  [SDRDF] ' RUNMOD 20 DUMPC 
    0000.01D9:  A0FF.FA00  58FF.F640  613C.07F2   34FF.2E01  613C.07F2  34FF.2E01  613C.07F2   34FF.2E01     
    0000.01E1:  613C.07F2  34FF.2E01  613C.07F2   34FF.2E01  613C.07F2  34FF.2E01  613C.07F2   34FF.2E01      ok
    


  • It's cute, but I'm not sure what it gets us - I'm happy just to use the existing infrastructure.

    There seems to be 2 versions of the SDIO module, one of which is commented out - what's the story here?
  • ErNaErNa Posts: 1,751
    Next Step: Task is to have a simple state machine running that allows to check buttons and switch LEDs.
    We want to use +POLL to have a program, that responses to the console and so can be controled by console input.

    I believe we ran into some problems with the CASE construct. We are not sure about the BREAK functionality.
    This piece of code:
    TACHYON V5
     {
     Demonstrates TACHYON ADC Data Logging.
     }
     
    module MONITORING.fth ." ADC Data Logging module - [2018-09-19 Wed 15:18]" ;
    
    byte iState
    byte LState
    
    0 LState C!
    
    pub RunLEDs
    
         LState C@ SWITCH
            0 CASE
              10 HIGH 10 LOW 10 FLOAT 1 LState C! BREAK
            1 CASE
              11 HIGH 11 LOW 11 FLOAT 2 LState C! BREAK
            2 CASE
              12 HIGH 12 LOW 12 FLOAT 0 LState C! BREAK
    ;
    
    pub RunMonitoring
      RunLEDs
    ;
    END
    

    ends up in crashing the system if we call it with RunMonitoring +POLL
    ...  TACHYON V5   Propeller .:.:--TACHYON--:.:. Forth V5r4 NEON 540180811.0000
    0026   ok
    
       End of source code, 0000  errors found  Load time = 0.5
    Code bytes used = 142
    Name bytes used = 64
    
    CODE:$48DE = 18142 bytes 
    NAME:$5AFC = 6404 bytes 
    DATA:$77BF = 687 bytes 
    FREE:      = 4638 bytes 
     Data Stack (0)
    
     ok
    ...  RunMonitoring +POLL  ok
    ...  �������������������������
    
      Propeller .:.:--TACHYON--:.:. Forth V5r4 NEON 540180811.0000
    

    and restarts TACHYON.

    When omiting the BREAK, we can load the modul but the stack keeps a value.
    TACHYON V5
     {
     Demonstrates TACHYON ADC Data Logging.
     }
     
    module MONITORING.fth ." ADC Data Logging module - [2018-09-19 Wed 15:18]" ;
    
    byte iState
    byte LState
    
    0 LState C!
    
    pub RunLEDs
    
         LState C@ SWITCH
            0 CASE
              10 HIGH 10 LOW 10 FLOAT 1 LState C!
            1 CASE
              11 HIGH 11 LOW 11 FLOAT 2 LState C!
            2 CASE
              12 HIGH 12 LOW 12 FLOAT 0 LState C!
    ;
    
    pub RunMonitoring
      RunLEDs
    ;
    END
    

    Loading this code results in a Stack Level of 1.
    Starting prints � ???
    --------------------------------------------------------------------------------
    ...  TACHYON V5   Propeller .:.:--TACHYON--:.:. Forth V5r4 NEON 540180811.0000
    0026   ok
    
       End of source code, 0000  errors found  Load time = 0.4
    Code bytes used = 136
    Name bytes used = 64
    
    CODE:$48D8 = 18136 bytes 
    NAME:$5AFC = 6404 bytes 
    DATA:$77BF = 687 bytes 
    FREE:      = 4644 bytes 
     Data Stack (1)
    $001F.4890 - 2050192
    
    
     ok
    ...  RunMonitoring +POLL  ok
    ...  � ???  
    ...  
    

    The LEDs connected to the pin flicker, as it is expected.
    If we insert a delay time on/10 ms/off the LEDs are bright, also as expected. So +POLL is able to manage modules that have a delay time longer than polling time. The hanging question is: what happens, if the modules runtime exceeds the polling intervall, will the intervall be expanded (polling frequency goes down?)

    Anyway, the CASE of CASE is under investigation, seems odd as long as not understood.


  • @ErNa - I'm assuming you meant "tick of" as in:
    ' RunMonitoring +POLL
    
    If you enter:
    RunMonitoring +POLL
    
    Then of course it runs RunMonitoring once without leaving anything on the stack but +POLL expects a valid address which it doesn't get.
  • ErNaErNa Posts: 1,751
    sorry, what do you mean with "tick of"? Maybe I also have the understanding of a 5th grader. If I think about it: RunMonitoring BLANK runs RunMonitoring, +POLL is called with empty stack, so must fail. " ' RunMonitoring " places the address of RunMonitoring on the stack? OK, writing this, I checked on Tachyon, YES. But I didn't find "'" in the glossary, had more the impression of it being a comment.
    LOW?     ( pin -- flg )    X    Test if pin is low
    HIGH?     ( pin -- flg )    X    Test if pin is high
    
    I somehow have the impression that this means "wait for"
  • I'm having trouble loading rooms, even the shortest "UART.hex" fails.
    I tried to compile "TACHYON5r4.spin" downloaded and afterwards loaded "EXTEND.FTH".
    Then I copy and paste "UART.hex"

    Afterwards I loaded "TACHYON5r4-180812.binary" and tried "UART.hex" again, but unsuccessfully.

    I have a Gadget Gangster, replacing eeprom with a 24lc512, who came by slow boat from China.

    I run the Linux Mint 19 Cinnamon, and use GTKTerm as a terminal.
    End of line delay is 15 miliseconds.

    What's next I can try?
    1337 x 1052 - 158K
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2018-09-20 22:11
    ErNa wrote: »
    sorry, what do you mean with "tick of"? Maybe I also have the understanding of a 5th grader. If I think about it: RunMonitoring BLANK runs RunMonitoring, +POLL is called with empty stack, so must fail. " ' RunMonitoring " places the address of RunMonitoring on the stack? OK, writing this, I checked on Tachyon, YES. But I didn't find "'" in the glossary, had more the impression of it being a comment.
    LOW?     ( pin -- flg )    X    Test if pin is low
    HIGH?     ( pin -- flg )    X    Test if pin is high
    
    I somehow have the impression that this means "wait for"

    The tick symbol ' in Forth finds the code address of the following word so what I meant with "tick of" was "tick symbol for address of" the following word. Using tiny symbols like tick and dot are a problem with proportional fonts as sometimes you don't see them so here I will space them out for clarity:
    '     RunMonitoring    +POLL
    
    We use this to find the code address of a word rather than actually executing it. Since my name fields are in a separate area I have the equivalent NFA' to find the name field address "of" a word. (Perhaps I should have an alias for this tiny symbol, maybe CFA' so that it corresponds with NFA'. I do that same for . in that I have PRINT etc. The symbol is easy to use interactively while the longer word is better for readability)

    When I use the ? symbol as a suffix I hope by convention to mostly imply that this returns with a yes/no true/false flag. So LOW? will test a pin and return with a true if high or false if low.
  • frida wrote: »
    I'm having trouble loading rooms, even the shortest "UART.hex" fails.
    I tried to compile "TACHYON5r4.spin" downloaded and afterwards loaded "EXTEND.FTH".
    Then I copy and paste "UART.hex"

    Afterwards I loaded "TACHYON5r4-180812.binary" and tried "UART.hex" again, but unsuccessfully.

    I have a Gadget Gangster, replacing eeprom with a 24lc512, who came by slow boat from China.

    I run the Linux Mint 19 Cinnamon, and use GTKTerm as a terminal.
    End of line delay is 15 miliseconds.

    What's next I can try?

    Thanks for the screen shot, I see you typed in SAVEROM yourself before pasting since I had left that out while I was experimenting with some bash script and python code :)

    Just to make sure I have manually added SAVEROM to the start of the text file and tried pasting it with GTkTerm set to 15ms but unfortunately it worked :)
    ...               
    01FB Saving to EEPROM  ok
    ...   
    

    Could you try that again?
Sign In or Register to comment.