Author Topic: A question for PROPELLER users  (Read 4325 times)

0 Members and 2 Guests are viewing this topic.

Offline IconicPCBTopic starter

  • Super Contributor
  • ***
  • Posts: 1634
  • Country: au
A question for PROPELLER users
« on: August 23, 2022, 11:12:34 pm »
Is there a way estimate the number of clock cycles it takes to run this bit of code:

 level := 0                                                    ' clear work var 
  repeat 12                                                     ' null + 12 data bits
    outa[clk] := 1                                              ' clock a bit
    outa[clk] := 0
    level := (level << 1) | ina[dout]                           ' input data bit from dout

The code is supposed to implement an SPI read of an A/D converter

The clk timing is in question.

I have absolutely no experience with the paralax compiler.
 

Offline EEVblog

  • Administrator
  • *****
  • Posts: 42495
  • Country: au
    • EEVblog
Re: A question for PROPELLER users
« Reply #1 on: August 24, 2022, 12:22:31 am »
The Propeller is still a thing?
Haven't heard about it for a long long time.
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 17876
  • Country: fr
Re: A question for PROPELLER users
« Reply #2 on: August 24, 2022, 12:24:16 am »
The Propeller is still a thing?
Haven't heard about it for a long long time.

Yep!
And the Propeller 2 is actually interesting: https://www.parallax.com/propeller-2/
 

Offline BradC

  • Super Contributor
  • ***
  • Posts: 2526
  • Country: au
Re: A question for PROPELLER users
« Reply #3 on: August 24, 2022, 12:53:32 am »
Huh, I only pulled out a Prop proto board on the weekend because I needed to quickly lash up a relatively accurate counter and timer.

Estimating clock cycles in SPIN code is a bit of a crap shoot.

When I wrote compiler I had it spit out a list file which broke down the SPIN into bytecode, and you can use that combined with the published interpreter code to estimate it. That's the hard way.

The much easier way is to profile it by toggling a pin either side of the code in question and time it. I often use a CRO for that, but oddly enough the weekend lash up was to use the Prop to time some code segments on a PIC for exactly the same method.

I was heavily into the Propeller between about 2006 & 2010. I still use the Propeller for stuff that's harder to do on other processors, but I kinda drifted back toward the PIC about 10 years ago. Now the prop comes out when I want to do Video/VGA or quick proto-lashups mainly.

The P2 looks interesting, but I don't really have the time or need to try and get into it.
 

Offline tellurium

  • Frequent Contributor
  • **
  • Posts: 345
  • Country: ua
Re: A question for PROPELLER users
« Reply #4 on: August 24, 2022, 09:06:42 pm »
Yep!
And the Propeller 2 is actually interesting: https://www.parallax.com/propeller-2/

Looking at it, am I right assuming that their approach is somewhat similar to RPI PIO?
Instead of adding specific controllers for peripherals, they provide an efficient way to bitbang any protocol?
Mongoose - a full-stack embedded network library for STM32, NXP and other - https://mongoose.ws
TCP/IP stack + drivers + TLS1.3 + HTTP/WebSocket/MQTT + OTA in a single file
 

Offline IconicPCBTopic starter

  • Super Contributor
  • ***
  • Posts: 1634
  • Country: au
Re: A question for PROPELLER users
« Reply #5 on: August 24, 2022, 10:09:13 pm »
Since the propeller relies on multiple cores, the compiler must generate code to cater to the multi core approach.

How does the task allocator know which core to use?

Can such an arrangement guarantee precise timing when needed unles some specific approach  is deployed which guarantees precise repeatable timing?
 
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 3452
  • Country: au
Re: A question for PROPELLER users
« Reply #6 on: August 24, 2022, 10:10:48 pm »
Yep!
And the Propeller 2 is actually interesting: https://www.parallax.com/propeller-2/

Looking at it, am I right assuming that their approach is somewhat similar to RPI PIO?
Instead of adding specific controllers for peripherals, they provide an efficient way to bitbang any protocol?

Some values of 'somewhat similar' could be applied I guess  ;)

The RPI PIO has room for 32 x 16 bit opcodes,  with 9 opcodes I can see - so I'd call that a useful state engine / microcoded peripheral

The P2 has 8 x COG RAM/CODE storage for 512 x 32 bit opcodes, with 400+ opcodes, so each one is ~an ARM level microcontroller.

The P2 also has significant peripheral hardware, each pin of the 64 IO has 32 bit counter/capture/shifter/streamer hardware.
 

Offline IconicPCBTopic starter

  • Super Contributor
  • ***
  • Posts: 1634
  • Country: au
Re: A question for PROPELLER users
« Reply #7 on: August 24, 2022, 10:20:59 pm »
Propeller is not a microcontroller it is a microprocessor.

It has no peripherals.

EDIT: its it correct that the propeller has those peripherals? I was under the impression it had no hardware peripherals.
« Last Edit: August 24, 2022, 10:23:45 pm by IconicPCB »
 

Offline Sal Ammoniac

  • Super Contributor
  • ***
  • Posts: 1816
  • Country: us
Re: A question for PROPELLER users
« Reply #8 on: August 24, 2022, 10:33:23 pm »
Since the propeller relies on multiple cores, the compiler must generate code to cater to the multi core approach.

How does the task allocator know which core to use?

It doesn't. You need to allocate and control cores manually.
"That's not even wrong" -- Wolfgang Pauli
 

Offline Sal Ammoniac

  • Super Contributor
  • ***
  • Posts: 1816
  • Country: us
Re: A question for PROPELLER users
« Reply #9 on: August 24, 2022, 10:35:28 pm »
Propeller is not a microcontroller it is a microprocessor.

It has no peripherals.

EDIT: its it correct that the propeller has those peripherals? I was under the impression it had no hardware peripherals.

You are correct. Other than 32 I/O ports, it has no peripherals. If you want to implement a UART, for example, you use a core to bit-bang it. Ditto for I2C, SPI, etc. You can't do Ethernet or high-speed USB, however, because the cores aren't fast enough.
"That's not even wrong" -- Wolfgang Pauli
 

Offline uer166

  • Super Contributor
  • ***
  • Posts: 1285
  • Country: us
Re: A question for PROPELLER users
« Reply #10 on: August 24, 2022, 10:49:58 pm »
Cool chip, but expensive and weird. Can't see this being used mainstream, what is the intended market here? It does have a weird set of peripherals such as CORDIC, ADCs, and pixel blenders?
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 3452
  • Country: au
Re: A question for PROPELLER users
« Reply #11 on: August 25, 2022, 12:08:57 am »
Propeller is not a microcontroller it is a microprocessor.

It has no peripherals.

EDIT: its it correct that the propeller has those peripherals? I was under the impression it had no hardware peripherals.

It depends on the model.
The older P1 has no peripherals.
The new P2, has many 32 bit Digital peripherals, with the Smart Pins - you can have >> 32 PWM or Capture channels or UARTS or SPI all running, only Pin and handling limited.
 

Offline IconicPCBTopic starter

  • Super Contributor
  • ***
  • Posts: 1634
  • Country: au
Re: A question for PROPELLER users
« Reply #12 on: August 25, 2022, 10:53:54 pm »
It is the older model.
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 3452
  • Country: au
Re: A question for PROPELLER users
« Reply #13 on: August 26, 2022, 01:31:54 am »
It is the older model.
ok

Is there a way estimate the number of clock cycles it takes to run this bit of code:
The clk timing is in question.
I have absolutely no experience with the paralax compiler.

I've not used GEAR, but this looks promising, as it's a Software simulator for the P1  so is an alternative to simply clipping on a scope to a running program.
https://forums.parallax.com/discussion/156347/improved-gear-emulator
https://github.com/davispuh/gear-emu

If their interpreted Spin language is not fast enough, you could look at their compiled languages.

https://forums.parallax.com/discussion/168913/new-basic-compiler-for-prop1-and-prop2/p1

 


 

Offline BradC

  • Super Contributor
  • ***
  • Posts: 2526
  • Country: au
Re: A question for PROPELLER users
« Reply #14 on: August 26, 2022, 10:46:07 am »
If their interpreted Spin language is not fast enough, you could look at their compiled languages.

Or just write in straight PASM. It's a doddle.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->