The purpose of this group is to foster exchange of information on the Texas Instruments MSP430 family of microcontrollers and related tools. Everyone welcome, all levels of familiarity/expertise.
CRC-CCITT code in ANSI C for MSP430 - Nick Alexeev - Jan 29 14:40:54 2007
Colleagues,
Could you recommend a community-proven CRC-CCITT code or generic CRC-16
code for MSP430 in ANSI C?
By the way, is there a good forum for the IAR compiler?
Thanks,
Nick

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )
Re: CRC-CCITT code in ANSI C for MSP430 - Andreas Koepke - Jan 29 15:01:47 2007
See
http://www.ross.net/crc/crcpaper.html
The following was generated for it for the
ITU_T polynomial: x^16 + x^12 + x^5 + 1
(looks odd, but works fast)
uint16_t const ccitt_crc16_table[256] = {
0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7,
0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef,
0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6,
0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de,
0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485,
0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d,
0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4,
0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc,
0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823,
0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b,
0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12,
0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a,
0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41,
0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49,
0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70,
0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78,
0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f,
0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067,
0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e,
0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256,
0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d,
0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405,
0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c,
0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634,
0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab,
0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3,
0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a,
0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92,
0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9,
0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1,
0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8,
0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0
};
uint16_t crcByte(uint16_t fcs, uint8_t c)
{
fcs = ccitt_crc16_table[(fcs >> 8 ^ c) & 0xffU] ^ (fcs << 8);
return fcs;
}
Nick Alexeev wrote:
> Colleagues,
>
> Could you recommend a community-proven CRC-CCITT code or generic CRC-16
> code for MSP430 in ANSI C?
>
> By the way, is there a good forum for the IAR compiler?
>
> Thanks,
> Nick
>

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )
RE: CRC-CCITT code in ANSI C for MSP430 - Microbit - Jan 29 15:10:11 2007
You can also use looped code. This runs slower, but uses very little code :
I've set it for the CCITT 0x1021 polynomial.
With this algorithm, init crc accumulator to 0xFFFF. Run all data through the get_crc()
func.
Append LOW byte, then HIGH byte at end of packet.
On other side, init crc to 0xFFFF, run ALL bytes (incl rxd crc) through the get_crc()
func. Result
should be 0...
#define POLY 0x1021
unsigned int crc; // use crc as a global as simple example
void get_crc (unsigned char in) {
unsigned char ctr,temp;
for (ctr=8;ctr>0;--ctr)
{
temp = in ^ (unsigned char)crc; //do next bit
crc >>= 1; //update CRC
if (temp & 0x01) //if LSB XOR == 1
crc ^= POLY; //then XOR polynomial with CRC
in >>= 1; //next bit
}
}
Best Regards,
Kris
-----Original Message-----
From: m...@yahoogroups.com [mailto:m...@yahoogroups.com] On Behalf Of Nick Alexeev
Sent: Tuesday, 30 January 2007 6:41 AM
To: m...@yahoogroups.com
Subject: [msp430] CRC-CCITT code in ANSI C for MSP430
Colleagues,
Could you recommend a community-proven CRC-CCITT code or generic CRC-16
code for MSP430 in ANSI C?
By the way, is there a good forum for the IAR compiler?
Thanks,
Nick
Yahoo! Groups Links

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )
RE: CRC-CCITT code in ANSI C for MSP430 - Paul Curtis - Jan 29 16:56:13 2007
I am surprised that the following code is not more widely known. It's fast,
small, doesn't need lookup table, and contains no loops.
void
crc_ccitt_init(void)
{
crc = 0xffff;
}
void
crc_ccitt_update(unsigned char x)
{
unsigned crc_new = (unsigned char)(crc >> 8) | (crc << 8);
crc_new ^= x;
crc_new ^= (unsigned char)(crc_new & 0xff) >> 4;
crc_new ^= crc_new << 12;
crc_new ^= (crc_new & 0xff) << 5;
crc = crc_new;
}
unsigned int
crc_ccitt_crc(void)
{
return crc;
}
Regards,
--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors
> -----Original Message-----
> From: m...@yahoogroups.com [mailto:m...@yahoogroups.com]
> On Behalf Of Microbit
> Sent: 29 January 2007 20:10
> To: m...@yahoogroups.com
> Subject: RE: [msp430] CRC-CCITT code in ANSI C for MSP430
>
> You can also use looped code. This runs slower, but uses very
> little code :
> I've set it for the CCITT 0x1021 polynomial.
> With this algorithm, init crc accumulator to 0xFFFF. Run all
> data through the get_crc() func.
> Append LOW byte, then HIGH byte at end of packet.
> On other side, init crc to 0xFFFF, run ALL bytes (incl rxd
> crc) through the get_crc() func. Result should be 0...
>
> #define POLY 0x1021
> unsigned int crc; // use crc as a
> global as simple example
>
> void get_crc (unsigned char in) {
> unsigned char ctr,temp;
>
> for (ctr=8;ctr>0;--ctr)
> {
> temp = in ^ (unsigned char)crc; //do next bit
> crc >>= 1; //update CRC
> if (temp & 0x01) //if LSB XOR == 1
> crc ^= POLY; //then XOR
> polynomial with CRC
> in >>= 1; //next bit
> }
> }
> Best Regards,
> Kris
>
>
> -----Original Message-----
> From: m...@yahoogroups.com [mailto:m...@yahoogroups.com]
> On Behalf Of Nick Alexeev
> Sent: Tuesday, 30 January 2007 6:41 AM
> To: m...@yahoogroups.com
> Subject: [msp430] CRC-CCITT code in ANSI C for MSP430
>
> Colleagues,
>
> Could you recommend a community-proven CRC-CCITT code or
> generic CRC-16 code for MSP430 in ANSI C?
>
> By the way, is there a good forum for the IAR compiler?
>
> Thanks,
> Nick
>
> Yahoo! Groups Links
>
> Yahoo! Groups Links

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )
OT : Is Vista worth the fuss ? - Microbit - Jan 30 3:20:30 2007
Hi friends,
Normally I prefer to wait for a few years till endless bugs & vulnerabilities are
reasonably
removed from the latest Windows OS before I upgrade, but Vista appears to be a better
step
forward. Or is it ? (the claim of 2 years of internal beta tests)
Wondering if any members here have already tried Vista, and what they think of it ?
I know it's very early days, but I'd love to hear some first hand experience...
Also, Vista appears to "brag" about IE7 and its new features when using Vista, but I don't
see any
difference with IE7 I'm using on XP SP2 ? Isn't this the same IE7 ?
Best Regards,
Kris

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )
Re: CRC-CCITT code in ANSI C for MSP430 - Andreas Koepke - Jan 30 4:43:56 2007
Cool code. Where did you get it from?
(Lookup may still be faster, the MSP is not so good at shifts.)
Best, Andreas
Paul Curtis wrote:
> I am surprised that the following code is not more widely known. It's fast,
> small, doesn't need lookup table, and contains no loops.
>
> void
> crc_ccitt_init(void)
> {
> crc = 0xffff;
> }
>
> void
> crc_ccitt_update(unsigned char x)
> {
> unsigned crc_new = (unsigned char)(crc >> 8) | (crc << 8);
> crc_new ^= x;
> crc_new ^= (unsigned char)(crc_new & 0xff) >> 4;
> crc_new ^= crc_new << 12;
> crc_new ^= (crc_new & 0xff) << 5;
> crc = crc_new;
> }
>
> unsigned int
> crc_ccitt_crc(void)
> {
> return crc;
> }
>
> Regards,
>
> --
> Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
> CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors
>
>
>>-----Original Message-----
>>From: m...@yahoogroups.com [mailto:m...@yahoogroups.com]
>>On Behalf Of Microbit
>>Sent: 29 January 2007 20:10
>>To: m...@yahoogroups.com
>>Subject: RE: [msp430] CRC-CCITT code in ANSI C for MSP430
>>
>>You can also use looped code. This runs slower, but uses very
>>little code :
>>I've set it for the CCITT 0x1021 polynomial.
>>With this algorithm, init crc accumulator to 0xFFFF. Run all
>>data through the get_crc() func.
>>Append LOW byte, then HIGH byte at end of packet.
>>On other side, init crc to 0xFFFF, run ALL bytes (incl rxd
>>crc) through the get_crc() func. Result should be 0...
>>
>>#define POLY 0x1021
>>unsigned int crc; // use crc as a
>>global as simple example
>>
>>void get_crc (unsigned char in) {
>>unsigned char ctr,temp;
>>
>>for (ctr=8;ctr>0;--ctr)
>> {
>> temp = in ^ (unsigned char)crc; //do next bit
>> crc >>= 1; //update CRC
>> if (temp & 0x01) //if LSB XOR == 1
>> crc ^= POLY; //then XOR
>>polynomial with CRC
>> in >>= 1; //next bit
>> }
>>}
>>Best Regards,
>>Kris
>>-----Original Message-----
>>From: m...@yahoogroups.com [mailto:m...@yahoogroups.com]
>>On Behalf Of Nick Alexeev
>>Sent: Tuesday, 30 January 2007 6:41 AM
>>To: m...@yahoogroups.com
>>Subject: [msp430] CRC-CCITT code in ANSI C for MSP430
>>
>>Colleagues,
>>
>>Could you recommend a community-proven CRC-CCITT code or
>>generic CRC-16 code for MSP430 in ANSI C?
>>
>>By the way, is there a good forum for the IAR compiler?
>>
>>Thanks,
>>Nick
>>
>>Yahoo! Groups Links
>>
>>Yahoo! Groups Links
>>
>
______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.
(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )
RE: CRC-CCITT code in ANSI C for MSP430 - Paul Curtis - Jan 30 4:55:52 2007
Hi,
> Cool code. Where did you get it from?
It has been derived many times independently. I have an interest in CRCs
ever since I wrote code for a Data Broadcast system which required implicit
continuity. That probably won't mean much to anybody, but I did a lot of
work on CRCs at that time.
> (Lookup may still be faster, the MSP is not so good at shifts.)
Lookup will be faster, in general.
--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )
Re: OT : Is Vista worth the fuss ? - dmm - Jan 30 6:22:40 2007
On Tue, 30 Jan 2007 19:15:19 +1100, you wrote:
>Hi friends,
>
>Normally I prefer to wait for a few years till endless bugs & vulnerabilities are
reasonably
>removed from the latest Windows OS before I upgrade, but Vista appears to be a better
step
>forward. Or is it ? (the claim of 2 years of internal beta tests)
>Wondering if any members here have already tried Vista, and what they think of it ?
>I know it's very early days, but I'd love to hear some first hand experience...
>
>Also, Vista appears to "brag" about IE7 and its new features when using Vista, but I
don't see any
>difference with IE7 I'm using on XP SP2 ? Isn't this the same IE7 ?
>
>Best Regards,
>Kris
>
Having just upgraded from Win98SE to XPSp2 in the past 6 months, I'm not too fussed about
Vista,
and because the bugs and security failures have as yet to be worked out before the first
service
pack due in December . There's also the cost issue of upgrading the hardware to run the
os,
unless you've upgraded your pc already.

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )
Re: OT : Is Vista worth the fuss ? - Christopher Cole - Jan 30 9:05:43 2007
On Tue, Jan 30, 2007 at 07:15:19PM +1100, Microbit wrote:
> Wondering if any members here have already tried Vista, and what they think of it ?
> I know it's very early days, but I'd love to hear some first hand experience...
I have been running Vista 32 bit edition (final release from MSDN) every day
for over two weeks now, and I have had very little trouble. I am running it
on a two year old laptop, and it is plenty fast! You don't need a lightning
fast machine to run Vista. Vista rates my machine a '1' (very poor), but it
appears to be quick enough for me!
Most of my applications that I use day-to-day work just fine under Vista:
- Rowley Crossworks (compiler AND FETP programmer/debugger work fine)
- Cadsoft Eagle, 4.16r2
- Cygwin environment
- LTSpice and Qucs
- FEMM
- TeraTerm (FTDIChip already has Vista Drivers for their USB-Serial chips!)
- Putty / WinSCP
- Gimp
- GVim
I have not come across anything that does NOT work. In general, I have found
that if a program works on XP, it will work just as well under Vista. This
is the case with the 32 bit release of Vista.
I tried 64 bit Vista on another machine, and I ran into numerous problems!
This is because the lack of 64 bit drivers. For some reason, even though 64
bit machines have been out for a while now, 64 bit support for drivers and
software is rare. I find this extremely odd, because the effort to port the
code base to 64 bit would not be that bad... and recompile for 64 bit.
Unfortunately, this effectively doubles software inventory and possibly
support efforts on the part of the vendor. So, I am afraid that the lack of
64 bit support may stick with us for a while...
Take care,
-Chris
--
| Christopher Cole, Cole Design and Development c...@coledd.com |
| Embedded Electronics and Software Design http://coledd.com |
______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.
(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )
Re: OT : Is Vista worth the fuss ? - William Sell - Jan 30 11:11:54 2007
Hi Kris,
I think that you have to explicitly load IE7 on your box, it is not native
with XP. I have both IE7 and Firefox2.0. Both browsers are very easy to
use, I normally stick with Firefox, unless I bumped into sites where the
page does not load properly. As to the question about Vista, no doubt
security and UI are improved, but it really comes down to driver support. I
do not trust the pre-system scan, so I will wait until some brave soul
reports that Crossworks, CrossConnect and the TI FET all work under Vista.
/Bill
On 1/30/07, Microbit
wrote:
>
> Hi friends,
>
> Normally I prefer to wait for a few years till endless bugs &
> vulnerabilities are reasonably
> removed from the latest Windows OS before I upgrade, but Vista appears to
> be a better step
> forward. Or is it ? (the claim of 2 years of internal beta tests)
> Wondering if any members here have already tried Vista, and what they
> think of it ?
> I know it's very early days, but I'd love to hear some first hand
> experience...
>
> Also, Vista appears to "brag" about IE7 and its new features when using
> Vista, but I don't see any
> difference with IE7 I'm using on XP SP2 ? Isn't this the same IE7 ?
>
> Best Regards,
> Kris
>
>
--
This message was sent from my Gmail account. You can use either
w...@comcast.net or email to this account directly.
[Non-text portions of this message have been removed]

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Re: OT : Is Vista worth the fuss ? - Ian Okey - Jan 30 11:38:06 2007
On 30/01/07, Microbit
wrote:
> Hi friends,
>
> Normally I prefer to wait for a few years till endless bugs & vulnerabilities are
reasonably
> removed from the latest Windows OS before I upgrade, but Vista appears to be a better
step
> forward. Or is it ? (the claim of 2 years of internal beta tests)
> Wondering if any members here have already tried Vista, and what they think of it ?
> I know it's very early days, but I'd love to hear some first hand experience...
>
> Also, Vista appears to "brag" about IE7 and its new features when using Vista, but I
don't see any
> difference with IE7 I'm using on XP SP2 ? Isn't this the same IE7 ?
>
> Best Regards,
> Kris
I am in no hurry to get Vista. I reckon that it is only prudent to
wait and see whether all the talk about improved security turns out to
be true. I know that MS have spent vast amounts of run-time trying to
get things right BUT... they have ditched the old TCP-IP protocol
stack that has caused so many (now patched) problems in XP, NT and
Win-98. All those years of being under hack attack have now been lost
and all the new (and some old re-introduced) problems will have to be
worked out again.
http://www.symantec.com/avcenter/reference/ATR-VistaAttackSurface.pdf
In addition the DRM issues with Vista promise to be intersting, seeing
that the protection on HD-DVD and BLU-RAY discs has already been
cracked, I wonder how many will find that drivers, discs and displays
will fail due to licence revocations insisted on by the movie studios.
http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.html
It promises to be interesting
Ian
______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Re: OT : Is Vista worth the fuss ? - old_cow_yellow - Jan 30 12:55:15 2007
--- "William Sell"
wrote:
>
> Hi Kris,
> I think that you have to explicitly load IE7 on your box,
> it is not native with XP.
> ...
I thought Microsoft told the court (under oath) that it is not
possible to separate IE from Windows.
______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )RE: OT : Is Vista worth the fuss ? - Paul Curtis - Jan 30 13:04:24 2007
Hi,
> Hi Kris,
> I think that you have to explicitly load IE7 on your box, it
> is not native with XP. I have both IE7 and Firefox2.0. Both
> browsers are very easy to use, I normally stick with Firefox,
> unless I bumped into sites where the page does not load
> properly. As to the question about Vista, no doubt security
> and UI are improved, but it really comes down to driver
> support. I do not trust the pre-system scan, so I will wait
> until some brave soul reports that Crossworks, CrossConnect
> and the TI FET all work under Vista.
Jolly good. We're going to sacrifice a machine to Vista to see if it's
worth a jot and how badly things break under it.
--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )
Re: Re: OT : Is Vista worth the fuss ? - William Sell - Jan 30 13:08:18 2007
Too true, so the IE7 load only updates the current IE6 explorer. I meant
that IE7 does not ship with XP...
On 1/30/07, old_cow_yellow
wrote:
>
> --- "William Sell" wrote:
> >
> > Hi Kris,
> > I think that you have to explicitly load IE7 on your box,
> > it is not native with XP.
> > ...
>
> I thought Microsoft told the court (under oath) that it is not
> possible to separate IE from Windows.
>
>
>
--
This message was sent from my Gmail account. You can use either
w...@comcast.net or email to this account directly.
[Non-text portions of this message have been removed]

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Re: OT : Is Vista worth the fuss ? - Bill Penrose - Jan 30 13:26:19 2007
--- In m...@yahoogroups.com, "Microbit"
wrote:
> Normally I prefer to wait for a few years till endless bugs &
vulnerabilities are reasonably
> removed from the latest Windows OS before I upgrade, but Vista
appears to be a better step
> forward.
I'm the luddite that still uses Office 97 because I have no need to
upgrade. It does everything I want. Recently, an automatic 'update' to
XP caused my Word 97 to fail. I went back to the next restore point,
fixed it, and turned off automatic updates forever.
How can Vista be anything more than a giant version of the same thing?
Make *everyone's* software useless, and blackmail them into buying
$1000s of new software. What can Vista possibly do, short of live
dancing girls, that is worth that kind of money, not to mention the
years they (we) will spend debugging it and patching gaping security
holes?
Forget it. I'll give up my XP and my Office 97 when they pry my cold,
dead fingers from the keyboard.
Dangerous Bill

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Re: Re: OT : Is Vista worth the fuss ? - William Sell - Jan 30 13:37:31 2007
I recommend to everyone to turn off Automatic Updates. Otherwise you are
likely to encounter the svchost error that appears when the system is unable
to carry out the update. If you are happy with 97, then stick with it. The
only reason to update is for security, and this is always a question with
any MS OS. As firmware engineers all we are is glorified typists, so why do
we need anything better than XP??
On 1/30/07, Bill Penrose
wrote:
>
> --- In m...@yahoogroups.com , "Microbit"
> wrote:
> > Normally I prefer to wait for a few years till endless bugs &
> vulnerabilities are reasonably
> > removed from the latest Windows OS before I upgrade, but Vista
> appears to be a better step
> > forward.
>
> I'm the luddite that still uses Office 97 because I have no need to
> upgrade. It does everything I want. Recently, an automatic 'update' to
> XP caused my Word 97 to fail. I went back to the next restore point,
> fixed it, and turned off automatic updates forever.
>
> How can Vista be anything more than a giant version of the same thing?
> Make *everyone's* software useless, and blackmail them into buying
> $1000s of new software. What can Vista possibly do, short of live
> dancing girls, that is worth that kind of money, not to mention the
> years they (we) will spend debugging it and patching gaping security
> holes?
>
> Forget it. I'll give up my XP and my Office 97 when they pry my cold,
> dead fingers from the keyboard.
>
> Dangerous Bill
>
>
>
--
This message was sent from my Gmail account. You can use either
w...@comcast.net or email to this account directly.
[Non-text portions of this message have been removed]

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Re: OT : Is Vista worth the fuss ? - Robert Bacs - Jan 30 13:57:08 2007
Hi,
The lack of drivers for Windows Vista 64 bit is that
this version of Vista requires digitally signed
drivers, of course there is an option to avoid this,
see advanced booting options: "Disable Driver
Signature Enforcement".
Best regards,
Boby
--- Christopher Cole
wrote:
> On Tue, Jan 30, 2007 at 07:15:19PM +1100, Microbit
> wrote:
> > Wondering if any members here have already tried
> Vista, and what they think of it ?
> > I know it's very early days, but I'd love to hear
> some first hand experience...
>
> I have been running Vista 32 bit edition (final
> release from MSDN) every day
> for over two weeks now, and I have had very little
> trouble. I am running it
> on a two year old laptop, and it is plenty fast!
> You don't need a lightning
> fast machine to run Vista. Vista rates my machine a
> '1' (very poor), but it
> appears to be quick enough for me!
>
> Most of my applications that I use day-to-day work
> just fine under Vista:
> - Rowley Crossworks (compiler AND FETP
> programmer/debugger work fine)
> - Cadsoft Eagle, 4.16r2
> - Cygwin environment
> - LTSpice and Qucs
> - FEMM
> - TeraTerm (FTDIChip already has Vista Drivers for
> their USB-Serial chips!)
> - Putty / WinSCP
> - Gimp
> - GVim
>
> I have not come across anything that does NOT work.
> In general, I have found
> that if a program works on XP, it will work just as
> well under Vista. This
> is the case with the 32 bit release of Vista.
>
> I tried 64 bit Vista on another machine, and I ran
> into numerous problems!
> This is because the lack of 64 bit drivers. For
> some reason, even though 64
> bit machines have been out for a while now, 64 bit
> support for drivers and
> software is rare. I find this extremely odd,
> because the effort to port the
> code base to 64 bit would not be that bad... and
> recompile for 64 bit.
> Unfortunately, this effectively doubles software
> inventory and possibly
> support efforts on the part of the vendor. So, I am
> afraid that the lack of
> 64 bit support may stick with us for a while...
>
> Take care,
> -Chris
>
> --
> | Christopher Cole, Cole Design and Development
> c...@coledd.com |
> | Embedded Electronics and Software Design
> http://coledd.com |
>
____________________________________________________________________________________
Need Mail bonding?
Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.
http://answers.yahoo.com/dir/?link=list&sid=396546091

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Re: Re: OT : Is Vista worth the fuss ? - Steve Sabram - Jan 30 14:20:02 2007
William Sell wrote:
> I recommend to everyone to turn off Automatic Updates. Otherwise you are
> likely to encounter the svchost error that appears when the system is unable
> to carry out the update. If you are happy with 97, then stick with it. The
> only reason to update is for security, and this is always a question with
> any MS OS. As firmware engineers all we are is glorified typists, so why do
> we need anything better than XP??
>
> On 1/30/07, Bill Penrose
wrote:
>
>> --- In m...@yahoogroups.com , "Microbit"
>> wrote:
>>
>>> Normally I prefer to wait for a few years till endless bugs &
>>>
>> vulnerabilities are reasonably
>>
>>> removed from the latest Windows OS before I upgrade, but Vista
>>>
>> appears to be a better step
>>
>>> forward.
>>>
>> I'm the luddite that still uses Office 97 because I have no need to
>> upgrade. It does everything I want. Recently, an automatic 'update' to
>> XP caused my Word 97 to fail. I went back to the next restore point,
>> fixed it, and turned off automatic updates forever.
>>
I have better. There is a CPA that I used hire that is still running
DOS 3.0 with a CGA version of Excel and Word and an amber monitor.
Somehow, somewhere, there is still development going on with USB devices
somehow working on the thing. It may be a parallel to USB interface for
his Inkjet printer running in text mode. He considers the ole '286
system he runs "his best office equipment amatorization ever."
>> How can Vista be anything more than a giant version of the same thing?
>> Make *everyone's* software useless, and blackmail them into buying
>> $1000s of new software. What can Vista possibly do, short of live
>> dancing girls, that is worth that kind of money, not to mention the
>> years they (we) will spend debugging it and patching gaping security
>> holes?
>>
Look at it as an opportunity instead of a liability. If you are this
high tech, your consulting services will be in great demand when the
sales guys gets lost with too many anamated 3D icons on the screen.
>> Forget it. I'll give up my XP and my Office 97 when they pry my cold,
>> dead fingers from the keyboard.
>>
Sometimes a business can only improve one retirement at a time.
Steve
______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Re: CRC-CCITT code in ANSI C for MSP430 - Stuart_Rubin - Jan 30 14:26:13 2007
IAR provides a nice data sheet for calculating CRC's (and checksums).
This is really convenient as their linker can automatically calculate
the CRC (or checksum) and stuff it into a known location in your
object code. You can then calculate the CRC at runtime to validate
your flash image.
See "Technical Note 91733"
http://supp.iar.com/Support/?note=91733&from=search+result
Stuart
--- In m...@yahoogroups.com, "Nick Alexeev"
wrote:
>
> Colleagues,
>
> Could you recommend a community-proven CRC-CCITT code or generic CRC-16
> code for MSP430 in ANSI C?
>
> By the way, is there a good forum for the IAR compiler?
>
> Thanks,
> Nick
>

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )RE: OT : Is Vista worth the fuss ? - Microbit - Jan 30 21:09:45 2007
Hi Bill, Christopher, et al,
I updated to IE7 as soon as it listed as "critical update".
I'm personally quite pleased with IE7 - clean GUI, phishing seems to be OK etc.
So I must presume that IE7 is the same under Vista as it is under XP (?)
Also, since IE7 release one security update only so far, hopefully a good sign....
I also like that IE7 stores web pages in a single file, rather than using extra
folders.
Initially it irritated me that when I start it and it goes to my homepage (Google) with
ADSL modem
"disconnected" on 10.1.1.1, IE7 refused to select one of my "favourites".
The phishing patch seems to have fixed that.
> do not trust the pre-system scan, so I will wait until some brave soul
> reports that Crossworks, CrossConnect and the TI FET all work under Vista.
I see that Christopher has pioneered the road :-)
As long as CrossWorks/XConnect runs OK (has it ever not ?:-) and some other misc. stuff
like PCB
CAD, other compiler GUIs such as MPLAB, Office, iTunes etc. I'm happy.
I can't seem to shake the impression of earlier days of Windows :
As long as you install MS stuff all is good and well, when you start installing 3rd party,
the
shite hits the fan....
Well, at least DLLs aren't all installed in the same directory as much anymore.
Those were the days when my love affair with proprietary stuff like Compaq etc. came to
a
screaming halt !!! Never again, never again....
I'd like to try Linux one fine day, but I dislike things like Linux using 0xxxFFF8 as "end
of
cluster chain" marker (rather than 0xxxFFFF) which some MP3 players choke on - small
things like
that...
Best Regards,
Kris
-----Original Message-----
From: m...@yahoogroups.com [mailto:m...@yahoogroups.com] On Behalf Of William Sell
Sent: Wednesday, 31 January 2007 3:08 AM
To: m...@yahoogroups.com
Subject: Re: [msp430] OT : Is Vista worth the fuss ?
Hi Kris,
I think that you have to explicitly load IE7 on your box, it is not native
with XP. I have both IE7 and Firefox2.0. Both browsers are very easy to
use, I normally stick with Firefox, unless I bumped into sites where the
page does not load properly. As to the question about Vista, no doubt
security and UI are improved, but it really comes down to driver support. I
do not trust the pre-system scan, so I will wait until some brave soul
reports that Crossworks, CrossConnect and the TI FET all work under Vista.
/Bill
On 1/30/07, Microbit
wrote:
>
> Hi friends,
>
> Normally I prefer to wait for a few years till endless bugs &
> vulnerabilities are reasonably
> removed from the latest Windows OS before I upgrade, but Vista appears to
> be a better step
> forward. Or is it ? (the claim of 2 years of internal beta tests)
> Wondering if any members here have already tried Vista, and what they
> think of it ?
> I know it's very early days, but I'd love to hear some first hand
> experience...
>
> Also, Vista appears to "brag" about IE7 and its new features when using
> Vista, but I don't see any
> difference with IE7 I'm using on XP SP2 ? Isn't this the same IE7 ?
>
> Best Regards,
> Kris
>
>
--
This message was sent from my Gmail account. You can use either
w...@comcast.net or email to this account directly.
[Non-text portions of this message have been removed]
Yahoo! Groups Links

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )RE: Re: OT : Is Vista worth the fuss ? - Microbit - Jan 30 21:11:53 2007
Heh, heh.....
Best Regards,
Kris
-----Original Message-----
From: m...@yahoogroups.com [mailto:m...@yahoogroups.com] On Behalf Of Bill Penrose
Sent: Wednesday, 31 January 2007 5:25 AM
To: m...@yahoogroups.com
Subject: [msp430] Re: OT : Is Vista worth the fuss ?
--- In m...@yahoogroups.com, "Microbit"
wrote:
> Normally I prefer to wait for a few years till endless bugs &
vulnerabilities are reasonably
> removed from the latest Windows OS before I upgrade, but Vista
appears to be a better step
> forward.
I'm the luddite that still uses Office 97 because I have no need to
upgrade. It does everything I want. Recently, an automatic 'update' to
XP caused my Word 97 to fail. I went back to the next restore point,
fixed it, and turned off automatic updates forever.
How can Vista be anything more than a giant version of the same thing?
Make *everyone's* software useless, and blackmail them into buying
$1000s of new software. What can Vista possibly do, short of live
dancing girls, that is worth that kind of money, not to mention the
years they (we) will spend debugging it and patching gaping security
holes?
Forget it. I'll give up my XP and my Office 97 when they pry my cold,
dead fingers from the keyboard.
Dangerous Bill
Yahoo! Groups Links

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )RE: OT : Is Vista worth the fuss ? - Microbit - Jan 30 21:35:03 2007
Thanks Ian, *very* insightful !
PS : I was always under the apprehension that NO machine is 100% safe from hackers.
The recent (dumb) advertising spree of "Hello, I'm a MAC, I can't get viruses"
surely is crap ? (aka false advertising).
I thought MAC is less vulnerable because most hackers don't bother with them ?
In any case, I think it's beyond a joke when Apple can't provide full SW support for their
OWN
product (iPOd) on a MAC, as they have on a PC.....
Best Regards,
Kris
-----Original Message-----
From: m...@yahoogroups.com [mailto:m...@yahoogroups.com] On Behalf Of Ian Okey
Sent: Wednesday, 31 January 2007 3:38 AM
To: m...@yahoogroups.com
Subject: Re: [msp430] OT : Is Vista worth the fuss ?
On 30/01/07, Microbit
wrote:
> Hi friends,
>
> Normally I prefer to wait for a few years till endless bugs & vulnerabilities are
reasonably
> removed from the latest Windows OS before I upgrade, but Vista appears to be a better
step
> forward. Or is it ? (the claim of 2 years of internal beta tests)
> Wondering if any members here have already tried Vista, and what they think of it ?
> I know it's very early days, but I'd love to hear some first hand experience...
>
> Also, Vista appears to "brag" about IE7 and its new features when using Vista, but I
don't see
any
> difference with IE7 I'm using on XP SP2 ? Isn't this the same IE7 ?
>
> Best Regards,
> Kris
I am in no hurry to get Vista. I reckon that it is only prudent to
wait and see whether all the talk about improved security turns out to
be true. I know that MS have spent vast amounts of run-time trying to
get things right BUT... they have ditched the old TCP-IP protocol
stack that has caused so many (now patched) problems in XP, NT and
Win-98. All those years of being under hack attack have now been lost
and all the new (and some old re-introduced) problems will have to be
worked out again.
http://www.symantec.com/avcenter/reference/ATR-VistaAttackSurface.pdf
In addition the DRM issues with Vista promise to be intersting, seeing
that the protection on HD-DVD and BLU-RAY discs has already been
cracked, I wonder how many will find that drivers, discs and displays
will fail due to licence revocations insisted on by the movie studios.
http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.html
It promises to be interesting
Ian
Yahoo! Groups Links

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Re: Re: CRC-CCITT code in ANSI C for MSP430 - "John C. Westmoreland, P.E." - Jan 31 4:26:07 2007
Hello Everyone,
Maybe I missed an e-mail or two in this thread - but seems no one mentioned
the app. note done by TI and posted on their site. They have routines in assembly
and C - I've used them in past projects. The assembly routines are very fast. I did
a timing analysis for CRC-32 on 64-byte packets a while ago - if anyone is interested
in those stats please e-mail me - it was on a '1611 if memory serves me at the moment.
Pretty sure I did the analysis for CRC-16 too and found the response to be mostly linear -
which
is what you'd expect I suppose.
Here's the URL to TI's app note - example source can be downloaded too:
http://focus.ti.com/mcu/docs/mcusupporttechdocsc.tsp?sectionId=96&tabId=1502&abstractName=slaa221
http://www.ti.com/litv/pdf/slaa221
http://www.ti.com/litv/zip/slaa221
The app. note is slaa221 - so if the above URL's don't translate cleanly for you - you can
go to TI's site
and do a search.
HTH,
John W.
----- Original Message -----
From: Stuart_Rubin
To: m...@yahoogroups.com
Sent: Tuesday, January 30, 2007 11:25 AM
Subject: [msp430] Re: CRC-CCITT code in ANSI C for MSP430
IAR provides a nice data sheet for calculating CRC's (and checksums).
This is really convenient as their linker can automatically calculate
the CRC (or checksum) and stuff it into a known location in your
object code. You can then calculate the CRC at runtime to validate
your flash image.
See "Technical Note 91733"
http://supp.iar.com/Support/?note=91733&from=search+result
Stuart
--- In m...@yahoogroups.com, "Nick Alexeev"
wrote:
>
> Colleagues,
>
> Could you recommend a community-proven CRC-CCITT code or generic CRC-16
> code for MSP430 in ANSI C?
>
> By the way, is there a good forum for the IAR compiler?
>
> Thanks,
> Nick
>
[Non-text portions of this message have been removed]
______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Re: CRC-CCITT code in ANSI C for MSP430 - Andreas Koepke - Feb 27 10:28:32 2007
I just did some speed tests:
- the loop based is the slowest crc implementation
- the loop free code pointed out by you is about 10 times faster
- the table based approach is about 20 times faster than the loop based.
I take the loop free code from now on ;-)
Best, Andreas
Paul Curtis wrote:
> Hi,
>>Cool code. Where did you get it from?
> It has been derived many times independently. I have an interest in CRCs
> ever since I wrote code for a Data Broadcast system which required implicit
> continuity. That probably won't mean much to anybody, but I did a lot of
> work on CRCs at that time.
>>(Lookup may still be faster, the MSP is not so good at shifts.)
> Lookup will be faster, in general.
>
> --
> Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
> CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors
______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.
(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )
Re: CRC-CCITT code in ANSI C for MSP430 - safeldt2 - Oct 23 10:07:13 2009
Hi Paul,
I saw your fast CRC-CCITT function.
Do you have a similar function for the CRC-16-ANSI used by MODBUS?
Thanks in advance
Uffe
--- In m...@yahoogroups.com, "Paul Curtis"
wrote:
>
> I am surprised that the following code is not more widely known. It's fast,
> small, doesn't need lookup table, and contains no loops.
>
> void
> crc_ccitt_init(void)
> {
> crc = 0xffff;
> }
>
> void
> crc_ccitt_update(unsigned char x)
> {
> unsigned crc_new = (unsigned char)(crc >> 8) | (crc << 8);
> crc_new ^= x;
> crc_new ^= (unsigned char)(crc_new & 0xff) >> 4;
> crc_new ^= crc_new << 12;
> crc_new ^= (crc_new & 0xff) << 5;
> crc = crc_new;
> }
>
> unsigned int
> crc_ccitt_crc(void)
> {
> return crc;
> }
>
> Regards,
>
> --
> Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
> CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors
>
>
>
> > -----Original Message-----
> > From: m...@yahoogroups.com [mailto:m...@yahoogroups.com]
> > On Behalf Of Microbit
> > Sent: 29 January 2007 20:10
> > To: m...@yahoogroups.com
> > Subject: RE: [msp430] CRC-CCITT code in ANSI C for MSP430
> >
> > You can also use looped code. This runs slower, but uses very
> > little code :
> > I've set it for the CCITT 0x1021 polynomial.
> > With this algorithm, init crc accumulator to 0xFFFF. Run all
> > data through the get_crc() func.
> > Append LOW byte, then HIGH byte at end of packet.
> > On other side, init crc to 0xFFFF, run ALL bytes (incl rxd
> > crc) through the get_crc() func. Result should be 0...
> >
> > #define POLY 0x1021
> > unsigned int crc; // use crc as a
> > global as simple example
> >
> > void get_crc (unsigned char in) {
> > unsigned char ctr,temp;
> >
> > for (ctr=8;ctr>0;--ctr)
> > {
> > temp = in ^ (unsigned char)crc; //do next bit
> > crc >>= 1; //update CRC
> > if (temp & 0x01) //if LSB XOR == 1
> > crc ^= POLY; //then XOR
> > polynomial with CRC
> > in >>= 1; //next bit
> > }
> > }
> >
> >
> > Best Regards,
> > Kris
> >
> >
> > -----Original Message-----
> > From: m...@yahoogroups.com [mailto:m...@yahoogroups.com]
> > On Behalf Of Nick Alexeev
> > Sent: Tuesday, 30 January 2007 6:41 AM
> > To: m...@yahoogroups.com
> > Subject: [msp430] CRC-CCITT code in ANSI C for MSP430
> >
> > Colleagues,
> >
> > Could you recommend a community-proven CRC-CCITT code or
> > generic CRC-16 code for MSP430 in ANSI C?
> >
> > By the way, is there a good forum for the IAR compiler?
> >
> > Thanks,
> > Nick
> >
> >
> >
> >
> >
> >
> >
> >
______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )RE: Re: CRC-CCITT code in ANSI C for MSP430 - Paul Curtis - Oct 23 10:27:09 2009
Hi,
> I saw your fast CRC-CCITT function.
>
> Do you have a similar function for the CRC-16-ANSI used by MODBUS?
Isn't CRC16 just the CCITT one with the polynomial reversed? No, I didn't
need anything like that--all my code these days uses lookup tables as I'm
not constrained on RAM/ROM.
-- Paul.
------------------------------------

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )
Re: CRC-CCITT code in ANSI C for MSP430 - safeldt2 - Oct 23 11:09:22 2009
--- In m...@yahoogroups.com, "Paul Curtis"
wrote:
>
> Hi,
>
> > I saw your fast CRC-CCITT function.
> >
> > Do you have a similar function for the CRC-16-ANSI used by MODBUS?
>
> Isn't CRC16 just the CCITT one with the polynomial reversed? No, I didn't
> need anything like that--all my code these days uses lookup tables as I'm
> not constrained on RAM/ROM.
>
> -- Paul.
>
Hi Paul,
The polynomial is a little different.
CRC-16-IBM x16 + x15 + x2 + 1 Modbus
CRC-16-CCITT x16 + x12 + x5 + 1
http://en.wikipedia.org/wiki/Cyclic_redundancy_check
I'm not skilled enough to figure out what to change in your CCITT routine.
My problem is that I want to implement modbus in a motor controller where there is only
1000 bytes left. Therefore I was pleased when I saw your small and fast routine.
Uffe
------------------------------------
______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com ) RE: Re: CRC-CCITT code in ANSI C for MSP430 - Paul Curtis - Oct 23 11:22:21 2009
Hi,
> The polynomial is a little different.
>=20
> CRC-16-IBM x16 + x15 + x2 + 1 Modbus
> CRC-16-CCITT x16 + x12 + x5 + 1
>=20
> http://en.wikipedia.org/wiki/Cyclic_redundancy_check
>=20
> I'm not skilled enough to figure out what to change in your CCITT routine=
.
>=20
> My problem is that I want to implement modbus in a motor controller where
> there is only 1000 bytes left. Therefore I was pleased when I saw your
> small and fast routine.
This can be done by a simple table lookup to be very fast, or by loops,
which is sort of slow, or unrolled which strikes a good balance.
--
Paul Curtis, Rowley Associates Ltd=A0=A0 http://www.rowley.co.uk
CrossWorks V2 is out for LPC1700, LPC3100, LPC3200, SAM9, and more!
------------------------------------

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )
Re: CRC-CCITT code in ANSI C for MSP430 - Hugh Molesworth - Oct 23 14:26:21 2009
A look-up table approach is given in the Modbus Protocol
Specification available on the web; just search for the pdf document.
You can use 2 x 8-bit tables or 1 x 16-bit table. If you have more
RAM available than flash, just generate the tables at run time.
Hugh
At 04:07 PM 10/23/2009, you wrote:
>--- In m...@yahoogroups.com, "Paul Curtis"
wrote:
> >
> > Hi,
> >
> > > I saw your fast CRC-CCITT function.
> > >
> > > Do you have a similar function for the CRC-16-ANSI used by MODBUS?
> >
> > Isn't CRC16 just the CCITT one with the polynomial reversed? No, I didn't
> > need anything like that--all my code these days uses lookup tables as I'm
> > not constrained on RAM/ROM.
> >
> > -- Paul.
> >Hi Paul,
>
>The polynomial is a little different.
>
>CRC-16-IBM x16 + x15 + x2 + 1 Modbus
>CRC-16-CCITT x16 + x12 + x5 + 1
>
>http://en.wikipedia.org/wiki/Cyclic_redundancy_check
>
>I'm not skilled enough to figure out what to change in your CCITT routine.
>
>My problem is that I want to implement modbus in a motor controller
>where there is only 1000 bytes left. Therefore I was pleased when I
>saw your small and fast routine.
>
>Uffe
>
>------------------------------------

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Re: CRC-CCITT code in ANSI C for MSP430 - safeldt2 - Oct 23 17:01:45 2009
I have seen these approaches, my problem is that I have only 1000 bytes left for MODBUS
incl. CRC.
Uffe
--- In m...@yahoogroups.com, Hugh Molesworth
wrote:
>
> A look-up table approach is given in the Modbus Protocol
> Specification available on the web; just search for the pdf document.
> You can use 2 x 8-bit tables or 1 x 16-bit table. If you have more
> RAM available than flash, just generate the tables at run time.
> Hugh
>
> At 04:07 PM 10/23/2009, you wrote:
> >--- In m...@yahoogroups.com, "Paul Curtis" wrote:
> > >
> > > Hi,
> > >
> > > > I saw your fast CRC-CCITT function.
> > > >
> > > > Do you have a similar function for the CRC-16-ANSI used by MODBUS?
> > >
> > > Isn't CRC16 just the CCITT one with the polynomial reversed? No, I didn't
> > > need anything like that--all my code these days uses lookup tables as I'm
> > > not constrained on RAM/ROM.
> > >
> > > -- Paul.
> > >
> >
> >Hi Paul,
> >
> >The polynomial is a little different.
> >
> >CRC-16-IBM x16 + x15 + x2 + 1 Modbus
> >CRC-16-CCITT x16 + x12 + x5 + 1
> >
> >http://en.wikipedia.org/wiki/Cyclic_redundancy_check
> >
> >I'm not skilled enough to figure out what to change in your CCITT routine.
> >
> >My problem is that I want to implement modbus in a motor controller
> >where there is only 1000 bytes left. Therefore I was pleased when I
> >saw your small and fast routine.
> >
> >Uffe
> >
> >
> >
> >------------------------------------
> >
> >
> >
> >

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Re: CRC-CCITT code in ANSI C for MSP430 - Hugh Molesworth - Oct 23 18:19:44 2009
Here you go:
static uint16 Modbus_CRC16(byte *buf, uint16 len)
/*
* Information taken from:
*
* PI-MBUS-300 Rev.G Modicom Modbus Protocol Reference Guide
*
*/
{
uint16 i, crc_16 = 0xFFFF;
// This is a slow technique but it avoids using 512-byte look-up
tables above
while (len--)
{
crc_16 ^= *buf++;
for (i=0; i<8; i++)
{
if (crc_16 & 0x0001)
{
crc_16 >>= 1;
crc_16 ^= 0xA001;
}
else
{
crc_16 >>= 1;
}
}
}
return crc_16;
}
Hugh
At 10:01 PM 10/23/2009, you wrote:
>I have seen these approaches, my problem is that I have only 1000
>bytes left for MODBUS incl. CRC.
>
>Uffe
>
>--- In m...@yahoogroups.com, Hugh Molesworth
wrote:
> >
> > A look-up table approach is given in the Modbus Protocol
> > Specification available on the web; just search for the pdf document.
> > You can use 2 x 8-bit tables or 1 x 16-bit table. If you have more
> > RAM available than flash, just generate the tables at run time.
> > Hugh
> >
> > At 04:07 PM 10/23/2009, you wrote:
> >
> >
> > >--- In m...@yahoogroups.com, "Paul Curtis" wrote:
> > > >
> > > > Hi,
> > > >
> > > > > I saw your fast CRC-CCITT function.
> > > > >
> > > > > Do you have a similar function for the CRC-16-ANSI used by MODBUS?
> > > >
> > > > Isn't CRC16 just the CCITT one with the polynomial
> reversed? No, I didn't
> > > > need anything like that--all my code these days uses lookup
> tables as I'm
> > > > not constrained on RAM/ROM.
> > > >
> > > > -- Paul.
> > > >
> > >
> > >Hi Paul,
> > >
> > >The polynomial is a little different.
> > >
> > >CRC-16-IBM x16 + x15 + x2 + 1 Modbus
> > >CRC-16-CCITT x16 + x12 + x5 + 1
> > >
> > >http://en.wikipedia.org/wiki/Cyclic_redundancy_check
> > >
> > >I'm not skilled enough to figure out what to change in your CCITT routine.
> > >
> > >My problem is that I want to implement modbus in a motor controller
> > >where there is only 1000 bytes left. Therefore I was pleased when I
> > >saw your small and fast routine.
> > >
> > >Uffe
> > >
> > >
> > >
> > >------------------------------------
> > >
> > >
> > >
> > >

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Re: CRC-CCITT code in ANSI C for MSP430 - safeldt2 - Oct 26 3:46:40 2009
"unrolled" this is the magic word.
How do you make a unrolled version for the polynomial=20
x16 + x15 + x2 + 1
like the one you posted for=20
x16 + x12 + x5 + 1 ?
What is to be changed in the following code?
(It is apparently NOT just to change 12->15 and 5->2)=20
regards
Uffe
void =
=20
crc_ccitt_init(void) =
=20
{ =
=20
crc =3D 0xffff; =
=20
} =
=20
=
=20
void =
=20
crc_ccitt_update(unsigned char x) =
=20
{ =
=20
unsigned crc_new =3D (unsigned char)(crc >> 8) | (crc << 8);
crc_new ^=3D x; =
=20
crc_new ^=3D (unsigned char)(crc_new & 0xff) >> 4; =
=20
crc_new ^=3D crc_new << 12; =
=20
crc_new ^=3D (crc_new & 0xff) << 5; =
=20
crc =3D crc_new; =
=20
} =
=20
=
=20
unsigned int =
=20
crc_ccitt_crc(void) =
=20
{ =
=20
return crc; =
=20
}=20=20=20
--- In m...@yahoogroups.com, "Paul Curtis"
wrote:
>
> Hi,
>=20
> > The polynomial is a little different.
> >=20
> > CRC-16-IBM x16 + x15 + x2 + 1 Modbus
> > CRC-16-CCITT x16 + x12 + x5 + 1
> >=20
> > http://en.wikipedia.org/wiki/Cyclic_redundancy_check
> >=20
> > I'm not skilled enough to figure out what to change in your CCITT routi=
ne.
> >=20
> > My problem is that I want to implement modbus in a motor controller whe=
re
> > there is only 1000 bytes left. Therefore I was pleased when I saw your
> > small and fast routine.
>=20
> This can be done by a simple table lookup to be very fast, or by loops,
> which is sort of slow, or unrolled which strikes a good balance.
>=20
> --
> Paul Curtis, Rowley Associates Ltd=A0=A0 http://www.rowley.co.uk
> CrossWorks V2 is out for LPC1700, LPC3100, LPC3200, SAM9, and more!
>
------------------------------------
______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )