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

merge my work on RS485 master into your library #1

Merged
merged 5 commits into from
May 31, 2016

Conversation

hwestbrook
Copy link
Contributor

Hi pkourany,

I saw this post on the particle forum, and thought it might be time to contribute what I've been working on back into your library. What do you think?

The main changes are:

  • Split the header and cpp files
  • Changed how txen and rxen work, in order to make it compatible with the RS485 chip I am using (SN65HVD70). I think this cleans it up a bit anyway
  • Added an example for using this as a master.

As I only have the SN65HVD70, I am not sure this will work with the MAX485.

Heath

@pkourany
Copy link
Owner

@hwestbrook, given that this change is primarily for the SN65HVD70, can you conditionally compile modify the code to handle both original (RS485) and your new device?

@hwestbrook
Copy link
Contributor Author

@pkourany, the SN65HVD70 is a RS485 device that should work identically to the MAX485.

In my particular circuit I can control RXEN and TXEN independently, so I need to initialize like this:
Modbus master(0, 1, TXEN_PIN, RXEN_PIN);

But others, who wire their RS485 pins where the RXEN and TXEN are tied together, might need to initialize like this:
Modbus master(0, 1, TXEN_PIN);

Otherwise, I think the operation is exactly the same. Both RS845 chips use serial communication and so will both need to conform to the same serial -> MODBUS communication pattern.

Did I miss something?

@pkourany
Copy link
Owner

@hwestbrook, we'll need to add that to the README or in the file comments. Otherwise, sounds good! I'll take one last look tonight and merge.

@pkourany pkourany merged commit 3cb13b1 into pkourany:master May 31, 2016
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

Successfully merging this pull request may close these issues.

2 participants