Shop OBEX P1 Docs P2 Docs Learn Events
SX28 and Pic16F57 compatibility — Parallax Forums

SX28 and Pic16F57 compatibility

Hello,
I bought some Scenix SX28 chips in 1999 but never programmed them since I didn't have the SXkey programmer. However I read on sxlist.com that you can use sxdefs.inc with MPLAB to write a hex file that will run on SX28.

Does this mean that SX26 and Pic16F57 machine code is compatible?

Thank you.

«1

Comments

  • They are run off of binary in their memory. Mplab and sx key are just compilers, programmers

  • What I mean is can I program a Pic16F57 with MPLAB/Pickit3 to blink an LED on a pin and then use the same hex file
    to blink the same pin on the SX28?

    However, you can't use Pickit3 with SX28, because SX28 RB6/RB7 don't provide ICSPDAT and ICSPCLK functionality.
    You need an SXkey programmer to upload the hex file to SX28 via OSC1/OSC2.

    I can't find an SXkey programmer any longer, but I might try making a fluffy2 programmer as described at hellspark.com.

  • No, but you might want to read this. I have an SXkey

  • Thank you, Parallax documentation is really nice, and the Ubicom AN is interesting, but I haven't seen a PC parallel poet for a long time.

  • Checkout SXlist.com

  • Thanks, but I search for their SXDEV tool and only get an HTTP 404. Too bad, the SX28 looks like a fantastic controller; I found one project for a Ham PSK31 audio beacon with great documentation.

  • The SX is a dinosaur, I get you have a few and want to use them. The SXKey has a Ft232 and SX28 on it, plus a few transistors. I mostly work with the propeller P1

  • P1 looks interesting. Can you program it with an FTDI USB to TTL adapter?

  • JonnyMacJonnyMac Posts: 9,030
    edited 2023-09-23 20:51

    P1 looks interesting. Can you program it with an FTDI USB to TTL adapter?

    You need an extra transistor and cap to reset from the adapter -- schematic is available.

    As Bob suggests, the SX is long dead (thanks to Microchip) and Chip Gracey used what he learned while working on that to create the Propeller (P1), and now the P2. The P1 is faster than the SX, probably uses less current even with all 8 cores running (SX current was always a problem), and the need for interrupts is eliminated. I wrote a lot of of SX code; in fact, while working for Parallax I helped Terry Hitt (Bean) with SX/B. I wrote the book Bob referenced earlier (I work in the movie industry, so I changed my name from Williams to McPhalen). I liked the SX, and created a lot with it, but I LOVE the Propeller, and even though the P1 has a couple years on it, you can count on support and it doesn't require any fancy tools. The P1 cannot do single-step debugging like the SX, but to do that you need an SX-Key (and they're impossible to find [no, you can't have mine ]). One of the problems that Parallax had is a critical component of the SX-Key became obsolete.

    Give the Propeller 1 a try. You can get in for about $35 if you get the FLiP module. The USB circuitry is built in. Plug it into a breadboard and start experimenting.

    https://www.parallax.com/product/propeller-flip-microcontroller-module/

    BTW, if you're an assembly programmer, you'll find the P1 assembly far and away nicer than PIC/SX assembly. And there are no memory banks to work about. P2 assembly is even nicer yet.

  • Thanks, I think I'll get a P1 and a Prop Plug and try them out. I have a BS1 and BS2sx both over 20 years old, and they are still working.

    BTW, Parallax doesn't seem to favor Linux much, do they?

  • BTW, Parallax doesn't seem to favor Linux much, do they?

    No, Chip is very DOS/Windows centric. His favorite coding language is x386 assembly (with a bit of Delphi/Pascal that he used for PNut).

    If you want native Linux tools have a look at Spin Tools IDE (compiles to byte codes like Propeller Tool) and FlexProp (compiles to PASM). Of the two, my preference is Spin Tools because it looks like an upgraded version of Propeller Tool. Note the Spin Tools is [currently] limited to Spin (Propeller's native language); FlexProp can compile Spin, BASIC, and C. It's quite popular for people who don't like Spin as much as I do.

    https://www.maccasoft.com/spin-tools-ide/
    https://github.com/totalspectrum/flexprop/releases

  • Thanks very much, this is very helpful. I'm going to try a P1 on a breadboard with a 50MHz XTAL and a 24LC52.

  • JonnyMacJonnyMac Posts: 9,030
    edited 2023-09-23 23:47

    If you put a P1 (not a Flip) on a breadboard make sure you put bypass caps (at least 0.1) on both VCC pins. Also, the P1 was designed for a 5MHz crystal because it has a PLL that can be set to 1x, 2x, 4x, 8x, and 16x -- at 16x with a 5MHz crystal we get 80 MHz. If you use the 50MHz crystal, you will be limited to 2x PLL setting because the P1 cannot run more than about 110MHz under very good conditions. Also, the P1 needs a 32K EEPROM, like the 24LC256. I tend to use the 24LC512 (maybe that's what you meant) as it gives me 32K of program storage, and 32K of additional storage.

    If this is about learning the P1, the FLiP is going to save you a lot of time (which is $) getting started. Once you're used to the P1, custom circuits are the next step.

  • Got it. 5.0 MHz and 24LC512. Thanks.

  • JonnyMacJonnyMac Posts: 9,030
    edited 2023-09-24 15:48

    FWIW, the P1 FLiP has the 5MHz crystal and 24LC512 built in; it's ready to run out of the box.

  • @JonnyMac said:
    I wrote the book Bob referenced earlier (I work in the movie industry, so I changed my name from Williams to McPhalen).

    So is this different from Al Williams, another author at Parallax?

    I learned SX assembly programming from the Al Williams guide pdf in the late 90's and it was an absolute piece of cake. (I had no PIC programming experience) If Parallax would just commit and have Al Williams write something similar for the Propeller 1 or 2 , I WOULD PROBABLY BE PLAYING WITH THEM TODAY.

    Another thing. How did I miss this SX BASIC compiler thing, that evidentally came out in 2008? Was this never advertised? Today is the first time I am heard about it.

  • JonnyMacJonnyMac Posts: 9,030
    edited 2023-09-24 15:24

    So is this different from Al Williams, another author at Parallax

    Al and I are not the same person, nor related -- though that question used to come up a lot when I was going by Williams and we both actively wrote for Nuts & Volts.

    I learned SX assembly programming from the Al Williams guide pdf in the late 90's and it was an absolute piece of cake.

    I liked that book, too. While Terry was developing SX/B I used what I learned from Al (and others) to make adjustments in the SASM output of SX/B that would get folded back into the compiler. I also used code from Al and others (and wrote some of my own) for interrupt routines in SX/B -- like this UART code.

    ' =========================================================================
      INTERRUPT NOCODE 230_400                      ' (3)   4.34 uSecs
    ' =========================================================================
    
    Mark_ISR:
      ASM
        BANK  flags                                 ' (1)
        SETB  isrFlag                               ' (1)
      ENDASM
    
    
    ' -------
    ' RX UART
    ' -------
    '
    ' UART code by C. Gracey, A. Williams, et al
    ' -- buffer mods by Jon McPhalen
    '
    Receive:
      ASM
        BANK  rxSerial                              ' (1)
        JB    rxBufCnt.3, RX_Done                   ' (2/4) skip if buffer is full
        MOVB  C, RX                                 ' (4)   sample serial input
        TEST  rxCount                               ' (1)   receiving now?
        JNZ   RX_Bit                                ' (2/4) yes, get next bit
        MOV   W, #9                                 ' (1)   no, prep for next byte
        SC                                          ' (1/2)
         MOV  rxCount, W                            ' (1)   if start, load  bit count
        MOV   rxDivide, #Baud1x5                    ' (2)   prep for 1.5 bit periods
    
    RX_Bit:
        DJNZ  rxDivide, RX_Done                     ' (2/4) complete bit cycle?
        MOV   rxDivide, #Baud1x0                    ' (2)   yes, reload bit timer
        DEC   rxCount                               ' (1)   update bit count
        SZ                                          ' (1/2)
         RR   rxByte                                ' (1)   position for next bit
        SZ                                          ' (1/2)
        JMP   RX_Done                               ' (3)
    
    RX_Buffer:
        MOV   W, #rxBuf                             ' (1)   point to buffer head
        ADD   W, rxHead                             ' (1)
        MOV   FSR, W                                ' (1)
        MOV   IND, rxByte                           ' (2)   move rxByte to head
        INC   rxHead                                ' (1)   update head
        CLRB  rxHead.3                              ' (1)   keep 0..7
        INC   rxBufCnt                              ' (1)   update buffer count
        SETB  rxReady                               ' (1)   set ready flag
    
    RX_Done:
        'BANK  __DEFAULT                            ' (1)
      ENDASM
    
    
    ' -------
    ' TX UART
    ' -------
    '
    ' UART code by C. Gracey, A. Williams, et al
    ' -- buffer mods by Jon McPhalen
    '
    Transmit:
      ASM
        BANK  txSerial                              ' (1)
        TEST  txCount                               ' (1)   transmitting now?
        JZ    TX_Buffer                             ' (2/4) if txCount = 0, no
        DEC   txDivide                              ' (1)   update bit timer
        JNZ   TX_Done                               ' (2/4) time for new bit?
        MOV   txDivide, #Baud1x0                    ' (2)   yes, reload timer
        STC                                         ' (1)   set for stop bit
        RR    txHi                                  ' (1)   rotate TX char buf
        RR    txLo                                  ' (1)
        DEC   txCount                               ' (1)   update the bit count
        MOVB  TX, txLo.6                            ' (4)   output the bit
        JMP   TX_Done                               ' (3)
    
    TX_Buffer:
        TEST  txBufCnt                              ' (1)   anything in buffer?
        JZ    TX_Done                               ' (2/4) exit if empty
        MOV   W, #txBuf                             ' (2)   point to buffer tail
        ADD   W, txTail                             ' (1)
        MOV   FSR, W                                ' (1)
        MOV   txHi, IND                             ' (2)   move byte to TX reg
        CLR   txLo                                  ' (1)   clear for start bit
        MOV   txCount, #10                          ' (2)   start + 8 + 1 stop
        INC   txTail                                ' (1)   update tail pointer
        CLRB  txTail.3                              ' (1)   keep 0..7
        DEC   txBufCnt                              ' (1)   update buffer count
    
    TX_Done:
        BANK  __DEFAULT                             ' (1)
      ENDASM
    
      RETURNINT                                     ' (3)
    
    

    I don't know if Al has ever written about the Propeller, but I certainly have. I used to write a column for Nuts & Volts and wrote many articles about the P1. I stopped writing regularly in 2017, but when the P2 was nearing release I did write an introductory article about ti. That's online here:
    -- https://www.nutsvolts.com/magazine/article/an-introduction-to-the-parallax-propeller-2

    If you have a digital subscription to Nuts & Volts you should be able to find my old articles. I wrote under both names: Jon Williams and Jon McPhalen.

    Another thing. How did I miss this SX BASIC compiler thing, that evidentally came out in 2008? Was this never advertised?

    I don't know. Parallax doesn't do a lot of marketing, but back then they advertised on the back cover to Nuts & Volts and I was writing I was writing a monthly column. I used SX/B after leaving Parallax to create products for EFX-TEK and do neat custom stuff for Disneyland and others. Ultimately, though, the SX was not viable for production based on restrictions imposed by Microchip and the P1 price came into a range where it was a better choice. All the boards I designed for EFX-TEK were converted to the P1.

  • @JonnyMac said:

    I don't know. Parallax doesn't do a lot of marketing, but back then they advertised on the back cover to Nuts & Volts and I was writing I was writing a monthly column.

    Just took my biennial trip to Barnes and Noble. Nuts Volts is gone of course. What was more interesting is Circuit Cellar and Popular Mechanics is almost completely devoid of print advertising now, including what used to be decently large 'classified' advertising section. I wonder if the modern equivalent would be Youtube advertising

  • @JonnyMac from January 2008

  • It's not that difficult to make an SX chip programmer. Last year I built a programmer on a propeller 1 protoboard. The electronic circuitry is like that of the application note referenced earlier in this thread but is a lot simpler; it only uses 3 transistors, 6 resistors, plus you've got to make a 12.5 volt supply. To keep it simple, I just powered the entire protoboard from a 12.5V supply. I coded the sx programming protocol in spin and asm.

    I wrote a Delphi program to read a .obj file assembled by sx-key software, send the codes to the propeller board over USB, then tell the propeller to write to the sx chip.

    It worked for simple blink-LED tests on sx18s, sx28s and sx48s, and it worked for a project I'd started, making a serial backpack for a four-line LCD, but then I put it away so I could work on other projects.

    So it hasn't had extensive testing, and could well have bugs. Plus, the Delphi user interface is just the bare minimum to make it work.

    But it does work. This morning I successfully rewrote my half-finished LCD driver code to an sx28.

    I'll zip up and post the codes when I get a chance.

    The circuit diagram is drawn at the top of one of the spin files.

    480 x 640 - 139K
    640 x 480 - 53K
    837 x 1008 - 105K
  • Here's my spin code, Delphi code, a Delphi executable and some notes. I hadn't written this thinking that anyone else would want to use it, so there's no guarantee that it will work, but it should show the general idea that worked for me.

  • Wow, Fantastic!

    I had almost given up on my SX28 chips and ordered a Propeller 1 with Prop Plug to play with. Now I'll get a Propeller Proto Board too, and learn Spin and Propeller programming, and try to build your SX28 programmer. I'll learn how to use the Delphi IDE, too.

    Thank you for this work and information. My goal is to see if an MPLAB hex file really runs on an SX28.

  • Here's the document that I used for understanding just about every step of the sx programming.

    As I read it over again this morning, I read that some older Scenix parts are not designed to run at 3.3 volts.

    Most of my parts are newer, and work fine with this programming design, but I do have one old sx28 with a date code of 9837 that reports device code $FEE, which is one of those 5v only parts.

    It seems that I was able to read its device code using 3.3v, but in general, I'd rather not try to work with parts out of their specified voltage range.

    So if your sx28's are older, this circuit might be better if it was redesigned to run the sx at 5 volts. The changes might be as simple as adding two resistors to the OSC2 line, one to protect the propeller pin from excessive current when its fed 5v from the sx OSC2 pin, and one to pull the OSC2 line up to 5v when it's floating. And the existing OSC1 pullup resistor would need to be pulled up to 5v, not 3.3v. And the power line to the sx would also need to be 5v, not 3.3v.

    Just another puzzle to solve.

  • rffish,

    I know you already ordered a Flip but this discounted kit is the same price and has extra parts that you might find handy.
    https://www.parallax.com/product/propeller-flip-try-it-invention-kit/
    Great price on a decent meter.
    https://www.parallax.com/product/digital-multimeter-bbt858l/

    Tracy Allen was looking for SX28s for his Stache product last year so he may be able to use your old chips.
    https://forums.parallax.com/discussion/174514/again-seeking-sx-chips

  • Great offer, probably too late to change my order.
    I ordered the Flip because I can't get Propeller Tool to recognize my P8X32A on a breadboard.

  • David B,

    My SX28 chips have date code 9951 so they will probably work with your original programmer.

    They don't sell the Propeller protoboard any longer, so I'm trying to make my own on a breadboard.

    Thank you.

  • Thanks for the info, but I got the Propeller Flip running on a breadboard and will try to build the SX programmer around that.

    I also setup my P8X32A 40 pin DIP on a breadboard as described in the Propeller Education Kit p.31 figure, but Propeller Tool doesn't see my P1. My Prop Plug is good (did a serial terminal test), and my Win11 drivers work with Flip, so I'm still working on this problem, too.

  • Check for power on pins 9, 29 and 12, 32 . Pin 9 and 29 is the grounded, Pin 12 and 32 is 3.3 vdc. Pin 10 grounded. I use the crystal 5 Mhz. on my setup. Check for proper Rx and Tx connection, remember Rx to Tx etc. . Reset pin and ground.

Sign In or Register to comment.