Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Measuring frequency on Rpi 4 #4

Open
jarekkt opened this issue Oct 2, 2020 · 1 comment
Open

Measuring frequency on Rpi 4 #4

jarekkt opened this issue Oct 2, 2020 · 1 comment

Comments

@jarekkt
Copy link

jarekkt commented Oct 2, 2020

How have you been able to measure frequency on Rpi 4 ?

I have tried myself (with a bit more direct approach - kernel driver which stops whole CPU for the test period ).
If I do direct bit banging like this:

while(1)
{
GPIO_CLR = BV(4);
GPIO_SET = BV(4);
}

then the signal on pin is messed - as if pin current strength is too low to charge pin capacitance.

Something like this works better:

while(1)
{
GPIO_CLR = BV(4);
GPIO_CLR = BV(4);

GPIO_SET = BV(4);
GPIO_SET = BV(4);
}

Then the signal is readable - the frequency is about 52MHz ( checked on 200MHz scope)

Is there any control over Rpi 4 pin speed/strength ?

@weagle08
Copy link

I've observed the same on PI 4. The above modification works.

for (;;) {
    *set_reg = (1<<TOGGLE_GPIO);
    *set_reg = (1<<TOGGLE_GPIO);
    *clr_reg = (1<<TOGGLE_GPIO);
    *clr_reg = (1<<TOGGLE_GPIO);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants