Shop OBEX P1 Docs P2 Docs Learn Events
Debug and explore your hardware the easy way! - Page 2 — Parallax Forums

Debug and explore your hardware the easy way!

2»

Comments

  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2015-03-05 21:59
    Cluso99 wrote: »
    Peter,
    I am hoping for a little spare time to try this finally.
    Can you post (or email) me the source files and what I need to compile this please?
    I need to recompile for 6.5MHz as that is my usual xtal in my boards and it makes it easier for me to try when I have a few spare minutes ;)
    Thanks, Ray

    Hi Ray, you can just copy the source and change the _xinfreq and sysfreq to suit as that should work fine. After which you can just copy and paste extend.fth into a running system.

    I haven't tried running this with the automatic crystal selection but I think it should work. In case it doesn't then just comment/delete these lines in the kernel source:
    SETPLL	byte	_WORD,(@_setpll+s)>>8,@_setpll+s		' autoset crystal operation
     	byte	XCALL,xLOADMOD,XOP,pRUNMOD
    


    btw, type
    CREATE EXPLORER
    just before you load extend.fth
  • Cluso99Cluso99 Posts: 18,069
    edited 2015-03-05 22:52
    Thanks Peter.
    Where is the debugger source?
    Do I use PropTool to compile this?

    Postedit:
    I found the README.TXT and TachyonV2.4.spin.
    Do I just compile this (after I change the xtal) and load to eeprom?
    Then I should be able to test the debug info as shown in the posts above?
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2015-03-05 23:10
    Cluso99 wrote: »
    Thanks Peter.
    Where is the debugger source?
    Do I use PropTool to compile this?

    These are direct dropbox links to the kernel and extend.fth

    So just the kernel is just compiled with Proptool or BST and after the Prop boots you can type "CREATE EXPLORER" and copy and paste EXTEND.FTH through your serial terminal (set line delay to 15ms). After it compiles EXTEND.FTH it will automatically backup everything into eeprom.
  • Cluso99Cluso99 Posts: 18,069
    edited 2015-03-06 00:00
    These are direct dropbox links to the kernel and extend.fth

    So just the kernel is just compiled with Proptool or BST and after the Prop boots you can type "CREATE EXPLORER" and copy and paste EXTEND.FTH through your serial terminal (set line delay to 15ms). After it compiles EXTEND.FTH it will automatically backup everything into eeprom.
    Sounds simple enough. I will give it a try soon. I had found the readme.txt and the Tachyon v2.4 so I am good to go.

    While I am at it, I am going to look at how you determine the 5MHz vs 6MHz (and 10MHz vs 12MHz). Hoping this might also be accurate enough to test for 6.5MHz too.

    In my PropOS, I test for my TriBlade, RamBlade1 and RamBlade3 using pullup tests, and if not default to a standard prop board. I would like to add the xtal test here too.
  • Cluso99Cluso99 Posts: 18,069
    edited 2015-03-06 00:30
    Looking at your code I see it was Phil's code to test for 5 v 10MHz xtals, not 5 v 6 as I thought.
    I think he is just checking that the pll can lock, which it will no do if the xtal is 10MHz.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2015-03-06 00:42
    Cluso99 wrote: »
    Looking at your code I see it was Phil's code to test for 5 v 10MHz xtals, not 5 v 6 as I thought.
    I think he is just checking that the pll can lock, which it will no do if the xtal is 10MHz.

    Yes, I lifted that one as it seemed useful since most of my boards are 10MHz but a all the Parallax boards are 5MHz. So perhaps in your setup you could just disable this then as there is no point in having any setting higher than 10MHz I guess.
    _clkmode	= xtal1 + pll16x
    _xinfreq	= 6_500_000			' <--- AUTOMATIC 5 or 10MHz operation change at boot
    sysfreq		= 104_000_000
    baud		= 115200	    	' <-- user change - tested from 300 baud to 3M baud
    

    and disable references to SETPLL
  • Cluso99Cluso99 Posts: 18,069
    edited 2015-03-06 01:14
    Actually I have some 12MHz 3.5x2.5mm xtals for some of my new boards! I am aiming for 96MHz for USB.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2015-03-06 03:22
    Cluso99 wrote: »
    Actually I have some 12MHz 3.5x2.5mm xtals for some of my new boards! I am aiming for 96MHz for USB.

    I use those little 3.2x5mm 6MHz oscillators on my P8 module. Probably a little larger than those tiny ones you are using but still very small and easy to handle. They cost just over a $1 in quantity. I can get smaller ones again, 1.6x1.2mm but they cost a little bit more.
    dZRPxas5cvgrjKXYddiXJ2p-sLpuRKQ0mTeLBHT10Bl3VF4WDI_J7DGmLlbD55W2Tsxm--Fe7uSA9BHWhr7oBABoe-1TpbSAKY5xwABuwodZL07pY61hmig_NJjYbYLNearLfFY

    Isn't 12MHz pushing it for the PLL to operate as it multiples the input frequency by 16 which means it is trying to run at 192MHz.
  • Cluso99Cluso99 Posts: 18,069
    edited 2015-03-06 19:49
    I use those little 3.2x5mm 6MHz oscillators on my P8 module. Probably a little larger than those tiny ones you are using but still very small and easy to handle. They cost just over a $1 in quantity. I can get smaller ones again, 1.6x1.2mm but they cost a little bit more.

    Isn't 12MHz pushing it for the PLL to operate as it multiples the input frequency by 16 which means it is trying to run at 192MHz.
    When we were discussing overclocking with Chip, he said that he expected that up to 14.318MHz (the video freq) would work fine. Sapieha was using 15MHz xtal on my TriBlade to get 120MHz running successfully on the DIP40 prop. However I couldn't get 15MHz to work on the QFP44 prop but 14.318MHz worked fine for the little testing I did.
    IIRC the 12MHz 3.2x2.5 (approx.) are ~.80c.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2015-03-06 19:57
    Cluso99 wrote: »
    When we were discussing overclocking with Chip, he said that he expected that up to 14.318MHz (the video freq) would work fine. Sapieha was using 15MHz xtal on my TriBlade to get 120MHz running successfully on the DIP40 prop. However I couldn't get 15MHz to work on the QFP44 prop but 14.318MHz worked fine for the little testing I did.
    IIRC the 12MHz 3.2x2.5 (approx.) are ~.80c.

    and all along everybody plays it safe with 5MHz crystals because the Prop is "spec'd" for 10MHz crystals when in fact I have never ever had any problems with 10MHz and 14.318MHz works fine too then!
  • Cluso99Cluso99 Posts: 18,069
    edited 2015-03-06 23:47
    and all along everybody plays it safe with 5MHz crystals because the Prop is "spec'd" for 10MHz crystals when in fact I have never ever had any problems with 10MHz and 14.318MHz works fine too then!
    Yes. But I am not confident I did enough testing at 14.318MHz. I have shipped an extra 13.5MHz xtal (for 108MHz) with my 6.5MHz (104MHz) RamBlades but am not sure how many have tried them. Most RamBlades run ZiCog and CPM2.2 at 104MHz. Not all cogs are used, a couple of the cogs get a pretty good workout.
  • Cluso99Cluso99 Posts: 18,069
    edited 2015-03-08 18:48
    Peter,
    Disabled the auto xtal select, set to pll*16 and xtal 6.5MHz, changed to 115200 baud, compiled and programmed into eeprom (Tachyon V2.4.spin).
    Boots up using PST :):):)

    Now to see about the simple debug commands before progressing ;)
  • Cluso99Cluso99 Posts: 18,069
    edited 2015-03-08 18:54
    Peter,
    I see that nowadays I would then have to load EXTEND.FTH.

    How did you do the debug version? Was the binary created from an older version that included lshw or did you need to load EXTEND.FTH ???

    Meanwhile I will get TeraTerm setup so I can download EXTEND.FTH...
  • Cluso99Cluso99 Posts: 18,069
    edited 2015-03-08 19:41
    OK, downloaded TeraTerm and set 115200 and 20mS, paste <cr> from EXTEND.FTH.

    I tried lshw without success...
    Tried ^C and it rebooted successfully but still no lshw.

    What do I need or what am I missing?
      Propeller .:.:--TACHYON--:.:. Forth V24150126.1930
    
    VER:    Propeller .:.:--TACHYON--:.:. Forth V24150126.1930
    FREQ:   104MHZ (PLLEN OSCEN XTAL1  PLL16X)
    NAMES:  $5A7B...7487 for 6,668 bytes (+4,251)
    CODE:   $0924...3B65 for 12,865 bytes (+8,549)
    CALLS:  387 vectors free
    RAM:    7,958 bytes free
    BUILD:  FIRMWARE BUILD DATE 000101:000000
    BOOTS:  0
    BOOT:   EXTEND.boot
    POLL:
    
    MODULES LOADED:
    1A00: EXTEND.fth          Primary extensions to TACHYON kernel - 150303-1730
    
    ----------------------------------------------------------------
    lshw --> LSHW <-- not found  ????????????????
    

    Postedit
    I note previously you said about "CREATE EXPLORER".
    I didn't do this as I was following the readme.txt instructions.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2015-03-08 19:45
    Cluso99 wrote: »
    OK, downloaded TeraTerm and set 115200 and 20mS, paste <cr> from EXTEND.FTH.

    I tried lshw without success...
    Tried ^C and it rebooted successfully but still no lshw.

    What do I need or what am I missing?
      Propeller .:.:--TACHYON--:.:. Forth V24150126.1930
    
    VER:    Propeller .:.:--TACHYON--:.:. Forth V24150126.1930
    FREQ:   104MHZ (PLLEN OSCEN XTAL1  PLL16X)
    NAMES:  $5A7B...7487 for 6,668 bytes (+4,251)
    CODE:   $0924...3B65 for 12,865 bytes (+8,549)
    CALLS:  387 vectors free
    RAM:    7,958 bytes free
    BUILD:  FIRMWARE BUILD DATE 000101:000000
    BOOTS:  0
    BOOT:   EXTEND.boot
    POLL:
    
    MODULES LOADED:
    1A00: EXTEND.fth          Primary extensions to TACHYON kernel - 150303-1730
    
    ----------------------------------------------------------------
    lshw --> LSHW <-- not found  ????????????????
    

    There are a couple of little extras in EXPLORER so before you load EXTEND.fth (or just type COLD) you must type this:
    CREATE EXPLORER
    after which you can load EXTEND.fth and some IFDEF EXPLORER directives in there will ensure the extras get loaded.
  • Cluso99Cluso99 Posts: 18,069
    edited 2015-03-08 20:42
    Thanks Peter.
    Think there is a bug in the explorer section as it goes into a loop at the end of the port display
    lshw
    FREQ:   104MHZ (PLLEN OSCEN XTAL1  PLL16X)
     PORT PINS
    +--------------------------------+
    P00 inp L float ||       H inp P31
    P01 inp L float ||       H out P30
    P02 inp L float || up    H inp P29
    P03 inp L float || up    H inp P28
    P04 inp L float || up    H inp P27
    P05 inp L float || float L inp P26
    P06 inp L float || float L inp P25
    P07 inp L float || float L inp P24
    P08 inp L float || up    H inp P23
    P09 inp L float || float L inp P22
    P10 inp L float || float L inp P21
    P11 inp L float || float L inp P20
    P12 inp L float || float L inp P19
    P13 inp L float || float L inp P18
    P14 inp L float || float L inp P17
    P15 inp L float || float L inp P16
    +--------------------------------+
      Propeller .:.:--TACHYON--:.:. Forth V24150126.1930
    
    VER:    Propeller .:.:--TACHYON--:.:. Forth V24150126.1930
      Propeller .:.:--TACHYON--:.:. Forth V24150126.1930
    
    VER:    Propeller .:.:--TACHYON--:.:. Forth V24150126.1930
      Propeller .:.:--TACHYON--:.:. Forth V24150126.1930
    
    VER:    Propeller .:.:--TACHYON--:.:. Forth V24150126.1930
      Propeller .:.:--TACHYON--:.:. Forth V24150126.1930
    

    BTW I have tried WORDS and there are a lot of words in the dictionary :)

    Next... How to see if SD works as I share pins with eeprom (just searching for my schematic)
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2015-05-06 00:29
    Here's a quick one-liner if you are checking I/O pins and assuming you have an ANSI terminal such as Teraterm or minicom etc.

    CLS BEGIN HOME lsio ESC? UNTIL

    Just type that in to run immediately and you can see what your I/O pins are doing as you "tickle" them. Hit ESC to exit.
     PORT PINS
    +--------------------------------+
    P00 inp L float ||       H inp P31
    P01 inp L float ||       H out P30
    P02 inp L float || up    L out P29
    P03 inp L float || up    H out P28
    P04 inp L down  || float L inp P27
    P05 inp L down  || float L inp P26
    P06 inp L down  || float L inp P25
    P07 inp L down  || float L inp P24
    P08 inp L down  || float L inp P23
    P09 inp H up    || float L inp P22
    P10 inp L down  || float L inp P21
    P11 inp L float || up    H inp P20
    P12 inp L float || up    H out P19
    P13 inp L float || float L inp P18
    P14 inp L float || float L inp P17
    P15 inp L float || float L inp P16
    +--------------------------------+
    

    Of course you can always define that function as:
    pub viewio CLS BEGIN HOME lsio ESC? UNTIL ;
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2015-05-20 23:50
    The explorer binary has been updated once again with various improvements but also includes 1-wire support so that it scans all the I/O pins for pullups and then interrogates these for 1-wire devices. The lshw list hardware feature runs automatically on startup and this is how it looks:
      Propeller .:.:--TACHYON--:.:. Forth V25150521.1600
    
    VER:    Propeller .:.:--TACHYON--:.:. Forth V25150521.1600
    FREQ:   80MHZ (PLLEN OSCEN XTAL1  PLL8X )
    NAMES:  $5855...74CE for 7,289 bytes (+525)
    CODE:   $0924...41E2 for 14,526 bytes (+1,270)
    CALLS:  330 vectors free
    RAM:    5,747 bytes free
    BUILD:  FIRMWARE BUILD DATE 000101:000000
    BOOTS:  1
    BOOT:   EXTEND.boot
    POLL:   
    
    MODULES LOADED: 
    3CEC: 1WIRE+.fth          1-wire interface + support & diagnostics 150520:0000 PBJ,MJB
    1A41: EXTEND.fth          Tachyon Forth Propeller hardware debugger and explorer - 150521-1400
    
    BOOT:   lshw1w
    POLL:   
    
    
    FREQ:   80MHZ (PLLEN OSCEN XTAL1  PLL8X )
     PORT PINS
    +--------------------------------+
    P00 inp L float ||       H inp P31
    P01 inp L float ||       H out P30
    P02 inp L float || up    H inp P29
    P03 inp L float || float H inp P28
    P04 inp L float || float L inp P27
    P05 inp L float || float L inp P26
    P06 inp L down  || float L inp P25
    P07 inp L down  || down  L inp P24
    P08 inp L float || up    H inp P23
    P09 inp L float || float L inp P22
    P10 inp L down  || float L inp P21
    P11 inp H up    || float L inp P20
    P12 inp L float || float L inp P19
    P13 inp L float || float L inp P18
    P14 inp L float || float L inp P17
    P15 inp L float || float L inp P16
    +--------------------------------+
     COG #0 registers
    $01F0: PAR  = $0000_17E8   %0000_0000_0000_0000_0001_0111_1110_1000
    $01F1: CNT  = $2750_90A6   %0010_0111_0101_0000_1001_0000_1010_0110
    $01F2: INA  = $E080_0800   %1110_0000_1000_0000_0000_1000_0000_0000
    $01F3: INB  = $0000_0000   %0000_0000_0000_0000_0000_0000_0000_0000
    $01F4: OUTA = $7000_0000   %0111_0000_0000_0000_0000_0000_0000_0000
    $01F5: OUTB = $0000_0145   %0000_0000_0000_0000_0000_0001_0100_0101
    $01F6: DIRA = $4000_0000   %0100_0000_0000_0000_0000_0000_0000_0000
    $01F7: DIRB = $0000_0000   %0000_0000_0000_0000_0000_0000_0000_0000
    $01F8: CTRA = $0580_0000   %0000_0101_1000_0000_0000_0000_0000_0000
    $01F9: CTRB = $0000_0000   %0000_0000_0000_0000_0000_0000_0000_0000
    $01FA: FRQA = $4000_0000   %0100_0000_0000_0000_0000_0000_0000_0000
    $01FB: FRQB = $0000_0000   %0000_0000_0000_0000_0000_0000_0000_0000
    $01FC: PHSA = $8000_0000   %1000_0000_0000_0000_0000_0000_0000_0000
    $01FD: PHSB = $0000_0000   %0000_0000_0000_0000_0000_0000_0000_0000
    $01FE: VCFG = $2000_0000   %0010_0000_0000_0000_0000_0000_0000_0000
    $01FF: VSCL = $0000_18F6   %0000_0000_0000_0000_0001_1000_1111_0110
     Scanning I2C bus
    Fast EEPROM or RTC   #0 at $A1: 65 00 00 00 00 00 00 00 00 00 00 00 00 B4 C4 04 
    
    Hardware signature = 2080.0800,0100.04C0,0000.00A1,0000.0000,0000.0000,7D0C.F5BE
    
    Scanning for 1-Wire devices from P0 to P27
    P11-01:  DEVICE# 0000.03C3.6AB8  = 18B20 THERMOMETER
    P11-02:  DEVICE# 0000.03B2.CB9D  = 18B20 THERMOMETER
    P11-03:  DEVICE# 0000.06D6.3C3C  = 2401 SERIAL ID
    P23-01:  DEVICE# 0000.000C.00DA  = 2450 QUAD ADC
    P23-02:  DEVICE# 0000.06D6.535E  = 2401 SERIAL ID
    ----------------------------------------------------------------
    

    To scan for 1-wire devices only just type ls1w.
    The default baud-rate is 115200 and runs automatically on Prop systems with either a 5MHz or 10MHz crystal.
Sign In or Register to comment.