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



  • I've updated EXTEND.FTH with *SCL and *SDA using $7E and $7F REG addresses. This places them at the end of the 128 bytes so you only have to worry about allocating 128 bytes for each instance of a Tachyon cog.
    However there seems to be a problem and while I like to fix it tonight, I'm just really bushed and I will have to try again in the morning since I am obviously making mistakes here.
  • Thanks Peter ... I will read up on REG accesses.
  • Hi Paul, I've updated EXTEND.FTH and I will get around to updating the binary as well shortly.
    Just specify I2CPINS at the start of your cog's task and you can also specify the speed if necessary.

    Remember that you can paste or send Forth code into the terminal with only 3ms line delay. No need to go slow.
  • Looks exactly like I was hoping, thank you!

    What about i2cflg? Should it be in the task register block as well ? $7D ?
  • This is how I tweaked for i2cflg. All other routines unchanged
    ---			*** I2C DRIVER ***
    pub *SCL			$7E REG C@ ;	--- returns the SCL pin number
    pub *SDA			$7F REG C@ ;	--- returns the SDA pin number
    pub *i2cflg			$7D REG C@ ;	--- returns the i2cflg to see if bus is busy=TRUE, inactive=FALSE.    --- *****************************************************
    pub i2cflg!			$7D REG C! ;	--- write the i2cflg state                                                                   --- *****************************************************
    pub I2CPINS ( sda scl -- )	$7E REG C! $7F REG C! ;
    --- byte i2cflg                                        --- *****************************************************
    --- wait but timeout while busy
    --- pub ?I2C	i2cflg C@ IF 1500 BEGIN 1- i2cflg C@ 0= OVER 0= OR UNTIL DROP i2cflg C~  THEN ; --- *****************************************************
    pub ?I2C	*i2cflg IF 1500 BEGIN 1- *i2cflg 0= OVER 0= OR UNTIL DROP FALSE i2cflg! THEN ;
    pub <I2C
    pub <I2C>	--- restart without checking busy
    	--- setup mask for CLOCK instruction
    ---	*SDA LOW 1 i2cflg C! *SCL LOW --- *****************************************************
    	*SDA LOW TRUE i2cflg! *SCL LOW
    { I2C STOP CONDITION also releases I2C lines
     SCL XX-------:=
     SDA XX___----:=
    pub I2C>
    	--- pull SDA high from low while clock high
    	--- free up I2C lines
    --- 	i2cflg C~						--- i2c bus free --- *****************************************************
    	FALSE i2cflg!
  • Yes, that's the idea. I noticed that the previous I2C routines had a bug in assigning new pins. Sure enough, you could assign new pins but @SDA was a fixed constant, so it would have failed. This was done at the time to make it faster but a MASK operation does not push or pop the stack so it is very fast and so it is just as good to say *SDA MASK than it was to say "@SDA".
    I checked the register usage and those last few bytes from $7A in the first 128 bytes are free.
    snippet from the listing.
    0038(0076)             | padwr           res 1           ' write index (builds characters down from lsb to msb in MODULO style)
    0038(0077)             |                 res 1
    0038(0078)             | undef           res 2           ' undefined word exception vector
    0038(007A) 00          |               byte  0[$200-$38]
    0200(00EC)             |               org
    0200(0000) 00 00       |         word      0
  • Peter,
    I just downloaded the latest binaries from sourceforge. I went to install them and discovered that the QS board where I was going to install was defective, not your problem. The question I have is how do I download a .Spin driver that runs in another cog? I want to try avsa's NRF24L01 driver and communicate between two QS props with it. The second question I have is how do I get permissions to log onto the tychon forum on Sourceforge? I was going to pose this question on the forum there but was blocked.
  • Hi Jim, Look at the top of the page over to the right for "Create" to create an account at Sourceforge. You can go to the discussion link and create a new topic then and post. In the process of checking my settings I have also created a Tachyon for P1 and a TAQOZ for P2 forum as well.

    I will look at that Spin driver because if it is mostly PASM we can compile it as a hex file that we can load into upper EEPROM anytime as a "ROM". Then at runtime you can load a ROM by name into a cog. You would also have some minimal application "hooks" at the Forth level to interface to this cog.

    However, I have written some nRF24L01 stuff in Tachyon, mainly for sniffing wireless keyboards. So I guess I could look at that chip and see if I can come up with something useful, for you and me, for Tachyon, and for TAQOZ!
  • RS_JimRS_Jim Posts: 1,369
    edited 2020-05-24 - 13:57:05
    That is great! The actual driver is spin and I am sure the hooks would be easy in tachyon.
    A direct tachyon driver would also be super. Maybe it would be easier to just do in Tachyon.
    edit changed pasm to spin
  • I was reminded about the Parallax Propeller font that is built into the P1 ROM and it's suitability for the P2 as well. I decided to write a one-liner to extract the font in table ready format to paste into TAQOZ. However, along the way I wanted to check what I was reading and made a quick little driver that "draws" the big font on the terminal screen. This is what happens when I type:
    BIG ." Hello World" CON

    byte xp
    pub .FONT       DUP 2/ 7 << $8000 + FROM 4 BY
    ( ch )          32 FOR I @ OVER 1 AND IF 2/ THEN CR 9 xp C@ 2* EMITS  16 FOR DUP 1 AND "  *" + C@ EMIT 2/ 2/ NEXT DROP NEXT DROP xp C++ ;
    pub BIGEMIT     uemit W~ HOME >B .FONT 
    pri BIG!         ' BIGEMIT uemit W! ;
    pub BIG         xp C~ BIG! HOME  ;

    @RS_Jim - I've been a bit sidetracked getting software and hardware together for my latest P2D2s and so I still have to try out those nRF24L01 modules soon. Maybe I will do this on the P2 first and then port it back to the P1.
    2500 x 680 - 12K
  • RS_JimRS_Jim Posts: 1,369
    edited 2020-06-25 - 15:14:59
    Thanks for the reply. I am looking forward to the rfl driver. I am glad you bumped this thread, as I was going to bump it to make it easier for rsideaka to find, as he was inquiring about the P1 dictionary in another thread.
Sign In or Register to comment.