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

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

11920222425

Comments

  • 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.
    Cheers!
  • 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
    	?I2C
    pub <I2C>	--- restart without checking busy
    	*SDA FLOAT *SCL HIGH
    	--- setup mask for CLOCK instruction
     	*SCL MASK @SCL COG!
    ---	*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
    	*SDA LOW *SCL HIGH ( 1 DROP ) *SDA HIGH
    	--- free up I2C lines
     	*SDA FLOAT *SCL FLOAT
    --- 	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.
    Jim
  • 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,768
    edited 2020-05-24 13:57
    Peter,
    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.
    Thanks.
    Jim
    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
    

    BIG%20WORLD.png
    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,768
    edited 2020-06-25 15:14
    Peter,
    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.
    Jim.
  • Peter,
    I just put the latest TF5 on a proto board and get this note on start

    “Mon, 01 Jan 2001 00:00:00 UTC *Card Error*”
    Is it because there is no SD card?
    Jim
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-07-09 00:05
    Yes, you have no SD card! :) What you need to do is setup the pins that you have the SD card on. For instance if you are using a Prop activity board then you would enter this:
    &25.22.24.23 SDPINS
    
    This automatically backs up the pin settings to the EEPROM for next time, and now you are ready to mount.
    If you have a custom board then simply enter the 4 pin numbers in that format and in this order: &<CardSelect>.<CardDataOut>.<CardDataIn>.<CardClock>

    Practically all settings for Tachyon are configurable at runtime, so there is no need to recompile on the PC. The only exception is if you have a crystal other than 5 or 10MHz, and then you need to PC compile with your clock setting.

    btw: the default setting is normally for one of my boards, in this case it is probably the P8 that is also used with the IoT5500.
    &27.24.26.25 SDPINS ( P8 )
    
  • I will not be putting an SD card on this P1. How do I forget the SD card?
    Jim
  • You can FORGET EASYFILE and it will forget up to that point including everything that might have been added after it but normally there is no need to remove it as there is plenty of memory for your code. So I'd recommend leaving it there, because if you start forgetting things, you mightn't know what you're doing! :)

    There are just so many things packed into Tachyon as standard, and EASYFILE is one of them, although it is added after EXTEND. Is there any particular reason you might have? BTW, which board is it and what are you looking at doing?
  • Hi Peter,
    The board I am using is a Parallax 32212 proto board that I am going to set up with an NRF24L01 and an 8 channel ADC. The Idea is to connect two Joy sticks and use it for a Robot control. I probably will not run out of program space but I just wanted to know if there was a way to gain some.
    Jim
  • bob_g4bbybob_g4bby Posts: 440
    edited 2020-07-28 10:36
    SD card issue - I have the same problem as MJB had back in June 2019 ( no fix was discussed ). An sd card is reported as 0 bytes with 0kb clusters. Any clues on how to fix would be appreciated, so I can read files properly etc. What card brand / capacity / cluster size is a known worker please?
    Propeller .:.:--TACHYON--:.:. Forth V5r7 NEON 570190926.2300
      *** MODULES ***  Propeller .:.:--TACHYON--:.:. Forth V5r7 NEON 570190926.2300
    3C94: EASYFILE         SDHC card + FAT32 Virtual Memory File System V1.2 171024-0000
    300E: TOOLS            DEV TOOLS
    1AC0: EXTEND           Primary extensions to TACHYON V5 kernel  - 200514-0100
    
    
    FREQ = 80.00MHZ
    *** INITS ***
    MOUNT 42DA
    NO ROMS
    *** I2C ***
    $A0 EE/RTC
    I/O =  31 :UHUU 27 :~~~~ 23 :~~~~ 19 :~~~~ 15 :~~~~ 11 :~~~~ 7 :~~~~ 3 :UU~U
    INTERCOM: &05.78.32.55 @3,990
    
    CODE:$4D86 = 19334 bytes
    NAME:$5A4C = 6580 bytes
    DATA:$779D = 653 bytes
    FREE:      = 3270 bytes
     Data Stack (0)
    Mon, 01 Jan 2001 00:00:00 UTC
    CARD: SA16G TM02.55 #DD6D.7C29 2019/5 !C0FF.80C7 14,056us
    FAT: #0000.0000   0 bytes (0kB clusters)
    
    --------------------------------------------------------------------------------
    --------------------------------------------------------------------------------
    TF5> [0n
    

    The lines above appear on P1 reset and also after inserting an sdhc card.

    So, copying what MJB did, the directory reads:-
    TF5> $800000 $100 SD DUMP ---
    0080.0000:   54 41 43 48  59 4F 4E 20  20 20 20 08  00 00 00 00    TACHYON    .....
    0080.0010:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00    ................
    0080.0020:   38 30 35 31  20 20 20 20  54 58 54 20  10 21 66 A8    8051    TXT .!f.
    0080.0030:   FB 50 FB 50  00 00 EF 88  ED 50 03 00  60 36 00 00    .P.P.....P..`6..
    0080.0040:   42 52 45 41  4B 4F 55 54  54 58 54 20  10 2B 66 A8    BREAKOUTTXT .+f.
    0080.0050:   FB 50 FB 50  00 00 15 62  E6 50 04 00  FE 17 00 00    .P.P...b.P......
    0080.0060:   43 4C 4B 47  45 4E 20 20  54 58 54 20  10 2E 66 A8    CLKGEN  TXT ..f.
    0080.0070:   FB 50 FB 50  00 00 74 62  E6 50 05 00  02 1F 00 00    .P.P..tb.P......
    0080.0080:   44 41 53 4D  35 31 20 20  54 58 54 20  10 31 66 A8    DASM51  TXT .1f.
    0080.0090:   FB 50 FB 50  00 00 EB 88  ED 50 06 00  28 50 00 00    .P.P.....P..(P..
    0080.00A0:   44 4F 54 4C  45 44 20 20  54 58 54 20  10 34 66 A8    DOTLED  TXT .4f.
    0080.00B0:   FB 50 FB 50  00 00 F3 64  ED 50 07 00  37 01 00 00    .P.P...d.P..7...
    0080.00C0:   45 41 53 59  46 49 4C 45  54 58 54 20  10 3A 66 A8    EASYFILETXT .:f.
    0080.00D0:   FB 50 FB 50  00 00 F8 88  ED 50 08 00  34 A5 00 00    .P.P.....P..4...
    0080.00E0:   45 41 53 59  4E 45 54 20  54 58 54 20  10 43 66 A8    EASYNET TXT .Cf.
    0080.00F0:   FB 50 FB 50  00 00 A0 88  ED 50 0A 00  2C 9E 00 00    .P.P.....P..,... ok
    TF5>
    

    Which suggests the interface pins are connected OK. I have a 10k pullup on DO, DI but not SCLK and CS - just copied a circuit I found.

    The sdhc card was purchased from Wilko in the town centre yesterday. It's a high speed microSDHC 16gb card formatted fat32 branded 'Integral' and marked class 10 microsd up to 90 Mb/s read speed. It was formatted using the 'SD Card formatter' application with a 32k cluster. Windows 7 reports it is FAT32. I put some .txt files on on it as a test.

    The tachyon system was obtained from Peter's dropbox yesterday, and 'extend' and 'easyfile' were added to it from the same source.

    All chips are decoupled, sdhc wires are very short, supply is checked 3.3V, nothing is hot. Crystal on the P1 is 5MHz, eeprom is a 24lc512. Tachyon will run a soak test reliably over the bluetooth link at the default 115200 baud. ( : SOAK BEGIN WORDS KEY UNTIL ; )
    3264 x 2448 - 3M
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-07-28 12:58
    The card info looks correct and certainly you can access it.
    CARD: SA16G TM02.55 #DD6D.7C29 2019/5 !C0FF.80C7 14,056us

    The fact that you used the proper formatter would seem that it would indeed be FAT32.
    Now if only I had the disk utilities for the P1 that I do for the P2. I will fire up a Tachyon system and see what I can do in the way of utilities to dig a bit deeper.
    It's a mystery.

    But the obvious question is: Have you tried this with a Sandisk or some other card?

    Looking at your photo though, while the board looks well laid out, I don't like the look of those bypass caps, and unless I'm mistaken these film polys, like a lot of those larger styles they are not terribly good for much above audio frequencies. You need ceramics at least plus a small 10uF tantalum up that end. I've got no idea what the wiring looks like underneath but I normally strip and solder wire-wrap and also run a bare wire as a ground bus. I have even used the stick-on copper tape for this too.


    tip: you could try slowing down the Prop just to see if the SD responds properly. That way you know it is to do with speed and current etc.
  • MJBMJB Posts: 1,235
    The card info looks correct and certainly you can access it.
    CARD: SA16G TM02.55 #DD6D.7C29 2019/5 !C0FF.80C7 14,056us

    The fact that you used the proper formatter would seem that it would indeed be FAT32.
    Now if only I had the disk utilities for the P1 that I do for the P2. I will fire up a Tachyon system and see what I can do in the way of utilities to dig a bit deeper.
    It's a mystery.
    ...

    If you make new tools for Tachyon I will give it another try.
    BTW, I was using proper boards PropBOE and IoT5500+P8
    Would be nice if not only SanDisk would work
  • bob_g4bbybob_g4bby Posts: 440
    edited 2020-07-28 15:45
    Thanks for the hints, chaps. I've used wirewrap wire too. I'll put in a few cross-bonds to beef up 0v somewhat, as this is an 80MHz cpu after all. The caps are disc ceramics, they're just molded ones.

    OK on the Sandisk tip, I'll nip out and get a low capacity card from Curry's computer shop as they're useful anyway. Thought I'd ask before putting the scope on it.
  • OK, buying a Sandisk card seems to have fixed my problem, Tachyon recognised this 32Gb Sandisk microSDHC card straight of the box. I just renamed it and get the following responses:-
    TF5> MOUNT ---
    
    CARD: SS32G SD03.80 #5CC8.F8E1 2020/2 !C0FF.80C3 1,644us
    
    FAT: #6752.EDC2 MSWIN4.1 TACHYON     FAT32   31,910,789,120 bytes (32kB clusters)
    
     ok
    
    TF5> DIR ---
    
    TACHYON
    
    EASYNET .       ....d. 0000.6040    0  m2019/06 /10   00:17   c2020/07 /28   16:06 000.  a2020/07 /28
    
    ANYKEY  .FTH    .....a 0000.6200 3053  m2019/07 /21   13:36   c2019/07 /21   13:36 870.  a2020/07 /28
    
    CHARLCD .FTH    .....a 0000.6240 4487  m2019/07 /21   13:36   c2019/07 /21   13:36 010.  a2020/07 /28
    
    DECOMP  .FTH    .....a 0000.6280 6202  m2019/09 /26   08:56   c2019/09 /26   08:56 000.  a2020/07 /28
    
    DISK    .TF     .....a 0000.62C0 8758  m2019/09 /26   09:11   c2019/09 /26   09:11 000.  a2020/07 /28
    
    DUMPHEX .FTH    .....a 0000.6300  896  m2019/09 /18   04:13   c2019/09 /18   04:13 860.  a2020/07 /28
    
    EASYFILE.FTH    .....a 0000.6340  47k  m2020/06 /23   12:02   c2020/06 /23   12:02 690.  a2020/07 /28
    
    EASYFI~1.FTH    .....a 0000.63C0  46k  m2019/09 /30   01:29   c2019/09 /30   01:29 140.  a2020/07 /28
    
    EASYFI~2.FTH    .....a 0000.6440  46k  m2019/09 /30   15:53   c2019/09 /30   15:53 770.  a2020/07 /28
    

    I'll set up a read soak test and see if that's reliable.
  • I have had some problems with various rebranded noname cards and while they work in the PC, that is probably more to do with 4-bit SD mode vs the 1-bit SPI mode. The SD spec says what should be supported but noname will do what noname will do, they are not worried about not test SPI mode I'm sure.
    Besides, Sandisk cards with the A1 logo (the standard card these days) perform better since this type has lower latency because it is optimized for phones, rather than cameras which just write one large file and move on to the next.

    But hang on to that card because when you get a P2 board you can load TAQOZ and get it to do a full report (or maybe it will just work).

  • Yes, this P1 is just a warm-up to explore Tachyon, before the P2. I have a little bag of old sd cards, so the 'Wilko' card will go in there for a while. Thanks again.
  • Hi
    Did you say 'Wilko card'
    Does that mean you are from the UK?
    Dave
  • Yes Dave, I'm a retired electronics engineer and radio ham 10m E of Bath - I nipped into Wilkinsons's yesterday, thinking their sd cards would surely do for this Tachyon project - alas no. One good thing is that others will be aware of the issue - not a big expense these days either.
  • bob_g4bbybob_g4bby Posts: 440
    edited 2020-08-09 14:20
    CONBAUD working?

    Using Tachyon V5r7 NEON 570190926.2300, I would like to change the terminal baud rate from 115200. Tried 3000000 CONBAUD <enter> and then pressed the reset button. Tachyon reboots but the terminal is still 115200 baud.

    I notice that the value of CLOCKFREQ / baudrate is written to $28 in RAM and EEPROM. I can read those values both changing. Tried a couple of different baud rates, still apparently ignored

    have I missed something?
  • bob_g4bby wrote: »
    CONBAUD working?

    Using Tachyon V5r7 NEON 570190926.2300, I would like to change the terminal baud rate from 115200. Tried 3000000 CONBAUD <enter> and then pressed the reset button. Tachyon reboots but the terminal is still 115200 baud.

    I notice that the value of CLOCKFREQ / baudrate is written to $28 in RAM and EEPROM. I can read those values both changing. Tried a couple of different baud rates, still apparently ignored

    have I missed something?

    Not sure since I use this all the time but normally I don't go above 2M as 3M can be a bit edgy plus there is 0% baud rate error for 80M/2M. Read EEPROM and just make sure that it has written.
    CLKFREQ $28 E@ / .
    
  • @bob_g4bby - That was very strange when I tried it and it didn't work. Had a closer look and looks like I must have made a change to CONBAUD but used $28 instead of $18. Patched that and now it works.
    pub CONBAUD ( baud -- ) CLKFREQ SWAP / DUP $18 ! $18 E! ;
    
    825 x 650 - 72K
  • Nice one Peter, thanks for finding that. I want to experiment with passing arrays of data to and from LabView in Windows at audio rate, to test out dsp words on the P1. If I can get the baud rate high enough that can be in real time, so I can hear as well as graph the results. OK on checking the stability of the link and that 3Mbaud may not be possible.
  • 3Mbaud is physically possible with a P1 and the usual FTDI converter, but if you're constantly blasting data, some will go missing. It also helps to mess with the receive buffer sizes in the COM port's device manager property window thing
Sign In or Register to comment.