Shop OBEX P1 Docs P2 Docs Learn Events
TAQOZ - Tachyon Forth for the P2 BOOT ROM - Page 32 — Parallax Forums

TAQOZ - Tachyon Forth for the P2 BOOT ROM

1293032343538

Comments

  • jmgjmg Posts: 15,175
    hinv wrote: »
    I wasn't thinking of expanding the ROM, but just putting as much as possible of the newer TAQOZ into rom (prioritized, of course, by likely need) and load the lesser needed from SD, I2C, SPI, or whatever.
    That's already been done.
    hinv wrote: »
    This semiconductor fabrication is a bit out of my league, but I would think that updating ROM for a new batch of chips would be pretty trivial.
    All changes have a cost and a risk, so unless there are explicit ROM bugs found, it is unlikely Parallax would change the ROM,
    The issue currently under investigation, may not even involve a ROM layer change.

  • Cluso99Cluso99 Posts: 18,069
    IIRC the ROM is not a mask layer, but built from biased transistors and was one of the first parts to be frozen, well ahead of the Verilog. Chip did mention the cost to change and it wasn’t trivial.
  • I need some help with changing the Clock speed from TAQOZ again.
    I had this working before (page 16 of this thread; last Dec)

    What I need is to be able to change clock speed when using the ROM version of TAQOZ.

    What worked before was to boot, then paste the EXTEND file and then type:
    230400 CONBAUD P2-ES CRUISE

    That used to work.
    Now it does not recognize the "P2-ES" word and then CRUISE mangles my terminal connection.
    The "P2-ES" word was an important word to make this work but I don't even see it in the EXTEND file at all.

    I downloaded the EXTEND file from the P2-->Forth folder on Peter's dropbox but I get the same problem.

    Clearly things have changed and my files are out of date.
    What file do I need?

    Jason
  • I copied the original extensions across to the TAQOZ/Forth folder as "TAQOZ 1V0 ROM EXTEND.FTH". Just paste this in with maybe a small line delay. The code has been attached as a .TXT for reference.

    Here's a test on P2D2r3
    Cold start
    ----------------------------------------------------------------
      Parallax P2  .:.:--TAQOZ--:.:.  V1.0--142          180530-0135
    ----------------------------------------------------------------
    ----------------------------------------------------------------  ok
    ----------------------------------------------------------------  ok
    TAQOZ#   ok
    TAQOZ#   ok
    TAQOZ#   ok
    TAQOZ#   ok
    TAQOZ# TAQOZ   Parallax P2  .:.:--TAQOZ--:.:.  V1.0--142          180530-0135
     209                             
    210 lines and 834 bytes compiled,  with 0 errors in 1,046ms  ok
    TAQOZ#   ok
    TAQOZ# 230400 CONBAUD  25,000,000 XIN CRUISE  ok
    TAQOZ#   ok
    TAQOZ# .CLK 180MHz ok
    TAQOZ# fibos 
    fibo(1) = 458 cycles = 2,544ns @180MHz result =1
    fibo(6) = 778 cycles = 4,322ns @180MHz result =8
    fibo(11) = 1,098 cycles = 6,100ns @180MHz result =89
    fibo(16) = 1,418 cycles = 7,877ns @180MHz result =987
    fibo(21) = 1,738 cycles = 9,655ns @180MHz result =10946
    fibo(26) = 2,058 cycles = 11,433ns @180MHz result =121393
    fibo(31) = 2,378 cycles = 13,211ns @180MHz result =1346269
    fibo(36) = 2,698 cycles = 14,988ns @180MHz result =14930352
    fibo(41) = 3,018 cycles = 16,766ns @180MHz result =165580141
    fibo(46) = 3,338 cycles = 18,544ns @180MHz result =1836311903 ok
    TAQOZ# 
    

  • I copied the original extensions across to the TAQOZ/Forth folder as "TAQOZ 1V0 ROM EXTEND.FTH". Just paste this in with maybe a small line delay. The code has been attached as a .TXT for reference.

    Awesome ! Thanks again Peter!
    I will try this tonight ;-)

    J
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2019-10-21 02:33
    Well once again I get sidetracked as I was going to have the new filesystem methods to replace EASYFILE done by now. However, in the meantime I have added reporting like I have for P1 although I will expand on what I have at present no doubt including more detailed information about connected hardware.
    TAQOZ# sysinfo --- 
    KERNEL            Parallax P2  *TAQOZ* Extensible Firmware  V2.2 'CHIP' 200MHz 191021-0900
    MODULES:
      *EASYNET*     WIZnet NETWORK SERVERS 160707.1500 
      *W5500*       WIZNET W5500 driver for TAQOZ V1.0 191007 
      *TEXT*        VGA BMP TEXT 190800-0000
      *BMV*         BMV VIDEO PLAYER 190800-0000
      *WAVE*        WAVE AUDIO FILE PLAYER 190800-0000
      *BMP*         BMP FILE VIEWER 190800-0000
      *AV*          AUDIO & VIDEO DRIVERS 190614-0000 
      *ASMEX*       PASM2 instruction exerciser 191014-0000
      *SPIRAM*      LY68L6400 8MB SPI RAM ACCESS 191020-0000
      *DECOMPILER*  A decompiler for TAQOZ 190825-0000
      *RTC*         RV-3028 RTC DATE and TIME 190800-0000
      *I2C*         I2C BUS DRIVER 191000-0000
      *DISK*        SD DISK REPORTING & FORMATTING TOOLS 190800-0000
      *EASYFILE*    SD CARD and FAT32 with VIRTUAL MEMORY  190800-0000
      *SMARTPINS*   SMARTPIN FUNCTIONS and drive modes 190800-0000
      *P2CLOCK*     P2 CLOCK CONTROL 190800-0000
    MEMORY MAP
      CODE:         $0000_8596 34,198 bytes
      WORDS:        $0000_BD3D 11,540 bytes
      DATA:         $0007_E17A 378 bytes
      64K FREE:                14,247 bytes
    DEVICES
      SD CARD       SANDISK   SD SL08G REV$80 #588053344 DATE:2016/2
      SPI FLASH     $EF40_1400 #525908677058773111
    I2C DEVICES     $A4 $C0 
      RV3028 RTC    2166/66/65 ... 00:00:18 ok
    TAQOZ# 
    
    EDIT: updated sysinfo report
    BTW, "64K FREE" refers to the free memory in the first 64K which I have constrained TAQOZ to including VGA palette and file buffers etc so that screen memory starts at $1.0000
  • @"Peter Jakacki"
    Hi Peter

    I’m playing more with servos and had a few odd observations and a few questions.

    Right now I’m trying to get the SMALLEST movement possible from a Parallax Feedback 360 servo.
    Here are the words I have defined:

    : STOP 745 10000 360 pwm ; -Stop the servo by setting it to it's center Deadzone
    : B 1 DO I 2 + DROP LOOP ; -delay loop
    : M 10000 360 pwm ; -Move servo
    : TWITCH 730 M 25000 B STOP ; -make smallest movement

    Here are the values for M that change the servos movement:
    300 - 639 Fast CW
    640 - 732 Slow CW
    733 - 761 STOPPED (Dead band)
    762 - 855 Slow CCW
    860 - 1260 Fast CCW

    Also, I’m running the servo at 7 volts.
    The servo is under NO physical load.

    There are THREE odd observations I had that all relate to TAQOZ somehow.

    1) I tried a test where I defined M as the following:
    : M 10000 360 pwm 1 us STOP ;

    Using “us” as a delay filled the screen with an endless stream of dots and TAQOZ was no longer responding. I had to reset the board to continue.
    What did I bork ??
    As you can see from my code, I defined “B” to be a simple delay instead of using “us” for now.
    Is there a better way to do a delay?

    2) While testing my “TWITCH” word, I would paste it multiple times into the console.
    I had the unexpected result of it working “most” of the time. There did not seam to be any pattern.
    HOWEVER, when I put the code in a loop, it seemed to work every time and move the same distance everytime.
    Is this an interpreter glitch??

    3) Here’s another oddity when pasting code multiple times into the console.
    Here is the console after I pasted the EXTEND code:

    207
    208
    209
    210 lines and 834 bytes compiled, with 0 errors in 967ms ok
    TAQOZ# 230400 CONBAUD P2-ES CRUISE ok
    TAQOZ# ok
    TAQOZ# ¯ ??? ok
    TAQOZ# : STOP 745 10000 360 pwm ; ok
    TAQOZ# : B 1 DO I 2 + DROP LOOP ; ok
    TAQOZ# : M 10000 360 pwm ; ok
    TAQOZ# : twitch 730 M 25000 B STOP ; ok
    TAQOZ# 16 pin ok
    TAQOZ# mute ok
    TAQOZ# 16 pin ok
    TAQOZ# stop ok
    TAQOZ# 10 0 do I twitch loop ok
    TAQOZ# 10 0 do I twitch loop ok
    TAQOZ# 10 0 do I twitch loop ok
    TAQOZ# 10 0 do I twitch loop


    You will notice that there is no “OK” after the last line.
    The servo wasn’t moving.
    The terminal program and the P2-ES Tx LED did respond when pressing keys but the TAQOZ console remained unresponsive.

    I would love to hear any thoughts you might have on these items :-)

    J
  • @thej
    SEE is your friend, use it.
    TAQOZ# SEE us
    E681: pub us
    1814: 1472     CLKMHZ
    1816: 00BF     W*
    1818: F9E5     485   $01E5 
    181A: 007B     -
    181C: 0E94     WAIT
    181E: 004D     EXIT
          12 bytes 
    
    From this you can see that if you go too low then the calculation overhead forces the unsigned wait parameter to become negative or very large. The practical limit here is around 5us or more but you can always use WAIT for a controlled delay rather than loops.
    TAQOZ# LAP 500 WAIT LAP .LAP --- 610 cycles= 3,050ns @200MHz ok
    

    Your PWM prescaler and frame time seems to be around 18ms so your B delay addresses that by not trying to update more often then that but there's also the servo response time to take into consideration, just how long does it take the servo to start and finish when giving a new value. These are things you need to try out and are either covered in the specifications or they are things you need to measure under controlled conditions.

    I will try to look at your post in more detail later as I need to fly out the door.


  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2019-10-29 11:14
    @thej - just got back in and tried your code. Seems there is a problem.
    TAQOZ# .s --- 
     DATA STACK (0) ok
    TAQOZ# 10 0 do I twitch loop ---  ok
    TAQOZ# .s --- 
     DATA STACK (10)
    1   $0000_0009   9
    2   $0000_0008   8
    3   $0000_0007   7
    4   $0000_0006   6
    5   $0000_0005   5
    6   $0000_0004   4
    7   $0000_0003   3
    8   $0000_0002   2
    9   $0000_0001   1
    10   $0000_0000   0 ok
    TAQOZ#
    
    Repeating that each time will leave more and more garbage on the stack until eventually it crashes something. You are passing I to "twitch" which doesn't use up any external parameters. Putting twitch in a loop is giving the servo time to "twitch" but only sending out a single twitch pulse and resetting it is expecting a bit much from any motor or servo. The problem is that you told it to "stop" straight after that twitch pulse. The loop though was going "twitch, wait 20ms, STOP, no delay (so effectively canceling stop) and twitch again etc"

    Best thing is not to have STOP in there at all so that you could test it properly twitching back and forth like this:
    10 FOR twitch 200 ms STOP 200 ms NEXT
    

    BTW, FOR NEXT traditionally was just used as a simple loop without an index etc but TAQOZ implements a default starting index of 0 and increments that as if it were a "0 DO" loop. It's also possible to mix many of the DO LOOP and FOR NEXT compatible words together too. The other thing is that the interactive line is always compiled, just like a definition, so it will always work the same way at the same speed.

    EDIT: I decided to recode the microsecond routine as hubexec and when the P2 clock speed is changed it directly modifies an instruction there to suit. Now you can type "1 us".
    TAQOZ# LAP 1 us LAP .LAP --- 250 cycles= 1,000ns @250MHz ok
    TAQOZ# LAP 10 us LAP .LAP --- 2,498 cycles= 9,992ns @250MHz ok
    



  • thejthej Posts: 232
    edited 2019-10-30 00:09
    Nice update to the us code :-)

    Curious question for you.
    When I use Lap to time "20 ms" I don't get 20 ms as a duration.
    Is it coded for a specific clock speed?

    lap 20 ms lap .lap 1,600,474 cycles = 8,891,522ns @180MHz ok

    Remember that I am using the ROM version with ROM Extend file.

    J
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2019-10-30 14:24
    @thej - while the limited ROM version can be extended it is mainly useful as a hardware debugging tool. It is just as easy to load in a full version of TAQOZ. I will add a quick TAQOZ binary link to my sig to make that easier.

    Here is the latest TAQOZ binary, just rename it to _BOOT_P2.BIX etc and load it up onto the SD card and it will boot automatically running at 200MHz at 115200 baud default. You can change your settings easily at runtime.
    This is how it should greet you on reset (there's a short delay in there in case you just plugged it in and the USB is still connecting.
    Parallax P2  *TAQOZ* Extensible Firmware  V2.2 'CHIP' 200MHz 191021-0900
    
    KERNEL            Parallax P2  *TAQOZ* Extensible Firmware  V2.2 'CHIP' 200MHz 191021-0900
    MODULES:
      *MANDELBROT*  MANDELBROT VGA DEMO 190800-0000 
      *TEXT*        VGA BMP TEXT 190800-0000
      *BMV*         BMV VIDEO PLAYER 190800-0000
      *WAVE*        WAVE AUDIO FILE PLAYER 190800-0000
      *BMP*         BMP FILE VIEWER 190800-0000
      *AV*          AUDIO & VIDEO DRIVERS 190614-0000 
      *ASMEX*       PASM2 instruction exerciser 191014-0000
      *SPIRAM*      LY68L6400 8MB SPI RAM ACCESS 191020-0000
      *DECOMPILER*  A decompiler for TAQOZ 190825-0000
      *RTC*         RV-3028 RTC DATE and TIME 190800-0000
      *I2C*         I2C BUS DRIVER 191000-0000
      *DISK*        SD DISK REPORTING & FORMATTING TOOLS 190800-0000
      *EASYFILE*    SD CARD and FAT32 with VIRTUAL MEMORY  190800-0000
      *SMARTPINS*   SMARTPIN FUNCTIONS and drive modes 190800-0000
      *P2CLOCK*     P2 CLOCK CONTROL 190800-0000
      *SPIFLASH*
    MEMORY MAP
      CODE:         $0000_7062 28,770 bytes
      WORDS:        $0000_C4F4 9,578 bytes
      DATA:         $0000_EFA4 301 bytes
      64K FREE:                21,650 bytes
    DEVICES
      SD CARD       SANDISK   SD SC64G REV$80 #35190404 DATE:2018/10
    I2C DEVICES
    -------------------------------------------------------------------------------
    TAQOZ# 
    
  • @thej - while the limited ROM version can be extended it is mainly useful as a hardware debugging tool. It is just as easy to load in a full version of TAQOZ. I will add a quick TAQOZ binary link to my sig to make that easier.Here is the latest TAQOZ binary, just rename it to _BOOT_P2.BIX etc and load it up onto the SD card...

    Should this work with the Rev 1 chips? Does not for me...


    dgately
  • @dgately
    I'll be trying this tonight with my P2-ES board. I'll let you know how it goes.

    J
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2019-10-31 00:16
    Ok, I checked on my original eval board and the SD doesn't like to mount properly so I fixed it to 100MHz which you can change after boot from the terminal. The RevB eval board works fine but that has to do with an improved layout for the SD. The funny thing is that I had it working fine at one time so I will need to check "what I didn't change" :)

    Use this new binary which I double-checked for the eval board and it boots up at 115.2k baud although I prefer 3Mbd myself. Just remove the .ROM suffix which was added to keep the forum bot happy. The VGA is streamed differently with the RevB silicon.
    I added a final definition manually to indicate that this is the P2ES-EVAL board when it boots up and displays the system info.
    Parallax P2  *TAQOZ* Extensible Firmware  V2.2 'CHIP' 100MHz 191021-0900
    
    KERNEL            Parallax P2  *TAQOZ* Extensible Firmware  V2.2 'CHIP' 100MHz 191021-0900
    MODULES:
      *P2ES-EVAL*
      *ASMEX*       PASM2 instruction exerciser 191014-0000
      *SPIRAM*      LY68L6400 8MB SPI RAM ACCESS 191020-0000
      *DECOMPILER*  A decompiler for TAQOZ 190825-0000
      *RTC*         RV-3028 RTC DATE and TIME 190800-0000
      *I2C*         I2C BUS DRIVER 191000-0000
      *DISK*        SD DISK REPORTING & FORMATTING TOOLS 190800-0000
      *EASYFILE*    SD CARD and FAT32 with VIRTUAL MEMORY  190800-0000
      *SMARTPINS*   SMARTPIN FUNCTIONS and drive modes 190800-0000
      *P2CLOCK*     P2 CLOCK CONTROL 190800-0000
      *SPIFLASH*
    MEMORY MAP
      CODE:         $0000_58CE 22,734 bytes
      WORDS:        $0000_CD75 7,401 bytes
      DATA:         $0000_EF13 156 bytes
      64K FREE:                29,863 bytes
    DEVICES
      SD CARD       SANDISK   SD SC64G REV$80 #35190404 DATE:2018/10
    I2C DEVICES
    -------------------------------------------------------------------------------
    TAQOZ#  ---  ok
    TAQOZ# 
    
    CTRL-A Z for help | 115200 8N1 | NOR | Minicom 2.7.1 | VT102 | Offline | ttyUSB0                                                                     
    
  • Works great Peter !!!
    ...and 20 ms does indeed equal... 20ms :-)

    J
  • thej wrote: »
    Works great Peter !!!
    ...and 20 ms does indeed equal... 20ms :-)

    J

    Yes, works for me, as well!

    Thanks,
    dgately

  • If you connect your VGA on P0 it should display a random VGA pattern. I meant to load AV.FTH into that binary but you can always just copy and paste the file yourself and then type "BACKUP BIX" to quickly backup to the .BIX file although mostly I save to the MBR using "BU" as a shortcut.

    Once loaded you can divert the console output to the VGA using the "VGA" word and use "CON" to divert back to the console.
    Use VIEW <filename> to view 640x480 BMP files, and you can also play 16-bit WAV files over the audio output. On one of my links I even have bitmap demo videos that you can copy onto the SD card and have it play in full screen, QVGA, or both. Don't forget that you can change the P2 clock simply by typing "200 P2MHZ" and once again if you want to lock that in you should do a backup.

  • I've updated the binary for TAQOZ RELOADED (vs TAQOZ ROM) on the P2EVAL RevA and it now includes all the audio and video stuff as well along with a game of breakout for VGA.
    Click the link in my sig (which I double checked)

    The default sysclock is 300MHz and the serial coms starts up at a slow 115200 baud for compatibility (I like 3Mbd). In case you don't have sound try typing EVAL as that sets up P6,7 for audio out (you can backup this config if you want).

    BTW, for some strange reason I seem to have trouble releasing the SD's data out line even though I've tried all the extra clocks etc. This is preventing the SPI Flash from working although the P2D2 has an isolation resistor for this reason.
    Parallax P2  *TAQOZ* Extensible Firmware  V2.2 'CHIP' 300MHz 191021-0900
    
    KERNEL            Parallax P2  *TAQOZ* Extensible Firmware  V2.2 'CHIP' 300MHz 191021-0900
    MODULES:
      *P2ES-EVAL*
      *BREAKOUT*    BREAKOUT FOR THE P2 - 190606
      *TEXT*        VGA BMP TEXT 190800-0000
      *BMV*         BMV VIDEO PLAYER 190800-0000
      *WAVE*        WAVE AUDIO FILE PLAYER 190800-0000
      *BMP*         BMP FILE VIEWER 190800-0000
      *AV*          AUDIO & VIDEO DRIVERS 190614-0000 
      *ASMEX*       PASM2 instruction exerciser 191014-0000
      *SPIRAM*      LY68L6400 8MB SPI RAM ACCESS 191020-0000
      *DECOMPILER*  A decompiler for TAQOZ 190825-0000
      *RTC*         RV-3028 RTC DATE and TIME 190800-0000
      *I2C*         I2C BUS DRIVER 191000-0000
      *DISK*        SD DISK REPORTING & FORMATTING TOOLS 190800-0000
      *EASYFILE*    SD CARD and FAT32 with VIRTUAL MEMORY  190800-0000
      *SMARTPINS*   SMARTPIN FUNCTIONS and drive modes 190800-0000
      *P2CLOCK*     P2 CLOCK CONTROL 190800-0000
      *EXTEND*      Primary kernel extensions 191102-0000
      *SPIFLASH*
    MEMORY MAP
      CODE:         $0000_742A 29,738 bytes
      WORDS:        $0000_C380 9,950 bytes
      DATA:         $0000_EFB8 321 bytes
      64K FREE:                20,310 bytes
    DEVICES
      SD CARD       SANDISK   SD SC64G REV$80 #35190404 DATE:2018/10
    I2C DEVICES
    -------------------------------------------------------------------------------
    TAQOZ#
    
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-02-05 02:20
    While I was reformatting the P2 instruction spreadsheet for my own use (now that it is set in silicon), I have been discovering various instructions and methods that I like to put to use in TAQOZ. However, one of the simplest to implement is the new multi-pin operations that are possible with the Rev B silicon. Previously the pin instructions such as DRVH and DIRL etc only accepted a 6-bit destination for a pin number, but now it is possible to specify a starting pin and a range in the same destination. Although only 9-bits are available directly leaving 5-bits for the range this can be extended with SETQ to set the range.

    For most purposes if the range is 32 or less then here is a simple prefix operation in TAQOZ to encode the range into the pin destination.
    pub PINS ( from for -- pins )     1- 6 << + ;
    

    Now here is how it can be used, starting with a simple lsio to show the initial state of the pins:
    TAQOZ# lsio --- 
    P:0000000000111111111122222222223333333333444444444455555555556666
    P:0123456789012345678901234567890123456789012345678901234567890123
    ?:lllllhhhhhhhhhhhhhhhhhhhhhhhhhhhhlhhhhhhhhhhhhhhhhhhhhhhLhlLLLHL
    =:ddddd~~~~~~~~~~~~~~~~~~~~~~~~~~~u~u~~~~~~~~~~~~~~~~~~~~~uud~uu ok
    

    Then setting P8 for 4 pins low:
    TAQOZ# 8 4 PINS LOW ---  ok
    TAQOZ# lsio --- 
    P:0000000000111111111122222222223333333333444444444455555555556666
    P:0123456789012345678901234567890123456789012345678901234567890123
    ?:lllllhhhLLLLhhhhhhhhhhhhhhhhhhhhhhlhhhhhhhhhhhhhhhhhhhhhLhhLLLHL
    =:ddddd~~~~~~~~~~~~~~~~~~~~~~~~~~~u~?~~~~~~~~~~~~~~~~~~~~~uu~~uu ok
    

    Then P12 for 6 pins high
    TAQOZ# 12 6 PINS HIGH ---  ok
    TAQOZ# lsio --- 
    P:0000000000111111111122222222223333333333444444444455555555556666
    P:0123456789012345678901234567890123456789012345678901234567890123
    ?:lllllhhhLLLLHHHHHHhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhLhhLLLHL
    =:ddddd~~~~~~~~~~~~~~~~~~~~~~~~~~~u~u~~~~~~~~~~~~~~~~~~~~~uu~~uu ok
    

    Then using the fast toggle command T which uses the current PIN to DRVNOT P14 for 4 pins:
    TAQOZ# 14 4 PINS PIN T ---  ok
    TAQOZ# lsio --- 
    P:0000000000111111111122222222223333333333444444444455555555556666
    P:0123456789012345678901234567890123456789012345678901234567890123
    ?:lllllhhhLLLLHHLLLLhhhhhhhhhhhhhhhlhhhhhhhhhhhhhhhhhhhhhhLhhLLLHL
    =:ddddu~~~~~~~~~~~~~~~~~~~~~~~~~~~u~u~~~~~~~~~~~~~~~~~~~~~uu~~uu ok
    

    Then lastly making sure P0 for 32 pins are floating:
    TAQOZ# 0 32 PINS FLOAT ---  ok
    TAQOZ# lsio --- 
    P:0000000000111111111122222222223333333333444444444455555555556666
    P:0123456789012345678901234567890123456789012345678901234567890123
    ?:lllllhhhhhhhhhhhhhhhhhhhhhhhhhhhhlhhhhhhhhhhhhhhhhhhhhhhLhhLLLHL
    =:ddddd~~~~~~~~~~~~~~~~~~~~~~~~~~~u~u~~~~~~~~~~~~~~~~~~~~~uu~~uu ok
    
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-03-17 09:24
    Sometimes I need to trace what TAQOZ is doing instruction by instruction and in the past when the system has locked up I compile a version that uses some dedicated assembly level trace routines to print the Instruction Pointer, the wordcode it reads, and the stack. But now I have incorporated it into the kernel as standard and there is no overhead when it is not used. Code can explicitly enable TRACE or UNTRACE, or via the serial rx routine which monitors key sequences. Normal seuquences such as ESC ESC ESC ESC will reset the cog, and ^Z ^Z ^Z ^Z reboots the chip, but now I have added the ^T and ^U sequences where 4 are typed in sequence. So now even if the code appears to be locked up you can hit ^T four times and it will start reporting .

    Here is a simple use of an explicit trace to see what's going on with the stack:
    TAQOZ# !SP TRACE 100 300 SWAP - NOP UNTRACE ---
     7288 : F864 
     728A : F92C 1( 00000064 )
     728C : 007F 2( 0000012C  00000064 )
     728E : 008C 2( 00000064  0000012C )
     7290 : 0051 1( 000000C8 )
     7292 : 1324 1( 000000C8 ) ok
    

    The format is:
     IP   : CODE STACK DEPTH( TOP SECOND etc )
     728E : 008C 2( 00000064  0000012C )
    
    This may be enhanced to print out the name of the routine called etc but it has also got to be able to work even if the dictionary is corrupted.
    EDIT: Just tested out a simple name report - I will update the binary later tonight.
    TAQOZ# !SP TRACE 8 4 PINS UNTRACE ---
     60A0 : F808                 
     60A2 : F804                 1( 00000008 )
     60A4 : 333E PINS            2( 00000004  00000008 )
     333E : 008A 1-              2( 00000004  00000008 )
     3340 : F806                 2( 00000003  00000008 )
     3342 : 00AD <<              3( 00000006  00000003  00000008 )
     3344 : 008D +               2( 000000C0  00000008 )
     3346 : 004D                 1( 000000C8 )
     60A6 : 1390 UNTRACE         1( 000000C8 ) ok
    TAQOZ#  ---  ok
    

    I've attached the latest 64k binary that you can load up or copy onto an SD card for instant power-on boot on your RevB EVAL.
    This is the serial console startup at 115200 baud. This plus some extra utilities is what will be loaded onto the P2D2 boards this week (sorry, so many delays).
    KERNEL            Parallax P2  *TAQOZ* Extensible Firmware  V2.3 'CHIP' 200MHz 200317-1300
    MODULES:
      *TEXT*        VGA BMP TEXT 190800-0000
      *BMV*         BMV VIDEO PLAYER 190800-0000
      *WAVE*        WAVE AUDIO FILE PLAYER 190800-0000
      *BMP*         BMP FILE VIEWER 190800-0000
      *AV*          AUDIO & VIDEO DRIVERS 190614-0000 
      *TIA*         TAQOZ INTERACTIVE ASSEMBLER for the PARALLAX P2 - 200313-2200
      *SPIRAM*      LY68L6400 8MB SPI RAM ACCESS 191020-0000
      *DECOMPILER*  A decompiler for TAQOZ 190825-0000
      *RTC*         RV-3028 RTC DATE and TIME 190800-0000
      *I2C*         I2C BUS DRIVER 191000-0000
      *DISK*        SD DISK REPORTING & FORMATTING TOOLS 190800-0000
      *EASYFILE*    SD CARD and FAT32 with VIRTUAL MEMORY  190800-0000
      *SMARTPINS*   SMARTPIN FUNCTIONS and drive modes 190800-0000
      *P2CLOCK*     P2 CLOCK CONTROL 190800-0000
      *EXTEND*      Primary kernel extensions 200309-1000
      *SPIFLASH*
    MEMORY MAP
      CODE:         08C1A  35,866 bytes
      WORDS:        0B0A0  14,729 bytes
      DATA:         8002A  1,066 bytes
      64K FREE:            9,350 bytes
    HARDWARE
      PCB           P2      (P2D2)
      CLOCK IN      20MHZ
    DEVICES
      SD CARD       63 GB  SANDISK   SD SC64G REV$80 #35190404 DATE:2018 /10
      SPI FLASH     16MB WINBOND $EF40_1800 #4837448895114529879
    I2C DEVICES
      $A4           RV-3028 RTC
      $C4           Si5351A CLOCK GEN
                    2020/03/17 TUE 17:57:36
    -------------------------------------------------------------------------------
    
  • Nice addition :smile:
  • ErNaErNa Posts: 1,752
    edited 2020-03-17 14:35
    [img][/https://forums.parallax.com/utility/thumbnail/129001/FileUpload/7e/68682d5428841b540edc63defd2595.jpgimg]Hi Peter, I very much like to test what you describe as my project is stalled. Any updates? UPS is still working here ...-) Edit: As I'm sometimes reading between the lines I missed the message in the lines : "This plus some extra utilities is what will be loaded onto the P2D2 boards this week (sorry, so many delays)." What makes me happy now..[/img]
  • @"Peter Jakacki"

    I tried the TRACE. The attached is what I see.
    What am I missing?
    802 x 303 - 24K
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-03-17 15:32
    DaveJenson wrote: »
    @"Peter Jakacki"

    I tried the TRACE. The attached is what I see.
    What am I missing?

    Well I'll be, it worked perfectly on the P2D2 but when I tried it on the P2EVAL it spat out garbage! After some head scratching it turns out that I wasn't padding the serial transmit with stop bits. Not sure why it worked without them before but that's what I had to do to fix it. I think the UB3 chip I use for USB serial is ignoring those framing errors perhaps.

    This is off the P2 EVAL now:
    TAQOZ# TRACE 12 34 56 ROT - SWAP DUP + * DROP UNTRACE --- 
     8C84 : F80C                 1( 00000240 )
     8C86 : F822                 2( 0000000C  00000240 )
     8C88 : F838                 3( 00000022  0000000C  00000240 )
     8C8A : 0083 ROT             4( 00000038  00000022  0000000C  00000240 )
     8C8C : 008C -               4( 0000000C  00000038  00000022  00000240 )
     8C8E : 007F SWAP            3( 0000002C  00000022  00000240 )
     8C90 : 0074 DUP             3( 00000022  0000002C  00000240 )
     8C92 : 008D +               4( 00000022  00000022  0000002C  00000240 )
     8C94 : 0FFC *               3( 00000044  0000002C  00000240 )
     8C96 : 0069 DROP            2( 00000BB0  00000240 )
     8C98 : 138C UNTRACE         1( 00000240 ) ok
    

  • @"Peter Jakacki"

    Sorry to bother you again. I loaded the latest _BOOT_P2.BIX

    TerraTerm at 115200, 8, n,1

    I get no response. I see the Serial led flash when I type, but nothing on the screen.

    (Help?)
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-03-18 01:14
    That's very strange, I've double checked and cross checked those files and they definitely do work on the P2 RevB EVAL board. Enter the TAQOZ ROM then with the [>] + [space] + [esc] and you should be greeted by the TAQOZ prompt. MOUNT the card and do a DIR to make sure everything is working and you can see a _BOOT_P2.BIX file like this:
    -------------------------------------------------------------------------------
      Parallax P2  .:.:--TAQOZ--:.:.  V1.1--v33h         190219-1900
    -------------------------------------------------------------------------------
    TAQOZ#  ---  ok
    TAQOZ#  ---  ok
    TAQOZ# mount --- .SDSL32G 418C_9D60 LUMIX      32k 30,432M ok
    TAQOZ# dir --- 
    .SDSL32G 418C_9D60 LUMIX      32k 30,432M
    _BOOT_P2.BIX $01D4_9900   2014.06.19.01.31   65,536
    
    I had to remove the card and reset to get into the ROM and then reinserted it before MOUNT.

    I've added a small README to the zip file:
  • @"Peter Jakacki"

    Thank you. Further experimentation reveals that I have a flaky 4GB SD card...

    Time to replace it with modern technology (64GB or larger...)
  • Hi Peter,
    Have you had any experience with the Green Arrays evaluation board (EVB001)? It's a Forth development environment with a single chip containing 144 distinct computers! Their site is http://www.greenarraychips.com

    Kind regards,
    Michael
    K6MLE
  • K6MLE wrote: »
    Hi Peter,
    Have you had any experience with the Green Arrays evaluation board (EVB001)? It's a Forth development environment with a single chip containing 144 distinct computers! Their site is http://www.greenarraychips.com

    Kind regards,
    Michael
    K6MLE

    Ahh, those darned Green Arrays chips. I'm still waiting for them to showcase a real working code demonstration that will amaze me. Been waiting, Nada.
    I can't see how buried and introverted MISC CPUs (not "fully fledged computers") with such a tiny scratchpad of memory each can be made to work effectively.
    There are some that have direct access some I/O, and many don't etc.

    The P2 with 8 cores and direct access to each and every I/O and memory along with smart pins beats this chip with 144 cores hands down.

  • So I'm to understand that you've not yet had the 'experience'! :)
    Would you like to? I have one of the original evaluation boards and two binders of apps and notes that I notice I haven't touched in 9 years. My original outlay was just under $500.
    I wouldn't make this offer to very many others, but I'd be willing to send it to you to see what you can make it do!
    Do you think you'd be interested and have the time to give it a serious look? Not be like me, who has too many irons in the fire and still can't seem to spend any time with it ...

    Let me know!
    Kind regards,
    Michael
    K6MLE
Sign In or Register to comment.