A question for PROPELLER users - Page 1
Forum section: electronics / general

author: IconicPCB
author_rank: Super Contributor
timestamp: August 23, 2022, 11:12:34 pm
content: Is there a way estimate the number of clock cycles it takes to run this bit of code:level := 0 ' clear work varrepeat 12 ' null + 12 data bitsouta := 1 ' clock a bitouta := 0level := (level << 1) | ina ' input data bit from doutThe code is supposed to implement an SPI read of an A/D converterThe clk timing is in question.I have absolutely no experience with the paralax compiler.

author: EEVblog
author_rank: Unknown
timestamp: August 24, 2022, 12:22:31 am
content: The Propeller is still a thing?Haven't heard about it for a long long time.

author: SiliconWizard
author_rank: Super Contributor
timestamp: August 24, 2022, 12:24:16 am
content: Quote from: EEVblog on August 24, 2022, 12:22:31 amYep!And the Propeller 2 is actually interesting:https://www.parallax.com/propeller-2/

author: BradC
author_rank: Super Contributor
timestamp: August 24, 2022, 12:53:32 am
content: 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.

author: tellurium
author_rank: Frequent Contributor
timestamp: August 24, 2022, 09:06:42 pm
content: Quote from: SiliconWizard on August 24, 2022, 12:24:16 amLooking 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?

author: IconicPCB
author_rank: Super Contributor
timestamp: August 24, 2022, 10:09:13 pm
content: 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?

author: PCB.Wiz
author_rank: Super Contributor
timestamp: August 24, 2022, 10:10:48 pm
content: Quote from: tellurium on August 24, 2022, 09:06:42 pmSome values of 'somewhat similar' could be applied I guessThe 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 peripheralThe 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 P2alsohas significant peripheral hardware, each pin of the 64 IO has 32 bit counter/capture/shifter/streamer hardware.

author: IconicPCB
author_rank: Super Contributor
timestamp: August 24, 2022, 10:20:59 pm
content: 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.

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: August 24, 2022, 10:33:23 pm
content: Quote from: IconicPCB on August 24, 2022, 10:09:13 pmIt doesn't. You need to allocate and control cores manually.

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: August 24, 2022, 10:35:28 pm
content: Quote from: IconicPCB on August 24, 2022, 10:20:59 pmYou 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.

author: uer166
author_rank: Super Contributor
timestamp: August 24, 2022, 10:49:58 pm
content: 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?

author: PCB.Wiz
author_rank: Super Contributor
timestamp: August 25, 2022, 12:08:57 am
content: Quote from: IconicPCB on August 24, 2022, 10:20:59 pmIt 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.

author: IconicPCB
author_rank: Super Contributor
timestamp: August 25, 2022, 10:53:54 pm
content: It is the older model.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: August 26, 2022, 01:31:54 am
content: Quote from: IconicPCB on August 25, 2022, 10:53:54 pmokQuote from: IconicPCB on August 23, 2022, 11:12:34 pmI've not used GEAR, but this looks promising, as it's aSoftware simulator for the P1so is an alternative to simply clipping on a scope to a running program.https://forums.parallax.com/discussion/156347/improved-gear-emulatorhttps://github.com/davispuh/gear-emuIf 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

author: BradC
author_rank: Super Contributor
timestamp: August 26, 2022, 10:46:07 am
content: Quote from: PCB.Wiz on August 26, 2022, 01:31:54 amOr just write in straight PASM. It's a doddle.