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

Impossible constraint in 'asm' #84

Closed
azkara22 opened this issue Dec 23, 2020 · 6 comments
Closed

Impossible constraint in 'asm' #84

azkara22 opened this issue Dec 23, 2020 · 6 comments

Comments

@azkara22
Copy link

I am trying to use the ws2812 code for AVR with a ATtiny3217 but I get "Impossible constraint in 'asm'" error along with "asm operand 2 probably doesn't match constraints" warnings. The error looks like it's coming from the following instruction, but I can't get it work.

"I" (_SFR_MEM_ADDR(ws2812_PORTREG)

@cpldcpu
Copy link
Owner

cpldcpu commented Dec 23, 2020

Did you define a port register that is part of the I/O region?

@azkara22
Copy link
Author

I have just found that the PORTC register that I am using is out of the I/O region. The solution in my case has been to use the VPORTC_OUT register that it is on that region. Thank you for the response anyway.

@Sponge5
Copy link

Sponge5 commented Apr 3, 2021

Hi, is there a way to use a register outside the I/O region? In my case I need to use PH5 on ATMega2560. In iomxx0_1.h PORTH is defined as _SFR_MEM8(0x102).

@Sponge5
Copy link

Sponge5 commented Apr 3, 2021

The way I understand this is to replace out instructions with sts and fiddle with the amount of noop's. I'll probably resort to rewiring the board 😅

@cpldcpu
Copy link
Owner

cpldcpu commented Apr 4, 2021

Have a look at the Arduino version. It actually uses sts for port access.

https://github.com/cpldcpu/light_ws2812/blob/master/light_ws2812_Arduino/light_WS2812/light_ws2812.cpp

@cpldcpu
Copy link
Owner

cpldcpu commented Nov 18, 2023

Version 2.5 should fix this issue.

@cpldcpu cpldcpu closed this as completed Nov 18, 2023
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

No branches or pull requests

3 participants