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

[BUG] DAC steppers and 32 bits MCU #16285

Closed
0r31 opened this issue Dec 21, 2019 · 5 comments
Closed

[BUG] DAC steppers and 32 bits MCU #16285

0r31 opened this issue Dec 21, 2019 · 5 comments

Comments

@0r31
Copy link
Contributor

0r31 commented Dec 21, 2019

Hi all,

Bug Description

There are issues when using both DAC steppers feature and any 32 bits MCU.

My Configurations

You can find an example configuration in the attached archive file : dac+32bits.zip.

Steps to Reproduce

I just changed the board to BOARD_SMOOTHIEBOARD and add stuff to enable DAC features in the smoothisboard pins file. Then i tried to compile: It fails as three avr arduino core macros are not defined for lpc1769: word, highByte, lowByte.

I naively tried to define them in dac_mcp4728.cpp as I2C communication is based on 8 bits blocks:

#ifdef MCU_LPC1769
  unsigned int makeWord(unsigned char h, unsigned char l) { return (h << 8) | l; }

  #define word(...) makeWord(__VA_ARGS__)
  #define lowByte(w) ((uint8_t) ((w) & 0xff))
  #define highByte(w) ((uint8_t) ((w) >> 8))
#endif

Then the compilation succeeds but it doesn't work as expected as there absolutely no voltage on the DAC (MCP4728) outputs.

Expected behavior: DAC steppers feature must work on any 32 bits MCUs.

Actual behavior: Compilation failure or no voltage on DAC outputs.

Additional Information

I am aware there is a built-in DAC on the lpc1769 but i don't use if for now (use of a separate MCP4728).

Feel free to ask for more information. I would be glad to answer.

@boelle
Copy link
Contributor

boelle commented Jan 7, 2020

@dagorel is this still a problem?

@0r31
Copy link
Contributor Author

0r31 commented Jan 7, 2020

Hi @boelle ,

Yes it is. I don't find any fix for now.

@0r31
Copy link
Contributor Author

0r31 commented Jan 7, 2020

Hi again @boelle ,

It seems there is an issue in the arduino fmk for lpc176x regarding the missing macros (discussed with @p3p ). I will send a PR to the appropriate github repo.

Fixing this part doesn' fix the whole stuff. As said in the first message there is no voltage on mcp chip outputs... still investigating.

@0r31
Copy link
Contributor Author

0r31 commented Jan 14, 2020

Hi @boelle,

Looks like the main issue is on choosing the I2C master address at the platform level.
I already managed it but there are still some issues.
I don't think it can be specifically related to the Marlin repo even if there might be some changes to be done in a near future.

That's why i close the issue for now.

Regards,
Orel

@0r31 0r31 closed this as completed Jan 14, 2020
@github-actions
Copy link

github-actions bot commented Jul 3, 2020

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants