Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

Atmega128 and rtl8019

Atmega128 and rtl8019

2008-04-25 by magzky02

hi guys, i am going to interface the atmega128 to the ethernet 
controller RTL8019. I am using codevision compiler. Is there a library 
for this? Anyone knows a avr compiler with library to communicate with 
ethernet controller? I think this would be a dificult task to do it by 
manipulating ports bit by bit.

regards,
mago

Re: [AVR-Chat] Atmega128 and rtl8019

2008-04-25 by John Samperi

At 01:11 PM 25/04/2008, you wrote:
>I am using codevision compiler. Is there a library for this?

This would be better asked at the Codevision forum, would it
not? Aren't you a subscriber to that forum?


Regards

John Samperi

********************************************************
Ampertronics Pty. Ltd.
11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
Tel. (02) 9674-6495       Fax (02) 9674-8745
Email: john@ampertronics.com.au
Website  http://www.ampertronics.com.au
*Electronic Design * Custom Products * Contract Assembly
********************************************************

Re: [AVR-Chat] Atmega128 and rtl8019

2008-04-25 by Enki

Maybe thihs helps:

	http://members.home.nl/bzijlstra/software/examples/RTL8019as.htm

	Mark Jordan
Show quoted textHide quoted text
On 25 Apr 2008 at 3:11, magzky02 wrote:

> 
> hi guys, i am going to interface the atmega128 to the ethernet 
> controller RTL8019. I am using codevision compiler. Is there a library 
> for this? Anyone knows a avr compiler with library to communicate with 
> ethernet controller? I think this would be a dificult task to do it by 
> manipulating ports bit by bit.
> 
> regards,
> mago
>

Re: [AVR-Chat] Atmega128 and rtl8019

2008-04-25 by mago Umandam

Oops, i will search that forum :)

John Samperi <samperi@ampertronics.com.au> wrote:          At 01:11 PM 25/04/2008, you wrote:
>I am using codevision compiler. Is there a library for this?

This would be better asked at the Codevision forum, would it
not? Aren't you a subscriber to that forum?

Regards

John Samperi

********************************************************
Ampertronics Pty. Ltd.
11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
Tel. (02) 9674-6495 Fax (02) 9674-8745
Email: john@ampertronics.com.au
Website http://www.ampertronics.com.au
*Electronic Design * Custom Products * Contract Assembly
********************************************************



                           

       
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.

[Non-text portions of this message have been removed]

Re: [AVR-Chat] Atmega128 and rtl8019

2008-04-25 by David Kelly

On Fri, Apr 25, 2008 at 03:11:17AM -0000, magzky02 wrote:
> 
> hi guys, i am going to interface the atmega128 to the ethernet 
> controller RTL8019. I am using codevision compiler. Is there a library 
> for this? Anyone knows a avr compiler with library to communicate with 
> ethernet controller? I think this would be a dificult task to do it by 
> manipulating ports bit by bit.

It is clumsy because the ATmega128 does not support external
addressing. But that doesn't prevent people from doing it.

http://www.ethernut.de/
http://www.sics.se/~adam/lwip/
http://www.sics.se/~adam/uip/index.php/Main_Page

-- 
David Kelly N4HHE, dkelly@HiWAAY.net
========================================================================
Whom computers would destroy, they must first drive mad.

Re: [AVR-Chat] Atmega128 and rtl8019

2008-04-25 by mago Umandam

i have been searching the net and seems im giving up using atmega128. Rabbit processor is easier to interafce with dynamic c compiler having more documentation and libraries for ethernet applications.
   
  regards,
  mago

David Kelly <dkelly@hiwaay.net> wrote:
          On Fri, Apr 25, 2008 at 03:11:17AM -0000, magzky02 wrote:
> 
> hi guys, i am going to interface the atmega128 to the ethernet 
> controller RTL8019. I am using codevision compiler. Is there a library 
> for this? Anyone knows a avr compiler with library to communicate with 
> ethernet controller? I think this would be a dificult task to do it by 
> manipulating ports bit by bit.

It is clumsy because the ATmega128 does not support external
addressing. But that doesn't prevent people from doing it.

http://www.ethernut.de/
http://www.sics.se/~adam/lwip/
http://www.sics.se/~adam/uip/index.php/Main_Page

-- 
David Kelly N4HHE, dkelly@HiWAAY.net
========================================================================
Whom computers would destroy, they must first drive mad.


                           

       
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.

[Non-text portions of this message have been removed]

Re: [AVR-Chat] Atmega128 and rtl8019

2008-04-25 by Robert Adsett

At 08:04 AM 4/25/2008 -0700, mago Umandam wrote:
>i have been searching the net and seems im giving up using atmega128. 
>Rabbit processor is easier to interafce with dynamic c compiler having 
>more documentation and libraries for ethernet applications.

One thing to keep in mind Dynamic C isn't C.  It's C-like.

That said it's support libraries are pretty good.

Robert

"C is known as a language that gives you enough rope to shoot yourself in
the foot."  -- David Brown in comp.arch.embedded
http://www.aeolusdevelopment.com/

Re: [AVR-Chat] Atmega128 and rtl8019

2008-04-25 by David Kelly

On Fri, Apr 25, 2008 at 08:04:43AM -0700, mago Umandam wrote:
> i have been searching the net and seems im giving up using atmega128.
> Rabbit processor is easier to interafce with dynamic c compiler having
> more documentation and libraries for ethernet applications.

The Rabbit is OK for hobbyist but if you are designing for production I
found the cost was excessive.

Ethernut appears to me to be very complete and professional. Years ago
the license was not clear as to what was BSD-ish and what was GPL, today
the separation is much clearer. Add to that the difficulty of buying
RTL8019's or similar killed that option. Sad because I rather like
avr-gcc.

Would have used the AT91SAM7X chip had it been shipping when I had to
make my selection.

In the end used a HC12NE64. Not terribly happy, Codewarrior is a stinky
and expensive environment.

-- 
David Kelly N4HHE, dkelly@HiWAAY.net
========================================================================
Whom computers would destroy, they must first drive mad.

Re: Atmega128 and rtl8019

2008-04-26 by stevech11

Here's what I have running...
mega128 (ETT's $20 fat-stamp, 16MHz)
WizNet 810MJ (now 811MJ) ethernet module with on-board IP, TCP, ICMP,
ARP, 4 sockets that can run any protocol.
SPI interface to mega128 (just a few wires). 4MHz SPI rate.

All my own software to do the high level protocols - using socket
interface to the WizNet. Software runs under the (free) AvrX RTOS. So
far, I have a robust, fully interrupt driven, multi-tasking suite (in
16KB) of
DNS client - lookup symbolic names
Network Time client (NIST's DayTime servers)
SMTP client - send email
HTTP server with HTML in mega128's flash. 
Dynamic HTML parser for the mega128: keywords like "%YEAR%" "%MONTH%"
and "%MYIP%" and "%HITCOUNT%" "%ATODCHAN1%" or whatever you want to
add. This dynamic HTML parser replaces the keyword in the HTML with
the real-time value.

I use dynamic buffer allocation (a safer version of malloc() with
queuing of tasks needing temporary use of RAM. For example, the HTML
server gets RAM only when getting and parsing a GET or POST request
from an HTTP client, and when computing and sending the HTML response.
Then the RAM is released. Same for SMTP and the others. With that, and
how my code segments HTML processing, I get it all done with the RAM
that's in the mega128. Other implementations use gobs of RAM that sits
unused most of the time.

So if you can handle C and a simple RTOS, it's easy, since the hard
stuff (IP protocols) are in the $19 module.

steve

--- In AVR-Chat@yahoogroups.com, mago Umandam <magzky02@...> wrote:
>
> i have been searching the net and seems im giving up using
atmega128. Rabbit processor is easier to interafce with dynamic c
compiler having more documentation and libraries for ethernet
applications.
>    
>   regards,
>   mago
> 
> David Kelly <dkelly@...> wrote:
>           On Fri, Apr 25, 2008 at 03:11:17AM -0000, magzky02 wrote:
> > 
> > hi guys, i am going to interface the atmega128 to the ethernet 
> > controller RTL8019. I am using codevision compiler. Is there a
library 
> > for this? Anyone knows a avr compiler with library to communicate
with 
> > ethernet controller? I think this would be a dificult task to do
it by 
> > manipulating ports bit by bit.
> 
> It is clumsy because the ATmega128 does not support external
> addressing. But that doesn't prevent people from doing it.
> 
> http://www.ethernut.de/
> http://www.sics.se/~adam/lwip/
> http://www.sics.se/~adam/uip/index.php/Main_Page
> 
> -- 
> David Kelly N4HHE, dkelly@...
> ========================================================================
> Whom computers would destroy, they must first drive mad.
> 
> 
>                            
> 
>        
> ---------------------------------
> Be a better friend, newshound, and know-it-all with Yahoo! Mobile. 
Try it now.
Show quoted textHide quoted text
> 
> [Non-text portions of this message have been removed]
>

Re: Atmega128 and rtl8019

2008-04-27 by prkuve

hi,
i've sucessfully implimented interfacing with RTL8019 with atmega128...
using 'C' and able to exchange the data in UDP from any personal 
computer via LAN...

EEPROM write and power failure

2008-04-28 by Tim Gilbert

We're doing an instrument that needs to store a variable in EEPROM.  It is a statistical certainty that, at some point, the power will fail just as the software starts to write the data. Any idea's how to handle this?

Of course, we'll have the BOD enabled but I don't know (in fact really doubt) that it will save the day.


Thanks,



Tim Gilbert
JEM Innovation Inc.
303-926-9053 (office)
303-437-4342 (cell)
720-890-8582 (fax)
www.jeminnovation.com
www.pdksolutions.com

[Non-text portions of this message have been removed]

Re: [AVR-Chat] EEPROM write and power failure

2008-04-28 by Enki

Just put a high uF capacitor on the VCC pin and use a voltage 
divider to measure the power supply input voltage.
	
	Mark Jordan
Show quoted textHide quoted text
On 27 Apr 2008 at 19:38, Tim Gilbert wrote:

> We're doing an instrument that needs to store a variable in EEPROM.  It is a statistical certainty that, at some point, the power will fail just as the software starts to write the data. Any idea's how to handle this?
> 
> Of course, we'll have the BOD enabled but I don't know (in fact really doubt) that it will save the day.
> 
> 
> Thanks,
> 
> 
> 
> Tim Gilbert
> JEM Innovation Inc.
> 303-926-9053 (office)
> 303-437-4342 (cell)
> 720-890-8582 (fax)
> www.jeminnovation.com
> www.pdksolutions.com
> 
> [Non-text portions of this message have been removed]
> 
> 
> ------------------------------------
> 
> Yahoo! Groups Links
> 
> 
>

Re: [AVR-Chat] EEPROM write and power failure

2008-04-28 by David Kelly

On Apr 27, 2008, at 8:38 PM, Tim Gilbert wrote:

> We're doing an instrument that needs to store a variable in EEPROM.   
> It is a statistical certainty that, at some point, the power will  
> fail just as the software starts to write the data. Any idea's how  
> to handle this?

Write more than one copy.

A simple way to implement would be to declare 0xff not legal value for  
the variable and each time you write put it in the next EEPROM  
address. Out of RESET look for the last non-0xFF value.

Probably also want to store a checksum or CRC of the value just to  
make sure power didn't fail while the EEPROM write timer was running.  
A simple check would be to store a 1's complement.

--
David Kelly N4HHE, dkelly@HiWAAY.net
========================================================================
Whom computers would destroy, they must first drive mad.

Re: [AVR-Chat] EEPROM write and power failure

2008-04-28 by James Wagner

On Apr 27, 2008, at 6:38 PM, Tim Gilbert wrote:

> We're doing an instrument that needs to store a variable in EEPROM.  
> It is a statistical certainty that, at some point, the power will  
> fail just as the software starts to write the data. Any idea's how  
> to handle this?
>
> Of course, we'll have the BOD enabled but I don't know (in fact  
> really doubt) that it will save the day.
>
> Thanks,
>
> Tim Gilbert
> JEM Innovation Inc.
> 303-926-9053 (office)
> 303-437-4342 (cell)
> 720-890-8582 (fax)
> www.jeminnovation.com
> www.pdksolutions.com
>
> [Non-text portions of this message have been removed]
>
>
> 
Use the ADC to measure the primary source voltage. Use a largish-cap  
isolated by a diode. The cap should be big enough to hold up the micro  
long enough to write to the EEPROM. When the ADC tells you that the  
power is "failing", then drop everything and write to the EEPROM.

BOD only tells you after the fact!

Jim Wagner
Oregon Research Electronics



[Non-text portions of this message have been removed]

Re: [AVR-Chat] EEPROM write and power failure

2008-04-28 by John Samperi

At 12:01 PM 28/04/2008, you wrote:
>Use the ADC to measure the primary source voltage.

I would use the comparator set at an appropriate
level so there isn't the need for software intervention
until the comparator's IRQ fires.

Regards

John Samperi

********************************************************
Ampertronics Pty. Ltd.
11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
Tel. (02) 9674-6495       Fax (02) 9674-8745
Email: john@ampertronics.com.au
Website  http://www.ampertronics.com.au
*Electronic Design * Custom Products * Contract Assembly
********************************************************

Re: [AVR-Chat] Re: Atmega128 and rtl8019

2008-04-28 by mago Umandam

What is your compiler? coding  for communication on tcp/ip with all handshaking stuffs is quite a big job. I am still searching the net gathering infos about this as i want to use mega128. Someone has posted the ethernut module which is mega128 based and using an operating system called NUT/OS. Im reading more about this as i havent heard of NUT/OS before.:) My last resort will be the expensive rabbit core.

prkuve <prkuve@yahoo.co.in> wrote:          hi,
i've sucessfully implimented interfacing with RTL8019 with atmega128...
using 'C' and able to exchange the data in UDP from any personal 
computer via LAN...



                           

       
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.

[Non-text portions of this message have been removed]

Re: [AVR-Chat] EEPROM write and power failure

2008-04-28 by James Wagner

On Apr 27, 2008, at 7:30 PM, John Samperi wrote:

> At 12:01 PM 28/04/2008, you wrote:
> >Use the ADC to measure the primary source voltage.
>
> I would use the comparator set at an appropriate
> level so there isn't the need for software intervention
> until the comparator's IRQ fires.
>
> Regards
>
> John Samperi
>
> ********************************************************
> Ampertronics Pty. Ltd.
> 11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
> Tel. (02) 9674-6495 Fax (02) 9674-8745
> Email: john@ampertronics.com.au
> Website http://www.ampertronics.com.au
> *Electronic Design * Custom Products * Contract Assembly
> ********************************************************
>
>
> 
Good point., Better, less program impact, etc.

Jim Wagner

[Non-text portions of this message have been removed]

Re: EEPROM write and power failure

2008-04-28 by Graham Davies

--- In AVR-Chat@yahoogroups.com, "Tim Gilbert" <tim@...> wrote:

> ... store a variable in EEPROM ...
> ... power will fail just as the
> software starts to write the data ...

I assume you also want to deal with the situation in which power fails 
after the write has started but before it is complete.  Your full 
requirement, then, is that after a power failure, the variable will 
have a valid value, i.e. one that was deliberately written and not 
something half-written as the power went down.  Therefore, suggestions 
such as recognizing all-ones as invalid will not work.

The first technique to do this is the impending power loss signal.  In 
full, you need to generate a signal that will go active sufficiently 
ahead of power failure that you have time to complete the write before 
power is totally gone.  Before you start the write, you check this 
signal and if it is active you simply don't start, leaving the previous 
valid value in the variable.  This is easy to implement on AC powered 
equipment because you can sense the loss of AC very quickly with an 
optocoupler driven from its own full-wave rectifier feeding a simple 
digital input port.  The reservoir capacitor can be chosen to hold the 
regulated DC power rail at full voltage for quite a while after input 
power loss.  I personally don't like the suggestions that involve 
waiting until the DC line is already dropping.

The second technique is to "journal" the write operation.  This is 
similar to the suggestion of writing it twice, but involves extra data 
so that when power comes back up you can not only tell that a data 
write didn't complete but you can retrieve good data.  You need at 
least two copies of the data.  Then, you need single flag bits to mark 
the start of the write and the end of the write to each copy.  By 
looking at the flags, you can immediately tell if a write was started 
and not completed.  There was a very good article in Circuit Cellar 
about this a while back.

If you need further guidance, perhaps you could indicate which method 
you presently favor.

Graham.

Re: EEPROM write and power failure

2008-04-28 by Bruno

The comparator is a good choice..
I my last design i was using the comparator pins, so i use a lm311 
connected to INT pin...
You should use an osciloscope to confirm if you'll have enough time 
to do what you want before the uC goes off... In my case i'm using a 
1000uF cap. and i have 120ms to save the variables in eeprom... This 
time depends on your cap. size and your circuit...

Bruno...

--- In AVR-Chat@yahoogroups.com, John Samperi <samperi@...> wrote:
Show quoted textHide quoted text
>
> At 12:01 PM 28/04/2008, you wrote:
> >Use the ADC to measure the primary source voltage.
> 
> I would use the comparator set at an appropriate
> level so there isn't the need for software intervention
> until the comparator's IRQ fires.
> 
> Regards
> 
> John Samperi
> 
> ********************************************************
> Ampertronics Pty. Ltd.
> 11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
> Tel. (02) 9674-6495       Fax (02) 9674-8745
> Email: john@...
> Website  http://www.ampertronics.com.au
> *Electronic Design * Custom Products * Contract Assembly
> ********************************************************
>

Re: [AVR-Chat] Re: EEPROM write and power failure

2008-05-01 by Tim Gilbert

Just wanted to thank everyone for the ideas and let you know which direction we're heading.  Our original plan was to write the data every 3 seconds into a wear-leveling buffer.  However, since the hardware is still in flux, we're increasing our power supply capacitors to provide more time after the power failure.  We already had INT0 wired up to indicate power failure; so the plan is to NOT write the data until the interrupt is triggered.  The interrupt routine will then write the data to EEPROM and enter a while(1) loop, waiting for the power to die.

The flip side, is making sure the processor waits long enough on power up for the capacitors to charge (in our case, it shouldn't be a problem) before starting anything that would require storage on shutdown.


Thanks again,


Tim

[Non-text portions of this message have been removed]

RE: [AVR-Chat] Re: EEPROM write and power failure

2008-05-01 by Cat C

And if the power goes back up without really going all the way down, you'll be stuck in your while(1) loop :-)
Show quoted textHide quoted text
> To: AVR-Chat@yahoogroups.com
> From: tim@jeminnovation.com
> Date: Wed, 30 Apr 2008 22:38:07 -0600
> Subject: Re: [AVR-Chat] Re: EEPROM write and power failure
>
> Just wanted to thank everyone for the ideas and let you know which direction we're heading. Our original plan was to write the data every 3 seconds into a wear-leveling buffer. However, since the hardware is still in flux, we're increasing our power supply capacitors to provide more time after the power failure. We already had INT0 wired up to indicate power failure; so the plan is to NOT write the data until the interrupt is triggered. The interrupt routine will then write the data to EEPROM and enter a while(1) loop, waiting for the power to die.
>
> The flip side, is making sure the processor waits long enough on power up for the capacitors to charge (in our case, it shouldn't be a problem) before starting anything that would require storage on shutdown.
>
>
> Thanks again,
>
>
> Tim
>
> [Non-text portions of this message have been removed]
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>  To visit your group on the web, go to:
> http://groups.yahoo.com/group/AVR-Chat/
>
>  Your email settings:
> Individual Email | Traditional
>
>  To change settings online go to:
> http://groups.yahoo.com/group/AVR-Chat/join
> (Yahoo! ID required)
>
>  To change settings via email:
> mailto:AVR-Chat-digest@yahoogroups.com
> mailto:AVR-Chat-fullfeatured@yahoogroups.com
>
>  To unsubscribe from this group, send an email to:
> AVR-Chat-unsubscribe@yahoogroups.com
>
>  Your use of Yahoo! Groups is subject to:
> http://docs.yahoo.com/info/terms/
>

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.