-
Notifications
You must be signed in to change notification settings - Fork 248
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
Support for avrxmega3 architecture #24
Comments
I'm looking into this. I'm not an AVR expert at all, so might need some help -- it would even be encouraging to hear that this is practically possible.
So far, I've succeeded in getting my attiny1614 in 16 MHz, the lowest speed it supports without an external crystal. So, I'll mostly try to patch asmdrvasm16.inc as necessary until I can get this to work. I have a scope that'll hopefully help to figure out whether I'm doing the timing & protocol correctly after that. I think the following patterns need to be fixed since the 1-series chips use different assembly for these:
The inc file is only about 300 lines of code, so it'll probably be fine to make manual changes; testing the changes and figuring out what's still wrong will likely be the larger challenge. |
Actually, I have the code at least compiling by:
By using VPORTs, no other code changes need to happen I think. I can flash the device now, and it seems that usbInit() and usbPoll() return normally, but when I connect the device, my Mac doesn't see any new USB devices attaching. I'll try some more host devices to see if that makes any difference, but if that doesn't help, I'll try to attach a scope and see if I can see some communication on the line. |
I finally have it working \o/ The main impediments to the software are that some instructions take a different amount of cycles. For example, PUSH takes 1 instead of 2, ST takes 1 cycle instead of 2, but LDS takes 3 cycles instead of 2. Because of this, the timing reading bits was off from the spec. Another impediment is that the 1-series no longer maps the general purpose registers into memory. The assembly assumes that if you set Y to 20, *Y is the contents of r20, but that's not the case. This was a tiny optimization in the code, and I worked around this by allocating an extra byte in SRAM, writing r20 to it, then setting Y to that address. Now, my device is recognized by my laptop. I'll clean up the patch and create a pull request to this repository. |
@vslinuxdotnet See #26 for the patch :-) Could you perhaps test it as well, and report back your results in the PR? |
Hello, as soon as I have time, I will test it and report to you. Thank you. |
Testing today, what fuses did you use, and what pins for D+ and D- did you test? |
Forget it, in #26 link :) |
I can't compile it @sgielen I get:
|
@vslinuxdotnet Those errors are in a |
Compiling v-usb after apply your patch:
#define USB_CFG_IOPORTNAME B
diff --git a/usbdrv/usbdrv.c b/usbdrv/usbdrv.c
#define USB_CONCAT(a, b) a ## b -#define USB_OUTPORT(name) USB_CONCAT(PORT, name)
|
@vslinuxdotnet Oh, I didn't fix all of v-usb against attiny1614, just the |
That it, usbdrv compile, the main for vusb not. |
Found the repo: https://github.com/12oclocker/V-USB_TinyAvr |
Hello,
Exists some plans to v-usb works with avrxmega3 architecture, ex: attiny1614
Thank you
The text was updated successfully, but these errors were encountered: