Vitat's homepage
29 Apr 2024, 06:33 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: 21.03.08 Произведено обновление сайта/Site was updated
 
  Home   Forum   Help Search Login Register  

Pages: [1]   Go Down
  Print  
Author Topic: Updating to newer avr-libc  (Read 5940 times)
0 Members and 1 Guest are viewing this topic.
beta2k
Newbie
*
Posts: 2


View Profile
« 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
Logged
Vitat
Administrator
Full Member
*****
Gender: Male
Posts: 338


11507314
View Profile
« Reply #1 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.
Logged
beta2k
Newbie
*
Posts: 2


View Profile
« Reply #2 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 Smile

Jason

* IPBus.zip (17.56 KB - downloaded 641 times.)
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

TinyPortal v1.0.5 beta 1© Bloc

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!