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

PTC Support #551

Merged
merged 1 commit into from
Sep 27, 2024
Merged

PTC Support #551

merged 1 commit into from
Sep 27, 2024

Conversation

MX682X
Copy link
Contributor

@MX682X MX682X commented Sep 27, 2024

Pretty straight forward. A slightly updated version compared to the mTC, to accomodate the usage of uint64_t (I managed to convince the compiler to only use 40/48 bits though) and the changed PTC peripheral.

Also, addded "-fshort-enums" to platforms.txt (as well as reordering the options to be the same order on .c and .cpp)

If people don't complain about it, I'll make a PR on mTC later aswell. The only difference is that the Dx Version has one less example, the one that demonstrates how to use the Temp-Sensor together with PTC, as this problem luckily doesn't exist here.

@MX682X
Copy link
Contributor Author

MX682X commented Sep 27, 2024

If I haven't missed anything, the only thing that the linter complains about is the identation between #ifdefs. Examples are failing on the first glance, but just because they are missing their "previous version". There is a link in the README.md, but this is just for specifing the source.

@SpenceKonde
Copy link
Owner

Woah!!

@SpenceKonde SpenceKonde merged commit 73321d7 into SpenceKonde:master Sep 27, 2024
119 of 135 checks passed
@SpenceKonde
Copy link
Owner

We need to change the pins used by the example, 32 pin parts don't have a PORTB so the examples don't compile. I don't know why you picked the pins you picked, though, because the datasheet only lists pins as being touch pins - it doesn't say anything about what they're capable of or if they're different from eachother (I assume they are - it sounded like that), and I don't know where they've hidden the relevant documentation.

Speaking of that - uh, do you know a place to find documentation on this? The library docs don't have a description of what any of these options do, what the required wiring/layout is/etc. I generally want to consider that out of scope, deferring to Microchip. But uh, where can I find this information if I want to try this out? Or to add a link to it and maybe transcribe the headline feature list. There are valid reasons to not have part feature lists in library docs, of course, but in the case of the touch sensing, I see no reason not to: Each core has only one family of parts that has a PTC (DA and 1-series, right? No PTC on DB~DD, DU, EA, or EB, nor the 2-series right? So the data to be added is limited, and I like making tables in markdown. No reason not to, I mean, other than the fact that I have no idea what the values to list there are or where to find out this information.
Thanks

@MX682X
Copy link
Contributor Author

MX682X commented Oct 6, 2024

I don't know why you picked the pins you picked, though

I don't remember either, It's been a while since I've written this example. I was testing it with an 1614 originally...

it doesn't say anything about what they're capable of or if they're different from eachother

There is no difference. the X pins are basically getting an Overwrite on the DIR and OUT, the Y pins get rerouted to the PTC ADC input

And the information standpoint: Most of my information comes from assembly - like 75%. About 10% from debugging with Atmel Studio, 10% from the header files included when you use Atmel START to generate a touh project and 5% from the publically available documentation. With a pinch of guess work added on top.

Layouting of sensors is also spread across a bunch of AppNotes through the web, I might make a link/pdf collection.
Main link for how the Hardware look like can be found in this datasheet: https://www.mouser.com/pdfdocs/SAMA5D2_PTC_Firmware_UG.pdf (It's also linked through the wayback machine in the README)

Anyway, there is an open PR that changes the pins in the example, but I realized that I should change the gain function a bit, so I'll ammend some commits there.

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