Subscribe to EDN
RSS
Reprints/License
Print
Email

Speed C functions for C16x microcontrollers

Hans-Herbert Kirste, WAGO, Minden, Germany -- EDN, August 3, 2000

The Infineon C16x Series of µCs use an internal 16-bit-register architecture. The architecture can also process byte-wide functions. The µC uses byte moves to implement library functions such as memset() or memcopy(). This process makes the library code independent of count values and address values; both may be odd or even. The disadvantage is the loss of speed because of the need to process loop counters for every byte. Memory access also cuts the speed, because two cycles are necessary to write a word in 2 bytes. The code in Listing 1 implements a fast_memset() function that takes care of the byte count as well as the start access. Both may be odd or even. The function uses as many word moves as possible to preset the memory area. You can easily change the routine to process the copy function, memcopy(), with the same advantages. (DI #2569)

RSS
Reprints/License
Print
Email
Talkback
Canon Resource Center

Featured Company


Most Recent Resources

Advertisement
Related Content

No related content found.

  • 0 rated items found.
Advertisement

KNOWLEDGE CENTER

Datasheets.com Parts Search

185 million searchable parts
(please enter a part number or hit search to begin)
Engineering Careers
Jobs sponsored by
Advertisement
About EDN   |   Site Map   |   Contact Us   |   Subscription   |   RSS
© 2012 UBM Electronics. All rights reserved.
Use of this Web site is subject to its Terms of Use | Privacy Policy

Please visit these other UBM Canon sites

UBM Canon | Design News | Test & Measurement World | Packaging Digest | EDN | Qmed | Pharmalive | Appliance Magazine | Plastics Today | Powder Bulk Solids | Canon Trade Shows