Vitat's homepage

General => MP3 => Topic started by: beta2k on 11 Aug 2008, 07:01



Title: Updating to newer avr-libc
Post by: beta2k on 11 Aug 2008, 07:01
I've been working on updating ip-bus v4 for the newer versions of avr-libc.  I've removed all the cbi/sbi macros, switched from signal.h to interrupt.h, and I'm working on the delay routines.  Is delay1() actually 1us?  Switching to avr-libc delay routines will make frequency changes much simpler as they calculate the delays at compile time and are fairly accurate from what I read...  Also I've read in the forums/code a quite a few differences about the timings for the bus, is there a up to date list of times for StartBit, 1, 0, and ACK?

I'm also looking at using the internal comparator in the ATMega88 instead of the LM339, is this possible?

Jason


Title: Re: Updating to newer avr-libc
Post by: Vitat on 13 Aug 2008, 12:36
Is delay1() actually 1us?
Yes.

Also I've read in the forums/code a quite a few differences about the timings for the bus, is there a up to date list of times for StartBit, 1, 0, and ACK?
I set timings by experimental. Found low and high times wich works on my HU and set average.

I'm also looking at using the internal comparator in the ATMega88 instead of the LM339, is this possible?
It is possible i think.


Title: Re: Updating to newer avr-libc
Post by: beta2k on 14 Aug 2008, 20:34
Ok, here's a copy of the modifications I made.  You'll have to change F_CPU in constants.h or set it in your IDE.  I've updated to interrupt.h from signal.h, removed delay.h and now use avr-libc's util/delay.h and switched from cbi/sbi to <reg> &=/|=.  I've also added the proper registers for ATMega88's.  To port to another CPU you just need to add the #defines in constants.h  Hopefully this works :)

Jason