Shop OBEX P1 Docs P2 Docs Learn Events
Tachyon Forth for P2 -FAT32+WIZnet- Now Smartpins - wOOt! - Page 6 — Parallax Forums

Tachyon Forth for P2 -FAT32+WIZnet- Now Smartpins - wOOt!

1234689

Comments

  • Tubular wrote: »
    This is neat, Peter

    Regarding the DACs, their signals are broken out separately to the pins. On the P123-A9 they go to THS8136 DAC chips. I think for the CVA9 it would make sense to go to via the 80 pin connector, where there are spare pins.

    That makes sense as I also seem to recall that too now. So I could make up a DAC board off the 80 pin for VGA modes and Chip could add this pins into the next build.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2016-06-20 08:25
    SMARTPIN FUN & LA CAPTURE

    What happens when you sit at the serial terminal connected to your P2 and talk to Tachyon like this:
    0 PIN 115,000 TXD BAUD
    1 PIN 10,000,000 TXD BAUD
    2 PIN 1 MHZ
    3 PIN 1 10 1 PWM
    then arm the LA and type:
    0 pin $55 TX 1 PIN 10 FOR $55 TX NEXT

    EDIT: Sorry, syntax changed again as BAUD is a bit redundant, just say 115,200 TXD to set the mode and baud rate

    This: (check the PWM frequency, it's running 10% duty @4MHz)
    asynch-nco-pwm.jpg

    update
    Simply by defining an I/O word called SERIAL I can redirect Tachyon character I/O to any device. Copied straight from the console with the newer syntax again:

    TF2# 0 PIN 115,200 TXD ok
    TF2# 1 PIN 460,800 TXD ok
    TF2# 2 PIN 1 MHZ ok
    TF2# 3 PIN 1 10 1 PWM ok
    TF2# 1 SERIAL PRINT" HELLO WORLD" 0 SERIAL PRINT" HELLO" CON ok
    TF2#


    p2%20smartpin%20serial.jpg
    1903 x 890 - 285K
  • jmgjmg Posts: 15,173
    TF2# 1 SERIAL PRINT" HELLO WORLD" 0 SERIAL PRINT" HELLO" CON ok
    How many stopbits are defined at 115200 ?
    That looks somewhere between 1 & 2 ?, but ideally TX should always be whole BAUD edge aligned (no fractional creep)

  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2016-06-20 10:43
    Stop bits just need to be at least one bit long but in this case my software is polling the busy flag which accounts for the delay until the start of the next character. One "stop bit" I measured was 1.628 stop bits long. Ideally it would use the buffer-full flag and interrupts but I do notice in the smartpin description this (esp point 3):
    Here is the internal state sequence:
    1. Wait for an output word to be buffered via WYPIN, then set the ‘buffer-full’ and ‘busy’ flags.
    2. Move the word into the shifter, clear the ‘buffer-full’ flag, and raise IN.
    3. Output a high for one bit period (guarantees a whole STOP bit).
    4. Output a low for one bit period (the START bit).
    5. Output the LSB of the shifter for one bit period, shift right, and repeat until all data bits are sent.
    6. Output a high (begins the STOP bit).
    7. If the ‘buffer-full’ flag is set due to an intervening WYPIN, loop to (2). Otherwise, clear the ‘busy’ flag and loop to (1).

    RDPIN returns 8 bits and can always be used to read the ‘busy’ flag into D[7]/C.
    So these routines aren't final but they are functional enough to use in the meantime.
  • SMARTPIN FUN & LA CAPTURE

    What happens when you sit at the serial terminal connected to your P2 and talk to Tachyon like this:
    0 PIN 115,000 TXD BAUD
    1 PIN 10,000,000 TXD BAUD
    2 PIN 1 MHZ
    3 PIN 1 10 1 PWM
    then arm the LA and type:
    0 pin $55 TX 1 PIN 10 FOR $55 TX NEXT

    EDIT: Sorry, syntax changed again as BAUD is a bit redundant, just say 115,200 TXD to set the mode and baud rate

    This: (check the PWM frequency, it's running 10% duty @4MHz)

    .
    .
    .
    Dang it Peter, every time I see one of those beautiful LA captures I feel my CC exiting my wallet and dropping 399.00 on that neat little LA you use!!!!! But I still need/want to rebuild the top end of my Jeep 2006 CRD this year so cash is going to expensive Italian diesel parts just now.
    STOP  IT   NOT
    
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2016-06-21 01:31
    The DigiView DV3100 is such a pleasure to use and quite cheap compared to my dedicated Rigol MSO where I find the LA part of it clunky and limited. Mind you the DV3100 hardware could probably be emulated quite easily even with a little FPGA board but it's the software and usability that makes all the difference between a good design and say the nice looking but clunky (and buggy) Rigol.

    btw, P2 would make a great LA too.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2016-06-21 04:08
    40M baud smartpin transmit timing

    This is the amazing thing with the P2 and the smartpins which I am only just beginning to work with. In this capture the red trace is a single start bit of a 115,200 baud aynch character. The next blue trace is a whole message fitting into the corner of that start bit. The second serial transmit is setup for 40,000,000 baud! I created a simple TXDAT word used by TXSTR to lower the latency to 162ns between each character fed into the smartpin. This works just as well at 80M baud too except my character latency has increased to 281ns as I am just using RDBYTE for each byte but I can make that better.
    Setup my pins:
    0 PIN 115,200 TXD
    1 PIN 40,000,000 TXD
    2 PIN 1 MHZ
    3 PIN 100 800 1 PWM
    
    then print PROP2 on both serial ports:
    " PROP2" 0 SERIAL DUP PRINT$ 1 PIN TXSTR CON
    

    P2%2040mhz%20TX.jpg

    EDIT: Did it better, and at 80M baud!!!

    P2%2080M%20baud%20TX.jpg
    1773 x 390 - 172K
  • jmgjmg Posts: 15,173
    Stop bits just need to be at least one bit long but in this case my software is polling the busy flag which accounts for the delay until the start of the next character. One "stop bit" I measured was 1.628 stop bits long.
    You are using ASYNC modes for this testing ?

    I thought Chip had said the TxMIT was Baud-Clock locked in all cases.
    ie in this case, delays should bump from 1.0 to 2.0 stop bits (or 3 etc at highest baud speeds).

    Being Baud-Clock locked (no fractional bits) has benefits with ASYNC
    * You can test Baud to high precision with a frequency counter
    * You can calibrate RC oscillators, with multiple chars for better precision.
    * You know the time budgets are stable (at 1 or 2 stop bits)
    With fractional bits, a small change to code in one end, can shift the overall system timing, in a hard to find result.

    If the State engine is always TxCLK paced, you can set READY at the start of the Stop bit, allowing a full bit time to load NextChar.
    (or is this double buffered, allowing a char to wait in the pin, for Shifter-done, giving more time margin ?)
    Did Chip mention separate flags for
    READY (ok to load another char) and
    DONE (end of stop, ok to flip RS485 direction pin) ?

  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2016-06-21 17:54
    Just getting ready to assemble a P2 controller prototype with a whole lot of whiz-bangs on-board. I've mounted the BeMIcroCV-A9 underneath the matrix board, labeled the pins, positioned parts where I think they would work best and so far this is what I've got:
    • 2 x SD cards
    • IoT5500 module (WIZnet W500)
    • 2 x dual isolated and protected high-speed RS485 modules (4x RS485)
    • ESP8266MOD with int+ext ant
    • Serial Bluetooth
    • DS3231 RTC
    • USB A
    • 3.5mm stereo
    • VGA (needs DAC board but can do 8 color mode as is)
    • Switcher supply 24VDC in
    • Local Keypad and 4 line display (might upgrade a little)

    Also added extra Puppy module after photo in the bottom right like the RS485 ones for power switching or motor control
    I might still add a few other things I have sitting around but the extra Puppy module socket can take specials plus I have a lot of different boards already.
    I'd do a polyester laser label that goes over the clear cover with a window for the LCD of course plus any LED indicators (WS2812) shine right through nicely.
    The RS485 ports also feed and power VGA monitors using my Pixie boards

    All this will eventually turn into a final PCB too but I'm leaving my options open for P2 chips and other FPGA modules I can use.
    2000 x 1465 - 2M
  • Peter, While I remember you posted somewhere about numerous resets during ftdi enumeration. Just wanted to report that this seems to happen with straight windows too (ie the Wine emulation might be fine).

    Not sure whether its because I've had a lot of different ftdi chips connected to different ports over time. Maybe.
  • Might have been someone else I was responding too as the USB just works without fuss in Linux and while they always assign ttyUSB0 to the first port etc rather than the annoying "new" comport that Windows does, I would probably like to find a way to lock in a device to a port anyway. Actually I think there is as I've tried it once before.
  • Cluso99Cluso99 Posts: 18,069
    Peter,
    Did you post (or can you post) the async smart pin snippet please?
    I am having a problem with receive and cannot see my bug :(
  • In between all the many things that have dragged me away from assembling my CV-A9 P2 motherboard and enhancing Tachyon I have still managed to get two external SD cards running in addition to the internal microSD (access as C: D: E: for the moment) but I also have updated serial Flash, added I2C and EEPROM as well as the DS3231 RTC. On top of that I have the W5500 connected up and making some little changes to the low level SPI routines. Next step is the VGA just using a simple resistor DAC, then audio, then PS/2 keyboard on the USB socket. At some point USB will be implemented but probably not quite yet. After this I've got the ESP8266 to play with as well as my RS485 ports using the ping pong protocol. I'd like to try this networking at 20Mbits over short distances just to see what is possible.
  • Cluso99Cluso99 Posts: 18,069
    Wow Peter. Not only have you achieved a lot in such a short time, you have a huge plate full of things to do. How about you leave something for us mere mortals to do ;)
  • D.PD.P Posts: 790
    edited 2016-06-25 21:54
    Cluso99 wrote: »
    Wow Peter. Not only have you achieved a lot in such a short time, you have a huge plate full of things to do. How about you leave something for us mere mortals to do ;)

    Just shows the speed of development with a proper FORTH attached to the hardware as Peter has been saying here for a while. Wouldn't be surprised to see his first edition of a completely working boot loader appear soon either.

  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2016-06-26 02:24
    D.P wrote: »
    Cluso99 wrote: »
    Wow Peter. Not only have you achieved a lot in such a short time, you have a huge plate full of things to do. How about you leave something for us mere mortals to do ;)

    Just shows the speed of development with a proper FORTH attached to the hardware as Peter has been saying here for a while. Wouldn't be surprised to see his first edition of a completely working boot loader appear soon either.

    Oh yeah, I've been playing with a bootloader that handles serial Flash, or EEPROM even, or SD card with various boot schemes, raw or FAT32. These are some of the pin assignments I am using, and remember that while purists would want QSPI and HyperRAM supported on separate ports that this doesn't help to get the job done and so here is a practical configuration (and for the CV-A9).
    #P35    == *SDA			--- i2c data (scl on sfck)
    
    ( SERIAL FLASH + SD CARDS )
    #P56	== *SD1			--- SD CARD CS #1
    #P57	== *SD0			--- SD CARD CS #0
    #P58  	== *SFDO		--- also SD CARD DO
    #P59	== *SFDI		--- also SD CARD DI
    #P60	== *SFCK		--- also SD CARD CLK & SCL
    #P61	== *SFCS		--- 25Q80 serial flash CS
    #P62	== *TXD
    #P63	== *RXD
    
    ( INTERNAL )
    #P39    == *SDCS            --- internal microSD CARD CS
    #P36    == *SDDO            --- Data out from SDCARD
    #P41    == *SDCK            --- SDCARD clocks
    #P40    == *SDDI            --- Data to SDCARD
    

    btw, it is very easy to add more peripherals, too easy in fact. Now I have to see how I can implement SPI on smartpins.

  • FEEDBACK

    I've probably been too busy playing with the P2 and extending Tachyon that I may not have asked the question. Has anybody had a chance to use Tachyon lately and if so how did you find it?
  • Cluso99Cluso99 Posts: 18,069
    Too busy playing with other parts of P2 ;)
  • Cluso99 wrote: »
    Too busy playing with other parts of P2 ;)
    You may be, but it wouldn't be much fun going half blind with every compile load and cross your fingers method. But if you had my interactive assembler to test those opcodes you like to test and be able to interact with them and put them in all kinds of loops quickly then I'm sure that I would at least I'd be at the very least trying the latter method. Why be just busy & plodding when you can be busy and having fun seeing these opcodes come to life?



  • FEEDBACK

    I've probably been too busy playing with the P2 and extending Tachyon that I may not have asked the question. Has anybody had a chance to use Tachyon lately and if so how did you find it?

    I've have my board working and I've been trying the builds as they come out. Just keeping up with all the changes happening for now and can't say I've explored everything P2 Tachyon has to offer.

  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2016-06-27 16:12
    D.P wrote: »
    FEEDBACK

    I've probably been too busy playing with the P2 and extending Tachyon that I may not have asked the question. Has anybody had a chance to use Tachyon lately and if so how did you find it?

    I've have my board working and I've been trying the builds as they come out. Just keeping up with all the changes happening for now and can't say I've explored everything P2 Tachyon has to offer.

    At the moment I can do a BACKUP into serial Flash especially when I have a loaded system with networking and although I am still dependent upon PNut as a serial bootloader I only have to load the kernel with a quick F11 and then I can type RESTORE to bring it all back up. I may include an automatic restore provided the kernels match up so I would only need to do an F11 plus I can cobble together a small 8-pin PIC to handle the serial reload for me so that it is completely automatic. I say this because if you happen to have any serial Flash such as the 25Q80 then connect it up.

    Which board are you using again for P2 emulation?

    Right at the moment I'm hooking up my ESP8266 and a few other things but I decided I'd like to connect that module externally as I can just have a header on my MB and plug in a cable to the module which may be housed in a very small enclosure that can also mount an external antenna or even just heatshrink one of the other cheaper modules. Actually just before that I'm just hooking up some WS2812 LEDs as I want some indicators and I don't want to waste any more pins and I'm trying to leave P0..P15 uncommitted for Puppy modules including protoboard except for an optional VGA on part of that. The other way I could do indicators is to connect a PIC up at 2Mbaud (32MHz int clock) and use a smartpin to transmit my LEDs to it without anymore overhead than WRPIN and just a single I/O.

    FEEDBACK POLL

    I've probably been too busy playing with the P2 and extending Tachyon that I may not have asked the question. Has anybody had a chance to use Tachyon lately and if so how did you find it?
  • Cluso99Cluso99 Posts: 18,069
    Cluso99 wrote: »
    Too busy playing with other parts of P2 ;)
    You may be, but it wouldn't be much fun going half blind with every compile load and cross your fingers method. But if you had my interactive assembler to test those opcodes you like to test and be able to interact with them and put them in all kinds of loops quickly then I'm sure that I would at least I'd be at the very least trying the latter method. Why be just busy & plodding when you can be busy and having fun seeing these opcodes come to life?


    Actually, I have been rebuilding my Lmm Serial Debugger that I did in 2013 for the P2 prior to P2Hot.



  • D.P wrote: »
    FEEDBACK

    I've probably been too busy playing with the P2 and extending Tachyon that I may not have asked the question. Has anybody had a chance to use Tachyon lately and if so how did you find it?

    I've have my board working and I've been trying the builds as they come out. Just keeping up with all the changes happening for now and can't say I've explored everything P2 Tachyon has to offer.

    At the moment I can do a BACKUP into serial Flash especially when I have a loaded system with networking and although I am still dependent upon PNut as a serial bootloader I only have to load the kernel with a quick F11 and then I can type RESTORE to bring it all back up. I may include an automatic restore provided the kernels match up so I would only need to do an F11 plus I can cobble together a small 8-pin PIC to handle the serial reload for me so that it is completely automatic. I say this because if you happen to have any serial Flash such as the 25Q80 then connect it up.

    Which board are you using again for P2 emulation?

    Right at the moment I'm hooking up my ESP8266 and a few other things but I decided I'd like to connect that module externally as I can just have a header on my MB and plug in a cable to the module which may be housed in a very small enclosure that can also mount an external antenna or even just heatshrink one of the other cheaper modules. Actually just before that I'm just hooking up some WS2812 LEDs as I want some indicators and I don't want to waste any more pins and I'm trying to leave P0..P15 uncommitted for Puppy modules including protoboard except for an optional VGA on part of that. The other way I could do indicators is to connect a PIC up at 2Mbaud (32MHz int clock) and use a smartpin to transmit my LEDs to it without anymore overhead than WRPIN and just a single I/O.

    FEEDBACK POLL

    I've probably been too busy playing with the P2 and extending Tachyon that I may not have asked the question. Has anybody had a chance to use Tachyon lately and if so how did you find it?

    I have a CV-A9 board and serial flash I just can't find, discontinued or out of stock.

    Really nice to be able to start right back up with the "built" system after a quick reload from PNut.


  • Serial Flash should be easy, I just happen to have a whole tube of 25Q80s that I bought years ago in anticipation of a real P2 :)
    But I have other higher capacity Flash devices that should work as well. I see Mouser list many suitable devices and the 8Mb AT25F81 only costs around 50 cents each so I will double check the specs on that and I might even have some lying around or I might even check on some of those other devices I have and let you know. The other option would be an I2C 64KB EEPROM although my EEPROM methods are in EXTEND but I could put a compact method into the kernel if need be.
  • jmgjmg Posts: 15,173
    The other option would be an I2C 64KB EEPROM although my EEPROM methods are in EXTEND but I could put a compact method into the kernel if need be.

    Serial Flash parts are now much cheaper than moderate sizes EEPROMs.

    That said, there could be a small niche where a tiny-i2c-memory, could load a SD loader for example.
    I guess that comes down to how small a i2c loader can be, and what size a SD loader is, and if that can get int the boot ROM.

    I see a SOT23 1k Byte FT24C08A-ULR-T is ~ 17c, already more than the ~ 15c FT24C08A-ULR-T 512k Bytes.
    Amazing price skews really, EEPROM:Flash.

  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2016-06-28 07:24
    EEPROM is easy to read/write any byte and in the case of I2C parts there are also other non-volatile technologies available too, Since I only need one dedicated pin with the serial clock shared with the serial Flash clock then it is as I say a "no-brainer". I take note of the 17c part's price and package but unless I was building volume I rarely see any need to skimp and for around 50 cents I can have 64kB. But EEPROM cannot compete with serial Flash in terms of capacity and price.

    In fact since I have a little PIC that I am hooking up as a serial bootloader in the interim while we are waiting for bootrom updates, it is just as easy to use the internal memory of the PIC as the bootrom itself.

    FEEDBACK POLL

    I've probably been too busy playing with the P2 and extending Tachyon that I may not have asked the question. Has anybody had a chance to use Tachyon lately and if so how did you find it?
  • Cluso99Cluso99 Posts: 18,069
    S25FL116 are ~$0.38 in 1K quantities from Mouser. Quad SPI Flash 2MB (16Mb) 3V3 108MHz.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2016-06-28 10:38
    Yeah, I see that part there as I was looking this morning but what is not quite clear until you delve through the datasheet and locate the ordering part number dissection which indicates that this is the fat boy, a 208mil vs 150mil width part. So this is probably old stock of a high capacity part at the time that required the wider package.

    25FL116K0XMFI013 where the 01 at the end there is the 8-pin 208mil.
  • Cluso99Cluso99 Posts: 18,069
    edited 2016-06-28 11:13
    ...MFI040 are in stock, MFI041 & MFI043 are both on order. These are the 150mil versions.
    They are also used as a substitute for the ~$15 Altera Flash on the Cyclone IV FPGA's. The 116 is a later version of the 016.
  • jmgjmg Posts: 15,173
    Cluso99 wrote: »
    S25FL116 are ~$0.38 in 1K quantities from Mouser. Quad SPI Flash 2MB (16Mb) 3V3 108MHz.

    Digikey show stock of FT25H16S-RT, TSSOP8, $0.22440/1k


Sign In or Register to comment.