obdev / v-usb

A Firmware-Only USB implementation for Atmel's AVR Microcontrollers
1.22k stars 244 forks source link

Optimized RC oscillator calibration #4

Closed cpldcpu closed 7 years ago

cpldcpu commented 11 years ago

In the meantime I rewrote the entire oscillator calibration in assembler, saving 90 bytes in total. All changes reside in "libs-device" now, the usb-driver does not have to be altered.

osccal.c and usbMeasureFrameLength are not needed anymore. All functionality has been implemented in osccalASM.S with minor changes to osccal.h for the hook.

Original pull request:

I spent some time optimizing calibrateOscillator(void). The new implementation has been debugged on an ATtiny 85 and was confirmed to converge to the same osccal value as the previous implementation. If desired, I can also supply some debug data. I used a SPI connection to monitor the new implementation in real time.

Benefits:

cpldcpu commented 10 years ago

Not keeping this up to date, since it appears that obdev is ignoring V-USB on github.

You can find the latest version of osccalASM.S here: https://github.com/micronucleus/micronucleus/blob/testing-V2-New/firmware/osccalASM.S

NicoHood commented 8 years ago

Is this project abandoned or does someone still work on this? Cant they move the ownership to someone who care for it?

starkjohann commented 7 years ago

Sorry for not responding for a long time -- I don't use github regularly, so I don't check the messages here. A note on our support channel would be great!

Regarding the PR: I prefer to provide the C implementation in the examples because it's easier to understand and customize, but I would like to include a link to your improved version for people who just want something which works efficiently. Unfortunately the github link is broken. Have you moved the project?

cpldcpu commented 7 years ago

You can find the entire project here, including the optimized osccal:

https://github.com/micronucleus/micronucleus/tree/master/firmware

Might be of interest to you - it uses a significantly modified version of V-USB now, which does not need interrupts.

starkjohann commented 7 years ago

Hi Tim,

On 24 Jan 2017, at 22:45, Tim notifications@github.com wrote:

You can find the entire project here, including the optimized osccal.

https://github.com/micronucleus/micronucleus/tree/master/firmware

Might be of interest to you - it uses a significantly modified version of V-USB now, which does not need interrupts.

Thanks!

I’ve read about micronucleous and wanted to check it out later(tm), but I have almost no remaining free time since 2013 where my second daughter was born...

Regards, Christian.

cpldcpu commented 7 years ago

Well, no worries. There haven't been a lot of changes to Micronucleus lately, so it will still be the same later. I see the issue with lack of time...

You may also be interested in this, which also started out with V-USB:

https://github.com/cpldcpu/u-wire

Best Regards, Tim