Re: CCITT in C++ for AVR



On Sun, 27 Nov 2005 14:38:35 +0100, RadGar <radgar45@xxxxxxxxx> wrote:

>Hi,
>
> First of all - I'm a total newbie to AVR or other microcontrollers
>programming so forgive any mistakes I make.
>
> I am making a school project for PocketPC which is to send some data
>to mechanic robots controlled by AVRs or other types of microcontrollers
>(mostly AVR). The data I send is own designed packet, which includes its
>own 16bit CRC. After some googling I found the CCITT ( poly 0x1021 with
>0xFFFF init) and other types of 16bit CRCs (XModem, ARC) - I chose to go
>with CCITT, but still can go with other type if it makes it easier.
>
> To the subject now - I have no idea what type of compilers are
>available for such microcontrollers (AVR etc). What I'd like to know is
>there any library with CCITT (or other) calculation function. I'm aware
>there are many source codes for that on the web, but I'd still would go
>with the library function (just easier for the people to use it) - the
>speed is not an issue. It's just easier to point other people to the lib
>function in the documentation instead of making them type some code I
>present in the doc.

avr-libc have the following inline assembly functions:

__inline__ uint16_t _crc16_update (uint16_t __crc, uint8_t __data)
__inline__ uint16_t _crc_xmodem_update (uint16_t __crc, uint8_t
__data)
__inline__ uint16_t _crc_ccitt_update (uint16_t __crc, uint8_t __data)

avr-libc is a standard library for use with avr-gcc.

Regards
Anton Erasmus

.



Relevant Pages

  • Re: micorcontroller help
    ... PIC's need a programmer and getting AVR samples from Atmel is akin to getting a green card. ... I prefer the AVR but for a reason that won't matter to you; I hate C so I need a good, cheep BASIC compiler. ... microcontrollers i might work with, and have narrowed it down to PICs and Atmel ICs, any reason to go with Atmels over PICs? ...
    (comp.robotics.misc)
  • Re: Which microcontroller is best for simple 120-220V control?
    ... either the AVR or MSP430 microcontrollers. ... I do have a development environment compatability issue, ... Microsoft Visual Studio, but that would require a change to Windows. ...
    (comp.arch.embedded)
  • Re: How to search several directories for duplicate files?
    ... Microcontrollers", and a kit of parts for doing hobbyist projects with the ... AVR Butterfly microcontroller. ... on a PC running Windows. ...
    (comp.os.linux.misc)
  • CCITT in C++ for AVR
    ... I am making a school project for PocketPC which is to send some data to mechanic robots controlled by AVRs or other types of microcontrollers. ... with CCITT, but still can go with other type if it makes it easier. ... I'm aware there are many source codes for that on the web, but I'd still would go with the library function - the speed is not an issue. ...
    (comp.arch.embedded)
  • Re: WinAVR for ATtiny2313 ?
    ... I know I can download and install avr tools on my ... >Linux box, including the latest avr-libc, but then I'd have to ... The latest WinAVR has avr-libc 1.2.3. ...
    (comp.arch.embedded)