Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:27 28 Nov 2024 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 : port command speed

Author Message
Plasmamac

Guru

Joined: 31/01/2019
Location: Germany
Posts: 554
Posted: 11:27pm 30 Jul 2023
Copy link to clipboard 
Print this post

iam curiosity about the delay between the pins bits if i use the port command .
no digital analyzer atm  so i ask here .

the user manual say  :Set a number of I/O pins  (i.e. with one command)

but how simultaneously is it ?
Edited 2023-07-31 09:30 by Plasmamac
Plasma
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6798
Posted: 06:50am 31 Jul 2023
Copy link to clipboard 
Print this post

I think PORT bits are now effectively written and read as a single word, so it is actually simultaneously. If there is any delay at all it's probably not measurable.

I say this because this isn't a simple IO port based on a flip-flop register on the data bus. Things don't work like that any more. :) It may be that the individual pin registers are controlled one after the other then the whole register is copied to the pads. The end result is the same.
Mick

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

Joined: 05/03/2018
Location: Netherlands
Posts: 4247
Posted: 07:02am 31 Jul 2023
Copy link to clipboard 
Print this post

Plasma,

Less than 4ns (0.000000004 seconds) delay measured between individual pins changing.
For MMBasic you can assume they change simultaneous.
That is why Mick suggested to use the PORT command to drive stepper motors. They change all at the same time.

Volhout
Edited 2023-07-31 17:03 by Volhout
PicomiteVGA PETSCII ROBOTS
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1101
Posted: 07:21am 31 Jul 2023
Copy link to clipboard 
Print this post

Using this code on a Picomite running the latest software -


Setpin gp7,dout
Setpin gp13,dout
do
 port (gp7,1,gp13,1) = 1
 port (gp7,1,gp13,1) = 0
loop

On the oscilloscope, there is no measurable difference (less than 1nS on a 100MHz scope) on the positive transition with up to 30nS of ripple on the high state.
The negative transition has up to 20uS jitter.
The switching frequency in this example is around 14MHz.
D.
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
Plasmamac

Guru

Joined: 31/01/2019
Location: Germany
Posts: 554
Posted: 08:55am 31 Jul 2023
Copy link to clipboard 
Print this post

Thx for the test.
Plasma
 
Print this page


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

© JAQ Software 2024