Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 01:39 07 Mar 2026 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : High speed pulse trains

Author Message
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3658
Posted: 10:57pm 05 Mar 2026
Copy link to clipboard 
Print this post

I thought I saw a post recently about sending High speed pulse trains. I couldn't find anything about it in the manual (maybe poor search foo). What is available?
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on FOTS
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 3054
Posted: 11:45pm 05 Mar 2026
Copy link to clipboard 
Print this post

Assuming you want more flexibility than PWM there is Bitstream that works down to 1µS intervals, in increments of 1µS.
Faster than that would require PIO I expect.
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3658
Posted: 11:47pm 05 Mar 2026
Copy link to clipboard 
Print this post

BITSTREAM--thank you. Knowing what to search for makes such a difference.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on FOTS
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 3054
Posted: 12:16am 06 Mar 2026
Copy link to clipboard 
Print this post

It can often simplify things using

Array Set x, stream$() 'x = most common interval in µS, stream$() = Bitstream array

to set the base timing, then your program can loop through the array changing the elements as required.

Eg. in "Run Length" and "Pulse Position" encoding the intervals between bits are all the same so that would be "x" then you replace every second element with the bit duration. A For loop with Step 2 works nicely. Just make sure you get the starting polarity correct or the data will be inverted.

Links to examples for IR Remotes and Keypads (scroll to 74HC595 version) on FotS.
Edited 2026-03-06 10:21 by phil99
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3658
Posted: 02:33am 06 Mar 2026
Copy link to clipboard 
Print this post

But, ah, the problem for me is that bitstream is blocking. Too much going on for blocking to be allowed. Not now, but when/if I get to it, PIO seems to be the way.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on FOTS
 
mozzie
Senior Member

Joined: 15/06/2020
Location: Australia
Posts: 213
Posted: 04:55am 06 Mar 2026
Copy link to clipboard 
Print this post

G'day Lizby,
Depending on the type of pulsetrain you require, PLAY LOAD SOUND might offer a way of saving the pulsetrain in an array and "playing" it in the background.

Hope this helps.

Regards,
Lyle.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 8642
Posted: 08:41am 06 Mar 2026
Copy link to clipboard 
Print this post

If it's a high speed asynchronous serial string that needs accurate timing and must be non-blocking then you are stuck. MMBasic always processes interrupts after each statement so you can't write it in MMBasic as that will screw up the timing. BITSTREAM is blocking to get the accuracy. PWM will give you a hardware generated signal so that isn't blocking. I agree, a PIO looks like the only way - and only if it's a fixed sequence that will fit in its memory. Otherwise changing the data via a pipe and/or interrupts will probably mess things up a bit.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 11026
Posted: 09:49am 06 Mar 2026
Copy link to clipboard 
Print this post

lizby, what is the requirement? Perhaps I can do somethging...
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5746
Posted: 10:33am 06 Mar 2026
Copy link to clipboard 
Print this post

@lizby,

There is a thread on high speed data send from picomite using PIO where they drive LED displays. The PIO outputs data from a circular buffer filled with data from MMbasic.
So it could repeat endless, and an update of the buffer starts to send out the new data.

But more info on your application could help.

Do you know that Peter has a "buffered" driver for ILI9341 displays ? That also outputs high speed data using the second ARM core. Set up a "fake SPI display", write dummy data to it and it will be send out. ---bad idea--- it converts from RGB121 to RGB565.

Volhout
Edited 2026-03-06 20:34 by Volhout
PicomiteVGA PETSCII ROBOTS
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3658
Posted: 01:52pm 06 Mar 2026
Copy link to clipboard 
Print this post

  matherp said  lizby, what is the requirement? Perhaps I can do somethging...


This is down the line, relating to making "Vibe Virtual Model Railroading" (posting today) less virtual, with the ability to send DCC controls. In talking with Gemini, it said you would need to send continuous repeating bit streams to keep engines rolling. For right now it's just a thought exercise--it's likely to be some time before I tested (and I have no actual model railroad gear). Gemini did suggest some test equipment.

I understand that it could work with PIO (which is Greek to me, but I know help is available here).
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on FOTS
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5746
Posted: 02:08pm 06 Mar 2026
Copy link to clipboard 
Print this post

DCC_details.zip
PicomiteVGA PETSCII ROBOTS
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2026