-
Notifications
You must be signed in to change notification settings - Fork 70
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
port to pi4 #19
base: master
Are you sure you want to change the base?
port to pi4 #19
Conversation
…seems to select regular oscillator, see comments in code). apologies for moving code around - i'm not a c++ guy and that was the easiest way to get it to compile. i also don't understand why i'm getting warnings! enjoy!
@@ -301,3 +215,98 @@ bool GPIO::Init() { | |||
|
|||
return gpio_port_ != MAP_FAILED && clock_reg_ != MAP_FAILED; | |||
} | |||
|
|||
|
|||
// BCM2835-ARM-Peripherals.pdf, page 105 onwards. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To keep the diff small, can you move this block back to around line 105 ?
Thanks, looks like a good starting point. Where did you find a documentation of the frequencies ? That would be good to include in a comment. |
i got the frequencies through experimentation and observation via oscilloscope, not via documentation. if i move the code back to line 105 compilation fails, as per commit comments. i would love to be more helpful but, again, as per commit comments, i'm not a c++ guy so i have no clue. sorry! |
Hi, I found this code from librpitx which is a radio frequency transmitter library for raspberry pi and the engine of rpitx. I don't have any pi 4 device so I couldn't test it, but I think it might be helpful information.
In the code I found, the frequency of the regular oscillator for pi 4 seems to be 54000000 which is close to your observation. I couldn't figure out the other frequency values (pllc, plld, hdmi) from the code. But I'm sure you guys can figure it out (by running it, for example). |
BTW if you move the definition of for example: // We are not interested in the _exact_ model, just good enough to determine
// What to do.
enum RaspberryPiModel {
PI_MODEL_1,
PI_MODEL_2,
PI_MODEL_3,
PI_MODEL_4
};
// just a forward declaration
static RaspberryPiModel GetPiModel();
// BCM2835-ARM-Peripherals.pdf, page 105 onwards.
double GPIO::StartClock(double requested_freq) {
// ...
} |
as per my commit comments i'm not a c++ guy so feel free to treat this as a starting point and do a nicer job, but it does seem to work! :)