From j_baraclough at zetnet.co.uk Thu May 1 10:58:31 2008 From: j_baraclough at zetnet.co.uk (John Baraclough) Date: Thu May 1 11:59:15 2008 Subject: [Icc-avr] ADC Differential input In-Reply-To: <000b01c8ab2d$af325ad0$0301a8c0@Sylvain> References: <000b01c8ab2d$af325ad0$0301a8c0@Sylvain> Message-ID: <481A04C7.5080907@zetnet.co.uk> It's a combination of the internal switching required to achieve differential inputs and very bad data sheet writing!!! You need to write xxx01001 to use positive input on ADC1 and negative input on ADC0 with a gain of 10x. An examination of the data sheet shows that the following codes will produce no output as the differential inputs are on the same pin: xxx01000 xxx01010 xxx01100 xxx01110 xxx11010 These combinations apply to both 1280 and 1281 regardless of the state of the MUX5 bit. As Bob says you need to keep the common mode voltage below the VREF/GAIN value so that the ampliifer does not saturate. HTH. All the best for now, John Sylvain Bissonnette wrote: > Hi, > > That's the first time I have to use the differential input on a > AVR and my question is > if I chose the value 01000 in the MUX register it's written > Posisive Diff Input : ADC0 > Negative Diff Input : ADC0 > > I don't understand why it's the same input? > > Thanks > Sylvain Bissonnette > ------------------------------------------------------------------------ > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr > From jassenbaum at htp-tel.de Thu May 1 13:38:18 2008 From: jassenbaum at htp-tel.de (Johannes Assenbaum) Date: Thu May 1 14:39:46 2008 Subject: [Icc-avr] ADC Differential input References: <000b01c8ab2d$af325ad0$0301a8c0@Sylvain> <481A04C7.5080907@zetnet.co.uk> Message-ID: Besides bad datasheet writing, MUX settings for same input in differential and amplified mode make sense to find out the actual offset of analog signal preprocessing. Best regards, Johannes > It's a combination of the internal switching required to achieve > differential inputs and very bad data sheet writing!!! You need to write > xxx01001 to use positive input on ADC1 and negative input on ADC0 with a > gain of 10x. An examination of the data sheet shows that the following > codes will produce no output as the differential inputs are on the same pin: > xxx01000 > xxx01010 > xxx01100 > xxx01110 > xxx11010 > These combinations apply to both 1280 and 1281 regardless of the state > of the MUX5 bit. As Bob says you need to keep the common mode voltage > below the VREF/GAIN value so that the ampliifer does not saturate. > HTH. > All the best for now, > John > Sylvain Bissonnette wrote: >> Hi, >> >> That's the first time I have to use the differential input on a >> AVR and my question is >> if I chose the value 01000 in the MUX register it's written >> Posisive Diff Input : ADC0 >> Negative Diff Input : ADC0 >> >> I don't understand why it's the same input? >> >> Thanks >> Sylvain Bissonnette >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Icc-avr mailing list >> Icc-avr@imagecraft.com >> http://dragonsgate.net/mailman/listinfo/icc-avr >> > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr > -- > No virus found in this incoming message. > Checked by AVG. > Version: 7.5.524 / Virus Database: 269.23.7/1409 - Release Date: 01.05.08 08:39 From sbissonnette at microsyl.com Thu May 1 17:39:18 2008 From: sbissonnette at microsyl.com (Sylvain Bissonnette) Date: Thu May 1 17:40:44 2008 Subject: [Icc-avr] ADC Differential input References: <000b01c8ab2d$af325ad0$0301a8c0@Sylvain> <481A04C7.5080907@zetnet.co.uk> Message-ID: <001101c8abec$f4f61a60$0301a8c0@Sylvain> Hi, Thanks for your inputs, It's now more clear to me, in fact it was dark. Yours Sylvain Bissonnette ----- Original Message ----- From: "Johannes Assenbaum" To: Sent: Thursday, May 01, 2008 3:38 PM Subject: Re: [Icc-avr] ADC Differential input > Besides bad datasheet writing, MUX settings for same input in differential > and amplified mode make sense to find out the actual offset of analog > signal preprocessing. > > Best regards, > Johannes > >> It's a combination of the internal switching required to achieve >> differential inputs and very bad data sheet writing!!! You need to write >> xxx01001 to use positive input on ADC1 and negative input on ADC0 with a >> gain of 10x. An examination of the data sheet shows that the following >> codes will produce no output as the differential inputs are on the same >> pin: > >> xxx01000 >> xxx01010 >> xxx01100 >> xxx01110 >> xxx11010 > >> These combinations apply to both 1280 and 1281 regardless of the state >> of the MUX5 bit. As Bob says you need to keep the common mode voltage >> below the VREF/GAIN value so that the ampliifer does not saturate. > >> HTH. > >> All the best for now, >> John > > >> Sylvain Bissonnette wrote: >>> Hi, >>> >>> That's the first time I have to use the differential input on a >>> AVR and my question is >>> if I chose the value 01000 in the MUX register it's written >>> Posisive Diff Input : ADC0 >>> Negative Diff Input : ADC0 >>> >>> I don't understand why it's the same input? >>> >>> Thanks >>> Sylvain Bissonnette >>> ------------------------------------------------------------------------ >>> >>> _______________________________________________ >>> Icc-avr mailing list >>> Icc-avr@imagecraft.com >>> http://dragonsgate.net/mailman/listinfo/icc-avr >>> > >> _______________________________________________ >> Icc-avr mailing list >> Icc-avr@imagecraft.com >> http://dragonsgate.net/mailman/listinfo/icc-avr > > >> -- >> No virus found in this incoming message. >> Checked by AVG. >> Version: 7.5.524 / Virus Database: 269.23.7/1409 - Release Date: 01.05.08 >> 08:39 > > > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr > From BobGardner at aol.com Sun May 4 11:14:14 2008 From: BobGardner at aol.com (BobGardner@aol.com) Date: Sun May 4 12:15:09 2008 Subject: [Icc-avr] example of vprintf use? Message-ID: Would one of you c experts show this tired old fortran programmer a small example of how to use vprintf and perhaps describe a situation where it would make things simpler? Multiple serial ports maybe? **************Wondering what's for Dinner Tonight? Get new twists on family favorites at AOL Food. (http://food.aol.com/dinner-tonight?NCID=aolfod00030000000001) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080504/cbf94b1f/attachment.html From webbra.mlist at verizon.net Mon May 5 11:42:30 2008 From: webbra.mlist at verizon.net (Rich Webb) Date: Mon May 5 12:43:42 2008 Subject: [Icc-avr] example of vprintf use? In-Reply-To: <200805051900.m45J04cR073064@mail.imagecraft.com> References: <200805051900.m45J04cR073064@mail.imagecraft.com> Message-ID: <481F5516.3050105@verizon.net> > Would one of you c experts show this tired old fortran programmer a small > example of how to use vprintf and perhaps describe a situation where it would > make things simpler? Multiple serial ports maybe? The singular benefit to vprintf() is that you are permitted to change the number of arguments to a particular vprintf() call on successive occasions. It's like vanilla printf() in that it takes a variable number of arguments. With printf(), however, once you've coded in the format string and argument list then the number and type of arguments is fixed (for that particular line in the code, of course). For a somewhat artificial example, consider an application that enumerates and reports on an unspecified (at compile time) number of objects in a raster image. One approach would be to have a single call to vprintf() that received a varargs list as its second parameter. It's complicated by needing to build an appropriate format list for each call and by having to mess with the va_start and va_end macros. I suspect that it's not used all that often. In the example above, I'd guess that the usual approach would be a while loop with a single call to printf() in the loop body for each identified object. From johan at edab.nu Mon May 5 12:20:29 2008 From: johan at edab.nu (johan@edab.nu) Date: Mon May 5 13:21:19 2008 Subject: [Icc-avr] example of vprintf use? Message-ID: <200805051920.m45JKTPk001399@gigamail.giganet.se> Here's an example of a wrapper for printf that I coded recently (although it uses vsprintf specifically and it's for an infineon target where I didn't have the possiblity to override putchar likte in iccavr) void ASC0_Debug(PrintDebugType debugType, const char* fmt, ...) { if(!(PrintDebug & debugType)) return; static char asc0SendBuffer[ASC0_SEND_BUFFER_SIZE]; // Print the log format string va_list arg; va_start(arg, fmt); int length = vsprintf(asc0SendBuffer, fmt, arg); va_end(arg); for(int i = 0;i < length;i ++) ASC0_SendChar(asc0SendBuffer[i]); } example call: ASC0_Debug(PDT_MEMORY, "Mem: %d bad, %d ms\n", numberOfFailed, time); On 2008-05-05 Rich Webb wrote: > Would one of you c experts show this tired old fortran programmer a small >> example of how to use vprintf and perhaps describe a situation where it would >> make things simpler? Multiple serial ports maybe? > >The singular benefit to vprintf() is that you are permitted to change >the number of arguments to a particular vprintf() call on successive >occasions. > >It's like vanilla printf() in that it takes a variable number of >arguments. With printf(), however, once you've coded in the format >string and argument list then the number and type of arguments is fixed >(for that particular line in the code, of course). > >For a somewhat artificial example, consider an application that >enumerates and reports on an unspecified (at compile time) number of >objects in a raster image. One approach would be to have a single call >to vprintf() that received a varargs list as its second parameter. > >It's complicated by needing to build an appropriate format list for each >call and by having to mess with the va_start and va_end macros. > >I suspect that it's not used all that often. In the example above, I'd >guess that the usual approach would be a while loop with a single call >to printf() in the loop body for each identified object. > >_______________________________________________ >Icc-avr mailing list >Icc-avr@imagecraft.com >http://dragonsgate.net/mailman/listinfo/icc-avr > > From Albert.vanVeen at pertronic.co.nz Mon May 5 13:32:28 2008 From: Albert.vanVeen at pertronic.co.nz (Albert vanVeen) Date: Mon May 5 14:32:14 2008 Subject: [Icc-avr] ICCAVR IDE Message-ID: When I start up (usually inadvertently) a second copy, it behaves like a 'ghost' program: keeps showing the hour glass, nothing (absolutely nothing but reboot) can kill the process, so I can continue working. Is this considered normal behaviour? Albert van Veen. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080506/4ef91fa8/attachment.html From benra at imt.liu.se Mon May 5 22:57:52 2008 From: benra at imt.liu.se (Bengt Ragnemalm) Date: Mon May 5 23:58:09 2008 Subject: SV: [Icc-avr] ICCAVR IDE In-Reply-To: References: Message-ID: <000901c8af3e$1ff78f10$b160ec82@Shagrat> No it is not, I frequently starts up several copies of ICCAVR to look into more than one program at the time. However, most users use some external editor so maybe this is not so common. What version do you have? I think some of the early versions had this problem. /Bengt _____ Fr?n: icc-avr-bounces@imagecraft.com [mailto:icc-avr-bounces@imagecraft.com] F?r Albert vanVeen Skickat: den 5 maj 2008 22:32 Till: icc-avr@imagecraft.com ?mne: [Icc-avr] ICCAVR IDE When I start up (usually inadvertently) a second copy, it behaves like a 'ghost' program: keeps showing the hour glass, nothing (absolutely nothing but reboot) can kill the process, so I can continue working. Is this considered normal behaviour? Albert van Veen. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080506/ed4096aa/attachment.html From BobGardner at aol.com Tue May 6 05:37:21 2008 From: BobGardner at aol.com (BobGardner@aol.com) Date: Tue May 6 06:38:14 2008 Subject: [Icc-avr] StackCheck vs fp? Message-ID: Hello to iccavr users. Especially the ones that have used _StackCheck() and cprintf with a %7.1f format. I think I get a blowup full of hieroglyphics every time I use StackCheck in a program that does an ftoa. My _StackOverflowed(char n) function: INTR_OFF(); if(n) putc('H'); else putc('S); while(1); It should print H or S and hang... not spit out crap in a loop. Anyone confirm this? **************Wondering what's for Dinner Tonight? Get new twists on family favorites at AOL Food. (http://food.aol.com/dinner-tonight?NCID=aolfod00030000000001) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080506/21c30944/attachment.html From johan at edab.nu Tue May 6 06:12:53 2008 From: johan at edab.nu (=?ISO-8859-1?Q?Johan_Wallstr=F6m?=) Date: Tue May 6 07:13:43 2008 Subject: [Icc-avr] StackCheck vs fp? In-Reply-To: References: Message-ID: <48205955.8070106@edab.nu> Maybe you can try to remove the calls to putc in _StackOverflowed and just copy the code from putc to StackOverflowed? Since the call itself will use the stack which might be corrupted.. BobGardner@aol.com skrev: > Hello to iccavr users. Especially the ones that have used > _StackCheck() and cprintf with a %7.1f format. I think I get a blowup > full of hieroglyphics every time I use StackCheck in a program that > does an ftoa. My _StackOverflowed(char n) function: INTR_OFF(); if(n) > putc('H'); else putc('S); while(1); It should print H or S and hang... > not spit out crap in a loop. Anyone confirm this? > > > > ------------------------------------------------------------------------ > Wondering what's for Dinner Tonight? Get new twists on family > favorites at AOL Food > . > ------------------------------------------------------------------------ > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr > From bobgardner at aol.com Tue May 6 10:38:46 2008 From: bobgardner at aol.com (bobgardner@aol.com) Date: Tue May 6 11:39:45 2008 Subject: [Icc-avr] StackCheck vs fp? In-Reply-To: <48205955.8070106@edab.nu> References: <48205955.8070106@edab.nu> Message-ID: <8CA7DB72BB9962C-1608-A4D@MBLK-M12.sysops.aol.com> Good idea. I'll try that. Thanks. -----Original Message----- From: Johan Wallstr?m Sent: Tue, 6 May 2008 9:12 am Subject: Re: [Icc-avr] StackCheck vs fp? Maybe you can try to remove the calls to putc in _StackOverflowed and just copy the code from putc to StackOverflowed? Since the call itself will use the stack which might be corrupted..? ? BobGardner@aol.com skrev:? > Hello to iccavr users. Especially the ones that have used > _StackCheck() and cprintf with a %7.1f format. I think I get a blowup > full of hieroglyphics every time I use StackCheck in a program that > does an ftoa. My _StackOverflowed(char n) function: INTR_OFF(); if(n) > putc('H'); else putc('S); while(1); It should print H or S and hang... > not spit out crap in a loop. Anyone confirm this?? >? >? >? > ------------------------------------------------------------------------? > Wondering what's for Dinner Tonight? Get new twists on family > favorites at AOL Food > .? > ------------------------------------------------------------------------? >? > _______________________________________________? > Icc-avr mailing list? > Icc-avr@imagecraft.com? > http://dragonsgate.net/mailman/listinfo/icc-avr? > ? _______________________________________________? Icc-avr mailing list? Icc-avr@imagecraft.com? http://dragonsgate.net/mailman/listinfo/icc-avr? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080506/34ffb03d/attachment-0001.html From Albert.vanVeen at pertronic.co.nz Tue May 6 13:09:30 2008 From: Albert.vanVeen at pertronic.co.nz (Albert vanVeen) Date: Tue May 6 14:09:17 2008 Subject: [Icc-avr] ICCAVR IDE In-Reply-To: <000901c8af3e$1ff78f10$b160ec82@Shagrat> References: <000901c8af3e$1ff78f10$b160ec82@Shagrat> Message-ID: pretty new: V7.16A I can't even ignore the second (dead) copy, because as soon as I try to do something in the original copy (like F9 to compile), that hangs too! Very interesting that you can run more than one copy, as I would have expected. Albert. ________________________________ From: icc-avr-bounces@imagecraft.com [mailto:icc-avr-bounces@imagecraft.com] On Behalf Of Bengt Ragnemalm Sent: Tuesday, May 06, 2008 05:58 PM To: 'Discussion list for ICCAVR and ICCtiny Users. You do NOT needtosubscribeto icc-announce if you are a member of this.' Subject: SV: [Icc-avr] ICCAVR IDE No it is not, I frequently starts up several copies of ICCAVR to look into more than one program at the time. However, most users use some external editor so maybe this is not so common. What version do you have? I think some of the early versions had this problem. /Bengt ________________________________ Fr?n: icc-avr-bounces@imagecraft.com [mailto:icc-avr-bounces@imagecraft.com] F?r Albert vanVeen Skickat: den 5 maj 2008 22:32 Till: icc-avr@imagecraft.com ?mne: [Icc-avr] ICCAVR IDE When I start up (usually inadvertently) a second copy, it behaves like a 'ghost' program: keeps showing the hour glass, nothing (absolutely nothing but reboot) can kill the process, so I can continue working. Is this considered normal behaviour? Albert van Veen. Scanned by Bizo EmailFilter -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080507/47d795df/attachment.html From BobGardner at aol.com Tue May 6 19:21:08 2008 From: BobGardner at aol.com (BobGardner@aol.com) Date: Tue May 6 20:22:02 2008 Subject: [Icc-avr] ftoa buffer overflow? Message-ID: I'm trying to isolate this problem I'm having.... something to do with stackcheck and the ftoa buffer. I think this is a 15 char buffer located immediately before the 0xaa stackoverflow sentinel. My theory is if the ftoa buffer overwrites the sentinel, then the stack walks up into the hw stack pointer in ram and the regs and a big squirt of junk comes out on the screen. Why the stack is banging around up in this area is yet to be determined. Its unbelievable to me that I am so lucky to be the ONLY iccavr user that can conjure up this particular combination of conditions. I have written a test program that uses the az and sx keys to adjust a fp numerator and a denominator and dumps 16 bytes from 0x80. I am getting 'unexpected error'. That's a pretty subtle understatement. Does anyone know the conditions that would print 'unexpected error'? Thanks! **************Wondering what's for Dinner Tonight? Get new twists on family favorites at AOL Food. (http://food.aol.com/dinner-tonight?NCID=aolfod00030000000001) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080506/0a280ff5/attachment.html From richard-lists at imagecraft.com Tue May 6 21:46:05 2008 From: richard-lists at imagecraft.com (Richard Man) Date: Tue May 6 22:49:43 2008 Subject: [Icc-avr] ftoa buffer overflow? In-Reply-To: References: Message-ID: <200805070549.m475ng3o019382@mail.imagecraft.com> An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080506/b79bd9c2/attachment.html From j_baraclough at zetnet.co.uk Wed May 7 06:49:43 2008 From: j_baraclough at zetnet.co.uk (John Baraclough) Date: Wed May 7 07:50:38 2008 Subject: [Icc-avr] ftoa buffer overflow? In-Reply-To: References: Message-ID: <4821B377.3000903@zetnet.co.uk> Hi Bob, It might help to write a very small test application using the library functions that seem to be giving you trouble and run it in Studio to try and see what's happening. HTH John BobGardner@aol.com wrote: > I'm trying to isolate this problem I'm having.... something to do with > stackcheck and the ftoa buffer. I think this is a 15 char buffer > located immediately before the 0xaa stackoverflow sentinel. My theory > is if the ftoa buffer overwrites the sentinel, then the stack walks up > into the hw stack pointer in ram and the regs and a big squirt of junk > comes out on the screen. Why the stack is banging around up in this > area is yet to be determined. Its unbelievable to me that I am so > lucky to be the ONLY iccavr user that can conjure up this particular > combination of conditions. I have written a test program that uses the > az and sx keys to adjust a fp numerator and a denominator and dumps 16 > bytes from 0x80. I am getting 'unexpected error'. That's a pretty > subtle understatement. Does anyone know the conditions that would > print 'unexpected error'? Thanks! > > > > > ------------------------------------------------------------------------ > Wondering what's for Dinner Tonight? Get new twists on family > favorites at AOL Food > . > ------------------------------------------------------------------------ > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr > From amsol at amssolutions.co.za Wed May 7 09:34:49 2008 From: amsol at amssolutions.co.za (Gerhard at AMS) Date: Wed May 7 10:41:34 2008 Subject: [Icc-avr] help : String def References: Message-ID: <003601c8b060$4aeeeba0$1f01a8c0@amsmainxp2> Hi All, This is rather a stupid question..... (I am even embarresed to ask this, instead of RTFM!!) I wish to declare a String Variable : StrName = (String of Char); Then I wish to somewhere in my prgm state > StrName = "Hello World"; I know you buffs know the 'how-to' by heart........ Please advise the of the correct ' how-to declare a string and use of ' for the above? Your help is appreciated Thanks, Gerhard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080507/a7a67122/attachment.html From paul.aa9gg at gmail.com Wed May 7 10:15:02 2008 From: paul.aa9gg at gmail.com (Paul Mateer) Date: Wed May 7 11:15:53 2008 Subject: [Icc-avr] help : String def In-Reply-To: <003601c8b060$4aeeeba0$1f01a8c0@amsmainxp2> References: <003601c8b060$4aeeeba0$1f01a8c0@amsmainxp2> Message-ID: <20f5efc40805071015k33d05aeepa5a5dedc2bb6efd1@mail.gmail.com> I guess it depends on what you want to do.... char DATA[8]; /* Holder for HP Display Data */ csprintf(DATA," H2O Flo"); DATA now contains "H2O Flo" On Wed, May 7, 2008 at 11:34 AM, Gerhard at AMS wrote: > Hi All, > This is rather a stupid question..... > (I am even embarresed to ask this, instead of RTFM!!) > > I wish to declare a String Variable : StrName = (String of Char); > > Then I wish to somewhere in my prgm state > StrName = "Hello World"; > > I know you buffs know the 'how-to' by heart........ > > Please advise the of the correct ' how-to declare a string and use of ' > for the above? > Your help is appreciated > > Thanks, > Gerhard > > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr > > -- Paul Mateer, AA9GG Elan Engineering Corp. www.elanengr.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080507/5b57b9a1/attachment-0001.html From john at idea-tech.com Wed May 7 10:28:15 2008 From: john at idea-tech.com (John Woods) Date: Wed May 7 11:29:17 2008 Subject: [Icc-avr] help : String def In-Reply-To: <003601c8b060$4aeeeba0$1f01a8c0@amsmainxp2> References: <003601c8b060$4aeeeba0$1f01a8c0@amsmainxp2> Message-ID: <4821E6AF.4080306@idea-tech.com> Hi Gerhard, There are several ways to make a constant string variable. I use different methods depending on the target environment. char *StrName = "Hello World"; // I never use this method on embedded CPUs because the pointer and the string will both reside in RAM. const char *StrName = "Hello World"; // I use this quite often it tells the compiler its ok to put the string in flash only (at least in the compilers I use). The // disadvantage is that a pointer is still created in RAM. Depending on the compiler you can put the pointer in flash // by adding another const. const char StrName[] = "Hello World"; // This is my preferred method. In this case StrName is a symbol only and takes up no memory (RAM or flash) // but can still be used in the same manner as StrName in function calls (e.g. strlen(StrName).) The big difference // is that StrName cannot be reassigned a value. Gerhard at AMS wrote: > Hi All, > This is rather a stupid question..... > (I am even embarresed to ask this, instead of RTFM!!) > > I wish to declare a String Variable : StrName = (String of Char); > > Then I wish to somewhere in my prgm state > StrName = "Hello World"; > > I know you buffs know the 'how-to' by heart........ > > Please advise the of the correct ' how-to declare a string and use of > ' for the above? > Your help is appreciated > > Thanks, > Gerhard > > ------------------------------------------------------------------------ > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr > -- John Woods Phone: (780) 431 1843 Idea Technologies Inc. Fax: 1 866 293 5883 6746 75 St. Email: john@idea-tech.com Edmonton, Alberta, Web: www.idea-tech.com Canada, T6E 6T9 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080507/a4e906a2/attachment.html From j_baraclough at zetnet.co.uk Wed May 7 11:44:41 2008 From: j_baraclough at zetnet.co.uk (John Baraclough) Date: Wed May 7 12:45:36 2008 Subject: [Icc-avr] help : String def In-Reply-To: <003601c8b060$4aeeeba0$1f01a8c0@amsmainxp2> References: <003601c8b060$4aeeeba0$1f01a8c0@amsmainxp2> Message-ID: <4821F899.8050708@zetnet.co.uk> John Woods wrote: > Hi Gerhard, > > There are several ways to make a constant string variable. I use > different methods depending on the target environment. > > char *StrName = "Hello World"; > > // I never use this method on embedded CPUs because the pointer and > the string will both reside in RAM. > > const char *StrName = "Hello World"; *Remember that 'const' in ICCAVR is now deprecated and the new keyword '_flash' is preferred. * > > // I use this quite often it tells the compiler its ok to put the > string in flash only (at least in the compilers I use). The > // disadvantage is that a pointer is still created in RAM. Depending > on the compiler you can put the pointer in flash > // by adding another const. > > const char StrName[] = "Hello World"; > > // This is my preferred method. In this case StrName is a symbol only > and takes up no memory (RAM or flash) / /*Not quite correct, the string value still has to be stored somewhere in the code and in this case will appear in Flash only.* > // but can still be used in the same manner as StrName in function > calls (e.g. strlen(StrName).) The big difference > // is that StrName cannot be reassigned a value. > *Not quite correct, you would have to use 'cstrlen(StrName)' here.*/ / Paul Mateer wrote: > I guess it depends on what you want to do.... > > char DATA[8]; /* Holder for HP Display Data */ > > csprintf(DATA," H2O Flo"); > > DATA now contains "H2O Flo" *This is the best method. Firstly you need to decide the maximum length of string that you want to store, then add one byte for the terminating NULL. Finally you should use: cstrcpy(DATA, " H2O Flo"); Which copies 9 characters including the terminating NULL. If you are using 'printf()' elsewhere in your code, then you could also use: csprintf(DATA, "%S", " H2O Flo"); but be careful to note that you MUST use upper case 'S%' to indicate that the string is in Flash only. *Gerhard at AMS wrote: > Hi All, > This is rather a stupid question..... > (I am even embarresed to ask this, instead of RTFM!!) > > I wish to declare a String Variable : StrName = (String of Char); > > Then I wish to somewhere in my prgm state > StrName = "Hello World"; > > I know you buffs know the 'how-to' by heart........ > > Please advise the of the correct ' how-to declare a string and use of > ' for the above? > Your help is appreciated > > Thanks, > Gerhard > *HTH John * From paul.aa9gg at gmail.com Wed May 7 11:59:17 2008 From: paul.aa9gg at gmail.com (Paul Mateer) Date: Wed May 7 13:00:09 2008 Subject: [Icc-avr] help : String def In-Reply-To: <4821F899.8050708@zetnet.co.uk> References: <003601c8b060$4aeeeba0$1f01a8c0@amsmainxp2> <4821F899.8050708@zetnet.co.uk> Message-ID: <20f5efc40805071159o401b31e0iee087d46471834f4@mail.gmail.com> So which is correct (better?) between these two? On Wed, May 7, 2008 at 1:44 PM, John Baraclough wrote: > John Woods wrote: > > Paul Mateer wrote: > > > csprintf(DATA," H2O Flo"); > > > > > *This is the best method. Firstly you need to decide the maximum length of > string that you want to store, then add one byte for the terminating NULL. > Finally you should use: > > > csprintf(DATA, "%S", " H2O Flo"); > > but be careful to note that you MUST use upper case 'S%' to indicate that > the string is in Flash only. > > > > *Gerhard at AMS wrote: > > > Hi All, > > This is rather a stupid question..... (I am even embarresed to ask this, > > instead of RTFM!!) > > I wish to declare a String Variable : StrName = (String of Char); > > Then I wish to somewhere in my prgm state > StrName = "Hello World"; > > I know you buffs know the 'how-to' by heart........ > > Please advise the of the correct ' how-to declare a string and use of ' > > for the above? > > Your help is appreciated > > Thanks, > > Gerhard > > > > > > *HTH > > John > > > * > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr > -- Paul Mateer, AA9GG Elan Engineering Corp. www.elanengr.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080507/d1109fc2/attachment.html From j_baraclough at zetnet.co.uk Wed May 7 12:42:51 2008 From: j_baraclough at zetnet.co.uk (John Baraclough) Date: Wed May 7 13:43:47 2008 Subject: [Icc-avr] help : String def In-Reply-To: <20f5efc40805071159o401b31e0iee087d46471834f4@mail.gmail.com> References: <003601c8b060$4aeeeba0$1f01a8c0@amsmainxp2> <4821F899.8050708@zetnet.co.uk> <20f5efc40805071159o401b31e0iee087d46471834f4@mail.gmail.com> Message-ID: <4822063B.4010204@zetnet.co.uk> In the 'printf()' library function which lies underneath 'csprintf()' a format string is mandatory and therefore you must use: csprintf(DATA, "%S", " H2O Flo"); Personally I would also remove the inline string by declaring it in a header file: _flash WaterFlowString = " H2O Flo"; and then using: csprintf(DATA, "%S", WaterFlowString); in the code file. HTH. All the best for now, John Paul Mateer wrote: > So which is correct (better?) between these two? > > On Wed, May 7, 2008 at 1:44 PM, John Baraclough > > wrote: > > John Woods wrote: > > Paul Mateer wrote: > > csprintf(DATA," H2O Flo"); > > > *This is the best method. Firstly you need to decide the maximum > length of string that you want to store, then add one byte for the > terminating NULL. Finally you should use: > > > csprintf(DATA, "%S", " H2O Flo"); > > but be careful to note that you MUST use upper case 'S%' to > indicate that the string is in Flash only. > > > > *Gerhard at AMS wrote: > > Hi All, > This is rather a stupid question..... (I am even embarresed to > ask this, instead of RTFM!!) > I wish to declare a String Variable : StrName = (String of > Char); Then I wish to somewhere in my prgm state > StrName = > "Hello World"; > I know you buffs know the 'how-to' by heart........ > Please advise the of the correct ' how-to declare a string > and use of ' for the above? > Your help is appreciated > Thanks, > Gerhard > > > > *HTH > > John > > > * > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr > > > > > -- > Paul Mateer, AA9GG > Elan Engineering Corp. > www.elanengr.com > ------------------------------------------------------------------------ > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr > From paul.aa9gg at gmail.com Wed May 7 12:59:47 2008 From: paul.aa9gg at gmail.com (Paul Mateer) Date: Wed May 7 14:00:40 2008 Subject: [Icc-avr] help : String def In-Reply-To: <4822063B.4010204@zetnet.co.uk> References: <003601c8b060$4aeeeba0$1f01a8c0@amsmainxp2> <4821F899.8050708@zetnet.co.uk> <20f5efc40805071159o401b31e0iee087d46471834f4@mail.gmail.com> <4822063B.4010204@zetnet.co.uk> Message-ID: <20f5efc40805071259wd2af38cnb480d88ad9947c0d@mail.gmail.com> Hmmmm..... I've been using this format for years now with no problems! I did try it with the format string, of course it worked too but added 4 bytes to my code. typically I do something like this: csprintf(DATA,"%#4.1f GPM",PULSE_FLOW); On Wed, May 7, 2008 at 2:42 PM, John Baraclough wrote: > In the 'printf()' library function which lies underneath 'csprintf()' a > format string is mandatory and therefore you must use: > > csprintf(DATA, "%S", " H2O Flo"); > > Personally I would also remove the inline string by declaring it in a > header file: > > _flash WaterFlowString = " H2O Flo"; > > and then using: > > csprintf(DATA, "%S", WaterFlowString); > > in the code file. > > HTH. > > All the best for now, > John > > > Paul Mateer wrote: > > > So which is correct (better?) between these two? > > > > On Wed, May 7, 2008 at 1:44 PM, John Baraclough < > > j_baraclough@zetnet.co.uk > wrote: > > > > John Woods wrote: > > > > Paul Mateer wrote: > > > > csprintf(DATA," H2O Flo"); > > > > > > *This is the best method. Firstly you need to decide the maximum > > length of string that you want to store, then add one byte for the > > terminating NULL. Finally you should use: > > > > > > csprintf(DATA, "%S", " H2O Flo"); > > > > but be careful to note that you MUST use upper case 'S%' to > > indicate that the string is in Flash only. > > > > > > > > *Gerhard at AMS wrote: > > > > Hi All, > > This is rather a stupid question..... (I am even embarresed to > > ask this, instead of RTFM!!) > > I wish to declare a String Variable : StrName = (String of > > Char); Then I wish to somewhere in my prgm state > StrName = > > "Hello World"; > > I know you buffs know the 'how-to' by heart........ > > Please advise the of the correct ' how-to declare a string > > and use of ' for the above? > > Your help is appreciated > > Thanks, > > Gerhard > > > > > > *HTH > > > > John > > > > > > * > > > > _______________________________________________ > > Icc-avr mailing list > > Icc-avr@imagecraft.com > > http://dragonsgate.net/mailman/listinfo/icc-avr > > > > > > > > > > -- > > Paul Mateer, AA9GG > > Elan Engineering Corp. > > www.elanengr.com > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Icc-avr mailing list > > Icc-avr@imagecraft.com > > http://dragonsgate.net/mailman/listinfo/icc-avr > > > > > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr > -- Paul Mateer, AA9GG Elan Engineering Corp. www.elanengr.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080507/43216735/attachment.html From jwbacon at comcast.net Wed May 7 17:36:06 2008 From: jwbacon at comcast.net (Jim Bacon) Date: Wed May 7 18:36:59 2008 Subject: [Icc-avr] help : String def In-Reply-To: <4821E6AF.4080306@idea-tech.com> References: <003601c8b060$4aeeeba0$1f01a8c0@amsmainxp2> <4821E6AF.4080306@idea-tech.com> Message-ID: <200805080136.m481av89047146@mail.imagecraft.com> I've been programming for 25 years, and I learned something new today (subtle difference between const char *string and const char string[] ) You rock, as the young'uns put it. At 11:28 AM 5/7/2008, you wrote: >Hi Gerhard, > >There are several ways to make a constant string variable. I use >different methods depending on the target environment. > >char *StrName = "Hello World"; > >// I never use this method on embedded CPUs because the pointer and >the string will both reside in RAM. > >const char *StrName = "Hello World"; > >// I use this quite often it tells the compiler its ok to put the >string in flash only (at least in the compilers I use). The >// disadvantage is that a pointer is still created in RAM. Depending >on the compiler you can put the pointer in flash >// by adding another const. > >const char StrName[] = "Hello World"; > >// This is my preferred method. In this case StrName is a symbol >only and takes up no memory (RAM or flash) >// but can still be used in the same manner as StrName in function >calls (e.g. strlen(StrName).) The big difference >// is that StrName cannot be reassigned a value. > > > >Gerhard at AMS wrote: >>Hi All, >>This is rather a stupid question..... >>(I am even embarresed to ask this, instead of RTFM!!) >> >>I wish to declare a String Variable : StrName = (String of Char); >> >>Then I wish to somewhere in my prgm state > StrName = "Hello World"; >> >>I know you buffs know the 'how-to' by heart........ >> >>Please advise the of the correct ' how-to declare a string and use >>of ' for the above? >>Your help is appreciated >> >>Thanks, >>Gerhard >> >> >> >> >> >>_______________________________________________ >>Icc-avr mailing list >>Icc-avr@imagecraft.com >>http://dragonsgate.net/mailman/listinfo/icc-avr >> > > >-- >John Woods Phone: (780) 431 1843 >Idea Technologies Inc. Fax: 1 866 293 5883 >6746 75 St. Email: >john@idea-tech.com >Edmonton, >Alberta, Web: www.idea-tech.com >Canada, T6E 6T9 >_______________________________________________ >Icc-avr mailing list >Icc-avr@imagecraft.com >http://dragonsgate.net/mailman/listinfo/icc-avr * Give me ambiguity or give me something else. * ***************************************************************** Jim Bacon jwbacon@comcast.net 303-666-9455 (H) 303-250-0160 (Cell) http://adams22.homeip.net -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080507/a8875fd9/attachment-0001.html From amsol at amssolutions.co.za Thu May 8 05:44:44 2008 From: amsol at amssolutions.co.za (Gerhard at AMS) Date: Thu May 8 06:47:51 2008 Subject: [Icc-avr] help : Mega16 PORTC Message-ID: <007c01c8b109$4d4552f0$1f01a8c0@amsmainxp2> Hi Everybody, A simple question.... CPU : Mega 16 pdip (5VCC) (VCC=AVCC) ICC Compiler : V6.28 Built Apr 29 2k3 17:49:25 (Yes Richard, old, but good workhorse for my apps and paid for... :) ) Port Connection > PC[0..7] configured as input with PU ena, ttl load connected Problem> PC4 (TDO) remains hi-impedance, even though PU enabled. I found reading a value from this port (PINC) result in incorrect readValues. header file Code Snippet > DDRA=0xff; //PORTA = o/p PORTA=0x00; //set PORTA bits=0 DDRC=0x00; //PORTC = i/p PORTC=0xff; //ena PU while(1) { ch=PINC; //read PORTC (should read 0xff) [ch defined as unsigned char] PORTA=ch; //wr ch to PORTA } Executing this > I measure on PORTC bits 0,1,2,3,5,6,7 = 1 bit 4=hiZ On PORTA I measure bits 0,1,6,7 = 1 bits 2,3,4,5 = 0 If I GND PORTC 0,1,6,7 the PORTA bits 0,1,6,7 respond correctly PORTA bits 2,3,4,5 remains=0 gnd or hi If I run the same routine substituting PORTC params in code with that of PORTD, doing the same test exhibit the correct results, as what I would expect. ie when PORTD 0..7 change, the corresponding bits change on PORTA 0..7 btw - I have NO loads connected to either port, just the cpu basic connections at this time..... However, at the time when I noticed the problem, I had a std stable ttl load on PORTC. I have used 4 new CPU's both Mega16 and Mega16L , same result? What am I doing wrong, or what don't I understand about what I am attempting to do? Please, please, I a pulling my hair (and I don't have a lot!) for the last 24hr without seeing the elephant in the room..... Any help will be appreciated. Regards, Gerhard Laubscher Electronic Engineer (Comms Officer) SANAE 47 OverWinter Team SANAE iv Base (71o40' S / 2o51' W) Check-out SANAE Base on Google Earth!! Antarctica Tel : +27-21-405 9428/29 Fax : +27-21-405 9432 (std rates) SattPhone : 008816 315 467 74 HF : 6.210 Mhz Skype : gerhardjl email : gerhard.laubscher@sanae.sanap.ac.za website : www.sanap.org.za/sanae_team.html -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080508/3614e83d/attachment.html From rohde at aragon-interactive.de Thu May 8 05:58:45 2008 From: rohde at aragon-interactive.de (Roman Rohde) Date: Thu May 8 07:06:00 2008 Subject: [Icc-avr] help : Mega16 PORTC In-Reply-To: <007c01c8b109$4d4552f0$1f01a8c0@amsmainxp2> References: <007c01c8b109$4d4552f0$1f01a8c0@amsmainxp2> Message-ID: possible JTAG-fuse enabled. Am Thu, 08 May 2008 14:44:44 +0200 schrieb Gerhard at AMS : > Hi Everybody, > A simple question.... > > CPU : Mega 16 pdip (5VCC) (VCC=AVCC) > ICC Compiler : V6.28 Built Apr 29 2k3 17:49:25 > (Yes Richard, old, but good workhorse for my apps > and paid for... :) ) > > Port Connection > PC[0..7] configured as input with PU ena, ttl load > connected > > Problem> PC4 (TDO) remains hi-impedance, even though PU enabled. I > found reading > a value from this port (PINC) result in incorrect readValues. > > header file > > Code Snippet > DDRA=0xff; //PORTA = o/p > PORTA=0x00; //set PORTA bits=0 > DDRC=0x00; //PORTC = i/p > PORTC=0xff; //ena PU > while(1) > { > ch=PINC; //read PORTC (should read 0xff) > [ch defined as unsigned char] > PORTA=ch; //wr ch to PORTA > } > > Executing this > I measure on PORTC bits 0,1,2,3,5,6,7 = 1 > bit 4=hiZ > On PORTA I measure bits 0,1,6,7 = 1 > bits 2,3,4,5 = > 0 > > If I GND PORTC 0,1,6,7 the PORTA bits 0,1,6,7 > respond correctly > PORTA bits 2,3,4,5 remains=0 gnd or hi > > If I run the same routine substituting PORTC params in code with that of > PORTD, doing the same test > exhibit the correct results, as what I would expect. ie when PORTD 0..7 > change, the corresponding > bits change on PORTA 0..7 > > btw - I have NO loads connected to either port, just the cpu basic > connections at this time..... > However, at the time when I noticed the problem, I had a std stable ttl > load on PORTC. > > I have used 4 new CPU's both Mega16 and Mega16L , same result? > > What am I doing wrong, or what don't I understand about what I am > attempting to do? > Please, please, I a pulling my hair (and I don't have a lot!) for the > last 24hr without > seeing the elephant in the room..... > > Any help will be appreciated. > > Regards, > Gerhard Laubscher > Electronic Engineer (Comms Officer) > SANAE 47 OverWinter Team > SANAE iv Base (71o40' S / 2o51' W) Check-out SANAE Base on Google > Earth!! > Antarctica > Tel : +27-21-405 9428/29 Fax : +27-21-405 9432 (std rates) > SattPhone : 008816 315 467 74 HF : 6.210 Mhz > Skype : gerhardjl > email : gerhard.laubscher@sanae.sanap.ac.za > website : www.sanap.org.za/sanae_team.html > > > > > > > > > From j_baraclough at zetnet.co.uk Thu May 8 06:18:08 2008 From: j_baraclough at zetnet.co.uk (John Baraclough) Date: Thu May 8 07:19:03 2008 Subject: [Icc-avr] help : Mega16 PORTC In-Reply-To: <007c01c8b109$4d4552f0$1f01a8c0@amsmainxp2> References: <007c01c8b109$4d4552f0$1f01a8c0@amsmainxp2> Message-ID: <4822FD90.5010102@zetnet.co.uk> It sounds like JTAG is enabled. What are your fuse settings? John Gerhard at AMS wrote: > Hi Everybody, > A simple question.... > > CPU : Mega 16 pdip (5VCC) (VCC=AVCC) > ICC Compiler : V6.28 Built Apr 29 2k3 17:49:25 > (Yes Richard, old, but good workhorse for my apps > and paid for... :) ) > > Port Connection > PC[0..7] configured as input with PU ena, ttl > load connected > > Problem> PC4 (TDO) remains hi-impedance, even though PU enabled. I > found reading > a value from this port (PINC) result in incorrect readValues. > > header file > > Code Snippet > DDRA=0xff; //PORTA = o/p > PORTA=0x00; //set PORTA bits=0 > DDRC=0x00; //PORTC = i/p > PORTC=0xff; //ena PU > while(1) > { > ch=PINC; //read PORTC (should read > 0xff) [ch defined as unsigned char] > PORTA=ch; //wr ch to PORTA > } > > Executing this > I measure on PORTC bits 0,1,2,3,5,6,7 = 1 > bit 4=hiZ > > On PORTA I measure bits 0,1,6,7 = 1 > bits 2,3,4,5 = 0 > > If I GND PORTC 0,1,6,7 the PORTA bits 0,1,6,7 > respond correctly > PORTA bits 2,3,4,5 remains=0 gnd or hi > > If I run the same routine substituting PORTC params in code with that > of PORTD, doing the same test > exhibit the correct results, as what I would expect. ie when PORTD > 0..7 change, the corresponding > bits change on PORTA 0..7 > > btw - I have NO loads connected to either port, just the cpu basic > connections at this time..... > However, at the time when I noticed the problem, I had a std stable > ttl load on PORTC. > > I have used 4 new CPU's both Mega16 and Mega16L , same result? > > What am I doing wrong, or what don't I understand about what I am > attempting to do? > Please, please, I a pulling my hair (and I don't have a lot!) for the > last 24hr without > seeing the elephant in the room..... > > Any help will be appreciated. > > Regards, > Gerhard Laubscher > Electronic Engineer (Comms Officer) > SANAE 47 OverWinter Team > SANAE iv Base (71o40' S / 2o51' W) Check-out SANAE Base on Google > Earth!! > Antarctica > Tel : +27-21-405 9428/29 Fax : +27-21-405 9432 (std rates) > SattPhone : 008816 315 467 74 HF : 6.210 Mhz > Skype : gerhardjl > email : gerhard.laubscher@sanae.sanap.ac.za > > website : www.sanap.org.za/sanae_team.html > > > > > > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr > From amsol at amssolutions.co.za Thu May 8 07:29:37 2008 From: amsol at amssolutions.co.za (Gerhard at AMS) Date: Thu May 8 08:32:45 2008 Subject: [Icc-avr] help : Mega16 PORTC References: <007c01c8b109$4d4552f0$1f01a8c0@amsmainxp2> <4822FD90.5010102@zetnet.co.uk> Message-ID: <009c01c8b117$f43f4350$1f01a8c0@amsmainxp2> Hi, Fuse settings read with icc = 0x99e1 which confirms the default fact settings accd to the Atmel d/s. This then confirms that the JTAGEN=0, which means that it is enabled, according to d/s. Accd to your suggestions, I should disable the JTAG fuse bit, thus JTAGEN=1 thus the new code > 0xd9e1 Using icc prgming inteface > Fuse bits R W using R feature i confirm reading > 0x99e1 =default=correct To disable JTAGEN, the code should be 0xd9e1 ? When I now change code for fusebits to 0xd9e1 (in window) and funct Fuse bits W to write When I power off/on and Fuse bits R i get 0x00e1 I expected 0xd9e1 I am confused, what am I doing wrong,plse? Thx, Gerhard Laubscher Electronic Engineer (Comms Officer) SANAE 47 OverWinter Team SANAE iv Base (71o40' S / 2o51' W) Check-out SANAE Base on Google Earth!! Antarctica Tel : +27-21-405 9428/29 Fax : +27-21-405 9432 (std rates) SattPhone : 008816 315 467 74 HF : 6.210 Mhz Skype : gerhardjl email : gerhard.laubscher@sanae.sanap.ac.za website : www.sanap.org.za/sanae_team.html ----- Original Message ----- From: John Baraclough To: Discussion list for ICCAVR and ICCtiny Users. You do NOT need tosubscribe to icc-announce if you are a member of this. Sent: Thursday, May 08, 2008 1:18 PM Subject: Re: [Icc-avr] help : Mega16 PORTC It sounds like JTAG is enabled. What are your fuse settings? John Gerhard at AMS wrote: > Hi Everybody, > A simple question.... > > CPU : Mega 16 pdip (5VCC) (VCC=AVCC) > ICC Compiler : V6.28 Built Apr 29 2k3 17:49:25 > (Yes Richard, old, but good workhorse for my apps > and paid for... :) ) > > Port Connection > PC[0..7] configured as input with PU ena, ttl > load connected > > Problem> PC4 (TDO) remains hi-impedance, even though PU enabled. I > found reading > a value from this port (PINC) result in incorrect readValues. > > header file > > Code Snippet > DDRA=0xff; //PORTA = o/p > PORTA=0x00; //set PORTA bits=0 > DDRC=0x00; //PORTC = i/p > PORTC=0xff; //ena PU > while(1) > { > ch=PINC; //read PORTC (should read > 0xff) [ch defined as unsigned char] > PORTA=ch; //wr ch to PORTA > } > > Executing this > I measure on PORTC bits 0,1,2,3,5,6,7 = 1 > bit 4=hiZ > > On PORTA I measure bits 0,1,6,7 = 1 > bits 2,3,4,5 = 0 > > If I GND PORTC 0,1,6,7 the PORTA bits 0,1,6,7 > respond correctly > PORTA bits 2,3,4,5 remains=0 gnd or hi > > If I run the same routine substituting PORTC params in code with that > of PORTD, doing the same test > exhibit the correct results, as what I would expect. ie when PORTD > 0..7 change, the corresponding > bits change on PORTA 0..7 > > btw - I have NO loads connected to either port, just the cpu basic > connections at this time..... > However, at the time when I noticed the problem, I had a std stable > ttl load on PORTC. > > I have used 4 new CPU's both Mega16 and Mega16L , same result? > > What am I doing wrong, or what don't I understand about what I am > attempting to do? > Please, please, I a pulling my hair (and I don't have a lot!) for the > last 24hr without > seeing the elephant in the room..... > > Any help will be appreciated. > > Regards, > Gerhard Laubscher > Electronic Engineer (Comms Officer) > SANAE 47 OverWinter Team > SANAE iv Base (71o40' S / 2o51' W) Check-out SANAE Base on Google > Earth!! > Antarctica > Tel : +27-21-405 9428/29 Fax : +27-21-405 9432 (std rates) > SattPhone : 008816 315 467 74 HF : 6.210 Mhz > Skype : gerhardjl > email : gerhard.laubscher@sanae.sanap.ac.za > > website : www.sanap.org.za/sanae_team.html > > > > > > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr > _______________________________________________ Icc-avr mailing list Icc-avr@imagecraft.com http://dragonsgate.net/mailman/listinfo/icc-avr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080508/9bf7ee3f/attachment-0001.html From amsol at amssolutions.co.za Thu May 8 08:38:23 2008 From: amsol at amssolutions.co.za (Gerhard at AMS) Date: Thu May 8 09:41:30 2008 Subject: [Icc-avr] Solved : Mega16 PORTC References: <007c01c8b109$4d4552f0$1f01a8c0@amsmainxp2><4822FD90.5010102@zetnet.co.uk> <009c01c8b117$f43f4350$1f01a8c0@amsmainxp2> Message-ID: <00ab01c8b121$8f6c5da0$1f01a8c0@amsmainxp2> Hi Everybody, Just feedback - Your suggestion of disabling the JTAG fuse bit solved the problem The fact default = JTAG enable fuse bits = 0x99e1 Disable JTAGEN new fuse bit setting 0xd9e1 = makes PORTC generic IO Thanks for your feedback, it helps a lot! Regards, Gerhard Laubscher Electronic Engineer (Comms Officer) SANAE 47 OverWinter Team SANAE iv Base (71o40' S / 2o51' W) Check-out SANAE Base on Google Earth!! Antarctica Tel : +27-21-405 9428/29 Fax : +27-21-405 9432 (std rates) SattPhone : 008816 315 467 74 HF : 6.210 Mhz Skype : gerhardjl email : gerhard.laubscher@sanae.sanap.ac.za website : www.sanap.org.za/sanae_team.html ----- Original Message ----- From: Gerhard at AMS To: Discussion list for ICCAVR and ICCtiny Users. You do NOT needtosubscribeto icc-announce if you are a member of this. Sent: Thursday, May 08, 2008 2:29 PM Subject: Re: [Icc-avr] help : Mega16 PORTC Hi, Fuse settings read with icc = 0x99e1 which confirms the default fact settings accd to the Atmel d/s. This then confirms that the JTAGEN=0, which means that it is enabled, according to d/s. Accd to your suggestions, I should disable the JTAG fuse bit, thus JTAGEN=1 thus the new code > 0xd9e1 Using icc prgming inteface > Fuse bits R W using R feature i confirm reading > 0x99e1 =default=correct To disable JTAGEN, the code should be 0xd9e1 ? When I now change code for fusebits to 0xd9e1 (in window) and funct Fuse bits W to write When I power off/on and Fuse bits R i get 0x00e1 I expected 0xd9e1 I am confused, what am I doing wrong,plse? Thx, Gerhard Laubscher Electronic Engineer (Comms Officer) SANAE 47 OverWinter Team SANAE iv Base (71o40' S / 2o51' W) Check-out SANAE Base on Google Earth!! Antarctica Tel : +27-21-405 9428/29 Fax : +27-21-405 9432 (std rates) SattPhone : 008816 315 467 74 HF : 6.210 Mhz Skype : gerhardjl email : gerhard.laubscher@sanae.sanap.ac.za website : www.sanap.org.za/sanae_team.html ----- Original Message ----- From: John Baraclough To: Discussion list for ICCAVR and ICCtiny Users. You do NOT need tosubscribe to icc-announce if you are a member of this. Sent: Thursday, May 08, 2008 1:18 PM Subject: Re: [Icc-avr] help : Mega16 PORTC It sounds like JTAG is enabled. What are your fuse settings? John Gerhard at AMS wrote: > Hi Everybody, > A simple question.... > > CPU : Mega 16 pdip (5VCC) (VCC=AVCC) > ICC Compiler : V6.28 Built Apr 29 2k3 17:49:25 > (Yes Richard, old, but good workhorse for my apps > and paid for... :) ) > > Port Connection > PC[0..7] configured as input with PU ena, ttl > load connected > > Problem> PC4 (TDO) remains hi-impedance, even though PU enabled. I > found reading > a value from this port (PINC) result in incorrect readValues. > > header file > > Code Snippet > DDRA=0xff; //PORTA = o/p > PORTA=0x00; //set PORTA bits=0 > DDRC=0x00; //PORTC = i/p > PORTC=0xff; //ena PU > while(1) > { > ch=PINC; //read PORTC (should read > 0xff) [ch defined as unsigned char] > PORTA=ch; //wr ch to PORTA > } > > Executing this > I measure on PORTC bits 0,1,2,3,5,6,7 = 1 > bit 4=hiZ > > On PORTA I measure bits 0,1,6,7 = 1 > bits 2,3,4,5 = 0 > > If I GND PORTC 0,1,6,7 the PORTA bits 0,1,6,7 > respond correctly > PORTA bits 2,3,4,5 remains=0 gnd or hi > > If I run the same routine substituting PORTC params in code with that > of PORTD, doing the same test > exhibit the correct results, as what I would expect. ie when PORTD > 0..7 change, the corresponding > bits change on PORTA 0..7 > > btw - I have NO loads connected to either port, just the cpu basic > connections at this time..... > However, at the time when I noticed the problem, I had a std stable > ttl load on PORTC. > > I have used 4 new CPU's both Mega16 and Mega16L , same result? > > What am I doing wrong, or what don't I understand about what I am > attempting to do? > Please, please, I a pulling my hair (and I don't have a lot!) for the > last 24hr without > seeing the elephant in the room..... > > Any help will be appreciated. > > Regards, > Gerhard Laubscher > Electronic Engineer (Comms Officer) > SANAE 47 OverWinter Team > SANAE iv Base (71o40' S / 2o51' W) Check-out SANAE Base on Google > Earth!! > Antarctica > Tel : +27-21-405 9428/29 Fax : +27-21-405 9432 (std rates) > SattPhone : 008816 315 467 74 HF : 6.210 Mhz > Skype : gerhardjl > email : gerhard.laubscher@sanae.sanap.ac.za > > website : www.sanap.org.za/sanae_team.html > > > > > > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr > _______________________________________________ Icc-avr mailing list Icc-avr@imagecraft.com http://dragonsgate.net/mailman/listinfo/icc-avr ------------------------------------------------------------------------------ _______________________________________________ Icc-avr mailing list Icc-avr@imagecraft.com http://dragonsgate.net/mailman/listinfo/icc-avr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080508/c51feb4f/attachment.html From amsol at amssolutions.co.za Thu May 8 08:41:57 2008 From: amsol at amssolutions.co.za (Gerhard at AMS) Date: Thu May 8 09:45:08 2008 Subject: [Icc-avr] re Lantronix XPORT device & AVR References: <007c01c8b109$4d4552f0$1f01a8c0@amsmainxp2><4822FD90.5010102@zetnet.co.uk> <009c01c8b117$f43f4350$1f01a8c0@amsmainxp2> Message-ID: <00b501c8b122$134543d0$1f01a8c0@amsmainxp2> Something else... Is there any groupmember using Lantronix's XPORT-03 devices in apps? It is a ethernet/serial convertor module with build-in xfrmr/RJ45 port/ ip setting etc as well as other bells&whistles Regards, Gerhard Laubscher Electronic Engineer (Comms Officer) SANAE 47 OverWinter Team SANAE iv Base (71o40' S / 2o51' W) Check-out SANAE Base on Google Earth!! Antarctica Tel : +27-21-405 9428/29 Fax : +27-21-405 9432 (std rates) SattPhone : 008816 315 467 74 HF : 6.210 Mhz Skype : gerhardjl email : gerhard.laubscher@sanae.sanap.ac.za website : www.sanap.org.za/sanae_team.html -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080508/e42ecc87/attachment.html From j_baraclough at zetnet.co.uk Thu May 8 08:50:13 2008 From: j_baraclough at zetnet.co.uk (John Baraclough) Date: Thu May 8 09:51:09 2008 Subject: [Icc-avr] help : Mega16 PORTC In-Reply-To: <009c01c8b117$f43f4350$1f01a8c0@amsmainxp2> References: <007c01c8b109$4d4552f0$1f01a8c0@amsmainxp2> <4822FD90.5010102@zetnet.co.uk> <009c01c8b117$f43f4350$1f01a8c0@amsmainxp2> Message-ID: <48232135.7080404@zetnet.co.uk> Hi Gerhard, Don't use the ICCAVR interface for programming the fuses but download Studio from the Atmel website and use that. You can programme the fuses by simply using checkboxes in the Studio user interface. HTH. John Gerhard at AMS wrote: > Hi, > Fuse settings read with icc = 0x99e1 which confirms the default fact > settings > accd to the Atmel d/s. This then confirms that the JTAGEN=0, which means > that it is enabled, according to d/s. Accd to your suggestions, I > should disable > the JTAG fuse bit, thus JTAGEN=1 thus the new code > 0xd9e1 > > Using icc prgming inteface > Fuse bits R W > using R feature i confirm reading > 0x99e1 =default=correct > > To disable JTAGEN, the code should be 0xd9e1 ? > When I now change code for fusebits to 0xd9e1 (in window) > and funct Fuse bits W to write > > When I power off/on and Fuse bits R i get 0x00e1 > I expected 0xd9e1 > > I am confused, what am I doing wrong,plse? > > Thx, > Gerhard Laubscher > Electronic Engineer (Comms Officer) > SANAE 47 OverWinter Team > SANAE iv Base (71o40' S / 2o51' W) Check-out SANAE Base on Google > Earth!! > Antarctica > Tel : +27-21-405 9428/29 Fax : +27-21-405 9432 (std rates) > SattPhone : 008816 315 467 74 HF : 6.210 Mhz > Skype : gerhardjl > email : gerhard.laubscher@sanae.sanap.ac.za > > website : www.sanap.org.za/sanae_team.html > > > From amsol at amssolutions.co.za Thu May 8 09:25:20 2008 From: amsol at amssolutions.co.za (Gerhard at AMS) Date: Thu May 8 10:28:25 2008 Subject: [Icc-avr] help : Mega16 PORTC References: <007c01c8b109$4d4552f0$1f01a8c0@amsmainxp2> <4822FD90.5010102@zetnet.co.uk><009c01c8b117$f43f4350$1f01a8c0@amsmainxp2> <48232135.7080404@zetnet.co.uk> Message-ID: <00c201c8b128$1e2b46e0$1f01a8c0@amsmainxp2> Hi John, That is exactly what I did using a serial AVR ISP device, thanks! My normal prgmr is a parallel port connected homegrown device though Regards Gjl ----- Original Message ----- From: John Baraclough To: Discussion list for ICCAVR and ICCtiny Users. You do NOT need tosubscribe to icc-announce if you are a member of this. Sent: Thursday, May 08, 2008 3:50 PM Subject: Re: [Icc-avr] help : Mega16 PORTC Hi Gerhard, Don't use the ICCAVR interface for programming the fuses but download Studio from the Atmel website and use that. You can programme the fuses by simply using checkboxes in the Studio user interface. HTH. John Gerhard at AMS wrote: > Hi, > Fuse settings read with icc = 0x99e1 which confirms the default fact > settings > accd to the Atmel d/s. This then confirms that the JTAGEN=0, which means > that it is enabled, according to d/s. Accd to your suggestions, I > should disable > the JTAG fuse bit, thus JTAGEN=1 thus the new code > 0xd9e1 > > Using icc prgming inteface > Fuse bits R W > using R feature i confirm reading > 0x99e1 =default=correct > > To disable JTAGEN, the code should be 0xd9e1 ? > When I now change code for fusebits to 0xd9e1 (in window) > and funct Fuse bits W to write > > When I power off/on and Fuse bits R i get 0x00e1 > I expected 0xd9e1 > > I am confused, what am I doing wrong,plse? > > Thx, > Gerhard Laubscher > Electronic Engineer (Comms Officer) > SANAE 47 OverWinter Team > SANAE iv Base (71o40' S / 2o51' W) Check-out SANAE Base on Google > Earth!! > Antarctica > Tel : +27-21-405 9428/29 Fax : +27-21-405 9432 (std rates) > SattPhone : 008816 315 467 74 HF : 6.210 Mhz > Skype : gerhardjl > email : gerhard.laubscher@sanae.sanap.ac.za > > website : www.sanap.org.za/sanae_team.html > > > _______________________________________________ Icc-avr mailing list Icc-avr@imagecraft.com http://dragonsgate.net/mailman/listinfo/icc-avr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080508/ba645d04/attachment.html From jassenbaum at htp-tel.de Thu May 8 10:19:04 2008 From: jassenbaum at htp-tel.de (Johannes Assenbaum) Date: Thu May 8 11:20:36 2008 Subject: [Icc-avr] re Lantronix XPORT device & AVR References: <4822FD90.5010102@zetnet.co.uk> <009c01c8b117$f43f4350$1f01a8c0@amsmainxp2> <00b501c8b122$134543d0$1f01a8c0@amsmainxp2> Message-ID: I know lantronix's UDS embedded device servers and like them very well. I did not use XPORT parts yet, but going to change this soon. Why do you ask? Best regards, Johannes > Something else... > Is there any groupmember using Lantronix's XPORT-03 devices in apps? > It is a ethernet/serial convertor module with build-in xfrmr/RJ45 port/ > ip setting etc as well as other bells&whistles > Regards, > Gerhard Laubscher > Electronic Engineer (Comms Officer) > SANAE 47 OverWinter Team > SANAE iv Base (71o40' S / 2o51' W) Check-out SANAE Base on Google Earth!! > Antarctica > Tel : +27-21-405 9428/29 Fax : +27-21-405 9432 (std rates) > SattPhone : 008816 315 467 74 HF : 6.210 Mhz > Skype : gerhardjl > email : gerhard.laubscher@sanae.sanap.ac.za > website : www.sanap.org.za/sanae_team.html From bobgardner at aol.com Thu May 8 10:23:16 2008 From: bobgardner at aol.com (bobgardner@aol.com) Date: Thu May 8 11:24:14 2008 Subject: [Icc-avr] re Lantronix XPORT device & AVR In-Reply-To: <00b501c8b122$134543d0$1f01a8c0@amsmainxp2> References: <007c01c8b109$4d4552f0$1f01a8c0@amsmainxp2><4822FD90.5010102@zetnet.co.uk> <009c01c8b117$f43f4350$1f01a8c0@amsmainxp2> <00b501c8b122$134543d0$1f01a8c0@amsmainxp2> Message-ID: <8CA7F4755EFD3B0-A74-4CD@mblk-d31.sysops.aol.com> I just shipped a mega1280 and an XPORT3. Ran the xport to uart1 at 230kbps, debug serial to uart0 at 115200 bps. Can you see the xport in Lantronix Device Installer? if so, you are 90% there -----Original Message----- From: Gerhard at AMS Sent: Thu, 8 May 2008 11:41 am Subject: [Icc-avr] re Lantronix XPORT device & AVR Something else... Is there any groupmember using Lantronix's XPORT-03 devices in apps? ? It is a ethernet/serial convertor module with build-in xfrmr/RJ45 port/ ip setting etc as well as other bells&whistles ? Regards, Gerhard Laubscher Electronic Engineer? (Comms Officer) SANAE 47 OverWinter Team SANAE iv Base? (71o40' S / 2o51' W)? Check-out SANAE Base on Google Earth!! Antarctica Tel : +27-21-405 9428/29???? Fax : +27-21-405 9432? (std rates) SattPhone : 008816 315 467 74????? HF : 6.210 Mhz Skype : gerhardjl email : gerhard.laubscher@sanae.sanap.ac.za website : www.sanap.org.za/sanae_team.html _______________________________________________ Icc-avr mailing list Icc-avr@imagecraft.com http://dragonsgate.net/mailman/listinfo/icc-avr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080508/ea52fe40/attachment.html From amsol at amssolutions.co.za Thu May 8 14:10:30 2008 From: amsol at amssolutions.co.za (Gerhard at AMS) Date: Thu May 8 15:13:39 2008 Subject: [Icc-avr] re Lantronix XPORT device & AVR References: <007c01c8b109$4d4552f0$1f01a8c0@amsmainxp2><4822FD90.5010102@zetnet.co.uk> <009c01c8b117$f43f4350$1f01a8c0@amsmainxp2><00b501c8b122$134543d0$1f01a8c0@amsmainxp2> <8CA7F4755EFD3B0-A74-4CD@mblk-d31.sysops.aol.com> Message-ID: <00df01c8b14f$f50494b0$1f01a8c0@amsmainxp2> Hi Guys, I got hold of the dev-kit and spare modules. I have an app in mind to connect a proc (avr) on the serial end of th eXPORT. The proc it to monitor certain params which it then requires to send as an email via the xPort to a recipient. Else the proc monitor certain params and then the end-user can browse the xPort and view/set these params, something like that... I see that one require Borland's C-compiler ver 5.02 if one which to do serious dev? I am just about in the dark of how to get going. Maybe someone can give some guidance etc. If you have advice or anything, contact me plse? Regards, Gerhard Laubscher Electronic Engineer (Comms Officer) SANAE 47 OverWinter Team SANAE iv Base (71o40' S / 2o51' W) Check-out SANAE Base on Google Earth!! Antarctica Tel : +27-21-405 9428/29 Fax : +27-21-405 9432 (std rates) SattPhone : 008816 315 467 74 HF : 6.210 Mhz Skype : gerhardjl email : gerhard.laubscher@sanae.sanap.ac.za website : www.sanap.org.za/sanae_team.html ----- Original Message ----- From: bobgardner@aol.com To: icc-avr@imagecraft.com Sent: Thursday, May 08, 2008 5:23 PM Subject: Re: [Icc-avr] re Lantronix XPORT device & AVR I just shipped a mega1280 and an XPORT3. Ran the xport to uart1 at 230kbps, debug serial to uart0 at 115200 bps. Can you see the xport in Lantronix Device Installer? if so, you are 90% there -----Original Message----- From: Gerhard at AMS Sent: Thu, 8 May 2008 11:41 am Subject: [Icc-avr] re Lantronix XPORT device & AVR Something else... Is there any groupmember using Lantronix's XPORT-03 devices in apps? It is a ethernet/serial convertor module with build-in xfrmr/RJ45 port/ ip setting etc as well as other bells&whistles Regards, Gerhard Laubscher Electronic Engineer (Comms Officer) SANAE 47 OverWinter Team SANAE iv Base (71o40' S / 2o51' W) Check-out SANAE Base on Google Earth!! Antarctica Tel : +27-21-405 9428/29 Fax : +27-21-405 9432 (std rates) SattPhone : 008816 315 467 74 HF : 6.210 Mhz Skype : gerhardjl email : gerhard.laubscher@sanae.sanap.ac.za website : www.sanap.org.za/sanae_team.html _______________________________________________ Icc-avr mailing list Icc-avr@imagecraft.com http://dragonsgate.net/mailman/listinfo/icc-avr ------------------------------------------------------------------------------ Plan your next roadtrip with MapQuest.com: America's #1 Mapping Site. ------------------------------------------------------------------------------ _______________________________________________ Icc-avr mailing list Icc-avr@imagecraft.com http://dragonsgate.net/mailman/listinfo/icc-avr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080508/c37db225/attachment.html From BobGardner at aol.com Thu May 8 15:40:41 2008 From: BobGardner at aol.com (BobGardner@aol.com) Date: Thu May 8 16:41:39 2008 Subject: [Icc-avr] re Lantronix XPORT device & AVR Message-ID: The xport is just a 'serial port to ethernet' converter. You can write and debug your whole avr program using the serial ports and solder on the xport the day before you ship. In a message dated 5/8/2008 5:14:08 P.M. Eastern Daylight Time, amsol@amssolutions.co.za writes: Hi Guys, I got hold of the dev-kit and spare modules. I have an app in mind to connect a proc (avr) on the serial end of th eXPORT. The proc it to monitor certain params which it then requires to send as an email via the xPort to a recipient. Else the proc monitor certain params and then the end-user can browse the xPort and view/set these params, something like that... I see that one require Borland's C-compiler ver 5.02 if one which to do serious dev? I am just about in the dark of how to get going. Maybe someone can give some guidance etc. If you have advice or anything, contact me plse? Regards, Gerhard Laubscher Electronic Engineer (Comms Officer) SANAE 47 OverWinter Team SANAE iv Base (71o40' S / 2o51' W) Check-out SANAE Base on Google Earth!! Antarctica Tel : +27-21-405 9428/29 Fax : +27-21-405 9432 (std rates) SattPhone : 008816 315 467 74 HF : 6.210 Mhz Skype : gerhardjl email : _gerhard.laubscher@sanae.sanap.ac.za_ (mailto:gerhard.laubscher@sanae.sanap.ac.za) website : _www.sanap.org.za/sanae_team.html_ (http://www.sanap.org.za/sanae_team.html) ----- Original Message ----- From: _bobgardner@aol.com_ (mailto:bobgardner@aol.com) To: _icc-avr@imagecraft.com_ (mailto:icc-avr@imagecraft.com) Sent: Thursday, May 08, 2008 5:23 PM Subject: Re: [Icc-avr] re Lantronix XPORT device & AVR I just shipped a mega1280 and an XPORT3. Ran the xport to uart1 at 230kbps, debug serial to uart0 at 115200 bps. Can you see the xport in Lantronix Device Installer? if so, you are 90% there -----Original Message----- From: Gerhard at AMS <_amsol@amssolutions.co.za_ (mailto:amsol@amssolutions.co.za) > Sent: Thu, 8 May 2008 11:41 am Subject: [Icc-avr] re Lantronix XPORT device & AVR Something else... Is there any groupmember using Lantronix's XPORT-03 devices in apps? It is a ethernet/serial convertor module with build-in xfrmr/RJ45 port/ ip setting etc as well as other bells&whistles Regards, Gerhard Laubscher Electronic Engineer (Comms Officer) SANAE 47 OverWinter Team SANAE iv Base (71o40' S / 2o51' W) Check-out SANAE Base on Google Earth!! Antarctica Tel : +27-21-405 9428/29 Fax : +27-21-405 9432 (std rates) SattPhone : 008816 315 467 74 HF : 6.210 Mhz Skype : gerhardjl email : _gerhard.laubscher@sanae.sanap.ac.za_ (mailto:gerhard.laubscher@sanae.sanap.ac.za) website : _www.sanap.org.za/sanae_team.html_ (http://www.sanap.org.za/sanae_team.html) _______________________________________________ Icc-avr mailing list _Icc-avr@imagecraft.com_ (mailto:Icc-avr@imagecraft.com) _http://dragonsgate.net/mailman/listinfo/icc-avr_ (http://dragonsgate.net/mailman/listinfo/icc-avr) ____________________________________ Plan your next roadtrip with _MapQuest.com_ (http://www.mapquest.com/?ncid=mpqmap00030000000004) : America's #1 Mapping Site. ____________________________________ _______________________________________________ Icc-avr mailing list Icc-avr@imagecraft.com http://dragonsgate.net/mailman/listinfo/icc-avr _______________________________________________ Icc-avr mailing list Icc-avr@imagecraft.com http://dragonsgate.net/mailman/listinfo/icc-avr **************Wondering what's for Dinner Tonight? Get new twists on family favorites at AOL Food. (http://food.aol.com/dinner-tonight?NCID=aolfod00030000000001) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080508/b67c906b/attachment.html From hr_iccavr at srel.de Fri May 9 03:28:59 2008 From: hr_iccavr at srel.de (Hartmut Reinke) Date: Fri May 9 04:31:27 2008 Subject: [Icc-avr] re Lantronix XPORT device & AVR In-Reply-To: <00df01c8b14f$f50494b0$1f01a8c0@amsmainxp2> References: <007c01c8b109$4d4552f0$1f01a8c0@amsmainxp2><4822FD90.5010102@zetnet.co.uk> <009c01c8b117$f43f4350$1f01a8c0@amsmainxp2><00b501c8b122$134543d0$1f01a8c0@amsmainxp2> <8CA7F4755EFD3B0-A74-4CD@mblk-d31.sysops.aol.com> <00df01c8b14f$f50494b0$1f01a8c0@amsmainxp2> Message-ID: <4824276B.7030307@srel.de> I think, you will not need to write any Code with Borland C. If you want to communicate with your ATmega, just do it by opening a tcp-socket from your PC to the Xport via port 10001. If you have default settings, the Xport will send any date from the socket to its serial port and vice versa (9600Bd/8-n-1). If you want to communicate via Webbrowser, you may load a Java Applet onto your Xport (replacing the default-Applet, used for Configuration) This applet may open a socket to port 10001 and communicate with your ATmega whatever way you want. This is all easy, as long as you use static IP-Addresses within a local network. If you want to communicate over the Internet, things become more difficult, because you must find out the IP address first. My solution was, to let the Xport initiate the socket to an external HTTP-server with a known public IP (Xport supports modem-like AT-Commands). DNS is not supported by the Xport, an it may be quite cumbersome to implement via the serial port, although not impossible. This may be helpful to start: http://www.lantronix.com/learning/wp_check.php?file_name=Web-Enabling-Using-Java_WP.pdf Hartmut Reinke Gerhard at AMS schrieb: > Hi Guys, > I got hold of the dev-kit and spare modules. I have an app in mind to > connect a proc (avr) on the serial end of th eXPORT. The proc it to > monitor certain params which it then requires to send as an email via > the xPort to a recipient. Else the proc monitor certain params and then > the end-user can browse the xPort and view/set these params, something > like that... I see that one require Borland's C-compiler ver 5.02 if one > which to do serious dev? I am just about in the dark of how to get > going. Maybe someone can give some guidance etc. If you have advice or > anything, contact me plse? > Regards, > Gerhard Laubscher > Electronic Engineer (Comms Officer) > SANAE 47 OverWinter Team > SANAE iv Base (71o40' S / 2o51' W) Check-out SANAE Base on Google Earth!! > Antarctica > Tel : +27-21-405 9428/29 Fax : +27-21-405 9432 (std rates) > SattPhone : 008816 315 467 74 HF : 6.210 Mhz > Skype : gerhardjl > email : gerhard.laubscher@sanae.sanap.ac.za > > website : www.sanap.org.za/sanae_team.html > > > ----- Original Message ----- > *From:* bobgardner@aol.com > *To:* icc-avr@imagecraft.com > *Sent:* Thursday, May 08, 2008 5:23 PM > *Subject:* Re: [Icc-avr] re Lantronix XPORT device & AVR > > I just shipped a mega1280 and an XPORT3. Ran the xport to uart1 at > 230kbps, debug serial to uart0 at 115200 bps. Can you see the xport > in Lantronix Device Installer? if so, you are 90% there > > > -----Original Message----- > From: Gerhard at AMS > > Sent: Thu, 8 May 2008 11:41 am > Subject: [Icc-avr] re Lantronix XPORT device & AVR > > Something else... > Is there any groupmember using Lantronix's XPORT-03 devices in apps? > It is a ethernet/serial convertor module with build-in xfrmr/RJ45 > port/ > ip setting etc as well as other bells&whistles > > Regards, > Gerhard Laubscher > Electronic Engineer (Comms Officer) > SANAE 47 OverWinter Team > SANAE iv Base (71o40' S / 2o51' W) Check-out SANAE Base on Google > Earth!! > Antarctica > Tel : +27-21-405 9428/29 Fax : +27-21-405 9432 (std rates) > SattPhone : 008816 315 467 74 HF : 6.210 Mhz > Skype : gerhardjl > email : gerhard.laubscher@sanae.sanap.ac.za > > website : www.sanap.org.za/sanae_team.html > > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr > > ------------------------------------------------------------------------ > Plan your next roadtrip with MapQuest.com > : America's #1 > Mapping Site. > > ------------------------------------------------------------------------ > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr > > > ------------------------------------------------------------------------ > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr From richard at imagecraft.com Fri May 9 03:48:18 2008 From: richard at imagecraft.com (Richard Man) Date: Fri May 9 04:51:53 2008 Subject: [Icc-avr] V7.17 BETA1 Message-ID: <200805091151.m49Bpq98090742@mail.imagecraft.com> I think this is one of the longest projects we have done - we must have started doing the 64-bit double support back in, I don't know, 2004 or so, and it kept just getting derailed. I am happy to saqy that it appears to be working quite well now. Relatively slow of course on an AVR, but if you need it, here it is (on the PRO version). http://www.imagecraft.com/pub/iccv7avr_v717_beta1.exe From the readme file: V7.17 [ PRO only: 64 bits FP is now fully supported in the C level. For printing, you can use char *d2a(double d); full support for printf and high level math functions sin/cos/... will be done in the next release. ] IDE - Added Project->Options->Projecti->"Makefile Options" of two choices "Relative Paths" or "Absolute Paths" - Added device support for xmega64, xmega128, xmega192, and xmega256 - Simplified Project->Options->Target by replacing several checkboxes with an "Instruction Set" architecture drop box - [ Application Builder ] Added T261 - Added entries for XMega64, XM128, XM256 - Terminal support cleanup and minor GUI enhancements. Compiler - Added -MXmega with basic XMega support. - Added -dfp for double fp. - Debug info for __flash was broken. Header Files - Added M32C1, M32M1, M64C1, M64M1, M32U4 - Added ioxm128A1v.h and ioxm64A1v.h for ATxmega // richard On-line orders, support, and listservers available on web site. [ For technical support on ImageCraft products, please include all previous replies in your msgs. ] From amsol at amssolutions.co.za Fri May 9 03:56:45 2008 From: amsol at amssolutions.co.za (Gerhard at AMS) Date: Fri May 9 05:00:07 2008 Subject: [Icc-avr] re Lantronix XPORT device & AVR References: <007c01c8b109$4d4552f0$1f01a8c0@amsmainxp2><4822FD90.5010102@zetnet.co.uk> <009c01c8b117$f43f4350$1f01a8c0@amsmainxp2><00b501c8b122$134543d0$1f01a8c0@amsmainxp2> <8CA7F4755EFD3B0-A74-4CD@mblk-d31.sysops.aol.com><00df01c8b14f$f50494b0$1f01a8c0@amsmainxp2> <4824276B.7030307@srel.de> Message-ID: <011501c8b1c3$680bc500$1f01a8c0@amsmainxp2> Hi Hartmut, Thx for the feedback! Regards, Gerhard Laubscher Electronic Engineer (Comms Officer) SANAE 47 OverWinter Team SANAE iv Base (71o40' S / 2o51' W) Check-out SANAE Base on Google Earth!! Antarctica Tel : +27-21-405 9428/29 Fax : +27-21-405 9432 (std rates) SattPhone : 008816 315 467 74 HF : 6.210 Mhz Skype : gerhardjl email : gerhard.laubscher@sanae.sanap.ac.za website : www.sanap.org.za/sanae_team.html ----- Original Message ----- From: Hartmut Reinke To: Discussion list for ICCAVR and ICCtiny Users. You do NOT need tosubscribe to icc-announce if you are a member of this. Sent: Friday, May 09, 2008 10:28 AM Subject: Re: [Icc-avr] re Lantronix XPORT device & AVR I think, you will not need to write any Code with Borland C. If you want to communicate with your ATmega, just do it by opening a tcp-socket from your PC to the Xport via port 10001. If you have default settings, the Xport will send any date from the socket to its serial port and vice versa (9600Bd/8-n-1). If you want to communicate via Webbrowser, you may load a Java Applet onto your Xport (replacing the default-Applet, used for Configuration) This applet may open a socket to port 10001 and communicate with your ATmega whatever way you want. This is all easy, as long as you use static IP-Addresses within a local network. If you want to communicate over the Internet, things become more difficult, because you must find out the IP address first. My solution was, to let the Xport initiate the socket to an external HTTP-server with a known public IP (Xport supports modem-like AT-Commands). DNS is not supported by the Xport, an it may be quite cumbersome to implement via the serial port, although not impossible. This may be helpful to start: http://www.lantronix.com/learning/wp_check.php?file_name=Web-Enabling-Using-Java_WP.pdf Hartmut Reinke Gerhard at AMS schrieb: > Hi Guys, > I got hold of the dev-kit and spare modules. I have an app in mind to > connect a proc (avr) on the serial end of th eXPORT. The proc it to > monitor certain params which it then requires to send as an email via > the xPort to a recipient. Else the proc monitor certain params and then > the end-user can browse the xPort and view/set these params, something > like that... I see that one require Borland's C-compiler ver 5.02 if one > which to do serious dev? I am just about in the dark of how to get > going. Maybe someone can give some guidance etc. If you have advice or > anything, contact me plse? > Regards, > Gerhard Laubscher > Electronic Engineer (Comms Officer) > SANAE 47 OverWinter Team > SANAE iv Base (71o40' S / 2o51' W) Check-out SANAE Base on Google Earth!! > Antarctica > Tel : +27-21-405 9428/29 Fax : +27-21-405 9432 (std rates) > SattPhone : 008816 315 467 74 HF : 6.210 Mhz > Skype : gerhardjl > email : gerhard.laubscher@sanae.sanap.ac.za > > website : www.sanap.org.za/sanae_team.html > > > ----- Original Message ----- > *From:* bobgardner@aol.com > *To:* icc-avr@imagecraft.com > *Sent:* Thursday, May 08, 2008 5:23 PM > *Subject:* Re: [Icc-avr] re Lantronix XPORT device & AVR > > I just shipped a mega1280 and an XPORT3. Ran the xport to uart1 at > 230kbps, debug serial to uart0 at 115200 bps. Can you see the xport > in Lantronix Device Installer? if so, you are 90% there > > > -----Original Message----- > From: Gerhard at AMS > > Sent: Thu, 8 May 2008 11:41 am > Subject: [Icc-avr] re Lantronix XPORT device & AVR > > Something else... > Is there any groupmember using Lantronix's XPORT-03 devices in apps? > It is a ethernet/serial convertor module with build-in xfrmr/RJ45 > port/ > ip setting etc as well as other bells&whistles > > Regards, > Gerhard Laubscher > Electronic Engineer (Comms Officer) > SANAE 47 OverWinter Team > SANAE iv Base (71o40' S / 2o51' W) Check-out SANAE Base on Google > Earth!! > Antarctica > Tel : +27-21-405 9428/29 Fax : +27-21-405 9432 (std rates) > SattPhone : 008816 315 467 74 HF : 6.210 Mhz > Skype : gerhardjl > email : gerhard.laubscher@sanae.sanap.ac.za > > website : www.sanap.org.za/sanae_team.html > > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr > > ------------------------------------------------------------------------ > Plan your next roadtrip with MapQuest.com > : America's #1 > Mapping Site. > > ------------------------------------------------------------------------ > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr > > > ------------------------------------------------------------------------ > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr _______________________________________________ Icc-avr mailing list Icc-avr@imagecraft.com http://dragonsgate.net/mailman/listinfo/icc-avr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080509/97fa49bc/attachment.html From richard at imagecraft.com Mon May 12 00:21:14 2008 From: richard at imagecraft.com (Richard Man) Date: Mon May 12 01:24:59 2008 Subject: [Icc-avr] ICCAVR V7.17 released Message-ID: <200805120824.m4C8Oufn064496@mail.imagecraft.com> ICCV7 for AVR V71.7 has been released. From the readme file: 7.17 - May 12th 2008 [ PRO only: 64 bits FP is now fully supported in the C level. For printing, you can use char *d2a(double d); full support for printf and high level math functions sin/cos/... will be done in the next release. ] IDE - Added Project->Options->Projecti->"Makefile Options" of two choices "Relative Paths" or "Absolute Paths" - Added device support for xmega64, xmega128, xmega192, and xmega256 - Simplified Project->Options->Target by replacing several checkboxes with an "Instruction Set" architecture drop box - [ Application Builder ] Added T261 - Added entries for XMega64, XM128, XM256 - Terminal support cleanup and minor GUI enhancements. Compiler - Added -MXmega with basic XMega support. - Added -dfp for double fp. - Debug info for __flash was broken. Header Files - Added M32C1, M32M1, M64C1, M64M1, M32U4 - Added ioxm128A1v.h and ioxm64A1v.h for ATxmega // richard On-line orders, support, and listservers available on web site. [ For technical support on ImageCraft products, please include all previous replies in your msgs. ] From andrew_166 at msn.com Mon May 12 14:39:21 2008 From: andrew_166 at msn.com (Andrew) Date: Mon May 12 15:40:18 2008 Subject: [Icc-avr] ICCAVR 7.17 Help References: <20080421123449.8zn8y91kwp6o0w4o@webmail.htp.net> Message-ID: Hi I have downloaded the new ICCAVR 7.17 from the imagecraft website. i have tried to compile a current project and i get the following errors. although apart from the errors the project finishes compiling and seems to run fine: - E .\..\..!\..\..\..\..\..\..\..\DOCUME~1\Andy\MYDOCU~1\Work\PROJEC~1\ATMELA~1\SCANLI~1\Firmware\SCANLI~2\config.c(24): cannot include source file "config.h"; file not found !E .\..\..\..\..\..\..\..\..\..\DOCUME~1\Andy\MYDOCU~1\Work\PROJEC~1\ATMELA~1\SCANLI~1\Firmware\SCANLI~2\Data_Shift.c(25): cannot include source file "defines.h"; file not found !E .\..\..\..\..\..\..\..\..\..\DOCUME~1\Andy\MYDOCU~1\Work\PROJEC~1\ATMELA~1\SCANLI~1\Firmware\SCANLI~2\main.c(28): cannot include source file "config.h"; file not found !E .\..\..\..\..\..\..\..\..\..\DOCUME~1\Andy\MYDOCU~1\Work\PROJEC~1\ATMELA~1\SCANLI~1\Firmware\SCANLI~2\uart.c(34): cannot include source file "uart.h"; file not found I have tried creating a new project and added my .c and ..h files to the new project and re-compiled, this also produces the above errors, can anybody help ? Note; this compiled fine with 7.16A, Andy From paul.aa9gg at gmail.com Mon May 12 14:43:31 2008 From: paul.aa9gg at gmail.com (Paul Mateer) Date: Mon May 12 15:44:30 2008 Subject: [Icc-avr] ICCAVR 7.17 Help In-Reply-To: References: <20080421123449.8zn8y91kwp6o0w4o@webmail.htp.net> Message-ID: <20f5efc40805121443j2a758f8du6de4472d25c1678a@mail.gmail.com> Path issue??? On Mon, May 12, 2008 at 4:39 PM, Andrew wrote: > Hi > > > > I have downloaded the new ICCAVR 7.17 from the imagecraft website. i have > tried to compile a current project and i get the following errors. although > apart from the errors the project finishes compiling and seems to run fine: > - > > > > E > .\..\..!\..\..\..\..\..\..\..\DOCUME~1\Andy\MYDOCU~1\Work\PROJEC~1\ATMELA~1\SCANLI~1\Firmware\SCANLI~2\config.c(24): > cannot include source file "config.h"; file not found > !E > .\..\..\..\..\..\..\..\..\..\DOCUME~1\Andy\MYDOCU~1\Work\PROJEC~1\ATMELA~1\SCANLI~1\Firmware\SCANLI~2\Data_Shift.c(25): > cannot include source file "defines.h"; file not found > !E > .\..\..\..\..\..\..\..\..\..\DOCUME~1\Andy\MYDOCU~1\Work\PROJEC~1\ATMELA~1\SCANLI~1\Firmware\SCANLI~2\main.c(28): > cannot include source file "config.h"; file not found > !E > .\..\..\..\..\..\..\..\..\..\DOCUME~1\Andy\MYDOCU~1\Work\PROJEC~1\ATMELA~1\SCANLI~1\Firmware\SCANLI~2\uart.c(34): > cannot include source file "uart.h"; file not found > > > > > I have tried creating a new project and added my .c and ..h files to the > new project and re-compiled, this also produces the above errors, can > anybody help ? > > > > Note; this compiled fine with 7.16A, > > > > Andy > > > > > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr > -- Paul Mateer, AA9GG Elan Engineering Corp. www.elanengr.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080512/e0ca1ca8/attachment.html From andrew_166 at msn.com Mon May 12 14:44:01 2008 From: andrew_166 at msn.com (Andrew) Date: Mon May 12 15:44:58 2008 Subject: [Icc-avr] SPI USART Message-ID: Hi, I have the USART working in SPI master mode. I need to send 32Bits (LONG) to it. So i have written the following function : - Code: void USART_Transmitt (unsigned char Data) { while ( !( UCSR2A & (1<> 24)); USART_Transmitt ((mydata >> 16)); USART_Transmitt ((mydata >> 8)); USART_Transmitt ((mydata)); } My question is: - Is there a more efficient way of writing the above function? (To make the code execute faster i.e. a small gap between USART_Transmitt ((mydata >> 16)); and USART_Transmitt ((mydata >> 8); for example) I know I cannot make the USART_Transmitt function faster but can I make the data shifting execute faster? Many Thanks, Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080512/92fe21a8/attachment.html From andrew_166 at msn.com Mon May 12 15:29:47 2008 From: andrew_166 at msn.com (Andrew) Date: Mon May 12 16:30:43 2008 Subject: [Icc-avr] ICCAVR 7.17 Help References: <20080421123449.8zn8y91kwp6o0w4o@webmail.htp.net> <20f5efc40805121443j2a758f8du6de4472d25c1678a@mail.gmail.com> Message-ID: Hi, I have tried creating a new folder and placing my .c and .h files into it. Then i created a new project in 7.17 which i saved in the same file, then added all the .c and h files and i still get the errors. ANdy ----- Original Message ----- From: Paul Mateer To: Discussion list for ICCAVR and ICCtiny Users. You do NOT need tosubscribe to icc-announce if you are a member of this. Sent: Monday, May 12, 2008 10:43 PM Subject: Re: [Icc-avr] ICCAVR 7.17 Help Path issue??? On Mon, May 12, 2008 at 4:39 PM, Andrew wrote: Hi I have downloaded the new ICCAVR 7.17 from the imagecraft website. i have tried to compile a current project and i get the following errors. although apart from the errors the project finishes compiling and seems to run fine: - E \..\..!\..\..\..\..\..\..\..\DOCUME~1\Andy\MYDOCU~1\Work\PROJEC~1\ATMELA~1\SCANLI~1\Firmware\SCANLI~2\config.c(24): cannot include source file "config.h"; file not found !E \..\..\..\..\..\..\..\..\..\DOCUME~1\Andy\MYDOCU~1\Work\PROJEC~1\ATMELA~1\SCANLI~1\Firmware\SCANLI~2\Data_Shift.c(25): cannot include source file "defines.h"; file not found !E \..\..\..\..\..\..\..\..\..\DOCUME~1\Andy\MYDOCU~1\Work\PROJEC~1\ATMELA~1\SCANLI~1\Firmware\SCANLI~2\main.c(28): cannot include source file "config.h"; file not found !E \..\..\..\..\..\..\..\..\..\DOCUME~1\Andy\MYDOCU~1\Work\PROJEC~1\ATMELA~1\SCANLI~1\Firmware\SCANLI~2\uart.c(34): cannot include source file "uart.h"; file not found I have tried creating a new project and added my .c and ..h files to the new project and re-compiled, this also produces the above errors, can anybody help ? Note; this compiled fine with 7.16A, Andy _______________________________________________ Icc-avr mailing list Icc-avr@imagecraft.com http://dragonsgate.net/mailman/listinfo/icc-avr -- Paul Mateer, AA9GG Elan Engineering Corp. www.elanengr.com ------------------------------------------------------------------------------ _______________________________________________ Icc-avr mailing list Icc-avr@imagecraft.com http://dragonsgate.net/mailman/listinfo/icc-avr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080512/31d20893/attachment.html From richard-lists at imagecraft.com Mon May 12 16:00:51 2008 From: richard-lists at imagecraft.com (Richard Man) Date: Mon May 12 17:04:37 2008 Subject: [Icc-avr] ICCAVR 7.17 Help In-Reply-To: References: <20080421123449.8zn8y91kwp6o0w4o@webmail.htp.net> <20f5efc40805121443j2a758f8du6de4472d25c1678a@mail.gmail.com> Message-ID: <200805130004.m4D04aGL080275@mail.imagecraft.com> An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080512/dfa7998b/attachment-0001.html From benra at imt.liu.se Mon May 12 23:48:28 2008 From: benra at imt.liu.se (Bengt Ragnemalm) Date: Tue May 13 00:49:28 2008 Subject: SV: [Icc-avr] SPI USART In-Reply-To: References: Message-ID: Some hints: To make the USART send the data faster you can take care of the shifting in advance and put in local variables but this won?t make the code go faster, only the transmission. I see that the USART_Transmitt also receives data. Is this always necessary? The most typical method of making the shift faster is to create a struct of the long variable so you can reach the individual bytes. A struct is compiler dependent but as long as you don?t want the code to execute on another microcontroller family than AVR this should be no problem. To make code execute faster, take a careful look at you functions. Maybe you can skip some of them or send a pointer instead of data as parameters. Sometimes a macro could be used. For example #define SEND_GREEN mydata USART_TRANSMIT(mydata>>24);USARTTRANSMIT(mydata>> .. But I would avoid macros as they are very frustrating if you debug with Studio. Better may be to skip SendGreen and write the four lines in you code. If you have FLASH and need speed so to say. Turn of the code compressor if you need speed. /Bengt _____ Fr?n: icc-avr-bounces@imagecraft.com [mailto:icc-avr-bounces@imagecraft.com] F?r Andrew Skickat: den 12 maj 2008 23:44 Till: Discussion list for ICCAVR and ICCtiny Users. You do NOT needtosubscribeto icc-announce if you are a member of this. ?mne: [Icc-avr] SPI USART Hi, I have the USART working in SPI master mode. I need to send 32Bits (LONG) to it. So i have written the following function : - Code: void USART_Transmitt (unsigned char Data) { while ( !( UCSR2A & (1<> 24)); USART_Transmitt ((mydata >> 16)); USART_Transmitt ((mydata >> 8)); USART_Transmitt ((mydata)); } My question is: - Is there a more efficient way of writing the above function? (To make the code execute faster i.e. a small gap between USART_Transmitt ((mydata >> 16)); and USART_Transmitt ((mydata >> 8); for example) I know I cannot make the USART_Transmitt function faster but can I make the data shifting execute faster? Many Thanks, Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080513/fdfd2731/attachment.html From andrew_166 at msn.com Tue May 13 03:11:04 2008 From: andrew_166 at msn.com (Andrew) Date: Tue May 13 04:11:50 2008 Subject: [Icc-avr] SPI USART References: Message-ID: Hi /Bengt, I think shifting is the only way as I need to constantly change the data being sent out through the USART in SPI Mode. So I cannot use structures. I have removed the receive data command from the function:- CODE START: void USART_Transmitt_Green (unsigned char Data) { while ( !( UCSR3A & (1<>24);USARTTRANSMIT(mydata>>... But I would avoid macros as they are very frustrating if you debug with Studio. Better may be to skip SendGreen and write the four lines in you code. If you have FLASH and need speed so to say. Turn of the code compressor if you need speed. /Bengt ------------------------------------------------------------------------------ Fr?n: icc-avr-bounces@imagecraft.com [mailto:icc-avr-bounces@imagecraft.com] F?r Andrew Skickat: den 12 maj 2008 23:44 Till: Discussion list for ICCAVR and ICCtiny Users. You do NOT needtosubscribeto icc-announce if you are a member of this. ?mne: [Icc-avr] SPI USART Hi, I have the USART working in SPI master mode. I need to send 32Bits (LONG) to it. So i have written the following function : - Code: void USART_Transmitt (unsigned char Data) { while ( !( UCSR2A & (1<> 24)); USART_Transmitt ((mydata >> 16)); USART_Transmitt ((mydata >> 8)); USART_Transmitt ((mydata)); } My question is: - Is there a more efficient way of writing the above function? (To make the code execute faster i.e. a small gap between USART_Transmitt ((mydata >> 16)); and USART_Transmitt ((mydata >> 8); for example) I know I cannot make the USART_Transmitt function faster but can I make the data shifting execute faster? Many Thanks, Andy ------------------------------------------------------------------------------ _______________________________________________ Icc-avr mailing list Icc-avr@imagecraft.com http://dragonsgate.net/mailman/listinfo/icc-avr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080513/c25a381f/attachment-0001.html From j_baraclough at zetnet.co.uk Tue May 13 06:01:29 2008 From: j_baraclough at zetnet.co.uk (John Baraclough) Date: Tue May 13 07:02:28 2008 Subject: [Icc-avr] SPI USART In-Reply-To: References: Message-ID: <48299129.3080803@zetnet.co.uk> Sorry Andy, but that statement doesn't make sense. What Bengt ws talking about is something like this: typedef union { long LongValue; char CharValue[4]; } SpiData; SpiData Buffer; In your code: Buffer.LongValue = 0x12345678; void Send_Green (unsigned long mydata) { USART_Transmitt (Buffer.CharValue[3]); USART_Transmitt (Buffer.CharValue[2]); USART_Transmitt (Buffer.CharValue[1]); USART_Transmitt (Buffer.CharValue[0]); } HTH John Andrew wrote: > > Hi /Bengt, > > > > I think shifting is the only way as I need to constantly change the > data being sent out through the USART in SPI Mode. So I cannot use > structures. I have removed the receive data command from the function:- > > > From andrew_166 at msn.com Tue May 13 06:20:23 2008 From: andrew_166 at msn.com (Andrew) Date: Tue May 13 07:21:05 2008 Subject: [Icc-avr] SPI USART References: <48299129.3080803@zetnet.co.uk> Message-ID: Hi John, Sorry never used type defines like that before, in fact come to think of it i have never really used type defines at all. Is that much faster than bit shifting? Thansk, Andy ----- Original Message ----- From: "John Baraclough" To: "Discussion list for ICCAVR and ICCtiny Users. You do NOT need tosubscribe to icc-announce if you are a member of this." Sent: Tuesday, May 13, 2008 2:01 PM Subject: Re: [Icc-avr] SPI USART > Sorry Andy, but that statement doesn't make sense. What Bengt ws talking > about is something like this: > > typedef union { > long LongValue; > char CharValue[4]; > } SpiData; > > SpiData Buffer; > > > > In your code: > > Buffer.LongValue = 0x12345678; > > void Send_Green (unsigned long mydata) > { > USART_Transmitt (Buffer.CharValue[3]); > USART_Transmitt (Buffer.CharValue[2]); > USART_Transmitt (Buffer.CharValue[1]); > USART_Transmitt (Buffer.CharValue[0]); } > > HTH > > John > > > Andrew wrote: >> >> Hi /Bengt, >> >> >> I think shifting is the only way as I need to constantly change the data >> being sent out through the USART in SPI Mode. So I cannot use structures. >> I have removed the receive data command from the function:- >> >> > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr > From j_baraclough at zetnet.co.uk Tue May 13 06:25:59 2008 From: j_baraclough at zetnet.co.uk (John Baraclough) Date: Tue May 13 07:26:58 2008 Subject: [Icc-avr] SPI USART In-Reply-To: <48299129.3080803@zetnet.co.uk> References: <48299129.3080803@zetnet.co.uk> Message-ID: <482996E7.6060904@zetnet.co.uk> Ooops. Of course that should have read: void Send_Green (SpiData mydata) { USART_Transmitt (mydata.CharValue[3]); USART_Transmitt (mydata.CharValue[2]); USART_Transmitt (mydata.CharValue[1]); USART_Transmitt (mydata.CharValue[0]); } SendGreen(Buffer); John John Baraclough wrote: > Sorry Andy, but that statement doesn't make sense. What Bengt ws > talking about is something like this: > > typedef union { > long LongValue; > char CharValue[4]; > } SpiData; > > SpiData Buffer; > > > > In your code: > > Buffer.LongValue = 0x12345678; > > void Send_Green (unsigned long mydata) > { > USART_Transmitt (Buffer.CharValue[3]); > USART_Transmitt (Buffer.CharValue[2]); > USART_Transmitt (Buffer.CharValue[1]); > USART_Transmitt (Buffer.CharValue[0]); } > > HTH > > John From t.jaspers at cpseurope.com Tue May 13 06:45:05 2008 From: t.jaspers at cpseurope.com (Jaspers, Ton) Date: Tue May 13 07:46:07 2008 Subject: [Icc-avr] SPI USART In-Reply-To: Message-ID: <7B0EB27CF1CC93439B5CFB7526E5D74C6248D0@mickey.PBNV.local> Twenty years ago we used tricks like that to optimise our code but today's generation of compilers optimises your code to the extend that it doesn't (shouldn't) matter how you program it, the end result should be the same. It is also why I program: if ( TheBeltIsMoving == 0 ) { ..... Rather then if(!b){ .... In the old days the latter would generate faster code, today the compiler optimises for speed and should deliver the exact same result in either case. It allows me to increase readability and maintainability without suffering performance. The same is true in the original problem. A "<<8" should generate a byte swap/move or something along the lines that the proposed union would generate. "<<9" is translated in a byte swap/move plus a shift, etc. "<<16" uses a word swap/move, etc. If anno Domini 2008, you are still concerned about optimal code results while coding your sources, you are using a hoplessly outdated compiler product. There is nothing wrong with using a union (except that it is not a portable solution due to teh endian-nes issue). All I am saying is that other solutions are just as good if you use an optimising compiler like ICC. It shouldn't matter which solution you choose. Best wishes, Ton > -----Original Message----- > From: icc-avr-bounces@imagecraft.com > [mailto:icc-avr-bounces@imagecraft.com] On Behalf Of Andrew > Sent: dinsdag 13 mei 2008 15:20 > To: Discussion list for ICCAVR and ICCtiny Users. You do NOT > need tosubscribeto icc-announce if you are a member of this. > Subject: Re: [Icc-avr] SPI USART > > Hi John, > > Sorry never used type defines like that before, in fact come > to think of it i have never really used type defines at all. > > Is that much faster than bit shifting? > > Thansk, > > Andy > > > > > ----- Original Message ----- > From: "John Baraclough" > To: "Discussion list for ICCAVR and ICCtiny Users. You do NOT > need tosubscribe to icc-announce if you are a member of this." > > Sent: Tuesday, May 13, 2008 2:01 PM > Subject: Re: [Icc-avr] SPI USART > > > > Sorry Andy, but that statement doesn't make sense. What Bengt ws > > talking about is something like this: > > > > typedef union { > > long LongValue; > > char CharValue[4]; > > } SpiData; > > > > SpiData Buffer; > > > > > > > > In your code: > > > > Buffer.LongValue = 0x12345678; > > > > void Send_Green (unsigned long mydata) { USART_Transmitt > > (Buffer.CharValue[3]); USART_Transmitt (Buffer.CharValue[2]); > > USART_Transmitt (Buffer.CharValue[1]); > > USART_Transmitt (Buffer.CharValue[0]); } > > > > HTH > > > > John > > > > > > Andrew wrote: > >> > >> Hi /Bengt, > >> > >> > >> I think shifting is the only way as I need to constantly > change the > >> data being sent out through the USART in SPI Mode. So I > cannot use structures. > >> I have removed the receive data command from the function:- > >> > >> > > > > _______________________________________________ > > Icc-avr mailing list > > Icc-avr@imagecraft.com > > http://dragonsgate.net/mailman/listinfo/icc-avr > > > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr > From jassenbaum at htp-tel.de Tue May 13 12:51:56 2008 From: jassenbaum at htp-tel.de (Johannes Assenbaum) Date: Tue May 13 13:53:32 2008 Subject: [Icc-avr] SPI USART References: Message-ID: <7OeBNFkYNkIlc6E2sSja0JxzSkCf4M5xcyuxl1SyH10@akmail> Hi Andy, letting USART_Transmitt wait for data to be received is the reason for the gaps in transmission. I don't know by heart, how SPI master on USART works, but as SPI is synchronous, I guess, something like unsigned char USART_Receivee (void) { while ( !( UCSR2A & (1<> 24); nexttotransmit = mydata >> 16; longreturn[3] = USART_Receivee (); USART_Transmitt (nexttotransmit); nexttotransmit = mydata >> 8; longreturn[2] = USART_Receivee (); USART_Transmitt (nexttotransmit); nexttotransmit = mydata; longreturn[1] = USART_Receivee (); USART_Transmitt (nexttotransmit); longreturn[0] = USART_Receivee (); // do something with longreturn } will reduce gaps to minimum. Hope this helps. Johannes > Hi, > I have the USART working in SPI master mode. I need to send 32Bits (LONG) to it. So > i have written the following function : - > Code: > void USART_Transmitt (unsigned char Data) > { > while ( !( UCSR2A & (1< UDR2 = Data; // Put data into buffer, sends the data > while ( !(UCSR2A & (1< Data = UDR2; // Get data > } > Code: > void Send_Green (unsigned long mydata) > { > USART_Transmitt ((mydata >> 24)); > USART_Transmitt ((mydata >> 16)); > USART_Transmitt ((mydata >> 8)); > USART_Transmitt ((mydata)); > } > My question is: - Is there a more efficient way of writing the above function? (To > make the code execute faster i.e. a small gap between USART_Transmitt ((mydata >> > 16)); and USART_Transmitt ((mydata >> 8); for example) > I know I cannot make the USART_Transmitt function faster but can I make the data > shifting execute faster? > Many Thanks, > Andy From benra at imt.liu.se Tue May 13 23:33:43 2008 From: benra at imt.liu.se (Bengt Ragnemalm) Date: Wed May 14 00:34:45 2008 Subject: SV: [Icc-avr] SPI USART In-Reply-To: <7B0EB27CF1CC93439B5CFB7526E5D74C6248D0@mickey.PBNV.local> References: <7B0EB27CF1CC93439B5CFB7526E5D74C6248D0@mickey.PBNV.local> Message-ID: <30ABE3284E9F49AFBE71F5C8D613BCA9@Shagrat> Ton, I think you should test it. I have tested it several times and ICCAVR always produce smaller and most probably faster code if I use union/struct. But I must admit that it was several versions since I tested it. Actually you don't need to do a typedef if you don't want to, a union and struct can be used in a normal declaration but a typedef is usually to prefere to be able to use it on several variables in different parts of the code. A union will put variables on the same data space. A struct is a method to group several variables together. The indexing of the bytes in the struct was a clever method that I have never used. This is how I usually do it: CODE: typedef union { struct { unsigned char byte0; unsigned char byte1; unsigned char byte2; unsigned char byte3; } single; unsigned long total; } spiDataType; spiDataType mydata; mydata.total = 0x12345678; USART_Transmitt_Green(mydata); void Send_Green(unsigned long indata) { Mydata.total = indata; // To skip this you need the typedef or a global USART_Transmitt(mydata.single.byte3); USART_Transmitt(mydata.single.byte2); USART_Transmitt(mydata.single.byte1); USART_Transmitt(mydata.single.byte0); } /Bengt > -----Ursprungligt meddelande----- > Fr?n: icc-avr-bounces@imagecraft.com [mailto:icc-avr- > bounces@imagecraft.com] F?r Jaspers, Ton > Skickat: den 13 maj 2008 15:45 > Till: Discussion list for ICCAVR and ICCtiny Users. You do NOT need to > subscribeto icc-announce if you are a member of this. > ?mne: RE: [Icc-avr] SPI USART > > Twenty years ago we used tricks like that to optimise our code but > today's generation of compilers optimises your code to the extend that > it doesn't (shouldn't) matter how you program it, the end result should > be the same. > > > It is also why I program: > if ( TheBeltIsMoving == 0 ) > { > ..... > Rather then > if(!b){ > .... > > In the old days the latter would generate faster code, today the > compiler optimises for speed and should deliver the exact same result in > either case. It allows me to increase readability and maintainability > without suffering performance. > > The same is true in the original problem. A "<<8" should generate a byte > swap/move or something along the lines that the proposed union would > generate. "<<9" is translated in a byte swap/move plus a shift, etc. > "<<16" uses a word swap/move, etc. > > If anno Domini 2008, you are still concerned about optimal code results > while coding your sources, you are using a hoplessly outdated compiler > product. > > There is nothing wrong with using a union (except that it is not a > portable solution due to teh endian-nes issue). All I am saying is that > other solutions are just as good if you use an optimising compiler like > ICC. It shouldn't matter which solution you choose. > > Best wishes, > Ton > > > > -----Original Message----- > > From: icc-avr-bounces@imagecraft.com > > [mailto:icc-avr-bounces@imagecraft.com] On Behalf Of Andrew > > Sent: dinsdag 13 mei 2008 15:20 > > To: Discussion list for ICCAVR and ICCtiny Users. You do NOT > > need tosubscribeto icc-announce if you are a member of this. > > Subject: Re: [Icc-avr] SPI USART > > > > Hi John, > > > > Sorry never used type defines like that before, in fact come > > to think of it i have never really used type defines at all. > > > > Is that much faster than bit shifting? > > > > Thansk, > > > > Andy > > > > > > > > > > ----- Original Message ----- > > From: "John Baraclough" > > To: "Discussion list for ICCAVR and ICCtiny Users. You do NOT > > need tosubscribe to icc-announce if you are a member of this." > > > > Sent: Tuesday, May 13, 2008 2:01 PM > > Subject: Re: [Icc-avr] SPI USART > > > > > > > Sorry Andy, but that statement doesn't make sense. What Bengt ws > > > talking about is something like this: > > > > > > typedef union { > > > long LongValue; > > > char CharValue[4]; > > > } SpiData; > > > > > > SpiData Buffer; > > > > > > > > > > > > In your code: > > > > > > Buffer.LongValue = 0x12345678; > > > > > > void Send_Green (unsigned long mydata) { USART_Transmitt > > > (Buffer.CharValue[3]); USART_Transmitt (Buffer.CharValue[2]); > > > USART_Transmitt (Buffer.CharValue[1]); > > > USART_Transmitt (Buffer.CharValue[0]); } > > > > > > HTH > > > > > > John > > > > > > > > > Andrew wrote: > > >> > > >> Hi /Bengt, > > >> > > >> > > >> I think shifting is the only way as I need to constantly > > change the > > >> data being sent out through the USART in SPI Mode. So I > > cannot use structures. > > >> I have removed the receive data command from the function:- > > >> > > >> > > > > > > _______________________________________________ > > > Icc-avr mailing list > > > Icc-avr@imagecraft.com > > > http://dragonsgate.net/mailman/listinfo/icc-avr > > > > > > > _______________________________________________ > > Icc-avr mailing list > > Icc-avr@imagecraft.com > > http://dragonsgate.net/mailman/listinfo/icc-avr > > > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr From benra at imt.liu.se Tue May 13 23:37:58 2008 From: benra at imt.liu.se (Bengt Ragnemalm) Date: Wed May 14 00:38:56 2008 Subject: SV: [Icc-avr] SPI USART In-Reply-To: <7B0EB27CF1CC93439B5CFB7526E5D74C6248D0@mickey.PBNV.local> References: <7B0EB27CF1CC93439B5CFB7526E5D74C6248D0@mickey.PBNV.local> Message-ID: Ton, I do think I could be wrong about this. Maybe the struct have never produced smaller code in ICCAVR, maybe someone else know? But as you say, a union/struct could actually produce more readable code. A code there you can clearly read "byte3" can be better than ">>24". I never use this method on smaller data types like shorts but I think I would do it on a long. Sorry if I was wrong. /Bengt > -----Ursprungligt meddelande----- > Fr?n: icc-avr-bounces@imagecraft.com [mailto:icc-avr- > bounces@imagecraft.com] F?r Jaspers, Ton > Skickat: den 13 maj 2008 15:45 > Till: Discussion list for ICCAVR and ICCtiny Users. You do NOT need to > subscribeto icc-announce if you are a member of this. > ?mne: RE: [Icc-avr] SPI USART > > Twenty years ago we used tricks like that to optimise our code but > today's generation of compilers optimises your code to the extend that > it doesn't (shouldn't) matter how you program it, the end result should > be the same. > > > It is also why I program: > if ( TheBeltIsMoving == 0 ) > { > ..... > Rather then > if(!b){ > .... > > In the old days the latter would generate faster code, today the > compiler optimises for speed and should deliver the exact same result in > either case. It allows me to increase readability and maintainability > without suffering performance. > > The same is true in the original problem. A "<<8" should generate a byte > swap/move or something along the lines that the proposed union would > generate. "<<9" is translated in a byte swap/move plus a shift, etc. > "<<16" uses a word swap/move, etc. > > If anno Domini 2008, you are still concerned about optimal code results > while coding your sources, you are using a hoplessly outdated compiler > product. > > There is nothing wrong with using a union (except that it is not a > portable solution due to teh endian-nes issue). All I am saying is that > other solutions are just as good if you use an optimising compiler like > ICC. It shouldn't matter which solution you choose. > > Best wishes, > Ton > > > > -----Original Message----- > > From: icc-avr-bounces@imagecraft.com > > [mailto:icc-avr-bounces@imagecraft.com] On Behalf Of Andrew > > Sent: dinsdag 13 mei 2008 15:20 > > To: Discussion list for ICCAVR and ICCtiny Users. You do NOT > > need tosubscribeto icc-announce if you are a member of this. > > Subject: Re: [Icc-avr] SPI USART > > > > Hi John, > > > > Sorry never used type defines like that before, in fact come > > to think of it i have never really used type defines at all. > > > > Is that much faster than bit shifting? > > > > Thansk, > > > > Andy > > > > > > > > > > ----- Original Message ----- > > From: "John Baraclough" > > To: "Discussion list for ICCAVR and ICCtiny Users. You do NOT > > need tosubscribe to icc-announce if you are a member of this." > > > > Sent: Tuesday, May 13, 2008 2:01 PM > > Subject: Re: [Icc-avr] SPI USART > > > > > > > Sorry Andy, but that statement doesn't make sense. What Bengt ws > > > talking about is something like this: > > > > > > typedef union { > > > long LongValue; > > > char CharValue[4]; > > > } SpiData; > > > > > > SpiData Buffer; > > > > > > > > > > > > In your code: > > > > > > Buffer.LongValue = 0x12345678; > > > > > > void Send_Green (unsigned long mydata) { USART_Transmitt > > > (Buffer.CharValue[3]); USART_Transmitt (Buffer.CharValue[2]); > > > USART_Transmitt (Buffer.CharValue[1]); > > > USART_Transmitt (Buffer.CharValue[0]); } > > > > > > HTH > > > > > > John > > > > > > > > > Andrew wrote: > > >> > > >> Hi /Bengt, > > >> > > >> > > >> I think shifting is the only way as I need to constantly > > change the > > >> data being sent out through the USART in SPI Mode. So I > > cannot use structures. > > >> I have removed the receive data command from the function:- > > >> > > >> > > > > > > _______________________________________________ > > > Icc-avr mailing list > > > Icc-avr@imagecraft.com > > > http://dragonsgate.net/mailman/listinfo/icc-avr > > > > > > > _______________________________________________ > > Icc-avr mailing list > > Icc-avr@imagecraft.com > > http://dragonsgate.net/mailman/