add i2c support for orthogonal devices ER-301 #191
Conversation
|
For documentation purposes it is maybe worth knowing that ER-301 does not interpret a CV.SLEW message the same way this is meant on Teletype, but instead sets the time to ramp from 0 to 1V, as indicated here. |
i pulled the |
|
brian from O|D provided some helpful discussion on the er301 forum regarding expected data types and signed-ness, so there will be a revision to the
|
|
thankyou for jumping in on this! i'm good with calling it |
…as values, and does not have GET functionality at all. it never transmits; only receives.
|
here's the revised version, using the proper data type that er301 expects to receive: only signed 16bit integers. it does all the conversion it needs internally. also, it does not support i left the OP name as i still haven't figured out how to address multiple er301 modules, which will require more skill at modifying crow's i2c framework than i have. but i'm partial toward |
|
looking great! |
|
Looks great! Couple small things before merging:
Below is a refinement which can come later (though will be a breaking change if we don't do it now) I read through the OD forum thread, and was a little confused about the data types being used. The desired functionality is that What is the integer representation of 1 volt on er301? I'm super happy to add the handful of scaling lines to the crow system to enable this native handling of those values (and they will likely be useful for other ii modules!). |
| , args = { { 'port', u8 } | ||
| , { 'value', s16 } | ||
| } | ||
| } |
trentgill
Oct 4, 2019
Collaborator
Missing 2 closing curly braces right before this last one.
Missing 2 closing curly braces right before this last one.
trentgill
Oct 4, 2019
Collaborator
here's a binary built with the file provided if you have the hardware! https://www.dropbox.com/s/hohjct1v87lkq9w/crow-v0.0.9-8-g2b017da.zip?dl=0
here's a binary built with the file provided if you have the hardware! https://www.dropbox.com/s/hohjct1v87lkq9w/crow-v0.0.9-8-g2b017da.zip?dl=0
thanks; i’ll clean it up and send in the fixed version.
i’m not sure crow needs to convert at all — from what upstream said on the O|D forum, er301 does the conversion internally with whatever TT sends. since crow doesn’t have to go through teletype, does it need to worry about scaling? for er301’s handling of voltages, there’s a bit in the wiki on using http://wiki.orthogonaldevices.com/index.php/ER-301/Teletype_Integration#SC.CV_Unit
|
|
The quoted bit you added at the end suggests you want to use the If you just use s16, users will have to write Instead if you use s16V, then it will be |
that does make sense, though yeah, only for volt params. script writers shouldn't have to convert 1638 in their heads just to set a specific voltage. here's a quote from upstream:
i've made the other requested changes; should i also change the type to |
|
I think Do you have an ER-301? I can send you the firmware binary so you can test it before we merge to master? If not, is there someone who can test this for us? |
|
i do have an er301. unfortunately, mine is from the first batch, which doesn't have the revised cpu board that later versions do--it requires a (very easy, apparently) solder bridge and flip-flopped i2c cable pinouts, but i lack the tools and ability to perform the mod. there's a thread on lines in which folks list their i2c modules. or maybe put it as a general test-request to that thread/lines. edit: revised patch with all the above changes sent in; and a couple of testing requests are now posted to lines. |
|
Sounds good! I'm sure someone will be able to help out! |
…aces; use s16v type for voltage ops
|
ayeee - sorry for the nitpick but it needs to be |
|
no worries; not sure how i missed that. somethingsomething built-in lowercase macro? fixed in latest! |
…, so use its command numbers.
|
@nightmorph I've pulled your changes into the #224 which adds support for txI, and fixes an off-by-one error on ansible too. If we merge that, I'll close this PR as your changes will be pulled in there. |
|
rad! thank you so much! i was just alerted today on the O|D forum that ansible had the same off-by-one issue. i was hoping that it would be a general crow-level fix to benefit all supported modules, rather than doing it in an er301-specific lua file somewhere. thanks again! |
|
Closing in favour of #224 |
initial i2c command support for er301.
after seeing the forum thread, i read up on the er301 i2c implementation, took a quick look through teletype's ops for the 301, and came up with this first attempt at supporting that set of commands using crow's lua format.
i think i've got the correct signed/unsigned value types and ranges, but i'm not sure what the 301 uses/expects internally. some of the voltages or values might need to be float, for example, but i didn't see a way to set signed float values. 301's internals aren't entirely clear, here.
notes:
getlines entirely, based on jf.lua. but that's the only device+op that doesn't have it. all the other devices' ops useget = false, so i'm not sure if thegetline needs to be set at all iffalse.SC.CV.fooformat, withSCas the prefix for all er301 commands. i'm not sure if er301 expects to receiveSC.fooexactly from crow, or if the prefix doesn't matter. for now, i've left the name/prefix aser301at the top of the file; and simple command names likecv_slewandtr_pol.0x32and0x33.this support may not be complete; but at least it's a start. i don't have crow or TXo to test, and my er301 is from the first batch: its i2c pins are not the pre-bridged/fixed version on later units. so this crow+er301 support will need testing and updating by folks who have all the right hardware.