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

grbl-lpc on LPC1768 at 100MHz #5

Open
TomKeddie opened this issue May 23, 2017 · 12 comments
Open

grbl-lpc on LPC1768 at 100MHz #5

TomKeddie opened this issue May 23, 2017 · 12 comments

Comments

@TomKeddie
Copy link

Hi Claudio,

I'm looking around for some hardware to retrofit into a laser cutter and use laserweb/grbl-lpc. I hope you have a moment to answer my question.

From looking at the grbl-lpc code it looks like it runs at 120MHz.

#define XTAL (12000000UL) /* Oscillator
frequency */

This would imply an LPC1769 is needed and the LPC1768 is not fast enough (or code changes are needed for 100MHz).

I see mention on reddit that it works on some 1768 boards, should I adjust the above for 100MHz perhaps?

https://www.reddit.com/r/hobbycnc/comments/6b9p48/grbllpc/

Many thanks,
Tom

@cprezzi
Copy link
Collaborator

cprezzi commented May 23, 2017

I guess you are right, but I'm not the LPC specialist here.
@tbfleming Can you step in with your deeper knowlede please.

@tbfleming
Copy link
Collaborator

I'll try to explain later when I have time. The quick answer is: no, it's complicated enough that you need to use one of Arm's wizards to edit the headers to change clock frequency.

@cprezzi
Copy link
Collaborator

cprezzi commented May 23, 2017

At least I can say that grbl-LPC works on the MKS SBase board (LPC1768) without changes ;)

@tbfleming
Copy link
Collaborator

MKS used a '68? Lame! There's not much price difference between the two chips.

@tbfleming
Copy link
Collaborator

@cprezzi if you have a scope handy, I'd be curious to hear if the step rate is coming out correctly. I think I know what MKS might have done; if so the normal build would throw off the timers instead of overclocking the chip.

@TomKeddie
Copy link
Author

As far as I know this is the mks sbase schematic, can't recall where I got it.

MKS SBASE SCH_V12.pdf

@cprezzi
Copy link
Collaborator

cprezzi commented May 23, 2017

Thanks @TomKeddie! In this schematics, it is a 1769, but on my board (from aliexpress) it is a 1768 and grbl-LPC works with my board.

@tbfleming
Copy link
Collaborator

The schematic is missing a critical value: Y1's oscillator frequency. The ARM wizard needs to know this value to modify the header file to set the PLL config bits correctly. The PLL converts the input oscillator to the various clocks within the chip. The wizard figures out how to configure the PLL to do that correctly.

2 possibilities:

  • The MKS board has a lower frequency crystal designed to work with the PLL config that Smoothieware and GRBL-LPC use. If they did this, then grbl-lpc's current config won't overclock the chip, but the counters will run slow.
  • The MKS board uses the same crystal as a Smoothieboard. In this case grbl-lpc's current config overclocks the '68 to run at the '69's speed.

@cprezzi
Copy link
Collaborator

cprezzi commented May 24, 2017

@tbfleming Y1 on my board is 12.000 MHz and Y2 is 25.000 MHz

@tbfleming
Copy link
Collaborator

@cprezzi that means we're currently overclocking your chip.

@cprezzi
Copy link
Collaborator

cprezzi commented May 24, 2017

@tbfleming I didn't realize any problems yet, but I will check if the MCU gets hot.

@TomKeddie
Copy link
Author

@cprezzi I'm not sure it's like that for small micros. The LPC1768 and LPC1769 are likely the same chip tested and sorted according to the testing. I think it's more likely the chip will misbehave if the external environment makes it hot.

Perhaps we should tag this issue as an enhancement and plan to generate an alternate 100MHz config that people can switch in the Makefile?

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

No branches or pull requests

3 participants