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

Add: Tle5012b encoder #383

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add: Tle5012b encoder #383

wants to merge 1 commit into from

Conversation

Suke0811
Copy link
Collaborator

A 15 bit magnetic encoder parts available on jlcpcb

Copy link
Collaborator

@ducky64 ducky64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks ok, some suggestions. Consider eliminating the IIF pins if you're not using them right now, raw pins is lower-level of abstraction than I'd like if we don't need them yet.

This device has a weird interface, I haven't seen SSC elsewhere. How are you connecting this to the ESP32? Is there a way this should be adapted to a more standard interface?



class Tle5012b(Magnetometer, DefaultExportBlock):
"""Angle sensor based on Giant Magneto Resistance (GMR) for precise angular position sensing."""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider quantifying the precision. I think it's a 15-bit angle output?

Comment on lines +70 to +73
self.ifa = self.Export(self.ic.ifa, optional=True,
doc="IIF Phase A / Hall Switch Signal 1 / PWM / SPC output (input for SPC trigger only)")
self.ifb = self.Export(self.ic.ifb, optional=True, doc="IIF Phase B / Hall Switch Signal 2")
self.ifc = self.Export(self.ic.ifc, optional=True, doc="External Clock / IIF Index / Hall Switch Signal 3")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you use these? If not, I'd consider leaving these out for simplicity, for now.

Part of the reason is that design-side, I'd like the application circuit to provide high-level interfaces, and the application circuit could figure out how to map like PWM to device pins and enforce constraints (such as only one of the IO options can be active)


def contents(self) -> None:
self.footprint(
'U', 'fp:SO8_PG-DSO-8_INF',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'U', 'fp:SO8_PG-DSO-8_INF',
'U', 'Package_SO:SOP-8_3.9x4.9mm_P1.27mm',

Can a standard KiCad footprint be used? This one should be compatible, though the pads stretch more on the inside

self.gnd, self.vdd,
voltage_limit_tolerance=(-0.3, 0.3) * Volt,
input_threshold_factor=(0.3, 0.7),
current_limits=(5 * uAmp, 25 * mAmp)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where'd this come from?
It seems that it can sink up to -25mA and has a pull-up rating of 3uA? I don't see a source current limit even though there's a section on the SSC interface in push-pull configuration.

Comment on lines +20 to +23
dio_model_sck = DigitalSink.from_supply(self.gnd, self.vdd,
voltage_limit_tolerance=(-0.3, 0.3) * Volt)
self.sck = self.Port(dio_model_sck)
self.csq = self.Port(dio_model_sck)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
dio_model_sck = DigitalSink.from_supply(self.gnd, self.vdd,
voltage_limit_tolerance=(-0.3, 0.3) * Volt)
self.sck = self.Port(dio_model_sck)
self.csq = self.Port(dio_model_sck)
self.sck = self.Port(DigitalSink.from_bidir(dio_model))
self.csq = self.Port(DigitalSink.from_bidir(dio_model))

I think most of the pindefs can be reused?

@Suke0811
Copy link
Collaborator Author

This device uses stm32 instead of esp32, which is why it uses SSC. Are you still interested in merging this?

@ducky64
Copy link
Collaborator

ducky64 commented Sep 26, 2024

Hm. I think if it can't present one of the existing high-level digital interface busses (like SPI), it might not fit with the level-of-abstraction of the rest of the library.

Perhaps eventually we'll support SSC, but it doesn't seem common enough right now.

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