Shop OBEX P1 Docs P2 Docs Learn Events
Why...O...why...in this day and age... — Parallax Forums

Why...O...why...in this day and age...

For close to two decades now, I have been writing programs for the Basic Stamps. Many, many projects with the Bs2 and my favorite the BS2sx. Now, I understand, from Chris, that the BS2sx is now obsolete, due to the interpertor chip, not be produced. Such a shame...really. Now, I see Parallax shifting toward the Arduino, products, which I personally find sad.

The reason I feel sad, after using the Stamps, is...Parallax, (Chip Gracey) produced the Propeller, which by all standards, is far superior to the Arduino product. The basic problem with the Propeller, for old Stamp code writers, like myself, is the SPIN language is...really...just to complicated to learn, and I have tried. Book, after book, and I really don't think I am stupid.

So, repeating the subject line, "Why...O...why", with the aid of a super computer, or someone...(probably got something to do with moneys)..can't the PBASIC language be installed (if that is the right word) in the Propeller. I am sure this would put Parallax back on the Microcontroller map, and take some glory away from the Arduino. After all the Stamp was out there first.

I do know that there are other STAMPS with the multi slot programing abilities. But....well, I just had to speak out....because I hate to see Parallax go done the tubes..

Dennis
«1345678

Comments

  • Heater.Heater. Posts: 21,230
    Why not use BASIC on the Propller? See the PropBASIC thread in the general discussion section as we speak.
  • I don't see Parallax shifting to Arduino at all. They are are interfacing to expand their product line.

    PropBasic has been out for many years for the Propeller:

    http://forums.parallax.com/discussion/118611/download-propbasic-here-00-01-14-last-version-for-bst/p1

    Check it out!

  • kwinnkwinn Posts: 8,697
    The biggest problem I see is finding the information and code for setting up and using all the programming language options available for the propeller. It would be so nice if there was a single site where a was available.
  • There are 66,000 SX48 chips available at a good price:

    https://www.parallax.com/product/sx48bd-g

    The could be put onto something like:

    http://forums.parallax.com/discussion/94916/sx48-40-pin-dip-full-kit-and-pcb-available

    And there are 137 BS2SX available:

    https://www.parallax.com/product/bs2sx-ic
  • Denno, I started with the BS2. I used PropBasic for my first Propeller project because it 'was' a big jump and it was kind of scary. The power of the Propeller makes projects much cheaper.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    denno wrote: »
    For close to two decades now, I have been writing programs for the Basic Stamps. Many, many projects with the Bs2 and my favorite the BS2sx. Now, I understand, from Chris, that the BS2sx is now obsolete, due to the interpertor chip, not be produced. Such a shame...really. Now, I see Parallax shifting toward the Arduino, products, which I personally find sad.

    While the BS2e and BS2sx are now obsolete, the BS2p series more than makes up for them. I've been asking for years for the BS2e and BS2sx to be discontinued since the BS2p supercedes them. There really is no reason to use the older models when something faster and better can do the same job for the same cost.

    Also, Parallax isn't shifting toward the Arduino. We've simply provided some example code and a board (BoE Shield) to allow those already using the Arduino to make use of our accessories and robot platform.
    The reason I feel sad, after using the Stamps, is...Parallax, (Chip Gracey) produced the Propeller, which by all standards, is far superior to the Arduino product. The basic problem with the Propeller, for old Stamp code writers, like myself, is the SPIN language is...really...just to complicated to learn, and I have tried. Book, after book, and I really don't think I am stupid.

    The SPIN language was designed to be easy, but could not really be a variant of PBASIC for many reasons, not the first of which is major architectural differences. The PBASIC language could not really handle the resources of the Propeller without a huge overhaul. Also, there are inherent limitations in the PBASIC language that would then impose limitations on the Propeller hardware. These instructions are quite powerful and easy to master within the limitations of the BASIC Stamp, but the Propeller can do so much more. Many features of the BS2sx you refer to were added to get around some of these hardware limitations. So porting this to the Propeller just imposes the same limitations. SPIN was designed to free the programmer from such limitations.
    So, repeating the subject line, "Why...O...why", with the aid of a super computer, or someone...(probably got something to do with moneys)..can't the PBASIC language be installed (if that is the right word) in the Propeller. I am sure this would put Parallax back on the Microcontroller map, and take some glory away from the Arduino. After all the Stamp was out there first. I do know that there are other STAMPS with the multi slot programing abilities. But....well, I just had to speak out....because I hate to see Parallax go done the tubes.. Dennis

    Parallax never left the microcontroller map, nor is it going down the tubes. When the Propeller 2 comes out it will no doubt have a revised language as there aren't facilities within the current SPIN language to handle all the new hardware features of the new Propeller chip. It's just how things go.

  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2017-01-05 17:12
    I've always thought about writing a PBASIC in Forth on top of Tachyon so that you could write code in PBASIC interactively on the Prop itself but have it execute much faster than Spin. But just for a quick play I thought that I'd just modify some PBASIC source code so that it was more Forth friendly while still retaining its PBASIC style. So I added a handful of ALIASES and some simple definitions such as PWM to Tachyon and used the IncubatorOpenLoop source.

    Take for instance this part in PBASIC
    ' -----[ Initialization ]--------------------------------------------------
    LOW Heater                    ' Heater off
    LOW Fan                       ' Fan off
    PAUSE 1000                    ' Connection stabilization
    GOSUB ReadSP_Temps            ' Get temp span and offset from StampPlot
    
    
    ' -----[ Main Routine ]----------------------------------------------------
    DO
      GOSUB ReadSP_Controls
      GOSUB Drive_Heater
      GOSUB SetADC
      GOSUB ReadADC
      GOSUB CalcTemp
      GOSUB PlotTemp
      PAUSE 500
    LOOP
    

    when converted to Tachyon PBASIC style code becomes:
    : Init
    ' -----[ Initialization ]--------------------------------------------------
    Heater LOW			' Heater off
    Fan LOW				' Fan off
    1000 ms				' Connection stabilization
    ReadSP_Temps			' Get temp span and offset from StampPlot
    
    
    ' -----[ Main Routine ]----------------------------------------------------
    
    BEGIN
      ReadSP_Controls
      Drive_Heater
      SetADC
      ReadADC
      CalcTemp
      PlotTemp
      500 ms
    AGAIN
    
    
    The init section was named Init so that it could be called by name or setup to AUTORUN on reset. So far so good.

    This is one of the subroutines:
    Drive_Heater:
      FOR x = 0 TO 20                         ' Drive heater for 20 repetitions
        PWM Heater, PWM_Drive * 255/100, 100  ' %Duty converted to 0-255 for PWM
      NEXT
      RETURN
    

    In Tachyon PBASIC style:
    : Drive_Heater
      20 FOR                         ' Drive heater for 20 repetitions
        Heater PWM_Drive C@ 255 * 100 / 100 PWM		' %Duty converted to 0-255 for PWM
      NEXT
      RETURN
    

    which BTW is fully interactive and this is what this routine looks like decompiled:
    SEE Drive_Heater
    
    286E $0014 (20)
    2870 FOR
    2872 $0005 (5)
    2874 $768B (30347)
    2876 C@
    2878 $00FF (255)
    287A *
    287C $0064 (100)
    287E /
    2880 $0064 (100)
    2882 PWM
    2884 NEXT
    2886 EXIT
    
    The PWM function was implemented in a Q&D loop fashion even though there are better ways, but the PBASIC cycle time is still 4 times faster than a BS2px. Here I test that interactively using LAP functions to accurately measure execution time:
    ( 0068 $2686 ok )   Heater PWM_Drive C@ 255 * 100 / 100     LAP PWM LAP .LAP  10480 cycles at 96000000Hz  or 109.166us 
    

    I'm not saying the this is a "comfortable" solution but it just shows how quickly a PBASIC program could be "converted" although this is really just a quick test and I could make it with a bit more work handle unmodified PBASIC source except of course the source would just be pasted into a terminal interactively.
  • ElectrodudeElectrodude Posts: 1,657
    edited 2017-01-05 17:10
    PBASIC and Spin were my first two programming languages. I thought Spin was a very easy step from PBASIC. It had all of the features I had been wishing PBASIC had.

    I didn't bother with any books when I learned Spin. I just looked at demos, mostly ones that did VGA and TV output, and modified them to try to make them do other similar things. Eventually, I got to the point where I could write my own programs. I don't remember how or when I learned PASM, though.
  • PBASIC and Spin were my first two programming languages. I thought Spin was a very easy step from PBASIC. It had all of the features I had been wishing PBASIC had.

    I didn't bother with any books when I learned Spin. I just looked at demos, mostly ones that did VGA and TV output, and modified them to try to make them do other similar things. Eventually, I got to the point where I could write my own programs. I don't remember how or when I learned PASM, though.



    About the same scenerio for me, I never thought twice about when, I made the graduation from the BS2 to the Propeller and SPIN. I have a lot to learn yet, but the transition was smooth.
  • Denno,

    I too started with the BS2 and thought Spin was intimidating but now I love it!
    I would say that about 75% of Spin is the same as PBASIC but Spin is a lot more powerful.
    I learned Spin mainly from the Propeller Education Kit (PEK) textbook but also by looking at Demo programs and other people's code. Unfortunately I had to learn how to use Constants (CON) from other sources.

    Martin Hebel wrote a BS2 Object, or a Spin Library, for those PBASIC only commands such as RCTIME, SHIFTIN/OUT, PULSIN/OUT, etc.

    If you like PBASIC then you will love Spin,
  • Has anybody ever written an interpreter for the Prop that executes BS2 bytecodes? That shouldn't be too hard for somebody that is sufficiently motivated. That way you could compile a program for whichever version of the BS2 you want to run, and run it on the Prop instead.
  • Dave,
    The BS2 bytecodes are still considered proprietary to Parallax and are not publicly documented. I've thought about enhancing FemtoBasic to handle most of PBasic, but it ended up way too big and complex without completely rewriting FemtoBasic which I wasn't willing to do.
  • denno: Kinda have to second what Electrodude wrote. I was too impatient for results to bother with the manual at first. So I was staring at Chip's TV Text Demo code (because composite video was the thing I needed - and the thing that had propelled me toward the Propeller in the first place) and the light suddenly went on. Just for grins I made a minor change to the code and it worked. Half hour later my first Propeller project was done. It worked so well it left my head spinning. Since then I've looked at the manual many times, of course. But just to get your feet wet, I strongly recommend just doing something. Start with code that works and modify it in some simple way that makes sense. Chances are it will work - and that will get you jump-started.
  • jmgjmg Posts: 15,173
    ...but could not really be a variant of PBASIC for many reasons, not the first of which is major architectural differences. The PBASIC language could not really handle the resources of the Propeller without a huge overhaul. Also, there are inherent limitations in the PBASIC language that would then impose limitations on the Propeller hardware. These instructions are quite powerful and easy to master within the limitations of the BASIC Stamp, but the Propeller can do so much more.

    I agree that Spin is a better fit to P1 than PBASIC, but that does not quite address the OP's question.

    The main hurdle I see for PBASIC -> P1 is not language limitations, but the lack of Wide Vcc on P1.

    A key pivot for doing a 'better PBASIC' platform, will be backward hardware compatibility.

    Neither P1 nor P2 offers 5V IO operation, but BS2p already uses an external-vendor MCU, so a precedent is proven that Parallax can use other vendor's MCUs.

    The existing BS2p is not at the lowest price end of the spectrum, so a next-step has some elbow room in MCU choice.
    The range of ARM parts in 5V is expanding steadily, and Nuvoton, Infineon, and Cypress have many.

    Some work is being done on Python for MCUs, so a chip choice that allowed PBASIC with an eye to future Python could generate enough market interest.

  • Mike Green wrote: »
    Dave,
    The BS2 bytecodes are still considered proprietary to Parallax and are not publicly documented. I've thought about enhancing FemtoBasic to handle most of PBasic, but it ended up way too big and complex without completely rewriting FemtoBasic which I wasn't willing to do.
    Isn't there an open source PBasic tokenizer?

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    jmg wrote: »
    I agree that Spin is a better fit to P1 than PBASIC, but that does not quite address the OP's question.

    Interesting...it seems to me he's saying the hurdle is the language, not the hardware.
    The main hurdle I see for PBASIC -> P1 is not language limitations, but the lack of Wide Vcc on P1. A key pivot for doing a 'better PBASIC' platform, will be backward hardware compatibility. Neither P1 nor P2 offers 5V IO operation, but BS2p already uses an external-vendor MCU, so a precedent is proven that Parallax can use other vendor's MCUs.

    While the Propeller chip is not a 5V MCU, it can easily interface to 5V systems as shown in a myriad of examples Parallax has provided. Granted, not every 5V system is compatible with 3.3V signals, but the circuitry to make it all work smoothly is minimal.

    What do you mean the BS2p uses an external-vendor MCU? I don't understand that statement.
  • jmg wrote: »
    Neither P1 nor P2 offers 5V IO operation, but BS2p already uses an external-vendor MCU, so a precedent is proven that Parallax can use other vendor's MCUs.
    Don't *all* of the BASIC Stamp modules use an "external vendor MCU"? Even the original used a PIC if I recall.
  • jmgjmg Posts: 15,173
    David Betz wrote: »
    jmg wrote: »
    Neither P1 nor P2 offers 5V IO operation, but BS2p already uses an external-vendor MCU, so a precedent is proven that Parallax can use other vendor's MCUs.
    Don't *all* of the BASIC Stamp modules use an "external vendor MCU"? Even the original used a PIC if I recall.

    Well, yes, of course, but Chris said the only active variant was BS2p, so I focused on that.



  • jmgjmg Posts: 15,173
    What do you mean the BS2p uses an external-vendor MCU? I don't understand that statement.
    It simply means the BS2p MCU is made by Microchip, whilst the P1 is in-house Parallax.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    jmg wrote: »
    Well, yes, of course, but Chris said the only active variant was BS2p, so I focused on that.

    Actually, that's not what I said. I said the BS2p series supercedes the BS2e and BS2sx. There was also a BS2pe and a BS2px.

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2017-01-05 22:16
    jmg wrote: »
    It simply means the BS2p MCU is made by Microchip, whilst the P1 is in-house Parallax.

    The MCU used as the interpreter in the BS2p was not made by Microchip. It was a Parallax part. Before that it was a Ubicom part and prior to that it was Scenix. The die may have been made by the same company all along, however the owner of the SX brand at the time was as stated.

    Liekwise, the BS1 and BS2 use the PIC as the interpreter, which is the only one made by Microchip.
  • What do you mean the BS2p uses an external-vendor MCU?
    I think he means Scenix/Ubicom, instead of Parallax -- even though the SX is largely Chip's design.

    -Phil
  • jmgjmg Posts: 15,173
    edited 2017-01-05 22:17
    jmg wrote: »
    Well, yes, of course, but Chris said the only active variant was BS2p, so I focused on that.

    Actually, that's not what I said. I said the BS2p series supercedes the BS2e and BS2sx. There was also a BS2pe and a BS2px.
    Past tense ? The BS2pe & BS2px are now also obsolete, are they not ?

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    jmg wrote: »
    Past tense ? The BS2pe & BS2px are now also obsolete, are they not ?

    Okay, now we're quibbling needlessly. I will refer to the following article which was already previously shared when the BS2e and BS2sx were listed as obsolete.

    https://www.parallax.com/news/2016-05-20/bs2-substitution-recommendations-eol-sx-based-basic-stamp-microcontroller-modules

  • "For close to two decades now, I have been writing programs for the Basic Stamps."

    That's likely the root of your problem, honestly. Please don't take that as an insult because it's not intended as such in any way - it's natural to get comfortable with something and continue to use it because it comes easily, even when better options are available. If you spend some time with the Propeller and Spin you'll find that there's a learning curve, but it's not hard to use, and there are a lot of examples in the code provided with the Propeller Tool, the Object Exchange, and the forums, in addition to a lot of people here who are happy to help when something stumps you.

    There are also a few libraries available that provide many of the same functions as the Stamp, using the command names you're used to, which should help the transition. When you're ready to dig into the details, the code for those functions is available too.
  • jmgjmg Posts: 15,173
    edited 2017-01-05 22:43
    jmg wrote: »
    ...
    The range of ARM parts in 5V is expanding steadily, and Nuvoton, Infineon, and Cypress have many.

    Some work is being done on Python for MCUs, so a chip choice that allowed PBASIC with an eye to future Python could generate enough market interest.

    Examples :
    Checking in at Digikey finds MB9BF566KPMC-G-JNE2 in 48 pins, which would be a same-package retrofit & Parallax could use a change of colour to show different MCU host.

    http://www.digikey.com/product-detail/en/cypress-semiconductor-corp/MB9BF566KPMC-G-JNE2/1534-1106-ND

    ARM® Cortex®-M4F FM4 MB9B560L Microcontroller IC 32-Bit 160MHz 48-LQFP (7x7)
    Program Memory Size 544KB (544K x 8 )
    RAM Size 64K x 8
    Connectivity CAN, CSIO, I²C, LIN, UART/USART, USB
    Peripherals DMA, LVD, POR, PWM, WDT
    Number of I/O 33
    Voltage - Supply (Vcc/Vdd) 2.7 V ~ 5.5 V
    Data Converters A/D 8x12b, A/D 2x10b
    $3.36/1k

    From Nuvoton, also focusing on 48 pin, USB, Wide Vcc :
    (smaller and slower, but also lower price)
    https://direct.nuvoton.com/en/m452le6ae
    - ARM® Cortex®-M4 with DSP and FPU
    - Max frequency of 72 MHz
    - Operating voltage: 2.5V to 5.5V
    - 128 KB of Flash memory
    - 32 KB of SRAM
    12-bit ADC (up to 16 channels)
    12-bit DAC
    - USB 2.0 OTG
    - Up to 4 UARTs
    - Up to three SPIs
    - Up to two I2Cs (up to 1 MHz)
    - Smart card interface
    - I2S interfaces
    $1.89/1k
  • jmg wrote: »
    jmg wrote: »
    ...
    The range of ARM parts in 5V is expanding steadily, and Nuvoton, Infineon, and Cypress have many.

    Some work is being done on Python for MCUs, so a chip choice that allowed PBASIC with an eye to future Python could generate enough market interest.

    Examples :
    Checking in at Digikey finds MB9BF566KPMC-G-JNE2 in 48 pins, which would be a same-package retrofit & Parallax could use a change of colour to show different MCU host.

    http://www.digikey.com/product-detail/en/cypress-semiconductor-corp/MB9BF566KPMC-G-JNE2/1534-1106-ND

    ARM® Cortex®-M4F FM4 MB9B560L Microcontroller IC 32-Bit 160MHz 48-LQFP (7x7)
    Program Memory Size 544KB (544K x 8 )
    RAM Size 64K x 8
    Connectivity CAN, CSIO, I²C, LIN, UART/USART, USB
    Peripherals DMA, LVD, POR, PWM, WDT
    Number of I/O 33
    Voltage - Supply (Vcc/Vdd) 2.7 V ~ 5.5 V
    Data Converters A/D 8x12b, A/D 2x10b
    $3.36/1k

    From Nuvoton, also focusing on 48 pin, USB, Wide Vcc :
    (smaller and slower, but also lower price)
    https://direct.nuvoton.com/en/m452le6ae
    - ARM® Cortex®-M4 with DSP and FPU
    - Max frequency of 72 MHz
    - Operating voltage: 2.5V to 5.5V
    - 128 KB of Flash memory
    - 32 KB of SRAM
    12-bit ADC (up to 16 channels)
    12-bit DAC
    - USB 2.0 OTG
    - Up to 4 UARTs
    - Up to three SPIs
    - Up to two I2Cs (up to 1 MHz)
    - Smart card interface
    - I2S interfaces
    $1.89/1k
    If you use even an low-end ARM it would probably be possible to put the tokenizer in flash on the ARM chip. Then you could have a self-hosted BASIC stamp!
  • MicksterMickster Posts: 2,693
    edited 2017-01-05 23:19
    I am using the ByPic as an interactive front-end to my Prop. This is like a combo of C and BASIC, pseudo-compiled on a 32bit PIC. Totally blows Micromite's interpreter out the water.
  • Mickster wrote: »
    I am using the ByPic as an interactive front-end to my Prop. This is like a combo of C and BASIC, pseudo-compiled on a 32bit PIC. Totally blows Micromite's interpreter out the water.
    ByPic looks kind of interesting. Do you know if it is open source?
Sign In or Register to comment.