From benra at imt.liu.se Sun Sep 2 23:50:41 2007 From: benra at imt.liu.se (Bengt Ragnemalm) Date: Mon Sep 3 00:02:43 2007 Subject: [Icc-avr] Error message Message-ID: <002301c7edf6$bf03bf20$b160ec82@Shagrat> I got this error: !E filename.o(294): multiple define: ?myVar I did have some problems with multiple defined variables because of a bad #define in a header. But it was not with this variable so I just didn?t understand a thing until I found out that I had assigned a value to this global variable and also by mistake assigned it in the place there it was defined as extern. Like this: In main file: static unsigned char myVar=0; In other files: unsigned char myCar=0; Richard: Is it possible that this could result in some other error message than ?multiple define?? Something like ?multiple assigning of predefined value ? /Bengt ________________________________________________________________ Bengt Ragnemalm Tel +46 13 22 24 97 Research engineer FAX: +46 13 10 19 02 Link?pings Universitet mailto:bengt.ragnemalm@imt.liu.se Inst. f?r Medicinsk Teknik Internet: http://www.imt.liu.se S-581 85 Link?ping SWEDEN -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20070903/e4e3d3b3/attachment.html From j_baraclough at zetnet.co.uk Mon Sep 3 09:31:53 2007 From: j_baraclough at zetnet.co.uk (John Baraclough) Date: Mon Sep 3 09:44:04 2007 Subject: [Icc-avr] Error message In-Reply-To: <002301c7edf6$bf03bf20$b160ec82@Shagrat> References: <002301c7edf6$bf03bf20$b160ec82@Shagrat> Message-ID: Hi Bengt, You got that message because that is exactly what you have done. Global variables can only be defined in one place in the whole project. Everywhere else you must use the 'extern' keyword. John P.S. Last week Richard said he was going away for a "couple of years". I hope he only meant a "couple of weeks", but he has been very quiet. At 07:50 03/09/2007, you wrote: >I got this error: > >!E filename.o(294): multiple define: ?myVar > >I did have some problems with multiple defined >variables because of a bad #define in a header. >But it was not with this variable so I just >didn?t understand a thing until I found out that >I had assigned a value to this global variable >and also by mistake assigned it in the place >there it was defined as extern. Like this: > >In main file: >static unsigned char myVar=0; > >In other files: >unsigned char myCar=0; > >Richard: Is it possible that this could result >in some other error message than ?multiple >define?? Something like ?multiple assigning of predefined value ? > >/Bengt >________________________________________________________________ > >Bengt Ragnemalm Tel +46 13 22 24 97 > >Research engineer FAX: +46 13 10 19 02 > >Link?pings >Universitet >mailto:bengt.ragnemalm@imt.liu.se > >Inst. f?r Medicinsk Teknik >Internet: http://www.imt.liu.se > >S-581 85 Link?ping SWEDEN > > > >_______________________________________________ >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/20070903/3eea0219/attachment.html From richard-lists at imagecraft.com Mon Sep 3 18:45:54 2007 From: richard-lists at imagecraft.com (Richard) Date: Mon Sep 3 18:57:49 2007 Subject: [Icc-avr] Error message In-Reply-To: References: <002301c7edf6$bf03bf20$b160ec82@Shagrat> Message-ID: <200709040157.l841vhg9005381@dragonsgate2.imagecraft.com> At 09:31 AM 9/3/2007, John Baraclough wrote: >P.S. Last week Richard said he was going away for a "couple of >years". I hope he only meant a "couple of weeks", but he has been very quiet. > "Weeks" :-) Definitely weeks.... // richard (This email is for mailing lists. To reach me directly, please use richard at imagecraft.com) From benra at imt.liu.se Tue Sep 4 00:07:46 2007 From: benra at imt.liu.se (Bengt Ragnemalm) Date: Tue Sep 4 00:19:39 2007 Subject: SV: [Icc-avr] Error message In-Reply-To: References: <002301c7edf6$bf03bf20$b160ec82@Shagrat> Message-ID: <008101c7eec2$4bad4060$b160ec82@Shagrat> Sorry, sorry SORRY, I missed the very important word extern in one of the lines! The static should not be there either. Here is how it should be: In main file: unsigned char myVar=0; In other files: extern unsigned char myCar=0; Now you can see that the problem is that I have put a predefined value in the second line. /Bengt _____ Fr?n: John Baraclough [mailto:j_baraclough@zetnet.co.uk] Skickat: den 3 september 2007 18:32 Till: benra@imt.liu.se; Discussion list for ICCAVR and ICCtiny Users. You do NOT need to subscribe to icc-announce if you are a member of this. ?mne: Re: [Icc-avr] Error message Hi Bengt, You got that message because that is exactly what you have done. Global variables can only be defined in one place in the whole project. Everywhere else you must use the 'extern' keyword. John P.S. Last week Richard said he was going away for a "couple of years". I hope he only meant a "couple of weeks", but he has been very quiet. At 07:50 03/09/2007, you wrote: I got this error: !E filename.o(294): multiple define: ?myVar I did have some problems with multiple defined variables because of a bad #define in a header. But it was not with this variable so I just didn?t understand a thing until I found out that I had assigned a value to this global variable and also by mistake assigned it in the place there it was defined as extern. Like this: In main file: static unsigned char myVar=0; In other files: unsigned char myCar=0; Richard: Is it possible that this could result in some other error message than ?multiple define?? Something like ?multiple assigning of predefined value ? /Bengt ________________________________________________________________ Bengt Ragnemalm Tel +46 13 22 24 97 Research engineer FAX: +46 13 10 19 02 Link?pings Universitet mailto:bengt.ragnemalm@imt.liu.se Inst. f?r Medicinsk Teknik Internet: http://www.imt.liu.se S-581 85 Link?ping SWEDEN _______________________________________________ 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/20070904/9529793b/attachment.html From t.jaspers at cpseurope.com Tue Sep 4 00:40:16 2007 From: t.jaspers at cpseurope.com (Jaspers, Ton) Date: Tue Sep 4 00:52:21 2007 Subject: [Icc-avr] Error message In-Reply-To: <008101c7eec2$4bad4060$b160ec82@Shagrat> Message-ID: <7B0EB27CF1CC93439B5CFB7526E5D74C4B4490@mickey.PBNV.local> Close but I rather use this: In main file: unsigned char myVar=0; In other files: extern unsigned char myCar ; /* no initialisation, it is initialised where it ios defined only */ Further more I would suggest to put the external in a header file. If the declaration is in "aabb.c" then put the external in "aabb.h" like this: #idndef __AABB_H__ /* Avoids multiple inclusion */ #define __AABB_H__ extern unsigned char myCar ; #endif /* end of #ifndef __AABB_H__ , at end of file */ Personally I hate externals. I like to think in objects. The aabb.c file should provide an access methode (function) to access the myCar variable. In the "aabb.h" header file it would like something like this: #idndef __AABB_H__ /* Avoids multiple inclusion */ #define __AABB_H__ unsigned char readMyCar(void) ; int writeMyCar(unsigned char); #endif /* end of #ifndef __AABB_H__ , at end of file */ These access methodes provide a well controlled way to access the variable. The write functions, for example, could perform some range checking and return an error when the value is out of range. This is how we do it in medical instrument software that has to be scrutenized to the bone. Cheers, Ton ________________________________ From: icc-avr-bounces@imagecraft.com [mailto:icc-avr-bounces@imagecraft.com] On Behalf Of Bengt Ragnemalm Sent: dinsdag 4 september 2007 9:08 To: ICC-AVR discussion list Subject: SV: [Icc-avr] Error message Sorry, sorry SORRY, I missed the very important word extern in one of the lines! The static should not be there either. Here is how it should be: In main file: unsigned char myVar=0; In other files: extern unsigned char myCar=0; Now you can see that the problem is that I have put a predefined value in the second line. /Bengt ________________________________ Fr?n: John Baraclough [mailto:j_baraclough@zetnet.co.uk] Skickat: den 3 september 2007 18:32 Till: benra@imt.liu.se; Discussion list for ICCAVR and ICCtiny Users. You do NOT need to subscribe to icc-announce if you are a member of this. ?mne: Re: [Icc-avr] Error message Hi Bengt, You got that message because that is exactly what you have done. Global variables can only be defined in one place in the whole project. Everywhere else you must use the 'extern' keyword. John P.S. Last week Richard said he was going away for a "couple of years". I hope he only meant a "couple of weeks", but he has been very quiet. At 07:50 03/09/2007, you wrote: I got this error: !E filename.o(294): multiple define: 'myVar I did have some problems with multiple defined variables because of a bad #define in a header. But it was not with this variable so I just didn't understand a thing until I found out that I had assigned a value to this global variable and also by mistake assigned it in the place there it was defined as extern. Like this: In main file: static unsigned char myVar=0; In other files: unsigned char myCar=0; Richard: Is it possible that this could result in some other error message than "multiple define"? Something like "multiple assigning of predefined value..." /Bengt ________________________________________________________________ Bengt Ragnemalm Tel +46 13 22 24 97 Research engineer FAX: +46 13 10 19 02 Link?pings Universitet mailto:bengt.ragnemalm@imt.liu.se Inst. f?r Medicinsk Teknik Internet: http://www.imt.liu.se S-581 85 Link?ping SWEDEN _______________________________________________ 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/20070904/0da5b359/attachment-0001.html From amsol at amssolutions.co.za Tue Sep 4 01:13:41 2007 From: amsol at amssolutions.co.za (AMS Solutions - GJ Laubscher) Date: Tue Sep 4 01:24:35 2007 Subject: [Icc-avr] Qry :AVR AVREF Value? Message-ID: <005001c7eecb$83f9b3a0$0200a8c0@BigFoot> Hi All, Using a mega8 with the ADC enabled selecting AVREF= internal 2.56vdc - Sampling rate at 125k, which is within the 20-200khz as per atmel -circuit -k Vcc=5v connected to AVCC via 10uH, connected with a 100nF cap to GND (as per recomm atmel) & external cap 100nF poly connected to Pin21 (AVREF) I meassure 2.605Vdc on AVREF. I expected to read 2.56Vdc...... .........Using recently calibrated Fluke 77 I wonder whether this V-value on AVREF is in fact correct or should it have been 2.56V? Maybe FLuke out on low V? hmmm... maybe one of you guys have had the same experience or can point me to more reading/appl material. I really appreciate your feedback! Regards, Gerhard Laubscher TeleFax : +27-21-557 0160 Mobile : 082 366 1950 email : amsol@amssolutions.co.za website: http://www.amssolutions.co.za -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20070904/e09b2ebc/attachment.html From Derek.Robertson at logitech.uk.com Tue Sep 4 01:13:25 2007 From: Derek.Robertson at logitech.uk.com (Robertson, Derek) Date: Tue Sep 4 01:24:43 2007 Subject: [Icc-avr] Error message Message-ID: Presumably the myCar, myVar in this post is a typing error? Ton, I get your 'Object' approach, but I don't understand what this is for #idndef __AABB_H__ /* Avoids multiple inclusion */ #define __AABB_H__ I feel there may be a moment of enlightenment coming on! :o) ________________________________ From: Jaspers, Ton [mailto:t.jaspers@cpseurope.com] Sent: 04 September 2007 08:40 To: benra@imt.liu.se; Discussion list for ICCAVR and ICCtiny Users. You do NOT need to subscribeto icc-announce if you are a member of this. Subject: RE: [Icc-avr] Error message Close but I rather use this: In main file: unsigned char myVar=0; In other files: extern unsigned char myCar ; /* no initialisation, it is initialised where it ios defined only */ Further more I would suggest to put the external in a header file. If the declaration is in "aabb.c" then put the external in "aabb.h" like this: #idndef __AABB_H__ /* Avoids multiple inclusion */ #define __AABB_H__ extern unsigned char myCar ; #endif /* end of #ifndef __AABB_H__ , at end of file */ Personally I hate externals. I like to think in objects. The aabb.c file should provide an access methode (function) to access the myCar variable. In the "aabb.h" header file it would like something like this: #idndef __AABB_H__ /* Avoids multiple inclusion */ #define __AABB_H__ unsigned char readMyCar(void) ; int writeMyCar(unsigned char); #endif /* end of #ifndef __AABB_H__ , at end of file */ These access methodes provide a well controlled way to access the variable. The write functions, for example, could perform some range checking and return an error when the value is out of range. This is how we do it in medical instrument software that has to be scrutenized to the bone. Cheers, Ton ________________________________ From: icc-avr-bounces@imagecraft.com [mailto:icc-avr-bounces@imagecraft.com] On Behalf Of Bengt Ragnemalm Sent: dinsdag 4 september 2007 9:08 To: ICC-AVR discussion list Subject: SV: [Icc-avr] Error message Sorry, sorry SORRY, I missed the very important word extern in one of the lines! The static should not be there either. Here is how it should be: In main file: unsigned char myVar=0; In other files: extern unsigned char myCar=0; Now you can see that the problem is that I have put a predefined value in the second line. /Bengt ________________________________ Fr?n: John Baraclough [mailto:j_baraclough@zetnet.co.uk] Skickat: den 3 september 2007 18:32 Till: benra@imt.liu.se; Discussion list for ICCAVR and ICCtiny Users. You do NOT need to subscribe to icc-announce if you are a member of this. ?mne: Re: [Icc-avr] Error message Hi Bengt, You got that message because that is exactly what you have done. Global variables can only be defined in one place in the whole project. Everywhere else you must use the 'extern' keyword. John P.S. Last week Richard said he was going away for a "couple of years". I hope he only meant a "couple of weeks", but he has been very quiet. At 07:50 03/09/2007, you wrote: I got this error: !E filename.o(294): multiple define: 'myVar I did have some problems with multiple defined variables because of a bad #define in a header. But it was not with this variable so I just didn't understand a thing until I found out that I had assigned a value to this global variable and also by mistake assigned it in the place there it was defined as extern. Like this: In main file: static unsigned char myVar=0; In other files: unsigned char myCar=0; Richard: Is it possible that this could result in some other error message than "multiple define"? Something like "multiple assigning of predefined value..." /Bengt ________________________________________________________________ Bengt Ragnemalm Tel +46 13 22 24 97 Research engineer FAX: +46 13 10 19 02 Link?pings Universitet mailto:bengt.ragnemalm@imt.liu.se Inst. f?r Medicinsk Teknik Internet: http://www.imt.liu.se S-581 85 Link?ping SWEDEN _______________________________________________ Icc-avr mailing list Icc-avr@imagecraft.com http://dragonsgate.net/mailman/listinfo/icc-avr -------------------------------------------------------- Logitech Ltd is a limited company registered in Scotland. Registration Number: SC42330 Registered Address: Erskine Ferry Road, Old Kilpatrick, Glasgow, G60 5EU, Scotland, UK -------------------------------------------------------- This message (and any associated files) is intended only for the use of the individual or entity to which it is addressed and may contain information that is confidential, subject to copyright or constitutes a trade secret. If you are not the intended recipient you are hereby notified that any dissemination, copying or distribution of this message, or files associated with this message, is prohibited. If you have received this message in error, please notify us immediately by replying to the message and deleting it from your computer. Messages sent to and from us may be monitored. Any views or opinions presented are solely those of the author and do not necessarily represent those of the company. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20070904/9df8a8e2/attachment-0001.html From jh.bodin at telia.com Tue Sep 4 01:36:29 2007 From: jh.bodin at telia.com (Johan H. Bodin) Date: Tue Sep 4 01:48:36 2007 Subject: [Icc-avr] Am I blacklisted on the ICCAVR list? Message-ID: <46DD190D.8010809@telia.com> Ping!? I have made three fruitless attempts to post a message here... Johan Bodin From stephan.daub at sap.com Tue Sep 4 01:56:45 2007 From: stephan.daub at sap.com (Daub, Stephan) Date: Tue Sep 4 02:08:55 2007 Subject: AW: [Icc-avr] Error message In-Reply-To: Message-ID: Hi Derek, this #idndef __AABB_H__ /* Avoids multiple inclusion */ #define __AABB_H__ #endif /* end of #ifndef __AABB_H__ , at end of file */ construct is to avoid more than one execution of if this .h file is included in more than one .c file.... I think it's a standard K&R C recommendation.... I re-use a standard template for .h files which include such a contruct; this is to help-and-use-but-not-worry-anymore on your .h files. @Ton: I like your approach very much; I always try to organize my projects in that way. IMHO and not 100% serious: if many more people had followed that way (instead of C-spaghetti code) the OO-hype won't be there ;) Best, Stephan ________________________________ Von: icc-avr-bounces@imagecraft.com [mailto:icc-avr-bounces@imagecraft.com] Im Auftrag von Robertson, Derek Gesendet: Dienstag, 4. September 2007 10:13 An: Discussion list for ICCAVR and ICCtiny Users. You do NOT needtosubscribeto icc-announce if you are a member of this. Betreff: RE: [Icc-avr] Error message Presumably the myCar, myVar in this post is a typing error? Ton, I get your 'Object' approach, but I don't understand what this is for #idndef __AABB_H__ /* Avoids multiple inclusion */ #define __AABB_H__ I feel there may be a moment of enlightenment coming on! :o) ________________________________ From: Jaspers, Ton [mailto:t.jaspers@cpseurope.com] Sent: 04 September 2007 08:40 To: benra@imt.liu.se; Discussion list for ICCAVR and ICCtiny Users. You do NOT need to subscribeto icc-announce if you are a member of this. Subject: RE: [Icc-avr] Error message Close but I rather use this: In main file: unsigned char myVar=0; In other files: extern unsigned char myCar ; /* no initialisation, it is initialised where it ios defined only */ Further more I would suggest to put the external in a header file. If the declaration is in "aabb.c" then put the external in "aabb.h" like this: #idndef __AABB_H__ /* Avoids multiple inclusion */ #define __AABB_H__ extern unsigned char myCar ; #endif /* end of #ifndef __AABB_H__ , at end of file */ Personally I hate externals. I like to think in objects. The aabb.c file should provide an access methode (function) to access the myCar variable. In the "aabb.h" header file it would like something like this: #idndef __AABB_H__ /* Avoids multiple inclusion */ #define __AABB_H__ unsigned char readMyCar(void) ; int writeMyCar(unsigned char); #endif /* end of #ifndef __AABB_H__ , at end of file */ These access methodes provide a well controlled way to access the variable. The write functions, for example, could perform some range checking and return an error when the value is out of range. This is how we do it in medical instrument software that has to be scrutenized to the bone. Cheers, Ton ________________________________ From: icc-avr-bounces@imagecraft.com [mailto:icc-avr-bounces@imagecraft.com] On Behalf Of Bengt Ragnemalm Sent: dinsdag 4 september 2007 9:08 To: ICC-AVR discussion list Subject: SV: [Icc-avr] Error message Sorry, sorry SORRY, I missed the very important word extern in one of the lines! The static should not be there either. Here is how it should be: In main file: unsigned char myVar=0; In other files: extern unsigned char myCar=0; Now you can see that the problem is that I have put a predefined value in the second line. /Bengt ________________________________ Fr?n: John Baraclough [mailto:j_baraclough@zetnet.co.uk] Skickat: den 3 september 2007 18:32 Till: benra@imt.liu.se; Discussion list for ICCAVR and ICCtiny Users. You do NOT need to subscribe to icc-announce if you are a member of this. ?mne: Re: [Icc-avr] Error message Hi Bengt, You got that message because that is exactly what you have done. Global variables can only be defined in one place in the whole project. Everywhere else you must use the 'extern' keyword. John P.S. Last week Richard said he was going away for a "couple of years". I hope he only meant a "couple of weeks", but he has been very quiet. At 07:50 03/09/2007, you wrote: I got this error: !E filename.o(294): multiple define: 'myVar I did have some problems with multiple defined variables because of a bad #define in a header. But it was not with this variable so I just didn't understand a thing until I found out that I had assigned a value to this global variable and also by mistake assigned it in the place there it was defined as extern. Like this: In main file: static unsigned char myVar=0; In other files: unsigned char myCar=0; Richard: Is it possible that this could result in some other error message than "multiple define"? Something like "multiple assigning of predefined value..." /Bengt ________________________________________________________________ Bengt Ragnemalm Tel +46 13 22 24 97 Research engineer FAX: +46 13 10 19 02 Link?pings Universitet mailto:bengt.ragnemalm@imt.liu.se Inst. f?r Medicinsk Teknik Internet: http://www.imt.liu.se S-581 85 Link?ping SWEDEN _______________________________________________ Icc-avr mailing list Icc-avr@imagecraft.com http://dragonsgate.net/mailman/listinfo/icc-avr ________________________________ Logitech Ltd is a limited company registered in Scotland. Registration Number: SC42330 Registered Address: Erskine Ferry Road, Old Kilpatrick, Glasgow, G60 5EU, Scotland, UK ________________________________ This message (and any associated files) is intended only for the use of the individual or entity to which it is addressed and may contain information that is confidential, subject to copyright or constitutes a trade secret. If you are not the intended recipient you are hereby notified that any dissemination, copying or distribution of this message, or files associated with this message, is prohibited. If you have received this message in error, please notify us immediately by replying to the message and deleting it from your computer. Messages sent to and from us may be monitored. Any views or opinions presented are solely those of the author and do not necessarily represent those of the company. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20070904/e924327c/attachment-0001.html From stephan.daub at sap.com Tue Sep 4 02:05:50 2007 From: stephan.daub at sap.com (Daub, Stephan) Date: Tue Sep 4 02:18:14 2007 Subject: AW: [Icc-avr] Am I blacklisted on the ICCAVR list? In-Reply-To: <46DD190D.8010809@telia.com> Message-ID: ping back :) stephan -----Urspr?ngliche Nachricht----- Von: icc-avr-bounces@imagecraft.com [mailto:icc-avr-bounces@imagecraft.com] Im Auftrag von Johan H. Bodin Gesendet: Dienstag, 4. September 2007 10:36 An: ICCAVR list Betreff: [Icc-avr] Am I blacklisted on the ICCAVR list? Ping!? I have made three fruitless attempts to post a message here... Johan Bodin _______________________________________________ Icc-avr mailing list Icc-avr@imagecraft.com http://dragonsgate.net/mailman/listinfo/icc-avr From stephan.daub at sap.com Tue Sep 4 02:09:07 2007 From: stephan.daub at sap.com (Daub, Stephan) Date: Tue Sep 4 02:21:25 2007 Subject: AW: [Icc-avr] Qry :AVR AVREF Value? In-Reply-To: <005001c7eecb$83f9b3a0$0200a8c0@BigFoot> Message-ID: Hi Gerhard, I am sure you checked the correct setting of: ADMUX - REFS1:0: Reference Selection Bits ? ... But I just checked the datasheet (mega8 for example) and found VINT Internal Voltage Reference min 2.3 typ 2.56 max 2.7 V but I did not found any note on the causing parameters (temp, .....) hmmm.... Best, Stephan ________________________________ Von: icc-avr-bounces@imagecraft.com [mailto:icc-avr-bounces@imagecraft.com] Im Auftrag von AMS Solutions - GJ Laubscher Gesendet: Dienstag, 4. September 2007 10:14 An: ImageCraft UserGroup Betreff: [Icc-avr] Qry :AVR AVREF Value? Hi All, Using a mega8 with the ADC enabled selecting AVREF= internal 2.56vdc - Sampling rate at 125k, which is within the 20-200khz as per atmel -circuit -k Vcc=5v connected to AVCC via 10uH, connected with a 100nF cap to GND (as per recomm atmel) & external cap 100nF poly connected to Pin21 (AVREF) I meassure 2.605Vdc on AVREF. I expected to read 2.56Vdc...... .........Using recently calibrated Fluke 77 I wonder whether this V-value on AVREF is in fact correct or should it have been 2.56V? Maybe FLuke out on low V? hmmm... maybe one of you guys have had the same experience or can point me to more reading/appl material. I really appreciate your feedback! Regards, Gerhard Laubscher TeleFax : +27-21-557 0160 Mobile : 082 366 1950 email : amsol@amssolutions.co.za website: http://www.amssolutions.co.za From sl at ecpower.dk Tue Sep 4 02:14:08 2007 From: sl at ecpower.dk (Steven Lose) Date: Tue Sep 4 02:26:13 2007 Subject: SV: [Icc-avr] Am I blacklisted on the ICCAVR list? References: <46DD190D.8010809@telia.com> Message-ID: <072D96786BFC014AAEBA9EB07A8070EA285AE8@seattle.ecpower.dk> Well, you made it now. ;o) Med venlig hilsen / Best regards / mit freundlichen Gr??en EC POWER A/S Steven Lose Software Ingeni?r Tlf.: +45 87434100 Direkte tlf. +45 58286608 Email: sl@ecpower.dk www.ecpower.dk -----Oprindelig meddelelse----- Fra: icc-avr-bounces@imagecraft.com [mailto:icc-avr-bounces@imagecraft.com] P? vegne af Johan H. Bodin Sendt: 4. september 2007 10:36 Til: ICCAVR list Emne: [Icc-avr] Am I blacklisted on the ICCAVR list? Ping!? I have made three fruitless attempts to post a message here... Johan Bodin _______________________________________________ Icc-avr mailing list Icc-avr@imagecraft.com http://dragonsgate.net/mailman/listinfo/icc-avr From Derek.Robertson at logitech.uk.com Tue Sep 4 02:47:14 2007 From: Derek.Robertson at logitech.uk.com (Robertson, Derek) Date: Tue Sep 4 02:59:51 2007 Subject: [Icc-avr] Error message Message-ID: Ah... I get it... It's like a "Only do this once" flag to the compiler. So, first time round __AABB_H__ isn't defined, so define it and do . The next time the header is 'called', the compiler gets to this bit, __AABB_H__ has been defined so you skip . I've seen this construct a lot, but hadn't really understood it or questioned it. So you could do something like.... #ifndef INIT #define INIT // unsigned char myVar = 0; #endif void Set_myVar(unsigned char); unsigned char Get_myVar(void); Then by including the header in several C files you make the function proto-types 'public', but myVar only get's declared and initialised once. Would I be right in saying that you would need to compile the the C file to Object before compiling your project for myVar to be private to the correct module? Would doing this in your C file #define C_FILE_NAME and this in your header file #ifdef C_FILE_NAME unsigned char myVar = 0; #endif void Set_myVar(unsigned char); unsigned char Get_myVar(void); Not achieve the same result but force the correct scope, or am I still not getting this? Derek ________________________________ From: Daub, Stephan [mailto:stephan.daub@sap.com] Sent: 04 September 2007 09:57 To: Discussion list for ICCAVR and ICCtiny Users. You do NOT needtosubscribeto icc-announce if you are a member of this. Subject: AW: [Icc-avr] Error message Hi Derek, this #idndef __AABB_H__ /* Avoids multiple inclusion */ #define __AABB_H__ #endif /* end of #ifndef __AABB_H__ , at end of file */ construct is to avoid more than one execution of if this .h file is included in more than one .c file.... I think it's a standard K&R C recommendation.... I re-use a standard template for .h files which include such a contruct; this is to help-and-use-but-not-worry-anymore on your .h files. @Ton: I like your approach very much; I always try to organize my projects in that way. IMHO and not 100% serious: if many more people had followed that way (instead of C-spaghetti code) the OO-hype won't be there ;) Best, Stephan ________________________________ Von: icc-avr-bounces@imagecraft.com [mailto:icc-avr-bounces@imagecraft.com] Im Auftrag von Robertson, Derek Gesendet: Dienstag, 4. September 2007 10:13 An: Discussion list for ICCAVR and ICCtiny Users. You do NOT needtosubscribeto icc-announce if you are a member of this. Betreff: RE: [Icc-avr] Error message Presumably the myCar, myVar in this post is a typing error? Ton, I get your 'Object' approach, but I don't understand what this is for #idndef __AABB_H__ /* Avoids multiple inclusion */ #define __AABB_H__ I feel there may be a moment of enlightenment coming on! :o) ________________________________ From: Jaspers, Ton [mailto:t.jaspers@cpseurope.com] Sent: 04 September 2007 08:40 To: benra@imt.liu.se; Discussion list for ICCAVR and ICCtiny Users. You do NOT need to subscribeto icc-announce if you are a member of this. Subject: RE: [Icc-avr] Error message Close but I rather use this: In main file: unsigned char myVar=0; In other files: extern unsigned char myCar ; /* no initialisation, it is initialised where it ios defined only */ Further more I would suggest to put the external in a header file. If the declaration is in "aabb.c" then put the external in "aabb.h" like this: #idndef __AABB_H__ /* Avoids multiple inclusion */ #define __AABB_H__ extern unsigned char myCar ; #endif /* end of #ifndef __AABB_H__ , at end of file */ Personally I hate externals. I like to think in objects. The aabb.c file should provide an access methode (function) to access the myCar variable. In the "aabb.h" header file it would like something like this: #idndef __AABB_H__ /* Avoids multiple inclusion */ #define __AABB_H__ unsigned char readMyCar(void) ; int writeMyCar(unsigned char); #endif /* end of #ifndef __AABB_H__ , at end of file */ These access methodes provide a well controlled way to access the variable. The write functions, for example, could perform some range checking and return an error when the value is out of range. This is how we do it in medical instrument software that has to be scrutenized to the bone. Cheers, Ton ________________________________ From: icc-avr-bounces@imagecraft.com [mailto:icc-avr-bounces@imagecraft.com] On Behalf Of Bengt Ragnemalm Sent: dinsdag 4 september 2007 9:08 To: ICC-AVR discussion list Subject: SV: [Icc-avr] Error message Sorry, sorry SORRY, I missed the very important word extern in one of the lines! The static should not be there either. Here is how it should be: In main file: unsigned char myVar=0; In other files: extern unsigned char myCar=0; Now you can see that the problem is that I have put a predefined value in the second line. /Bengt ________________________________ Fr?n: John Baraclough [mailto:j_baraclough@zetnet.co.uk] Skickat: den 3 september 2007 18:32 Till: benra@imt.liu.se; Discussion list for ICCAVR and ICCtiny Users. You do NOT need to subscribe to icc-announce if you are a member of this. ?mne: Re: [Icc-avr] Error message Hi Bengt, You got that message because that is exactly what you have done. Global variables can only be defined in one place in the whole project. Everywhere else you must use the 'extern' keyword. John P.S. Last week Richard said he was going away for a "couple of years". I hope he only meant a "couple of weeks", but he has been very quiet. At 07:50 03/09/2007, you wrote: I got this error: !E filename.o(294): multiple define: 'myVar I did have some problems with multiple defined variables because of a bad #define in a header. But it was not with this variable so I just didn't understand a thing until I found out that I had assigned a value to this global variable and also by mistake assigned it in the place there it was defined as extern. Like this: In main file: static unsigned char myVar=0; In other files: unsigned char myCar=0; Richard: Is it possible that this could result in some other error message than "multiple define"? Something like "multiple assigning of predefined value..." /Bengt ________________________________________________________________ Bengt Ragnemalm Tel +46 13 22 24 97 Research engineer FAX: +46 13 10 19 02 Link?pings Universitet mailto:bengt.ragnemalm@imt.liu.se Inst. f?r Medicinsk Teknik Internet: http://www.imt.liu.se S-581 85 Link?ping SWEDEN _______________________________________________ Icc-avr mailing list Icc-avr@imagecraft.com http://dragonsgate.net/mailman/listinfo/icc-avr ________________________________ Logitech Ltd is a limited company registered in Scotland. Registration Number: SC42330 Registered Address: Erskine Ferry Road, Old Kilpatrick, Glasgow, G60 5EU, Scotland, UK ________________________________ This message (and any associated files) is intended only for the use of the individual or entity to which it is addressed and may contain information that is confidential, subject to copyright or constitutes a trade secret. If you are not the intended recipient you are hereby notified that any dissemination, copying or distribution of this message, or files associated with this message, is prohibited. If you have received this message in error, please notify us immediately by replying to the message and deleting it from your computer. Messages sent to and from us may be monitored. Any views or opinions presented are solely those of the author and do not necessarily represent those of the company. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20070904/f3f444cf/attachment-0001.html From richard-lists at imagecraft.com Tue Sep 4 10:24:09 2007 From: richard-lists at imagecraft.com (Richard) Date: Tue Sep 4 10:35:58 2007 Subject: [Icc-avr] Am I blacklisted on the ICCAVR list? In-Reply-To: <46DD190D.8010809@telia.com> References: <46DD190D.8010809@telia.com> Message-ID: <200709041735.l84HZvid013233@dragonsgate2.imagecraft.com> Make sure you post using the same reply address as your subscription address... At 01:36 AM 9/4/2007, you wrote: >Ping!? > >I have made three fruitless attempts to post a message here... > >Johan Bodin // richard (This email is for mailing lists. To reach me directly, please use richard at imagecraft.com) From jh.bodin at telia.com Tue Sep 4 23:50:06 2007 From: jh.bodin at telia.com (Johan H. Bodin) Date: Wed Sep 5 00:02:06 2007 Subject: [Icc-avr] Am I blacklisted on the ICCAVR list? In-Reply-To: <200709041735.l84HZvid013233@dragonsgate2.imagecraft.com> References: <46DD190D.8010809@telia.com> <200709041735.l84HZvid013233@dragonsgate2.imagecraft.com> Message-ID: <46DE519E.9050105@telia.com> Richard, yes, I am posting from exactly the same address as I used to subscribe to the list. I have tried four times now and changed both the subject line and some of the message contents... There must be some aggressive spam filter somewhere out there that doesn't like me... If the list allows small attachments, I can make a last desperate attempt to send it as a zipped text file.. Regards Johan Richard wrote: > Make sure you post using the same reply address as your subscription > address... > > At 01:36 AM 9/4/2007, you wrote: >> Ping!? >> >> I have made three fruitless attempts to post a message here... >> >> Johan Bodin From bjonaspero at hotmail.com Wed Sep 5 00:46:19 2007 From: bjonaspero at hotmail.com (Björn Lindgren) Date: Wed Sep 5 00:58:29 2007 Subject: [Icc-avr] Const arrays of pointers to const arrays In-Reply-To: <200709041735.l84HZvid013233@dragonsgate2.imagecraft.com> Message-ID: Can someone tell me how to define a constant array of pointers to other constant arrays. I can do this in assembler but I want the customer to take over the maintenance and therefore I wish to have 100% of the code in C. Here’s a condensed version: // pointer_test.c const signed char sinus_tab[2][3] = { {1,2,3},{4,5,6}}; /*** Viritual definition (I want something like this) const signed char *pointer[2] = { sinus_tab[1], &sinus_tab[0][0] };*/ // Working declaration (while the definition is done in assembler) extern const unsigned int pointer[2]; // Usage: const signed char *get_pointer( unsigned char index ) { return (void *)pointer[ index ]; } In assenmler (i.e. wanted result): .area lit(rom, con, rel) _pointer:: .word _sinus_tab+3 .word _sinus_tab The first constant array (sinus_tab) is ok but the second either ends up in ‘idata’ (initiated SRAM) or, I get error message like: cast from `pointer to const signed char' to `unsigned int' is illegal in constant expressions Thanx for help Björn Lindgren _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From bjonaspero at hotmail.com Wed Sep 5 02:10:25 2007 From: bjonaspero at hotmail.com (Björn Lindgren) Date: Wed Sep 5 02:22:32 2007 Subject: [Icc-avr] Const arrays of pointers to const arrays In-Reply-To: Message-ID: Sorry, it didn't work in assembler. It seemed like it did with the condensed data of 6 bytes below, but with full data range ( 2kbyte) it doesn't. Basically I want to get rid of: if( 0 == key ) { start_a = ptr_a = &sinus_tab[7][0]; // 0 start_b = ptr_b = &sinus_tab[3][0]; } else if( 1 == key ) { start_a = ptr_a = &sinus_tab[4][0]; // 1 start_b = ptr_b = &sinus_tab[0][0]; } ...etc... else if( 15 == key ) { start_a = ptr_a = &sinus_tab[5][0]; // 2 start_b = ptr_b = &sinus_tab[0][0]; } and replace it by a look-up table. Björn >From: "Björn Lindgren" >Date: Wed, 05 Sep 2007 09:46:19 +0200 > >Can someone tell me how to define a constant array of pointers to other >constant arrays. >I can do this in assembler but I want the customer to take over the >maintenance and therefore >I wish to have 100% of the code in C. > >Here’s a condensed version: > >// pointer_test.c > >const signed char sinus_tab[2][3] = { >{1,2,3},{4,5,6}}; > >/*** Viritual definition (I want something like this) >const signed char *pointer[2] = { > sinus_tab[1], > &sinus_tab[0][0] };*/ > >// Working declaration (while the definition is done in assembler) >extern const unsigned int pointer[2]; > >// Usage: >const signed char *get_pointer( unsigned char index ) { > > return (void *)pointer[ index ]; >} >In assenmler (i.e. wanted result): > .area lit(rom, con, rel) >_pointer:: > .word _sinus_tab+3 > .word _sinus_tab > >The first constant array (sinus_tab) is ok but the second either >ends up in ‘idata’ (initiated SRAM) or, I get error message like: > >cast from `pointer to const signed char' to `unsigned int' is illegal in >constant expressions > >Thanx for help >Björn Lindgren > >_________________________________________________________________ >Express yourself instantly with MSN Messenger! Download today it's FREE! >http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > >_______________________________________________ >Icc-avr mailing list >Icc-avr@imagecraft.com >http://dragonsgate.net/mailman/listinfo/icc-avr _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From richard at imagecraft.com Wed Sep 5 02:16:52 2007 From: richard at imagecraft.com (Richard) Date: Wed Sep 5 02:28:43 2007 Subject: [Icc-avr] AVR Studio plugin for ICCAVR now available Message-ID: <200709050928.l859Sffg020648@dragonsgate2.imagecraft.com> This plugin allows you to use AVR Studio as the IDE to run the ICCAVR compiler. Requires our compiler, AVR Studio 4.12 or higher and .NET Framework 2.0. Version: BETA 0, released Sept 5 2007 You may get it from our website http://www.imagecraft.com, click on "AVR Compiler," then the " Demo Download / Online Help / Sample Code Files" button, and then scroll to the middle to the code samples section. Or direct link at http://www.imagecraft.com/pub/code_samples/AVR/AVRIccPlugin.zip // 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 j_baraclough at zetnet.co.uk Wed Sep 5 05:01:59 2007 From: j_baraclough at zetnet.co.uk (John Baraclough) Date: Wed Sep 5 05:14:16 2007 Subject: [Icc-avr] Const arrays of pointers to const arrays In-Reply-To: References: <200709041735.l84HZvid013233@dragonsgate2.imagecraft.com> Message-ID: Hi Bjorn, This is from the Help file. const int table[] = { 1, 2, 3 }; const char *ptr1; char * const ptr2; const char * const ptr3; Here table is a table allocated in the program memory, ptr1 is an item in the data memory that points to data in the program memory, ptr2 is an item in the program memory that points to data in the data memory, and ptr3 is an item in the program memory that points to data in the program memory. In most cases, items such as table and ptr1 are most typical. The C compiler generates the LPM instruction to access the program memory. Here's how to do it. const signed char sinus_tab[2][3] = { {1,2,3}, {4,5,6} }; const signed char * const pointer[2] = { sinus_tab[1], sinus_tab[0] }; John At 08:46 05/09/2007, you wrote: >Can someone tell me how to define a constant >array of pointers to other constant arrays. >I can do this in assembler but I want the >customer to take over the maintenance and therefore >I wish to have 100% of the code in C. > >Here?s a condensed version: > >// pointer_test.c > >const signed char sinus_tab[2][3] = { >{1,2,3},{4,5,6}}; > >/*** Viritual definition (I want something like this) >const signed char *pointer[2] = { > sinus_tab[1], > &sinus_tab[0][0] };*/ > >// Working declaration (while the definition is done in assembler) >extern const unsigned int pointer[2]; > >// Usage: >const signed char *get_pointer( unsigned char index ) { > > return (void *)pointer[ index ]; >} >In assenmler (i.e. wanted result): > .area lit(rom, con, rel) >_pointer:: > .word _sinus_tab+3 > .word _sinus_tab > >The first constant array (sinus_tab) is ok but the second either >ends up in ?idata? (initiated SRAM) or, I get error message like: > >cast from `pointer to const signed char' to >`unsigned int' is illegal in constant expressions > >Thanx for help >Bj?rn Lindgren > >_________________________________________________________________ >Express yourself instantly with MSN Messenger! >Download today it's FREE! >http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > >_______________________________________________ >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/20070905/ab80f5de/attachment.html From stephan.daub at sap.com Wed Sep 5 06:01:59 2007 From: stephan.daub at sap.com (Daub, Stephan) Date: Wed Sep 5 06:15:22 2007 Subject: AW: [Icc-avr] Error message In-Reply-To: Message-ID: Hi Derek, >but force the correct scope, yes, >or am I still not getting this? no :) Defining/getting the correct scope (of attributes/funcs) is key for maintainability/robustness. Because there is no other (higher) control instance available (as is in JAVA, C#), you have to do this by your own in C and partly (in C++). And because I want to avoid unmaintainable spaghetti code && unstructured use of EXTERN && useless use of globals also (yes, for a little cost for getter()/setter()) I prefer strict using of .h/.c paires that contains everything of this "class/module-like" thing. (of course || yes, this does not make standard-C "OO", but it help to reuse and organize my stuff. Simple example: I have encapsulated all stuff for my own standard "packages" (example: my own (LIN like) protocol, motor drivers, task hanlder, eeprom access,...) in that way, and never had a problem to reuse this "classes" within other projects; better: this reduce my project startup time by far, and I do not care about the right scope of 'foo()' or 'extern char _baa' anymore. It's now foo() (with the .h at right place) and g/set_baa() - done. But: Yes: I partly intend to break this rule for (non-complex || easy to maintain || mini projects || super timecritical), esp. with the non-existance of tons of flash... because the above policy blow up code by some percent. But it's my impression that a code effectiveness review helped me to find an equivalent amount of flash- so: for me it's a win/win anyway. But2: I am sure that this is a very common thing for the participants of this digest...:) this is why: ; back to work now...:) HTH&Best Stephan ________________________________ Von: icc-avr-bounces@imagecraft.com [mailto:icc-avr-bounces@imagecraft.com] Im Auftrag von Robertson, Derek Gesendet: Dienstag, 4. September 2007 11:47 An: Discussion list for ICCAVR and ICCtiny Users. You do NOT needtosubscribeto icc-announce if you are a member of this. Betreff: RE: [Icc-avr] Error message Ah... I get it... It's like a "Only do this once" flag to the compiler. So, first time round __AABB_H__ isn't defined, so define it and do . The next time the header is 'called', the compiler gets to this bit, __AABB_H__ has been defined so you skip . I've seen this construct a lot, but hadn't really understood it or questioned it. So you could do something like.... #ifndef INIT #define INIT // unsigned char myVar = 0; #endif void Set_myVar(unsigned char); unsigned char Get_myVar(void); Then by including the header in several C files you make the function proto-types 'public', but myVar only get's declared and initialised once. Would I be right in saying that you would need to compile the the C file to Object before compiling your project for myVar to be private to the correct module? Would doing this in your C file #define C_FILE_NAME and this in your header file #ifdef C_FILE_NAME unsigned char myVar = 0; #endif void Set_myVar(unsigned char); unsigned char Get_myVar(void); Not achieve the same result but force the correct scope, or am I still not getting this? Derek ________________________________ From: Daub, Stephan [mailto:stephan.daub@sap.com] Sent: 04 September 2007 09:57 To: Discussion list for ICCAVR and ICCtiny Users. You do NOT needtosubscribeto icc-announce if you are a member of this. Subject: AW: [Icc-avr] Error message Hi Derek, this #idndef __AABB_H__ /* Avoids multiple inclusion */ #define __AABB_H__ #endif /* end of #ifndef __AABB_H__ , at end of file */ construct is to avoid more than one execution of if this .h file is included in more than one .c file.... I think it's a standard K&R C recommendation.... I re-use a standard template for .h files which include such a contruct; this is to help-and-use-but-not-worry-anymore on your .h files. @Ton: I like your approach very much; I always try to organize my projects in that way. IMHO and not 100% serious: if many more people had followed that way (instead of C-spaghetti code) the OO-hype won't be there ;) Best, Stephan ________________________________ Von: icc-avr-bounces@imagecraft.com [mailto:icc-avr-bounces@imagecraft.com] Im Auftrag von Robertson, Derek Gesendet: Dienstag, 4. September 2007 10:13 An: Discussion list for ICCAVR and ICCtiny Users. You do NOT needtosubscribeto icc-announce if you are a member of this. Betreff: RE: [Icc-avr] Error message Presumably the myCar, myVar in this post is a typing error? Ton, I get your 'Object' approach, but I don't understand what this is for #idndef __AABB_H__ /* Avoids multiple inclusion */ #define __AABB_H__ I feel there may be a moment of enlightenment coming on! :o) ________________________________ From: Jaspers, Ton [mailto:t.jaspers@cpseurope.com] Sent: 04 September 2007 08:40 To: benra@imt.liu.se; Discussion list for ICCAVR and ICCtiny Users. You do NOT need to subscribeto icc-announce if you are a member of this. Subject: RE: [Icc-avr] Error message Close but I rather use this: In main file: unsigned char myVar=0; In other files: extern unsigned char myCar ; /* no initialisation, it is initialised where it ios defined only */ Further more I would suggest to put the external in a header file. If the declaration is in "aabb.c" then put the external in "aabb.h" like this: #idndef __AABB_H__ /* Avoids multiple inclusion */ #define __AABB_H__ extern unsigned char myCar ; #endif /* end of #ifndef __AABB_H__ , at end of file */ Personally I hate externals. I like to think in objects. The aabb.c file should provide an access methode (function) to access the myCar variable. In the "aabb.h" header file it would like something like this: #idndef __AABB_H__ /* Avoids multiple inclusion */ #define __AABB_H__ unsigned char readMyCar(void) ; int writeMyCar(unsigned char); #endif /* end of #ifndef __AABB_H__ , at end of file */ These access methodes provide a well controlled way to access the variable. The write functions, for example, could perform some range checking and return an error when the value is out of range. This is how we do it in medical instrument software that has to be scrutenized to the bone. Cheers, Ton ________________________________ From: icc-avr-bounces@imagecraft.com [mailto:icc-avr-bounces@imagecraft.com] On Behalf Of Bengt Ragnemalm Sent: dinsdag 4 september 2007 9:08 To: ICC-AVR discussion list Subject: SV: [Icc-avr] Error message Sorry, sorry SORRY, I missed the very important word extern in one of the lines! The static should not be there either. Here is how it should be: In main file: unsigned char myVar=0; In other files: extern unsigned char myCar=0; Now you can see that the problem is that I have put a predefined value in the second line. /Bengt ________________________________ Fr?n: John Baraclough [mailto:j_baraclough@zetnet.co.uk] Skickat: den 3 september 2007 18:32 Till: benra@imt.liu.se; Discussion list for ICCAVR and ICCtiny Users. You do NOT need to subscribe to icc-announce if you are a member of this. ?mne: Re: [Icc-avr] Error message Hi Bengt, You got that message because that is exactly what you have done. Global variables can only be defined in one place in the whole project. Everywhere else you must use the 'extern' keyword. John P.S. Last week Richard said he was going away for a "couple of years". I hope he only meant a "couple of weeks", but he has been very quiet. At 07:50 03/09/2007, you wrote: I got this error: !E filename.o(294): multiple define: 'myVar I did have some problems with multiple defined variables because of a bad #define in a header. But it was not with this variable so I just didn't understand a thing until I found out that I had assigned a value to this global variable and also by mistake assigned it in the place there it was defined as extern. Like this: In main file: static unsigned char myVar=0; In other files: unsigned char myCar=0; Richard: Is it possible that this could result in some other error message than "multiple define"? Something like "multiple assigning of predefined value..." /Bengt ________________________________________________________________ Bengt Ragnemalm Tel +46 13 22 24 97 Research engineer FAX: +46 13 10 19 02 Link?pings Universitet mailto:bengt.ragnemalm@imt.liu.se Inst. f?r Medicinsk Teknik Internet: http://www.imt.liu.se S-581 85 Link?ping SWEDEN _______________________________________________ Icc-avr mailing list Icc-avr@imagecraft.com http://dragonsgate.net/mailman/listinfo/icc-avr ________________________________ Logitech Ltd is a limited company registered in Scotland. Registration Number: SC42330 Registered Address: Erskine Ferry Road, Old Kilpatrick, Glasgow, G60 5EU, Scotland, UK ________________________________ This message (and any associated files) is intended only for the use of the individual or entity to which it is addressed and may contain information that is confidential, subject to copyright or constitutes a trade secret. If you are not the intended recipient you are hereby notified that any dissemination, copying or distribution of this message, or files associated with this message, is prohibited. If you have received this message in error, please notify us immediately by replying to the message and deleting it from your computer. Messages sent to and from us may be monitored. Any views or opinions presented are solely those of the author and do not necessarily represent those of the company. From sl at ecpower.dk Tue Sep 4 02:41:21 2007 From: sl at ecpower.dk (Steven Lose) Date: Wed Sep 5 14:21:14 2007 Subject: SV: [Icc-avr] Error message References: Message-ID: <072D96786BFC014AAEBA9EB07A8070EA285AEB@seattle.ecpower.dk> Hi. I also use the Get & Set functions to exchange values between the c files, never use extern. Unsigned char GetEngineTemperature(void) { Return ucEngineTemperature; } The above Is very simple and I sometimes wonder if Richard could get the compiler to optimise the functions away so the asm code does not perform calls to do it. (but maybe there is reasons for keeping the call) Richard, I remember a lot of talk about inline functions as well, is it in the pipeline somewhere? Med venlig hilsen / Best regards / mit freundlichen Gr??en EC POWER A/S Steven Lose Software Ingeni?r Tlf.: +45 87434100 Direkte tlf. +45 58286608 Email: sl@ecpower.dk www.ecpower.dk ________________________________ Fra: icc-avr-bounces@imagecraft.com [mailto:icc-avr-bounces@imagecraft.com] P? vegne af Daub, Stephan Sendt: 4. september 2007 10:57 Til: Discussion list for ICCAVR and ICCtiny Users. You do NOT needtosubscribeto icc-announce if you are a member of this. Emne: AW: [Icc-avr] Error message Hi Derek, this #idndef __AABB_H__ /* Avoids multiple inclusion */ #define __AABB_H__ #endif /* end of #ifndef __AABB_H__ , at end of file */ construct is to avoid more than one execution of if this .h file is included in more than one .c file.... I think it's a standard K&R C recommendation.... I re-use a standard template for .h files which include such a contruct; this is to help-and-use-but-not-worry-anymore on your .h files. @Ton: I like your approach very much; I always try to organize my projects in that way. IMHO and not 100% serious: if many more people had followed that way (instead of C-spaghetti code) the OO-hype won't be there ;) Best, Stephan ________________________________ Von: icc-avr-bounces@imagecraft.com [mailto:icc-avr-bounces@imagecraft.com] Im Auftrag von Robertson, Derek Gesendet: Dienstag, 4. September 2007 10:13 An: Discussion list for ICCAVR and ICCtiny Users. You do NOT needtosubscribeto icc-announce if you are a member of this. Betreff: RE: [Icc-avr] Error message Presumably the myCar, myVar in this post is a typing error? Ton, I get your 'Object' approach, but I don't understand what this is for #idndef __AABB_H__ /* Avoids multiple inclusion */ #define __AABB_H__ I feel there may be a moment of enlightenment coming on! :o) ________________________________ From: Jaspers, Ton [mailto:t.jaspers@cpseurope.com] Sent: 04 September 2007 08:40 To: benra@imt.liu.se; Discussion list for ICCAVR and ICCtiny Users. You do NOT need to subscribeto icc-announce if you are a member of this. Subject: RE: [Icc-avr] Error message Close but I rather use this: In main file: unsigned char myVar=0; In other files: extern unsigned char myCar ; /* no initialisation, it is initialised where it ios defined only */ Further more I would suggest to put the external in a header file. If the declaration is in "aabb.c" then put the external in "aabb.h" like this: #idndef __AABB_H__ /* Avoids multiple inclusion */ #define __AABB_H__ extern unsigned char myCar ; #endif /* end of #ifndef __AABB_H__ , at end of file */ Personally I hate externals. I like to think in objects. The aabb.c file should provide an access methode (function) to access the myCar variable. In the "aabb.h" header file it would like something like this: #idndef __AABB_H__ /* Avoids multiple inclusion */ #define __AABB_H__ unsigned char readMyCar(void) ; int writeMyCar(unsigned char); #endif /* end of #ifndef __AABB_H__ , at end of file */ These access methodes provide a well controlled way to access the variable. The write functions, for example, could perform some range checking and return an error when the value is out of range. This is how we do it in medical instrument software that has to be scrutenized to the bone. Cheers, Ton ________________________________ From: icc-avr-bounces@imagecraft.com [mailto:icc-avr-bounces@imagecraft.com] On Behalf Of Bengt Ragnemalm Sent: dinsdag 4 september 2007 9:08 To: ICC-AVR discussion list Subject: SV: [Icc-avr] Error message Sorry, sorry SORRY, I missed the very important word extern in one of the lines! The static should not be there either. Here is how it should be: In main file: unsigned char myVar=0; In other files: extern unsigned char myCar=0; Now you can see that the problem is that I have put a predefined value in the second line. /Bengt ________________________________ Fr?n: John Baraclough [mailto:j_baraclough@zetnet.co.uk] Skickat: den 3 september 2007 18:32 Till: benra@imt.liu.se; Discussion list for ICCAVR and ICCtiny Users. You do NOT need to subscribe to icc-announce if you are a member of this. ?mne: Re: [Icc-avr] Error message Hi Bengt, You got that message because that is exactly what you have done. Global variables can only be defined in one place in the whole project. Everywhere else you must use the 'extern' keyword. John P.S. Last week Richard said he was going away for a "couple of years". I hope he only meant a "couple of weeks", but he has been very quiet. At 07:50 03/09/2007, you wrote: I got this error: !E filename.o(294): multiple define: 'myVar I did have some problems with multiple defined variables because of a bad #define in a header. But it was not with this variable so I just didn't understand a thing until I found out that I had assigned a value to this global variable and also by mistake assigned it in the place there it was defined as extern. Like this: In main file: static unsigned char myVar=0; In other files: unsigned char myCar=0; Richard: Is it possible that this could result in some other error message than "multiple define"? Something like "multiple assigning of predefined value..." /Bengt ________________________________________________________________ Bengt Ragnemalm Tel +46 13 22 24 97 Research engineer FAX: +46 13 10 19 02 Link?pings Universitet mailto:bengt.ragnemalm@imt.liu.se Inst. f?r Medicinsk Teknik Internet: http://www.imt.liu.se S-581 85 Link?ping SWEDEN _______________________________________________ Icc-avr mailing list Icc-avr@imagecraft.com http://dragonsgate.net/mailman/listinfo/icc-avr ________________________________ Logitech Ltd is a limited company registered in Scotland. Registration Number: SC42330 Registered Address: Erskine Ferry Road, Old Kilpatrick, Glasgow, G60 5EU, Scotland, UK ________________________________ This message (and any associated files) is intended only for the use of the individual or entity to which it is addressed and may contain information that is confidential, subject to copyright or constitutes a trade secret. If you are not the intended recipient you are hereby notified that any dissemination, copying or distribution of this message, or files associated with this message, is prohibited. If you have received this message in error, please notify us immediately by replying to the message and deleting it from your computer. Messages sent to and from us may be monitored. Any views or opinions presented are solely those of the author and do not necessarily represent those of the company. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20070904/c785c2c9/attachment-0001.html From david_brown at hotpop.com Wed Sep 5 14:22:51 2007 From: david_brown at hotpop.com (David Brown) Date: Wed Sep 5 14:35:10 2007 Subject: [Icc-avr] Error message In-Reply-To: References: Message-ID: <46DF1E2B.3060007@hotpop.com> Robertson, Derek wrote: > Ah... I get it... > > It's like a "Only do this once" flag to the compiler. > > So, first time round __AABB_H__ isn't defined, so define it and do > . The next time the header is 'called', the compiler gets > to this bit, __AABB_H__ has been defined so you skip . > That's what the construct means, but you have to be careful how you use it if you want to write maintainable and understandable code. Remember that the C preprocessor is a very flexible hack-job to fix deficiencies in the C language, and it's easy to get carried away. > I've seen this construct a lot, but hadn't really understood > it or questioned it. > > So you could do something like.... > > #ifndef INIT > #define INIT // > unsigned char myVar = 0; > #endif > > void Set_myVar(unsigned char); > unsigned char Get_myVar(void); > > Then by including the header in several C files you make the function > proto-types 'public', but myVar only get's declared and initialised > once. Would I be right in saying that you would need to compile the the > C file to Object before compiling your project for myVar to be private > to the correct module? > Nope, it is going to turn out wrong - remember that all #define'd symbols are cleared at the beginning of each object file's compilation, so each C file with this header will get its own "unsigned char myVar = 0;". > > Would doing this in your C file > > #define C_FILE_NAME > > and this in your header file > > #ifdef C_FILE_NAME > unsigned char myVar = 0; > #endif > > void Set_myVar(unsigned char); > unsigned char Get_myVar(void); > > Not achieve the same result but force the correct scope, or am I still > not getting this? > > Derek I've seen many suggested ways to handle public and private symbols in C, and many ways to try to get program structure to work sensibly. There is one way that works far better than anything else I've seen, by following the models used by real structured languages such as Pascal or Modula 2: If you have a module "module.c" that contains some resources used by other modules then you want something like this: // module.h #ifndef module_h__ typedef unsigned char dataType; // Global typedefs included here extern dataType globalData; // Externally accessible data extern void doSomething(int x); // Externally accessible func. #endif // module.c #include "module.h" // Essential for consistency dataType globalData; // Definition (with or without // initialisation, as needed) void doSomthing(int x) { ... } // Function definition static int localData; static int localFunction(int y); So every module has an interface header file which describes the types, data and functions exported by the module. It also contains comments describing what the module and its functions do - anyone wanting to use the module need only read through the header file. The C file contains the implementation, and describes *how* the header's data and functions work. The point of using the #ifndef module_h__ ... #enddef clause is that the header files can be included multiple times. For example, if you have a module "time" that handles time information, your "logging" header might #include "time.h" because it needs typedefs from "time.h". Your "capture" module might #include both "time.h" and "logging.h" since it needs functions declared in both header files - the #ifndef trick makes this safe. It is important for "module.c" to #include "module.h" as a guarantee of consistency - data and functions are declared "extern" in the header and defined in the module itself - any mistakes will be caught at compile time. A key point is that all data and functions are either declared "extern" in the module's header, and are therefore globally accessible to any module #include'ing the header, or they are declared "static" and are therefore private to the module's implementation. It's good for structuring, it's good for modular programming, it's good for making the code clearer, and it lets the compiler generate better code (if the compiler can do inter-procedural optimisations). As an aside, hiding a simple global variable with two global "Set" and "Get" functions leads to double the name-space pollution, a messier syntax, unnecessary extra source code, and very inefficient object code, while providing approximately zero benefit in terms of data encapsulation or modularisation. If you want to actually implement something useful in the Set and Get code, such as range checking, or resource locking, then it makes sense. Don't add such access functions "just in case" - figure out what data is going to need purposeful access functions, and use them as needed. If a program re-structure means that previously simple variables need access, then you can easily add them later. mvh., David From jassenbaum at htp-tel.de Wed Sep 5 14:30:11 2007 From: jassenbaum at htp-tel.de (Johannes Assenbaum) Date: Wed Sep 5 14:40:00 2007 Subject: AW: [Icc-avr] Qry :AVR AVREF Value? References: <005001c7eecb$83f9b3a0$0200a8c0@BigFoot> Message-ID: <7OsQPyGvxFU6tI65zxDnovIAgDSnxFhWNSdA9is1SZX@akmail> AREF is derived from the bandgap voltage, that drifts by temperature and Vcc mainly. See figure 166 in mega8 datasheet for typical characteristics. Re initial precision, I think 2,605V @ 5V vcc is fair for that very low cost solution. For higher precision, actual AREF must be known to adjust ADC results by software. To get the actual AREF voltage, both measuring AREF at AREF pin and sampling a known voltage from distinct ADC input are common, depending on lot size. Regards, Johannes > Hi Gerhard, > I am sure you checked the correct setting of: ADMUX - REFS1:0: Reference > Selection Bits ? > ... > But I just checked the datasheet (mega8 for example) and found > VINT Internal Voltage Reference min 2.3 typ 2.56 max 2.7 V > but I did not found any note on the causing parameters (temp, .....) > hmmm.... > Best, Stephan > ________________________________ > Von: icc-avr-bounces@imagecraft.com > [mailto:icc-avr-bounces@imagecraft.com] Im Auftrag von AMS Solutions - > GJ Laubscher > Gesendet: Dienstag, 4. September 2007 10:14 > An: ImageCraft UserGroup > Betreff: [Icc-avr] Qry :AVR AVREF Value? > Hi All, > Using a mega8 with the ADC enabled selecting AVREF= internal 2.56vdc - > Sampling rate at 125k, which is within the 20-200khz as per atmel > -circuit -k > Vcc=5v > connected to > AVCC via 10uH, > connected with a 100nF cap to GND (as per recomm atmel) > & > external cap 100nF poly connected to Pin21 (AVREF) > I meassure 2.605Vdc on AVREF. > I expected to read 2.56Vdc...... > .........Using recently calibrated Fluke 77 > I wonder whether this V-value on AVREF is in fact correct or should it > have been 2.56V? > Maybe FLuke out on low V? > hmmm... maybe one of you guys have had the same experience or can point > me to more reading/appl > material. > I really appreciate your feedback! > Regards, > Gerhard Laubscher > TeleFax : +27-21-557 0160 Mobile : 082 366 1950 > email : amsol@amssolutions.co.za website: > http://www.amssolutions.co.za > _______________________________________________ > 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 Free Edition. > Version: 7.5.485 / Virus Database: 269.13.5/988 - Release Date: 04.09.07 09:14 From paul.aa9gg at gmail.com Wed Sep 5 14:50:41 2007 From: paul.aa9gg at gmail.com (Paul Mateer) Date: Wed Sep 5 15:47:14 2007 Subject: [Icc-avr] Error message In-Reply-To: <072D96786BFC014AAEBA9EB07A8070EA285AEB@seattle.ecpower.dk> References: <072D96786BFC014AAEBA9EB07A8070EA285AEB@seattle.ecpower.dk> Message-ID: <20f5efc40709051450l761eb835m90f8fad0e2bd7280@mail.gmail.com> Hi All..... I too do this: In main file: unsigned char myVar=0; In other files: extern unsigned char myCar ; /* no initialisation, it is initialised where it ios defined only */ I have one file called RAM0.h with the initial declaration and then RAM1.hwith the extern declaration. In my main file I include RAM0.h and then in all others include RAM1.h 73 de Paul, AA9GG On 9/4/07, Steven Lose wrote: > > Hi. > > > > I also use the Get & Set functions to exchange values between the c files, > never use extern. > > > > Unsigned char GetEngineTemperature(void) > > { > > Return ucEngineTemperature; > > } > > > > The above Is very simple and I sometimes wonder if Richard could get the > compiler to optimise the functions away so the asm code does not perform > calls to do it. > > (but maybe there is reasons for keeping the call) > > > > Richard, I remember a lot of talk about inline functions as well, is it in > the pipeline somewhere? > > Med venlig hilsen / Best regards / mit freundlichen Gr??en > > *EC POWER A/S* > > *Steven Lose* > > Software Ingeni?r > > Tlf.: +45 87434100 > > Direkte tlf. +45 58286608 > > Email: sl@ecpower.dk > > www.ecpower.dk > ------------------------------ > > *Fra:* icc-avr-bounces@imagecraft.com [mailto: > icc-avr-bounces@imagecraft.com] *P? vegne af *Daub, Stephan > *Sendt:* 4. september 2007 10:57 > *Til:* Discussion list for ICCAVR and ICCtiny Users. You do NOT > needtosubscribeto icc-announce if you are a member of this. > *Emne:* AW: [Icc-avr] Error message > > > > Hi Derek, > > > > this > > > > #idndef __AABB_H__ /* Avoids multiple inclusion */ > > #define __AABB_H__ > > > > #endif /* end of #ifndef __AABB_H__ , at end of file */ > > > > construct is to avoid more than one execution of if this .h > file is included in more than one .c file.... > > I think it's a standard K&R C recommendation.... > > I re-use a standard template for .h files which include such a contruct; > this is to help-and-use-but-not-worry-anymore on your .h files. > > > > > > @Ton: I like your approach very much; I always try to organize my projects > in that way. > > IMHO and not 100% serious: if many more people had followed that way > (instead of C-spaghetti code) the OO-hype won't be there ;) > > > > Best, Stephan > > > ------------------------------ > > *Von:* icc-avr-bounces@imagecraft.com [mailto: > icc-avr-bounces@imagecraft.com] *Im Auftrag von *Robertson, Derek > *Gesendet:* Dienstag, 4. September 2007 10:13 > *An:* Discussion list for ICCAVR and ICCtiny Users. You do NOT > needtosubscribeto icc-announce if you are a member of this. > *Betreff:* RE: [Icc-avr] Error message > > > > Presumably the myCar, myVar in this post is a typing error? > > > > Ton, I get your 'Object' approach, but I don't understand what this is for > > > > #idndef __AABB_H__ /* Avoids multiple inclusion */ > > #define __AABB_H__ > > > > I feel there may be a moment of enlightenment coming on! :o) > ------------------------------ > > *From:* Jaspers, Ton [mailto:t.jaspers@cpseurope.com] > *Sent:* 04 September 2007 08:40 > *To:* benra@imt.liu.se; Discussion list for ICCAVR and ICCtiny Users. You > do NOT need to subscribeto icc-announce if you are a member of this. > *Subject:* RE: [Icc-avr] Error message > > Close but I rather use this: > > > > In main file: > unsigned char myVar=0; > > In other files: > extern unsigned char myCar ; /* no initialisation, it is > initialised where it ios defined only */ > > > > Further more I would suggest to put the external in a header file. > > If the declaration is in "aabb.c" then put the external in "aabb.h" like > this: > > > > #idndef __AABB_H__ /* Avoids multiple inclusion */ > > #define __AABB_H__ > > > > extern unsigned char myCar ; > > > > > > #endif /* end of #ifndef __AABB_H__ , at end of file */ > > > > > > Personally I hate externals. I like to think in objects. > > The aabb.c file should provide an access methode (function) to access the > myCar variable. > > In the "aabb.h" header file it would like something like this: > > > > > > #idndef __AABB_H__ /* Avoids multiple inclusion */ > > #define __AABB_H__ > > > > unsigned char readMyCar(void) ; > > int writeMyCar(unsigned char); > > #endif /* end of #ifndef __AABB_H__ , at end of file */ > > > > These access methodes provide a well controlled way to access the > variable. > > The write functions, for example, could perform some range checking and > return an error when the value is out of range. > > This is how we do it in medical instrument software that has to be > scrutenized to the bone. > > > > > > Cheers, Ton > > > > > > ------------------------------ > > *From:* icc-avr-bounces@imagecraft.com [mailto: > icc-avr-bounces@imagecraft.com] *On Behalf Of *Bengt Ragnemalm > *Sent:* dinsdag 4 september 2007 9:08 > *To:* ICC-AVR discussion list > *Subject:* SV: [Icc-avr] Error message > > Sorry, sorry SORRY, I missed the very important word extern in one of the > lines! The static should not be there either. Here is how it should be: > > In main file: > unsigned char myVar=0; > > In other files: > extern unsigned char myCar=0; > > Now you can see that the problem is that I have put a predefined value in > the second line. > > /Bengt > > > > > ------------------------------ > > *Fr?n:* John Baraclough [mailto:j_baraclough@zetnet.co.uk] > *Skickat:* den 3 september 2007 18:32 > *Till:* benra@imt.liu.se; Discussion list for ICCAVR and ICCtiny Users. > You do NOT need to subscribe to icc-announce if you are a member of this. > *?mne:* Re: [Icc-avr] Error message > > Hi Bengt, > > You got that message because that is exactly what you have done. Global > variables can only be defined in one place in the whole project. Everywhere > else you must use the 'extern' keyword. > > John > > > P.S. Last week Richard said he was going away for a "couple of years". I > hope he only meant a "couple of *weeks*", but he has been very quiet. > > > At 07:50 03/09/2007, you wrote: > > > I got this error: > > !E filename.o(294): multiple define: 'myVar > > I did have some problems with multiple defined variables because of a bad > #define in a header. But it was not with this variable so I just didn't > understand a thing until I found out that I had assigned a value to this > global variable and also by mistake assigned it in the place there it was > defined as extern. Like this: > > In main file: > static unsigned char myVar=0; > > In other files: > unsigned char myCar=0; > > Richard: Is it possible that this could result in some other error message > than "multiple define"? Something like "multiple assigning of predefined > value?" > > /Bengt > ________________________________________________________________ > > Bengt Ragnemalm Tel +46 13 22 24 97 > > Research engineer FAX: +46 13 10 19 > 02 > > Link?pings Universitet > mailto:bengt.ragnemalm@imt.liu.se > > Inst. f?r Medicinsk Teknik Internet: http://www.imt.liu.se > > S-581 85 Link?ping SWEDEN > > > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr > > > * > ------------------------------ > * > > *Logitech Ltd is a limited company registered in Scotland. Registration > Number: SC42330* > > *Registered Address: Erskine Ferry Road, Old Kilpatrick, Glasgow, G60 5EU, > Scotland, UK* > ------------------------------ > > > > This message (and any associated files) is intended only for the use of > the individual or entity > > to which it is addressed and may contain information that is confidential, > subject to copyright > > or constitutes a trade secret. If you are not the intended recipient you > are hereby notified that > > any dissemination, copying or distribution of this message, or files > associated with this message, > > is prohibited. If you have received this message in error, please notify > us immediately by replying > > to the message and deleting it from your computer. > > Messages sent to and from us may be monitored. > > Any views or opinions presented are solely those of the author and do not > necessarily represent > > those of the company. > > _______________________________________________ > 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/20070905/582e91cf/attachment-0001.html From BobGardner at aol.com Wed Sep 5 18:50:44 2007 From: BobGardner at aol.com (BobGardner@aol.com) Date: Wed Sep 5 19:02:54 2007 Subject: [Icc-avr] Error message Message-ID: In a message dated 9/5/2007 6:36:47 P.M. Eastern Daylight Time, paul.aa9gg@gmail.com writes: I also use the Get & Set functions to exchange values between the c files, never use extern. Unsigned char GetEngineTemperature(void) { Return ucEngineTemperature; } ======================================================== You'll need to give a summary of the pros and cons of this idea... its a lose in the speed and space department. Its a win in readability? What other criterion could possibly outweigh speed and space in any program? If the boss had a choice of two programs that passed the atp, one was written so that every variable was accessed with a call and a return instead of just a load, and as a result, ran slower and needed a bigger size flash, adding $2 extra for 10,000 32k processors instead of 10,000 16k processors, which would he approve for production? ************************************** Get a sneak peek of the all-new AOL at http://discover.aol.com/memed/aolcom30tour -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20070905/e9e02531/attachment.html From prsalter at bigpond.net.au Thu Sep 6 00:41:01 2007 From: prsalter at bigpond.net.au (Paul Salter) Date: Thu Sep 6 00:53:19 2007 Subject: [Icc-avr] avr studio plugin Message-ID: <008001c7f059$45cfa460$0100000a@rev> Hi, I have downloaded and installed the avr studio plug-in and installed it successfully. How do I now use avr studio as the editor ? Is there anything I need to setup after installation ? Regards Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20070906/2239aebd/attachment.html From richard-lists at imagecraft.com Thu Sep 6 01:15:34 2007 From: richard-lists at imagecraft.com (Richard) Date: Thu Sep 6 01:27:30 2007 Subject: [Icc-avr] avr studio plugin In-Reply-To: <008001c7f059$45cfa460$0100000a@rev> References: <008001c7f059$45cfa460$0100000a@rev> Message-ID: <200709060827.l868RTPX031823@dragonsgate2.imagecraft.com> An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20070906/8ff606ec/attachment.html From Derek.Robertson at logitech.uk.com Thu Sep 6 05:29:56 2007 From: Derek.Robertson at logitech.uk.com (Robertson, Derek) Date: Thu Sep 6 05:41:30 2007 Subject: [Icc-avr] Error message Message-ID: I guess it depends, on if your doing 10,000 identical units..... or 10 a year with a spec that get's changed on a daily basis.... I fall into the latter so more often than not, it's Maintainability/Readability that's more important. Thanks to all who shared there thoughts :o) So next question.... What is the correct way to use brackets and indentation ;o) ________________________________ From: BobGardner@aol.com [mailto:BobGardner@aol.com] Sent: 06 September 2007 02:51 To: icc-avr@imagecraft.com Subject: Re: [Icc-avr] Error message In a message dated 9/5/2007 6:36:47 P.M. Eastern Daylight Time, paul.aa9gg@gmail.com writes: I also use the Get & Set functions to exchange values between the c files, never use extern. Unsigned char GetEngineTemperature(void) { Return ucEngineTemperature; } ======================================================== You'll need to give a summary of the pros and cons of this idea... its a lose in the speed and space department. Its a win in readability? What other criterion could possibly outweigh speed and space in any program? If the boss had a choice of two programs that passed the atp, one was written so that every variable was accessed with a call and a return instead of just a load, and as a result, ran slower and needed a bigger size flash, adding $2 extra for 10,000 32k processors instead of 10,000 16k processors, which would he approve for production? ________________________________ Get a sneak peek of the all-new AOL.com . -------------------------------------------------------- Logitech Ltd is a limited company registered in Scotland. Registration Number: SC42330 Registered Address: Erskine Ferry Road, Old Kilpatrick, Glasgow, G60 5EU, Scotland, UK -------------------------------------------------------- This message (and any associated files) is intended only for the use of the individual or entity to which it is addressed and may contain information that is confidential, subject to copyright or constitutes a trade secret. If you are not the intended recipient you are hereby notified that any dissemination, copying or distribution of this message, or files associated with this message, is prohibited. If you have received this message in error, please notify us immediately by replying to the message and deleting it from your computer. Messages sent to and from us may be monitored. Any views or opinions presented are solely those of the author and do not necessarily represent those of the company. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20070906/35a31e2a/attachment.html From tobias.pflug at atm-computer.de Fri Sep 7 05:16:32 2007 From: tobias.pflug at atm-computer.de (Tobias Pflug) Date: Fri Sep 7 05:28:42 2007 Subject: [Icc-avr] test driven development Message-ID: <1189167392.6159.8.camel@p57.atm-computer.de> hi everyone, I was wondering if anyone in this list applies test-driven-development/unit testing in any of his embedded projects with imagecraft and if so, what frameworks you are using and what your experiences with it are. thanks. regards, Tobi From tim at sabretechnology.co.uk Thu Sep 13 07:17:59 2007 From: tim at sabretechnology.co.uk (Tim Mitchell) Date: Thu Sep 13 07:30:23 2007 Subject: [Icc-avr] Memory mapped display not working in bootloader Message-ID: <04671BB8D269034BBC4BB6BA894867260A80D5@sserver.SabreTechnology.local> Hello I am trying to write my first bootloader, for Mega USB1287. This is a 128K device. I have set the IDE to give me a 4K bootloader, and set to use external 32K sram. I have a 32K sram at 0000-3FFF and a display memory mapped at 0x8400-0x8F00. The display works fine in a normal program, however in the bootloader nothing seems to be being output to the display (same code copied to a new program) - in fact there is no activity on the external memory port at all. Is there any reason I can't do it like that in a bootloader? Or am I missing something really obvious? -- Tim Mitchell tim@sabretechnology.co.uk http://www.sabretechnology.co.uk Sabre Technology (Hull) Ltd, 3a Newlands Science Park, Hull HU6 7TQ Registered in England and Wales no.3131504 t:01482 801003 f:01482 801078 From tim at sabretechnology.co.uk Thu Sep 13 07:33:06 2007 From: tim at sabretechnology.co.uk (Tim Mitchell) Date: Thu Sep 13 07:45:28 2007 Subject: [Icc-avr] Re: Memory mapped display not working in bootloader Message-ID: <04671BB8D269034BBC4BB6BA894867260A80D6@sserver.SabreTechnology.local> Re my previous problem about the external memory interface not working, it appears that ICCAVR does not enable it when in bootloader mode. If I enable it myself using XMCRA=(1< References: <04671BB8D269034BBC4BB6BA894867260A80D5@sserver.SabreTechnology.local> Message-ID: Hi Tim, I think you may need to modify 'crtboot128.s' as it doesn't enable external RAM. The file 'extnewram.s' must be included to enable external RAM. Have a look at 'crtatmegaram.s' to see how this is done. John At 15:17 13/09/2007, you wrote: >Hello > >I am trying to write my first bootloader, for Mega USB1287. This is a >128K device. I have set the IDE to give me a 4K bootloader, and set to >use external 32K sram. > >I have a 32K sram at 0000-3FFF and a display memory mapped at >0x8400-0x8F00. The display works fine in a normal program, however in >the bootloader nothing seems to be being output to the display (same >code copied to a new program) - in fact there is no activity on the >external memory port at all. Is there any reason I can't do it like that >in a bootloader? > >Or am I missing something really obvious? > > >-- >Tim Mitchell >tim@sabretechnology.co.uk http://www.sabretechnology.co.uk >Sabre Technology (Hull) Ltd, 3a Newlands Science Park, Hull HU6 7TQ >Registered in England and Wales no.3131504 >t:01482 801003 f:01482 801078 > >_______________________________________________ >Icc-avr mailing list >Icc-avr@imagecraft.com >http://dragonsgate.net/mailman/listinfo/icc-avr From tozetd at gmail.com Thu Sep 13 13:51:50 2007 From: tozetd at gmail.com (Hamba Allah Laki-laki) Date: Thu Sep 13 14:04:07 2007 Subject: [Icc-avr] atmega8 RAM Configuration Message-ID: <48aab2470709131351p69f608b3w8ec5be0eb171c7d4@mail.gmail.com> I wish make a project with atmega8, i use ICCAVR v7.13A .. write my code... select project->option in compiler options windows, i select atmega8, on bottom , why we can choose external ram ??? did atmega8 support external memory (architecture)... ?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20070913/2251ea5f/attachment.html From jassenbaum at htp-tel.de Thu Sep 13 14:36:20 2007 From: jassenbaum at htp-tel.de (Johannes Assenbaum) Date: Thu Sep 13 14:46:17 2007 Subject: [Icc-avr] atmega8 RAM Configuration References: <48aab2470709131351p69f608b3w8ec5be0eb171c7d4@mail.gmail.com> Message-ID: Mega8 does not support external memory. Choose Mega8515/162 or just think big and go Mega64/128. > I wish make a project with atmega8, i use ICCAVR v7.13A > .. write my code... select project->option > in compiler options windows, i select atmega8, on bottom , why we can choose > external ram ??? > did atmega8 support external memory (architecture)... ?? From paul.aa9gg at gmail.com Thu Sep 13 14:52:38 2007 From: paul.aa9gg at gmail.com (Paul Mateer) Date: Thu Sep 13 15:04:56 2007 Subject: [Icc-avr] atmega8 RAM Configuration In-Reply-To: References: <48aab2470709131351p69f608b3w8ec5be0eb171c7d4@mail.gmail.com> Message-ID: <20f5efc40709131452p1d3a42b9k447207b67937f57@mail.gmail.com> We like the Mega32 :) On 9/13/07, Johannes Assenbaum wrote: > > Mega8 does not support external memory. Choose Mega8515/162 or just think > big and go Mega64/128. > > > > I wish make a project with atmega8, i use ICCAVR v7.13A > > > .. write my code... select project->option > > > in compiler options windows, i select atmega8, on bottom , why we can > choose > > external ram ??? > > > did atmega8 support external memory (architecture)... ?? > > > _______________________________________________ > 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/20070913/2b5ebb45/attachment.html From jassenbaum at htp-tel.de Thu Sep 13 15:02:34 2007 From: jassenbaum at htp-tel.de (Johannes Assenbaum) Date: Thu Sep 13 15:12:34 2007 Subject: [Icc-avr] atmega8 RAM Configuration References: <48aab2470709131351p69f608b3w8ec5be0eb171c7d4@mail.gmail.com> <20f5efc40709131452p1d3a42b9k447207b67937f57@mail.gmail.com> Message-ID: Mega32 has no external memory interface, too :-)) > We like the Mega32 :) > On 9/13/07, Johannes Assenbaum wrote: >> >> Mega8 does not support external memory. Choose Mega8515/162 or just think >> big and go Mega64/128. >> >> >> > I wish make a project with atmega8, i use ICCAVR v7.13A >> >> > .. write my code... select project->option >> >> > in compiler options windows, i select atmega8, on bottom , why we can >> choose >> > external ram ??? >> >> > did atmega8 support external memory (architecture)... ?? >> >> >> _______________________________________________ >> Icc-avr mailing list >> Icc-avr@imagecraft.com >> http://dragonsgate.net/mailman/listinfo/icc-avr >> > -- > Paul Mateer, AA9GG > Elan Engineering Corp. > www.elanengr.com From benra at imt.liu.se Thu Sep 13 22:59:37 2007 From: benra at imt.liu.se (Bengt Ragnemalm) Date: Thu Sep 13 23:11:40 2007 Subject: [Icc-avr] Bootloader Message-ID: <002501c7f694$6f1aab80$b160ec82@Shagrat> Is it possible for the normal program to access functions in the bootloader (to save space)? If that is so, how do I do it in C? Best regards Bengt ________________________________________________________________ Bengt Ragnemalm Tel +46 13 22 24 97 Research engineer FAX: +46 13 10 19 02 Link?pings Universitet mailto:bengt.ragnemalm@imt.liu.se Inst. f?r Medicinsk Teknik Internet: http://www.imt.liu.se S-581 85 Link?ping SWEDEN -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20070914/f292c01f/attachment.html From johan at edab.nu Fri Sep 14 00:00:00 2007 From: johan at edab.nu (=?iso-8859-1?Q?Johan_Wallstr=F6m?=) Date: Fri Sep 14 00:09:55 2007 Subject: [Icc-avr] Bootloader References: <002501c7f694$6f1aab80$b160ec82@Shagrat> Message-ID: <002e01c7f69c$de0ccb60$64026e0a@EDAB1> Hi I can think of two solutions: 1. Define addresses where the functions are located. Call these functions using pointers to functions. 2. To allow the functions to be at any address, have a table located at a specified address (in the bootloader area) containg the addresses of the functions you want to call. Here's an example of a function pointer (from a project in another compiler though): int (*ReadIgnition)(ubyte &ignitionStatus); So it's just called something like this: ubyte resultStatus; int resultRead = ReadIgnition(resultStatus); I guess if you would pick the value from a predefined table it would look something like this: typedef struct { int (*ReadIgnition)(ubyte &ignitionStatus); int (*ReadSomething)(ubyte &ignitionStatus); } TBootPointers; and then do const TBootPointers *bootPointers = 0xFC00; bootPointers->ReadIgnition(resultStatus); Or maybe this can be a clue: int (*ReadIgnition)(ubyte &ignitionStatus); ReadIgnition = (int (*)(ubyte &)) (*(*int)0xFC02); best regards Johan Wallstr?m Elektronik Design AB 060-169550 ----- Original Message ----- From: Bengt Ragnemalm To: ICC-AVR discussion list Sent: Friday, September 14, 2007 7:59 AM Subject: [Icc-avr] Bootloader Is it possible for the normal program to access functions in the bootloader (to save space)? If that is so, how do I do it in C? Best regards Bengt ________________________________________________________________ Bengt Ragnemalm Tel +46 13 22 24 97 Research engineer FAX: +46 13 10 19 02 Link?pings Universitet mailto:bengt.ragnemalm@imt.liu.se Inst. f?r Medicinsk Teknik Internet: http://www.imt.liu.se S-581 85 Link?ping SWEDEN ------------------------------------------------------------------------------ _______________________________________________ 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/20070914/603f84a6/attachment-0001.html From david_brown at hotpop.com Fri Sep 14 00:52:00 2007 From: david_brown at hotpop.com (David Brown) Date: Fri Sep 14 00:35:42 2007 Subject: [Icc-avr] Bootloader In-Reply-To: <002501c7f694$6f1aab80$b160ec82@Shagrat> References: <002501c7f694$6f1aab80$b160ec82@Shagrat> Message-ID: <46EA3DA0.4000800@hotpop.com> Bengt Ragnemalm wrote: > Is it possible for the normal program to access functions in the > bootloader (to save space)? If that is so, how do I do it in C? > > > > Best regards > > Bengt > You would want to set up a table of functions in the boot program such as: typedef void (*fvoid)(void); extern int foo(void); extern void bar(int a, int b); const fvoid funcTable[] = { (fvoid) foo, (fvoid) bar } You need to either fix it at a specific address, or to find it's address and compile that into the main program: typedef void (*fvoid)(void); #define funcTableAddress 0x1000 // Or whatever #define funcTable(n) (((fvoid*) funcTableAddress)[n]) #define foo() ((int (*)(void)) funcTable(0))() #define bar(a, b) ((void (*)(int, int)) funcTable(1))(a, b) Then you can use foo() and bar(a, b) as though they were normal functions. mvh., David From tim at sabretechnology.co.uk Tue Sep 18 01:49:55 2007 From: tim at sabretechnology.co.uk (Tim Mitchell) Date: Tue Sep 18 02:02:30 2007 Subject: [Icc-avr] Including bootloader in main hex file Message-ID: <04671BB8D269034BBC4BB6BA894867260A80EB@sserver.SabreTechnology.local> It's obviously bootloader week here on iccavr. I have finally got my stand-alone bootloader application working for my AVR90USB1287 project. Is there a good way of including the bootloader's hex file in with the main application hex file for production programming? Seems like a simple question but I can't work out how, other than combining the hex files manually. -- Tim Mitchell tim@sabretechnology.co.uk http://www.sabretechnology.co.uk Sabre Technology (Hull) Ltd, 3a Newlands Science Park, Hull HU6 7TQ Registered in England and Wales no.3131504 t:01482 801003 f:01482 801078 From richard-lists at imagecraft.com Tue Sep 18 02:14:57 2007 From: richard-lists at imagecraft.com (Richard) Date: Tue Sep 18 02:27:20 2007 Subject: [Icc-avr] Including bootloader in main hex file In-Reply-To: <04671BB8D269034BBC4BB6BA894867260A80EB@sserver.SabreTechno logy.local> References: <04671BB8D269034BBC4BB6BA894867260A80EB@sserver.SabreTechnology.local> Message-ID: <200709180927.l8I9RJMV090986@dragonsgate2.imagecraft.com> Yup, just concat them... At 01:49 AM 9/18/2007, Tim Mitchell wrote: >It's obviously bootloader week here on iccavr. > >I have finally got my stand-alone bootloader application working for my >AVR90USB1287 project. Is there a good way of including the bootloader's >hex file in with the main application hex file for production >programming? Seems like a simple question but I can't work out how, >other than combining the hex files manually. // richard (This email is for mailing lists. To reach me directly, please use richard at imagecraft.com) From sl at ecpower.dk Tue Sep 18 02:23:21 2007 From: sl at ecpower.dk (Steven Lose) Date: Tue Sep 18 02:35:46 2007 Subject: SV: [Icc-avr] Including bootloader in main hex file References: <04671BB8D269034BBC4BB6BA894867260A80EB@sserver.SabreTechnology.local> Message-ID: <072D96786BFC014AAEBA9EB07A8070EA286028@seattle.ecpower.dk> Hi Tim. I have no bootloader experience - yet, but I use a bat file to do the programming, and as I see it, it's just an extra programming that needs to be done, and another fuse setting to protect the boot area afterwards. So that the result would be: Programming Bootloader code Programming main sw code Program fuses to protect bootloader Med venlig hilsen / Best regards / mit freundlichen Gr??en EC POWER A/S Steven Lose Software Ingeni?r Tlf.: +45 87434100 Direkte tlf. +45 58286608 Email: sl@ecpower.dk www.ecpower.dk -----Oprindelig meddelelse----- Fra: icc-avr-bounces@imagecraft.com [mailto:icc-avr-bounces@imagecraft.com] P? vegne af Tim Mitchell Sendt: 18. september 2007 10:50 Til: Discussion list for ICCAVR and ICCtiny Users. You do NOT needtosubscribeto icc-announce if you are a member of this. Emne: [Icc-avr] Including bootloader in main hex file It's obviously bootloader week here on iccavr. I have finally got my stand-alone bootloader application working for my AVR90USB1287 project. Is there a good way of including the bootloader's hex file in with the main application hex file for production programming? Seems like a simple question but I can't work out how, other than combining the hex files manually. -- Tim Mitchell tim@sabretechnology.co.uk http://www.sabretechnology.co.uk Sabre Technology (Hull) Ltd, 3a Newlands Science Park, Hull HU6 7TQ Registered in England and Wales no.3131504 t:01482 801003 f:01482 801078 _______________________________________________ Icc-avr mailing list Icc-avr@imagecraft.com http://dragonsgate.net/mailman/listinfo/icc-avr From jh.bodin at telia.com Tue Sep 18 02:36:26 2007 From: jh.bodin at telia.com (Johan H. Bodin) Date: Tue Sep 18 02:48:36 2007 Subject: [Icc-avr] Including bootloader in main hex file In-Reply-To: <200709180927.l8I9RJMV090986@dragonsgate2.imagecraft.com> References: <04671BB8D269034BBC4BB6BA894867260A80EB@sserver.SabreTechnology.local> <200709180927.l8I9RJMV090986@dragonsgate2.imagecraft.com> Message-ID: <46EF9C1A.8070702@telia.com> It may work, but the chip programming software at the other end may choose to stop reading the file when it encounters the first intelhex "end record". You may wish to remove the end record (:00000001FF) from the first file before concat'ing the files. Regards Johan Bodin Richard wrote: > Yup, just concat them... > > At 01:49 AM 9/18/2007, Tim Mitchell wrote: >> It's obviously bootloader week here on iccavr. >> >> I have finally got my stand-alone bootloader application working for my >> AVR90USB1287 project. Is there a good way of including the bootloader's >> hex file in with the main application hex file for production >> programming? Seems like a simple question but I can't work out how, >> other than combining the hex files manually. From johan at edab.nu Tue Sep 18 05:01:27 2007 From: johan at edab.nu (=?iso-8859-1?Q?Johan_Wallstr=F6m?=) Date: Tue Sep 18 05:11:24 2007 Subject: [Icc-avr] Including bootloader in main hex file References: <04671BB8D269034BBC4BB6BA894867260A80EB@sserver.SabreTechnology.local> Message-ID: <004d01c7f9eb$a4bf9c00$64026e0a@EDAB1> Hi Tim Here's two possible solutions: * Program a device with the first file, then the other file (make sure to only erase the device before programming it with the first file). Then read out the complete file from the device and save it again. * Use srec_cat.exe and a batch file. It's a software to merge hex files correctly. I can't recall exactly where I got mine from, but I can send it if you want. It's quite nice, just run the batch file and the files will be merged directly. regards Johan Wallstr?m EDAB ----- Original Message ----- From: "Tim Mitchell" To: "Discussion list for ICCAVR and ICCtiny Users. You do NOT needtosubscribeto icc-announce if you are a member of this." Sent: Tuesday, September 18, 2007 10:49 AM Subject: [Icc-avr] Including bootloader in main hex file > It's obviously bootloader week here on iccavr. > > I have finally got my stand-alone bootloader application working for my > AVR90USB1287 project. Is there a good way of including the bootloader's > hex file in with the main application hex file for production > programming? Seems like a simple question but I can't work out how, > other than combining the hex files manually. > > > -- > Tim Mitchell > tim@sabretechnology.co.uk http://www.sabretechnology.co.uk > Sabre Technology (Hull) Ltd, 3a Newlands Science Park, Hull HU6 7TQ > Registered in England and Wales no.3131504 > t:01482 801003 f:01482 801078 > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr > > From stephan.daub at sap.com Tue Sep 18 05:43:09 2007 From: stephan.daub at sap.com (Daub, Stephan) Date: Tue Sep 18 05:59:04 2007 Subject: AW: [Icc-avr] Including bootloader in main hex file In-Reply-To: <004d01c7f9eb$a4bf9c00$64026e0a@EDAB1> Message-ID: Hi Johan, >I can't recall exactly where I got mine from, it's part of WINAVR. This is the original source: http://srecord.sourceforge.net/ by Peter Miller... Best, Stephan -----Urspr?ngliche Nachricht----- Von: icc-avr-bounces@imagecraft.com [mailto:icc-avr-bounces@imagecraft.com] Im Auftrag von Johan Wallstr?m Gesendet: Dienstag, 18. September 2007 14:01 An: Discussion list for ICCAVR and ICCtiny Users. You do NOT needtosubscribeto icc-announce if you are a member of this. Betreff: Re: [Icc-avr] Including bootloader in main hex file Hi Tim Here's two possible solutions: * Program a device with the first file, then the other file (make sure to only erase the device before programming it with the first file). Then read out the complete file from the device and save it again. * Use srec_cat.exe and a batch file. It's a software to merge hex files correctly. I can't recall exactly where I got mine from, but I can send it if you want. It's quite nice, just run the batch file and the files will be merged directly. regards Johan Wallstr?m EDAB ----- Original Message ----- From: "Tim Mitchell" To: "Discussion list for ICCAVR and ICCtiny Users. You do NOT needtosubscribeto icc-announce if you are a member of this." Sent: Tuesday, September 18, 2007 10:49 AM Subject: [Icc-avr] Including bootloader in main hex file > It's obviously bootloader week here on iccavr. > > I have finally got my stand-alone bootloader application working for my > AVR90USB1287 project. Is there a good way of including the bootloader's > hex file in with the main application hex file for production > programming? Seems like a simple question but I can't work out how, > other than combining the hex files manually. > > > -- > Tim Mitchell > tim@sabretechnology.co.uk http://www.sabretechnology.co.uk > Sabre Technology (Hull) Ltd, 3a Newlands Science Park, Hull HU6 7TQ > Registered in England and Wales no.3131504 > t:01482 801003 f:01482 801078 > > _______________________________________________ > 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 tim at sabretechnology.co.uk Tue Sep 18 07:37:06 2007 From: tim at sabretechnology.co.uk (Tim Mitchell) Date: Tue Sep 18 07:49:35 2007 Subject: [Icc-avr] Including bootloader in main hex file Message-ID: <04671BB8D269034BBC4BB6BA894867260A80F0@sserver.SabreTechnology.local> Johan Wallstr?m wrote: > Hi Tim > > Here's two possible solutions: > * Program a device with the first file, then the other file (make > sure to only erase the device before programming it with the first > file). Then read out the complete file from the device and save it > again. > * Use srec_cat.exe and a batch file. It's a software to merge hex > files correctly. I can't recall exactly where I got mine from, but I > can send it if you want. It's quite nice, just run the batch file and > the files will be merged directly. > Thanks for all advice, sreg_cat in the "execute command after successful build" option does the trick nicely, making sure the bootloader is always included in the hex file. As Stephan said it comes with WinAVR and was already lurking on my pc. If anyone else is trying to do this the correct format, which took me a while to discover, is: srec_cat .hex -intel .hex -intel -o .hex -intel It complains about missing start addresses in the hex files which ICCAVR does not appear to provide, but still works ok. -- Tim Mitchell tim@sabretechnology.co.uk http://www.sabretechnology.co.uk Sabre Technology (Hull) Ltd, 3a Newlands Science Park, Hull HU6 7TQ Registered in England and Wales no.3131504 t:01482 801003 f:01482 801078 From richard at imagecraft.com Thu Sep 20 15:19:00 2007 From: richard at imagecraft.com (Richard) Date: Thu Sep 20 15:31:48 2007 Subject: [Icc-avr] ICCAVR 7.14A released Message-ID: <200709202231.l8KMViXU031313@dragonsgate2.imagecraft.com> A bug fix patch: V7.14A - September 20th 2007 Compiler - [ bug introduced in 7.14 ] Conditional of the form if (long_func() != 0) was trashing R16 // 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 tim at sabretechnology.co.uk Fri Sep 21 01:10:05 2007 From: tim at sabretechnology.co.uk (Tim Mitchell) Date: Fri Sep 21 01:22:39 2007 Subject: [Icc-avr] Problem with code compressor Message-ID: <04671BB8D269034BBC4BB6BA894867260A8108@sserver.SabreTechnology.local> In my AT90USB1287 application, I tried enabling the code compressor to see how much it would compress. It compiles fine but the application no longer runs. Before I delve into a lengthy fault finding mission, are there any gotchas I should be aware of when using the code compressor? (the application is about 75Kbytes uncompressed, so over the 64K boundary, if that makes any difference). -- Tim Mitchell tim@sabretechnology.co.uk http://www.sabretechnology.co.uk Sabre Technology (Hull) Ltd, 3a Newlands Science Park, Hull HU6 7TQ Registered in England and Wales no.3131504 t:01482 801003 f:01482 801078 From richard-lists at imagecraft.com Fri Sep 21 01:48:57 2007 From: richard-lists at imagecraft.com (Richard) Date: Fri Sep 21 02:01:04 2007 Subject: [Icc-avr] Problem with code compressor In-Reply-To: <04671BB8D269034BBC4BB6BA894867260A8108@sserver.SabreTechno logy.local> References: <04671BB8D269034BBC4BB6BA894867260A8108@sserver.SabreTechnology.local> Message-ID: <200709210901.l8L912S2037237@dragonsgate2.imagecraft.com> First: what version? Help->About tells. The major thing to watch out for is timing dependent sequence, e.g. timing loops, or this sequence must occur in X cycles etc. types of code. In either case, you can disable the code compressor on relevant code fragments. Increase the HW stack by 10 bytes or so. Hopefully this will not put pressure on your software stack. Otherwise, the code compressor has been stable and robust for a number of years now. At 01:10 AM 9/21/2007, Tim Mitchell wrote: >In my AT90USB1287 application, I tried enabling the code compressor to >see how much it would compress. It compiles fine but the application no >longer runs. Before I delve into a lengthy fault finding mission, are >there any gotchas I should be aware of when using the code compressor? > >(the application is about 75Kbytes uncompressed, so over the 64K >boundary, if that makes any difference). // richard (This email is for mailing lists. To reach me directly, please use richard at imagecraft.com) From tim at sabretechnology.co.uk Fri Sep 21 02:27:00 2007 From: tim at sabretechnology.co.uk (Tim Mitchell) Date: Fri Sep 21 02:39:36 2007 Subject: [Icc-avr] Problem with code compressor Message-ID: <04671BB8D269034BBC4BB6BA894867260A810E@sserver.SabreTechnology.local> Richard wrote: > First: what version? Help->About tells. > > The major thing to watch out for is timing dependent sequence, e.g. > timing loops, or this sequence must occur in X cycles etc. types of > code. In either case, you can disable the code compressor on relevant > code fragments. > > Increase the HW stack by 10 bytes or so. Hopefully this will not put > pressure on your software stack. > > Otherwise, the code compressor has been stable and robust for a > number of years now. > ICCAVR version V7.13A Increasing stack does not make a difference, and I don't know of any time sensitive code. I will try to identify where it is going wrong. -- Tim Mitchell tim@sabretechnology.co.uk http://www.sabretechnology.co.uk Sabre Technology (Hull) Ltd, 3a Newlands Science Park, Hull HU6 7TQ Registered in England and Wales no.3131504 t:01482 801003 f:01482 801078 From sl at ecpower.dk Fri Sep 21 02:44:41 2007 From: sl at ecpower.dk (Steven Lose) Date: Fri Sep 21 02:57:07 2007 Subject: [Icc-avr] can't execute iccomavr.exe im 7.14a Message-ID: <072D96786BFC014AAEBA9EB07A8070EA2861B7@seattle.ecpower.dk> Hi. Just installed 7.14a And got this after a few compiles. iccavr: can't execute `C:\iccv7avr\bin\iccomavr.exe' C:\iccv7avr\bin\imakew.exe: Error code 100 Done: there are error(s). Exit code: 100. Fri Sep 21 11:38:39 2007 Med venlig hilsen / Best regards / mit freundlichen Gr??en EC POWER A/S Steven Lose Software Ingeni?r Tlf.: +45 87434100 Direkte tlf. +45 58286608 Email: sl@ecpower.dk www.ecpower.dk -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20070921/382c1425/attachment.html From sl at ecpower.dk Fri Sep 21 02:58:13 2007 From: sl at ecpower.dk (Steven Lose) Date: Fri Sep 21 03:10:46 2007 Subject: [Icc-avr] SV: can't execute iccomavr.exe im 7.14a Message-ID: <072D96786BFC014AAEBA9EB07A8070EA2861BA@seattle.ecpower.dk> Hi again. Reboot did not help. Reinstall 7.14a did not help Going back to 7.14 did not help Unmark 64 bit double helped. Now I'm back on 7.14a and it's ok. So it seems to be something about the 64bit fp. Best regards Steven ________________________________ Fra: Steven Lose Sendt: 21. september 2007 11:45 Til: Discussion list for ICCAVR and ICCtiny Users. You do NOT needtosubscribeto icc-announce if you are a member of this. Emne: can't execute iccomavr.exe im 7.14a Hi. Just installed 7.14a And got this after a few compiles. iccavr: can't execute `C:\iccv7avr\bin\iccomavr.exe' C:\iccv7avr\bin\imakew.exe: Error code 100 Done: there are error(s). Exit code: 100. Fri Sep 21 11:38:39 2007 Med venlig hilsen / Best regards / mit freundlichen Gr??en EC POWER A/S Steven Lose Software Ingeni?r Tlf.: +45 87434100 Direkte tlf. +45 58286608 Email: sl@ecpower.dk www.ecpower.dk -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20070921/52aa2d73/attachment-0001.html From richard-lists at imagecraft.com Fri Sep 21 03:17:17 2007 From: richard-lists at imagecraft.com (Richard) Date: Fri Sep 21 03:29:23 2007 Subject: [Icc-avr] can't execute iccomavr.exe im 7.14a In-Reply-To: <072D96786BFC014AAEBA9EB07A8070EA2861B7@seattle.ecpower.dk> References: <072D96786BFC014AAEBA9EB07A8070EA2861B7@seattle.ecpower.dk> Message-ID: <200709211029.l8LATM5Y038840@dragonsgate2.imagecraft.com> An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20070921/b12f78b0/attachment.html From paul.aa9gg at gmail.com Fri Sep 21 06:13:30 2007 From: paul.aa9gg at gmail.com (Paul Mateer) Date: Fri Sep 21 06:26:02 2007 Subject: [Icc-avr] Problem with code compressor In-Reply-To: <04671BB8D269034BBC4BB6BA894867260A810E@sserver.SabreTechnology.local> References: <04671BB8D269034BBC4BB6BA894867260A810E@sserver.SabreTechnology.local> Message-ID: <20f5efc40709210613m16300684t4c0e3ed492969a61@mail.gmail.com> I've stopped upgrading since V7.12. I too had lockup problems and variables getting trashed. Still haven't found out why(don't have the time), but my code runs fine with V7.12. Strange. On 9/21/07, Tim Mitchell wrote: > > Richard wrote: > > First: what version? Help->About tells. > > > > The major thing to watch out for is timing dependent sequence, e.g. > > timing loops, or this sequence must occur in X cycles etc. types of > > code. In either case, you can disable the code compressor on relevant > > code fragments. > > > > Increase the HW stack by 10 bytes or so. Hopefully this will not put > > pressure on your software stack. > > > > Otherwise, the code compressor has been stable and robust for a > > number of years now. > > > > ICCAVR version V7.13A > Increasing stack does not make a difference, and I don't know of any > time sensitive code. I will try to identify where it is going wrong. > > -- > Tim Mitchell > tim@sabretechnology.co.uk http://www.sabretechnology.co.uk > Sabre Technology (Hull) Ltd, 3a Newlands Science Park, Hull HU6 7TQ > Registered in England and Wales no.3131504 > t:01482 801003 f:01482 801078 > > _______________________________________________ > 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/20070921/0baa1aa8/attachment.html From sl at ecpower.dk Fri Sep 21 08:44:44 2007 From: sl at ecpower.dk (Steven Lose) Date: Fri Sep 21 08:57:20 2007 Subject: SV: [Icc-avr] Problem with code compressor Message-ID: <072D96786BFC014AAEBA9EB07A8070EA2861EC@seattle.ecpower.dk> Hi I've had the same experience when the first MIO came out. At first I just didn't use it, but later on, when I really really needed the last % space, I finally speed the hours on figuring out why, and not surprisingly, even though my software had run for year's with no problems at many customers, it turned out to be a SW error. Best regards Steven ________________________________ Fra: icc-avr-bounces@imagecraft.com [mailto:icc-avr-bounces@imagecraft.com] P? vegne af Paul Mateer Sendt: 21. september 2007 15:14 Til: Discussion list for ICCAVR and ICCtiny Users. You do NOT need tosubscribe to icc-announce if you are a member of this. Emne: Re: [Icc-avr] Problem with code compressor I've stopped upgrading since V7.12. I too had lockup problems and variables getting trashed. Still haven't found out why(don't have the time), but my code runs fine with V7.12. Strange. On 9/21/07, Tim Mitchell wrote: Richard wrote: > First: what version? Help->About tells. > > The major thing to watch out for is timing dependent sequence, e.g. > timing loops, or this sequence must occur in X cycles etc. types of > code. In either case, you can disable the code compressor on relevant > code fragments. > > Increase the HW stack by 10 bytes or so. Hopefully this will not put > pressure on your software stack. > > Otherwise, the code compressor has been stable and robust for a > number of years now. > ICCAVR version V7.13A Increasing stack does not make a difference, and I don't know of any time sensitive code. I will try to identify where it is going wrong. -- Tim Mitchell tim@sabretechnology.co.uk http://www.sabretechnology.co.uk Sabre Technology (Hull) Ltd, 3a Newlands Science Park, Hull HU6 7TQ Registered in England and Wales no.3131504 t:01482 801003 f:01482 801078 _______________________________________________ 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/20070921/ae489354/attachment.html From ira at extrasensory.com Fri Sep 21 14:23:48 2007 From: ira at extrasensory.com (Ira) Date: Fri Sep 21 14:36:28 2007 Subject: [Icc-avr] 3 byte long? Message-ID: <0MKpCa-1IYpyg21EM-0007N7@mrelay.perfora.net> I'm working on a project and I'd rather not go to the next bigger processor. The easiest place to save space would be if there was an easy way to implement 3 byte longs. I could do it all by hand but the code gets so much messier and know in this code that the fourth byte will never be anything but zero. Am I dreaming or has this been done? Ira From jh.bodin at telia.com Fri Sep 21 15:03:37 2007 From: jh.bodin at telia.com (Johan H. Bodin) Date: Fri Sep 21 15:15:54 2007 Subject: [Icc-avr] 3 byte long? In-Reply-To: <0MKpCa-1IYpyg21EM-0007N7@mrelay.perfora.net> References: <0MKpCa-1IYpyg21EM-0007N7@mrelay.perfora.net> Message-ID: <46F43FB9.2020209@telia.com> Yes! That would be a nice addition to the "standard C types"! It has been done in the PIC world... BKND compilers supports single bit and 24-bit variables in addition to the usual ones. Regards Johan Ira wrote: > I'm working on a project and I'd rather not go to the next bigger > processor. The easiest place to save space would be if there was an easy > way to implement 3 byte longs. I could do it all by hand but the code > gets so much messier and know in this code that the fourth byte will > never be anything but zero. Am I dreaming or has this been done? > > Ira From sbissonnette at microsyl.com Mon Sep 24 16:21:43 2007 From: sbissonnette at microsyl.com (Sylvain Bissonnette) Date: Mon Sep 24 15:39:49 2007 Subject: [Icc-avr] #define problem References: <200708141017.l7EAHXTL058581@dragonsgate2.imagecraft.com> <1187086936.6134.8.camel@p57.atm-computer.de> <200708142003.l7EK39GQ065520@dragonsgate2.imagecraft.com> <46C21C36.4000202@hotpop.com> <200708142225.l7EMPiDs067806@dragonsgate2.imagecraft.com> <000c01c7dee1$5d775ce0$0301a8c0@Sylvain> Message-ID: <000801c7ff01$ab2b72b0$0301a8c0@Sylvain> Hi, Is there a way to do #define MEGATYPE "Mega8" #if (MEGATYPE == "Mega8") #include "iom8v.h" #endif Thanks for your time Sylvain Bissonnette ----- Original Message ----- From: "Sylvain Bissonnette" To: "Discussion list for ICCAVR and ICCtiny Users. You do NOT needtosubscribetoicc-announce if you are a member of this." Sent: Tuesday, August 14, 2007 9:09 PM Subject: [Icc-avr] From ASM to C > Hi, > > Long time ago Richard had give me this code (Thanks for!) but I want to > port if in C and I don't have any > knowleage of ASM. Any help will be usefull for me. > > Thanks > Sylvain Bissonnette > > > .if MEGATYPE64 | MEGATYPE128 > SPMCR = 0x68 > .else > SPMCR = 0x57 > .endif > > ;----------------------------------------- > > ; void write_page (unsigned int adr, unsigned char function); > ; bits 8:15 adr addresses the page...(must setup RAMPZ beforehand!!!) > _write_page:: > XCALL __WAIT_SPMEN__ > movw r30, r16 ;move address to z pointer (R31 = ZH, R30 = ZL) > STS SPMCR, R18 ;argument 2 decides function > SPM ;perform pagewrite > RET > > ;----------------------------------------- > > ; void fill_temp_buffer (unsigned int data, unsigned int adr); > ; bits 7:1 in adr addresses the word in the page... (2=first word, > 4=second word etc..) > _fill_temp_buffer:: > XCALL __WAIT_SPMEN__ > movw r30, r18 ;move adress to z pointer (R31=ZH R30=ZL) > movw r0, r16 ;move data to reg 0 and 1 > LDI R19, 0x01 > STS SPMCR, R19 > SPM ;Store program memory > RET > > ;----------------------------------------- > > ;unsigned int read_program_memory (unsigned int adr ,unsigned char cmd); > _read_program_memory:: > movw r30, r16 ;move adress to z pointer > SBRC R18, 0 ;read lockbits? (second argument = 0x09) > STS SPMCR, R18 ;if so, place second argument in SPMEN register > .if MEGATYPE128 > ELPM r16, Z+ ;read LSB > ELPM r17, Z ;read MSB > .else > LPM r16, Z+ > LPM r17, Z > .endif > RET > > ;----------------------------------------- > > ;void write_lock_bits (unsigned char val); > _write_lock_bits:: > MOV R0, R16 > LDI R17, 0x09 > STS SPMCR, R17 > SPM ;write lockbits > RET > > ;----------------------------------------- > > _enableRWW:: > XCALL __WAIT_SPMEN__ > LDI R27,0x11 > STS SPMCR,R27 > SPM > RET > > ;----------------------------------------- > > __WAIT_SPMEN__: > LDS R27,SPMCR ; load SPMCR to R27 > SBRC R27,0 ; check SPMEN flag > RJMP __WAIT_SPMEN__ ; wait for SPMEN flag cleared > RET > > ;----------------------------------------- > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr > From MDipperstein at CalAmp.com Mon Sep 24 15:43:00 2007 From: MDipperstein at CalAmp.com (Michael Dipperstein) Date: Mon Sep 24 15:54:55 2007 Subject: [Icc-avr] #define problem In-Reply-To: <000801c7ff01$ab2b72b0$0301a8c0@Sylvain> Message-ID: Why not just: #define ATMega8 #if defined ATMega8 #include #endif In fact the Makefile generated by the IDE should put something like -DATMega8 in the parameters passed to the compiler for you. I've done things like this before: #if defined ATMega88 #include #elif defined ATMega48 #include #elif defined ATMega168 #include #elif defined ATMega8 #include #endif -Mike -----Original Message----- From: icc-avr-bounces@imagecraft.com [mailto:icc-avr-bounces@imagecraft.com] On Behalf Of Sylvain Bissonnette Sent: Monday, September 24, 2007 4:22 PM To: Discussion list for ICCAVR and ICCtiny Users. You do NOT needtosubscribeto icc-announce if you are a member of this. Subject: [Icc-avr] #define problem Hi, Is there a way to do #define MEGATYPE "Mega8" #if (MEGATYPE == "Mega8") #include "iom8v.h" #endif Thanks for your time Sylvain Bissonnette ----- Original Message ----- From: "Sylvain Bissonnette" To: "Discussion list for ICCAVR and ICCtiny Users. You do NOT needtosubscribetoicc-announce if you are a member of this." Sent: Tuesday, August 14, 2007 9:09 PM Subject: [Icc-avr] From ASM to C > Hi, > > Long time ago Richard had give me this code (Thanks for!) but I want to > port if in C and I don't have any > knowleage of ASM. Any help will be usefull for me. > > Thanks > Sylvain Bissonnette > > > .if MEGATYPE64 | MEGATYPE128 > SPMCR = 0x68 > .else > SPMCR = 0x57 > .endif > > ;---