Woody Home Page
AR1688 Z80 Performance
Dec 2, 2008
10 months after writing Z80 Speed, we now have much more knowledge about the AR1688 Z80 performance and IP phone system limitations.
Slow 2x16 LCD controller is the most common reason to prevent Z80 from running 48MHz or more. It is easy to solve by changing to a faster controller. Actually there are many fast controllers, those can not work are simply too old. Dot-matrix LCD controller are all fast enough, none of those caused problem so far.
Slow program flash connecting to Z80 data bus is another reason. Very lucky, we find that usually program flash is only slow for writing. So we can lower Z80 speed to 24MHz when writing, and keep whole system running at high speed most of the time.
Ethernet chip is the last thing to connect to Z80 data bus. With LCD and program flash problem solved, it is deciding how fast AR1688 based IP phone can run.
With mostly common used RTL8019AS, Z80 can run 60MHz.
Micrel KSZ8842 is not as fast as RTL8019AS, Z80 can only run 45MHz with it.
Davicom DM9003 is the best in terms of speed, Z80 can run 72MHz with it, the max of AR1688 chip design limit.
Where Z80 performance matters?
Even with Z80 running at 24MHz, AR1688 IP phones can handle nearly 1Mbps UDP data. It is ten times more than normal VoIP streams. So Z80 performance actually does not matter with network performance.
When it comes to the voice jitter problem caused by periodic re-register messages (Rtp First), Z80 performance matters, as we use it for MD5 calculation. When doing single loop less than 56 bytes encryption, it takes 4.7 milliseconds on 48MHz, 3.7ms on 60MHz, and 3.0ms on 72MHz.
Due to software interface difference, the "Rtp First" method described on the above link only works with RTL8019AS, we can not do the same to KSZ8842 nor DM9003, so we need to push MD5 calculation as fast as possible. Besides running Z80 on higher speed, we also plan to do more assembly optimization for MD5.
Z80 performance also matters with "real" DSP MIPS. We will put DSP in loop only allow interrupt handling when Z80 exchanges data with DSP. The faster Z80 can read and write DSP data, the more actual DSP MIPS can be used.
Why I am always talking about performance and optimization? Maybe because it is the only thing I know how to do it right.
"We should forget about small efficiencies, say about 97% of the time:
premature optimization is the root of all evil." - Donald Knuth "Structured
Programming with go to Statements" Computing Surveys, Vol. 6, No. 4,
December, 1974, page 268.

No comments for this page yet.

More options? Please login or register account.