Replies: 1 comment
-
Hi Ed, thanks for pointing out the problem. I must admit that I have not used one of the modern AVR MCUs. So, it may take a while until I come up with a solution. Best, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I started a discussion at SpenceKonde/megaTinyCore#664 that describes this. I don't think I need to duplicate that here, but I'll mention the basics.
I wanted to use SoftI2CMaster on an attiny1627 chip (and some other similar parts). It gave me some errors. I came up with a workaround that I think isn't really a good fix. In limited testing, it seems to work fine, but I had to edit the SoftI2CMaster.h file.
I think someone could implement the workaround as a real fix. I just don't really know how to do that. To that end, though, I will post some info here.
At https://www.microchip.com/en-us/product/ATTINY1627 there is a datasheet. I think the relevant info applies to all the attiny 0, 1, and 2-series parts. (https://ww1.microchip.com/downloads/aemDocuments/documents/MCU08/ProductDocuments/DataSheets/ATtiny1624-26-27-DataSheet-DS40002234B.pdf) In section 8.1, there is a Peripheral Address Map. Notice that VPORTA, VPORTB, and VPORTC are there at the top at address 0x00, 0x04, and 0x08.
Then, take a look at https://github.com/SpenceKonde/megaTinyCore/blob/master/megaavr/extras/ioheaders/iotn1627.h#L2181 and see how VPORTA_DIR, VPORTA_OUT, and VPORTA_IN are defined.
Basically, my workaround was to modify SoftI2CMaster.h and add a #if around the _DDR, _OUT, and _IN defines like this.
And then add them to my .INO file like this.
Which allows me to explicitly set them instead of using SDA_PORT and SCL_PORT. I bet that there's a better way to do this for a library. I just don't really know how to properly implement this for mass consumption.
Thanks!
Ed
Beta Was this translation helpful? Give feedback.
All reactions