|
Forum Index : Microcontroller and PC projects : High speed pulse trains
| Author | Message | ||||
| lizby Guru Joined: 17/05/2016 Location: United StatesPosts: 3658 |
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: AustraliaPosts: 3054 |
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 StatesPosts: 3658 |
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: AustraliaPosts: 3054 |
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 StatesPosts: 3658 |
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: AustraliaPosts: 213 |
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 KingdomPosts: 8642 |
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 KingdomPosts: 11026 |
lizby, what is the requirement? Perhaps I can do somethging... |
||||
| Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 5746 |
@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 StatesPosts: 3658 |
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: NetherlandsPosts: 5746 |
DCC_details.zip PicomiteVGA PETSCII ROBOTS |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2026 |