From richard-lists at imagecraft.com Thu Nov 1 00:39:15 2007 From: richard-lists at imagecraft.com (Richard) Date: Wed Oct 31 23:52:28 2007 Subject: [Icc-avr] IDE windows In-Reply-To: References: Message-ID: <200711010752.lA17qPmG035031@dragonsgate2.imagecraft.com> An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20071101/4fcc1eba/attachment.html From david_brown at hotpop.com Thu Nov 1 00:27:09 2007 From: david_brown at hotpop.com (David Brown) Date: Thu Nov 1 00:08:42 2007 Subject: SV: [Icc-avr] Bootloader problem In-Reply-To: <072D96786BFC014AAEBA9EB07A8070EA2CF0AD@seattle.ecpower.dk> References: <663810.87987.qm@web60416.mail.yahoo.com><001d01c81b3d$ad0cc770$0301a8c0@Sylvain><002d01c81b4f$23afcfb0$0301a8c0@Sylvain> <002a01c81c31$1f609e20$0301a8c0@Sylvain> <072D96786BFC014AAEBA9EB07A8070EA2CF0AD@seattle.ecpower.dk> Message-ID: <47298DDD.8010109@hotpop.com> (Rant - could people please not post hideous html emails on mailing lists like this? Plain text email works much better, and makes it easier to track attributions and quotations from different posters.) C does not *execute* from left to right. It *parses* from left to right, but the order of expressions within a sequence is not guaranteed in any way. The concept to understand here is "sequence points". The various expressions and statements of your program are separated by these sequence points, and the compiler's generated code preserves the order at each point. Thus all source code before a sequence point is executed before the given point, and none of the code from after that point has run. (Note that we are talking about the code's effect on the C virtual machine - optimising can re-order or change the code at any time, as long as it *acts* the same in the end.) Important sequence points are the ";" at the end of statements, just before a function call or return, and at the && and || operators. Other operators do not have sequence points, and there are no sequence points when evaluating function parameters. Thus the code: (A && B) will first evaluate A, then B (assuming that A evaluated to non-zero). However, the code (A + B) can evaluate A first, or B first - the order is not determined, as there is no sequence point. Similarly, foo(A, B) may evaluate A or B first. You might have come across this with examples like "foo(i, i++)" being undefined in C, since the order of evaluation is not specified. Thus the code: PageAddressHigh = RxChar() + (RxChar() << 8); is wrong. A good way to write this, ensuring that evaluation order is correct and is clear from the code, is: uint8_t tmpLo = RxChar(); uint8_t tmpHi = RxChar(); PageAddressHigh = tmpLo | (((uint16_t) tmpHi) << 8); mvh., David Steven Lose wrote: > Hi Sylvian. > > > > C executes from left to right, so #1 will be executes first. > > > > Just like this: > > > > If( ucCount && --!ucCount) > > { > > } > > > > Will detect the transition from non zero to zero > > > > But, is it readable? > > I avoid it and make an extra line, then it is clear what happens. > > > > Hence you ask, it is not clear what is happening, and then it is best to > avoid it. > > Or as some would says, if you read some code and have to stop at a line > and use time to understand what is happening, then it is not clear enough. > > > > 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 *Sylvain Bissonnette > *Sendt:* 1. november 2007 03:44 > *Til:* Discussion list for ICCAVR and ICCtiny Users. You do NOT > needtosubscribetoicc-announce if you are a member of this. > *Emne:* Re: [Icc-avr] Bootloader problem > > > > Hi Rodney, > > > > Thanks for your email that can not be more clear! a last question, > if I have > > > > PageAddressHigh = RxChar() + (RxChar() << 8); > > #1 #2 > > > > witch one of the 2 RxChar() will be execute first? > > > > Thanks > > Sylvain > > > > > > ----- Original Message ----- > > *From:* Rodney Pearson > > *To:* Discussion list for ICCAVR and ICCtiny Users. You do NOT > needtosubscribeto icc-announce if you are a member of this. > > > *Sent:* Wednesday, October 31, 2007 9:01 AM > > *Subject:* RE: [Icc-avr] Bootloader problem > > > > Sylvain ? > > > > To repeat what John mentioned in his email and to answer your question: > > > > 1 ? Make a copy of init.s (found in ICCAVR/libsrc.avr). Name it > something like ?initboot.s? > > 2 ? Make a copy of the appropriate crtbootXXX.s file based on the > device (found in ICCARV/libsrc.avr). Name it whatever makes sense. > > 3 ? Edit the new crtboot.s file to include the ?initbot.s? > > 4 ? Edit the ?initboot.s? to only set up the HW & SW stack > pointers. Remove unneeded code. > > 5 ? Open the new crtboot.s (if not already open) in ICCAVR > > 6 ? Go to File->Compile File->Start Up File to Object. This will > gernerate a new *.o library with the same name as the crtboot.s file. > > 7 ? Copy the new startup library to the library directory (ICCAVR/lib) > > 8 ? You will need to tell the compiler to use the new startup > library when building the bootloader: > > A ? Go to Compiler > Options->Target->Advanced->Non-default Startup > > B ? Enter in the name of the new startup library > (include the .o extension) > > C ? Perform a ?Rebuild All? to force the compiler to > perform a clean build and use the new library (not technically > necessary, but I?ve found that the > > compiler will sometimes not use the new library > until it needs to perform a clean build.) > > 9 ? You should be good to go. > > 10 ? You can verify that the new startup library code is included by > looking at the output listing and comparing it the changes you made > in the ?initboot.s? file > > > > See the ICCAVR help ?Startup File? for a bit more explanation on the > startup code and how to use it. > > > > Cheers! > > > > Rodney Pearson > > Software Engineer > > Juniper Systems, Inc. > > www.junipersys.com > > > > ------------------------------------------------------------------------ > > *From:* icc-avr-bounces@imagecraft.com > [mailto:icc-avr-bounces@imagecraft.com] *On Behalf Of *Sylvain > Bissonnette > *Sent:* Tuesday, October 30, 2007 5:47 PM > *To:* Discussion list for ICCAVR and ICCtiny Users. You do NOT > needtosubscribetoicc-announce if you are a member of this. > *Subject:* Re: [Icc-avr] Bootloader problem > > > > Hi Rodney, > > > > Hmmm, it's 256 word, 256k for a bootloader is a little big, If > I modify the init.s what I must do to say to the > > compiler to use my init.s and not the original one? > > > > Thanks > > Sylvain > > ----- Original Message ----- > > *From:* Rodney Pearson > > *To:* Discussion list for ICCAVR and ICCtiny Users. You do NOT > needtosubscribeto icc-announce if you are a member of this. > > > *Sent:* Tuesday, October 30, 2007 4:37 PM > > *Subject:* RE: [Icc-avr] Bootloader problem > > > > Hi Sylvain ? > > > > I?m assuming you meant 256 bytes, not 256k? (words? Bytes?) > > > > Either way you can save space in the start up file be removing > the code that initializes the memory of SRAM (assuming you are > not using SRAM in the same manner as ?normal? application > code). Take a look in the init.s startup file ? that is where > the initialization code is located. It is in Assembly. > > > > Cheers! > > > > Rodney Pearson > > Software Engineer > > Juniper Systems, Inc. > > www.junipersys.com > > > > ------------------------------------------------------------------------ > > *From:* icc-avr-bounces@imagecraft.com > [mailto:icc-avr-bounces@imagecraft.com] *On Behalf Of *Sylvain > Bissonnette > *Sent:* Tuesday, October 30, 2007 3:42 PM > *To:* Discussion list for ICCAVR and ICCtiny Users. You do NOT > needtosubscribetoicc-announce if you are a member of this. > *Subject:* [Icc-avr] Bootloader problem > > > > Hi, > > > > I'm currently working on my MegaLoad bootloader and I want > to fit this one in 256k size. when compiling > > I get not large enough... I need only couple of byte more. I > don't use any interrupt, is there some way to > > get a bit more maybe in the startup file? but I never had work > with the startup and I don't really now how > > to do this. Any help will be welcome. > > > > Thanks > > Sylvain Bissonnette > > From sl at ecpower.dk Thu Nov 1 01:51:07 2007 From: sl at ecpower.dk (Steven Lose) Date: Thu Nov 1 02:04:01 2007 Subject: SV: SV: [Icc-avr] Bootloader problem References: <663810.87987.qm@web60416.mail.yahoo.com><001d01c81b3d$ad0cc770$0301a8c0@Sylvain><002d01c81b4f$23afcfb0$0301a8c0@Sylvain> <002a01c81c31$1f609e20$0301a8c0@Sylvain><072D96786BFC014AAEBA9EB07A8070EA2CF0AD@seattle.ecpower.dk> <47298DDD.8010109@hotpop.com> Message-ID: <072D96786BFC014AAEBA9EB07A8070EA30797C@seattle.ecpower.dk> Hi. You're right; I'm not a native English speaker too. ;o) But an extra cast may be needed in front of tmpLo: uint8_t tmpLo = RxChar(); uint8_t tmpHi = RxChar(); PageAddressHigh = (uint16_t)tmpLo | (((uint16_t) tmpHi) << 8); And if this is 1000 lines below the define of PageAddressHigh, you might be unsure. "Did I declare it as char or int?" That's why I always use letters in front to remind me Unsigned int uiPageAddressHigh 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 David Brown Sendt: 1. november 2007 09:27 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: SV: [Icc-avr] Bootloader problem (Rant - could people please not post hideous html emails on mailing lists like this? Plain text email works much better, and makes it easier to track attributions and quotations from different posters.) C does not *execute* from left to right. It *parses* from left to right, but the order of expressions within a sequence is not guaranteed in any way. The concept to understand here is "sequence points". The various expressions and statements of your program are separated by these sequence points, and the compiler's generated code preserves the order at each point. Thus all source code before a sequence point is executed before the given point, and none of the code from after that point has run. (Note that we are talking about the code's effect on the C virtual machine - optimising can re-order or change the code at any time, as long as it *acts* the same in the end.) Important sequence points are the ";" at the end of statements, just before a function call or return, and at the && and || operators. Other operators do not have sequence points, and there are no sequence points when evaluating function parameters. Thus the code: (A && B) will first evaluate A, then B (assuming that A evaluated to non-zero). However, the code (A + B) can evaluate A first, or B first - the order is not determined, as there is no sequence point. Similarly, foo(A, B) may evaluate A or B first. You might have come across this with examples like "foo(i, i++)" being undefined in C, since the order of evaluation is not specified. Thus the code: PageAddressHigh = RxChar() + (RxChar() << 8); is wrong. A good way to write this, ensuring that evaluation order is correct and is clear from the code, is: uint8_t tmpLo = RxChar(); uint8_t tmpHi = RxChar(); PageAddressHigh = tmpLo | (((uint16_t) tmpHi) << 8); mvh., David Steven Lose wrote: > Hi Sylvian. > > > > C executes from left to right, so #1 will be executes first. > > > > Just like this: > > > > If( ucCount && --!ucCount) > > { > > } > > > > Will detect the transition from non zero to zero > > > > But, is it readable? > > I avoid it and make an extra line, then it is clear what happens. > > > > Hence you ask, it is not clear what is happening, and then it is best to > avoid it. > > Or as some would says, if you read some code and have to stop at a line > and use time to understand what is happening, then it is not clear enough. > > > > 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 *Sylvain Bissonnette > *Sendt:* 1. november 2007 03:44 > *Til:* Discussion list for ICCAVR and ICCtiny Users. You do NOT > needtosubscribetoicc-announce if you are a member of this. > *Emne:* Re: [Icc-avr] Bootloader problem > > > > Hi Rodney, > > > > Thanks for your email that can not be more clear! a last question, > if I have > > > > PageAddressHigh = RxChar() + (RxChar() << 8); > > #1 #2 > > > > witch one of the 2 RxChar() will be execute first? > > > > Thanks > > Sylvain > > > > > > ----- Original Message ----- > > *From:* Rodney Pearson > > *To:* Discussion list for ICCAVR and ICCtiny Users. You do NOT > needtosubscribeto icc-announce if you are a member of this. > > > *Sent:* Wednesday, October 31, 2007 9:01 AM > > *Subject:* RE: [Icc-avr] Bootloader problem > > > > Sylvain - > > > > To repeat what John mentioned in his email and to answer your question: > > > > 1 - Make a copy of init.s (found in ICCAVR/libsrc.avr). Name it > something like 'initboot.s' > > 2 - Make a copy of the appropriate crtbootXXX.s file based on the > device (found in ICCARV/libsrc.avr). Name it whatever makes sense. > > 3 - Edit the new crtboot.s file to include the 'initbot.s' > > 4 - Edit the 'initboot.s' to only set up the HW & SW stack > pointers. Remove unneeded code. > > 5 - Open the new crtboot.s (if not already open) in ICCAVR > > 6 - Go to File->Compile File->Start Up File to Object. This will > gernerate a new *.o library with the same name as the crtboot.s file. > > 7 - Copy the new startup library to the library directory (ICCAVR/lib) > > 8 - You will need to tell the compiler to use the new startup > library when building the bootloader: > > A - Go to Compiler > Options->Target->Advanced->Non-default Startup > > B - Enter in the name of the new startup library > (include the .o extension) > > C - Perform a "Rebuild All" to force the compiler to > perform a clean build and use the new library (not technically > necessary, but I've found that the > > compiler will sometimes not use the new library > until it needs to perform a clean build.) > > 9 - You should be good to go. > > 10 - You can verify that the new startup library code is included by > looking at the output listing and comparing it the changes you made > in the 'initboot.s' file > > > > See the ICCAVR help "Startup File" for a bit more explanation on the > startup code and how to use it. > > > > Cheers! > > > > Rodney Pearson > > Software Engineer > > Juniper Systems, Inc. > > www.junipersys.com > > > > ------------------------------------------------------------------------ > > *From:* icc-avr-bounces@imagecraft.com > [mailto:icc-avr-bounces@imagecraft.com] *On Behalf Of *Sylvain > Bissonnette > *Sent:* Tuesday, October 30, 2007 5:47 PM > *To:* Discussion list for ICCAVR and ICCtiny Users. You do NOT > needtosubscribetoicc-announce if you are a member of this. > *Subject:* Re: [Icc-avr] Bootloader problem > > > > Hi Rodney, > > > > Hmmm, it's 256 word, 256k for a bootloader is a little big, If > I modify the init.s what I must do to say to the > > compiler to use my init.s and not the original one? > > > > Thanks > > Sylvain > > ----- Original Message ----- > > *From:* Rodney Pearson > > *To:* Discussion list for ICCAVR and ICCtiny Users. You do NOT > needtosubscribeto icc-announce if you are a member of this. > > > *Sent:* Tuesday, October 30, 2007 4:37 PM > > *Subject:* RE: [Icc-avr] Bootloader problem > > > > Hi Sylvain - > > > > I'm assuming you meant 256 bytes, not 256k? (words? Bytes?) > > > > Either way you can save space in the start up file be removing > the code that initializes the memory of SRAM (assuming you are > not using SRAM in the same manner as "normal" application > code). Take a look in the init.s startup file - that is where > the initialization code is located. It is in Assembly. > > > > Cheers! > > > > Rodney Pearson > > Software Engineer > > Juniper Systems, Inc. > > www.junipersys.com > > > > ------------------------------------------------------------------------ > > *From:* icc-avr-bounces@imagecraft.com > [mailto:icc-avr-bounces@imagecraft.com] *On Behalf Of *Sylvain > Bissonnette > *Sent:* Tuesday, October 30, 2007 3:42 PM > *To:* Discussion list for ICCAVR and ICCtiny Users. You do NOT > needtosubscribetoicc-announce if you are a member of this. > *Subject:* [Icc-avr] Bootloader problem > > > > Hi, > > > > I'm currently working on my MegaLoad bootloader and I want > to fit this one in 256k size. when compiling > > I get not large enough... I need only couple of byte more. I > don't use any interrupt, is there some way to > > get a bit more maybe in the startup file? but I never had work > with the startup and I don't really now how > > to do this. Any help will be welcome. > > > > Thanks > > Sylvain Bissonnette > > _______________________________________________ Icc-avr mailing list Icc-avr@imagecraft.com http://dragonsgate.net/mailman/listinfo/icc-avr From j_baraclough at zetnet.co.uk Thu Nov 1 02:00:06 2007 From: j_baraclough at zetnet.co.uk (John Baraclough) Date: Thu Nov 1 02:12:58 2007 Subject: [Icc-avr] IDE windows In-Reply-To: <200711010752.lA17qPmG035031@dragonsgate2.imagecraft.com> References: <200711010752.lA17qPmG035031@dragonsgate2.imagecraft.com> Message-ID: Hi Richard, It is the boundary between the main edit window and the Project/Browser window that keeps moving. The strange thing is that it doesn't seem to happen every time the IDE is closed and reopened just often enough to be irritating. I've sent you a picture off-list. All the best for now, John At 08:39 01/11/2007, you wrote: >Which boundaries? There are code to keep track of the different >window sizes, but may be something got broken. If you give me a >specific thing to look for, I will check it out. > >At 11:11 AM 10/31/2007, Albert vanVeen wrote: > >>Every time I open the IDE, I have to shift the boundaries between >>the windows to where I like them to be. Why is this setting not >>saved automatically, and can I force it to be saved? >> >>Thanks, >> >>Albert van Veen >>software engineer >>Pertronic Industries >>17 Eastern Hutt Road >>Wingate, Lower Hutt >> > >// richard (This email is for mailing lists. To reach me directly, >please use richard at imagecraft.com) >_______________________________________________ >Icc-avr mailing list >Icc-avr@imagecraft.com >http://dragonsgate.net/mailman/listinfo/icc-avr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20071101/7a73de33/attachment.html From asyms at technosoft.co.uk Thu Nov 1 02:34:02 2007 From: asyms at technosoft.co.uk (Andy Syms) Date: Thu Nov 1 02:47:06 2007 Subject: SV: [Icc-avr] Bootloader problem In-Reply-To: <47298DDD.8010109@hotpop.com> Message-ID: > (Rant - could people please not post hideous html emails on mailing > lists like this? Plain text email works much better, and makes it > easier to track attributions and quotations from different posters.) I agree. Now, how do we stop people top posting and massively over-quoting ? ;-) Andy From david_brown at hotpop.com Thu Nov 1 03:05:49 2007 From: david_brown at hotpop.com (David Brown) Date: Thu Nov 1 02:47:10 2007 Subject: SV: SV: [Icc-avr] Bootloader problem In-Reply-To: <072D96786BFC014AAEBA9EB07A8070EA30797C@seattle.ecpower.dk> References: <663810.87987.qm@web60416.mail.yahoo.com><001d01c81b3d$ad0cc770$0301a8c0@Sylvain><002d01c81b4f$23afcfb0$0301a8c0@Sylvain> <002a01c81c31$1f609e20$0301a8c0@Sylvain><072D96786BFC014AAEBA9EB07A8070EA2CF0AD@seattle.ecpower.dk> <47298DDD.8010109@hotpop.com> <072D96786BFC014AAEBA9EB07A8070EA30797C@seattle.ecpower.dk> Message-ID: <4729B30D.9090907@hotpop.com> Steven Lose wrote: > Hi. > > You're right; I'm not a native English speaker too. ;o) I had guessed that from the Danish address, but I don't think I have noticed any errors in your writing until now - "I'm not a native English speaker *either*" :-) Of course, you'd see plenty more errors in my written Norwegian, even though I've lived here for 15 years. > > But an extra cast may be needed in front of tmpLo: > > uint8_t tmpLo = RxChar(); > uint8_t tmpHi = RxChar(); > PageAddressHigh = (uint16_t)tmpLo | (((uint16_t) tmpHi) << 8); > The extra cast is not necessary (tmpLo will be promoted to uint16_t automatically - the cast for tmpHi is actually only to make sure you are using unsigned ints, since the "<< 8" would normally cause the left argument to be promoted to a signed int). However, if it makes the working of the code clearer, use it! > And if this is 1000 lines below the define of PageAddressHigh, you > might be unsure. "Did I declare it as char or int?" That's why I > always use letters in front to remind me > > Unsigned int uiPageAddressHigh > You should always know what your variables are and what they are for before using them - if you are not absolutely sure of what PageAddressHigh is, you should look it up before writing the code! Adding "ui" and similar prefixes is not a convention I like in the general case - it makes code less readable, and gives you no extra information that you don't already have. There are certainly cases where it makes sense, because it makes the code clearer - a prefix of "p" for pointers is often helpful, and I often use prefixes for enumerated types ("typedef enum { colourRed, colourBlue, colourGreen } colours"), and I use prefixes somewhat in gui programming on PC's. In this, I follow the original "Hungarian notation", rather than the excessive usage that some people like. mvh., David > 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 David Brown > Sendt: 1. november 2007 09:27 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: SV: [Icc-avr] Bootloader problem > > > (Rant - could people please not post hideous html emails on mailing > lists like this? Plain text email works much better, and makes it > easier to track attributions and quotations from different posters.) > > C does not *execute* from left to right. It *parses* from left to > right, but the order of expressions within a sequence is not > guaranteed in any way. The concept to understand here is "sequence > points". The various expressions and statements of your program are > separated by these sequence points, and the compiler's generated code > preserves the order at each point. Thus all source code before a > sequence point is executed before the given point, and none of the > code from after that point has run. (Note that we are talking about > the code's effect on the C virtual machine - optimising can re-order > or change the code at any time, as long as it *acts* the same in the > end.) > > Important sequence points are the ";" at the end of statements, just > before a function call or return, and at the && and || operators. > Other operators do not have sequence points, and there are no > sequence points when evaluating function parameters. > > Thus the code: (A && B) will first evaluate A, then B (assuming that > A evaluated to non-zero). > > However, the code (A + B) can evaluate A first, or B first - the > order is not determined, as there is no sequence point. > > Similarly, foo(A, B) may evaluate A or B first. You might have come > across this with examples like "foo(i, i++)" being undefined in C, > since the order of evaluation is not specified. > > > Thus the code: PageAddressHigh = RxChar() + (RxChar() << 8); is > wrong. > > A good way to write this, ensuring that evaluation order is correct > and is clear from the code, is: > > uint8_t tmpLo = RxChar(); uint8_t tmpHi = RxChar(); PageAddressHigh = > tmpLo | (((uint16_t) tmpHi) << 8); > > > mvh., > > David > > > > > > Steven Lose wrote: >> Hi Sylvian. >> >> >> >> C executes from left to right, so #1 will be executes first. >> >> >> >> Just like this: >> >> >> >> If( ucCount && --!ucCount) >> >> { >> >> } >> >> >> >> Will detect the transition from non zero to zero >> >> >> >> But, is it readable? >> >> I avoid it and make an extra line, then it is clear what happens. >> >> >> >> Hence you ask, it is not clear what is happening, and then it is >> best to avoid it. >> >> Or as some would says, if you read some code and have to stop at a >> line and use time to understand what is happening, then it is not >> clear enough. >> >> >> >> 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 *Sylvain >> Bissonnette *Sendt:* 1. november 2007 03:44 *Til:* Discussion list >> for ICCAVR and ICCtiny Users. You do NOT >> needtosubscribetoicc-announce if you are a member of this. *Emne:* >> Re: [Icc-avr] Bootloader problem >> >> >> >> Hi Rodney, >> >> >> >> Thanks for your email that can not be more clear! a last question, >> if I have >> >> >> >> PageAddressHigh = RxChar() + (RxChar() << 8); >> >> #1 #2 >> >> >> >> witch one of the 2 RxChar() will be execute first? >> >> >> >> Thanks >> >> Sylvain >> >> >> >> >> >> ----- Original Message ----- >> >> *From:* Rodney Pearson >> >> *To:* Discussion list for ICCAVR and ICCtiny Users. You do NOT >> needtosubscribeto icc-announce if you are a member of this. >> >> >> *Sent:* Wednesday, October 31, 2007 9:01 AM >> >> *Subject:* RE: [Icc-avr] Bootloader problem >> >> >> >> Sylvain - >> >> >> >> To repeat what John mentioned in his email and to answer your >> question: >> >> >> >> 1 - Make a copy of init.s (found in ICCAVR/libsrc.avr). Name it >> something like 'initboot.s' >> >> 2 - Make a copy of the appropriate crtbootXXX.s file based on the >> device (found in ICCARV/libsrc.avr). Name it whatever makes sense. >> >> 3 - Edit the new crtboot.s file to include the 'initbot.s' >> >> 4 - Edit the 'initboot.s' to only set up the HW & SW stack >> pointers. Remove unneeded code. >> >> 5 - Open the new crtboot.s (if not already open) in ICCAVR >> >> 6 - Go to File->Compile File->Start Up File to Object. This will >> gernerate a new *.o library with the same name as the crtboot.s >> file. >> >> 7 - Copy the new startup library to the library directory >> (ICCAVR/lib) >> >> 8 - You will need to tell the compiler to use the new startup >> library when building the bootloader: >> >> A - Go to Compiler Options->Target->Advanced->Non-default Startup >> >> B - Enter in the name of the new startup library (include the .o >> extension) >> >> C - Perform a "Rebuild All" to force the compiler to perform a >> clean build and use the new library (not technically necessary, but >> I've found that the >> >> compiler will sometimes not use the new library until it needs to >> perform a clean build.) >> >> 9 - You should be good to go. >> >> 10 - You can verify that the new startup library code is included >> by looking at the output listing and comparing it the changes you >> made in the 'initboot.s' file >> >> >> >> See the ICCAVR help "Startup File" for a bit more explanation on >> the startup code and how to use it. >> >> >> >> Cheers! >> >> >> >> Rodney Pearson >> >> Software Engineer >> >> Juniper Systems, Inc. >> >> www.junipersys.com >> >> >> >> ------------------------------------------------------------------------ >> >> >> *From:* icc-avr-bounces@imagecraft.com >> [mailto:icc-avr-bounces@imagecraft.com] *On Behalf Of *Sylvain >> Bissonnette *Sent:* Tuesday, October 30, 2007 5:47 PM *To:* >> Discussion list for ICCAVR and ICCtiny Users. You do NOT >> needtosubscribetoicc-announce if you are a member of this. >> *Subject:* Re: [Icc-avr] Bootloader problem >> >> >> >> Hi Rodney, >> >> >> >> Hmmm, it's 256 word, 256k for a bootloader is a little big, If I >> modify the init.s what I must do to say to the >> >> compiler to use my init.s and not the original one? >> >> >> >> Thanks >> >> Sylvain >> >> ----- Original Message ----- >> >> *From:* Rodney Pearson >> >> *To:* Discussion list for ICCAVR and ICCtiny Users. You do NOT >> needtosubscribeto icc-announce if you are a member of this. >> >> >> *Sent:* Tuesday, October 30, 2007 4:37 PM >> >> *Subject:* RE: [Icc-avr] Bootloader problem >> >> >> >> Hi Sylvain - >> >> >> >> I'm assuming you meant 256 bytes, not 256k? (words? Bytes?) >> >> >> >> Either way you can save space in the start up file be removing the >> code that initializes the memory of SRAM (assuming you are not >> using SRAM in the same manner as "normal" application code). Take >> a look in the init.s startup file - that is where the >> initialization code is located. It is in Assembly. >> >> >> >> Cheers! >> >> >> >> Rodney Pearson >> >> Software Engineer >> >> Juniper Systems, Inc. >> >> www.junipersys.com >> >> >> >> ------------------------------------------------------------------------ >> >> >> *From:* icc-avr-bounces@imagecraft.com >> [mailto:icc-avr-bounces@imagecraft.com] *On Behalf Of *Sylvain >> Bissonnette *Sent:* Tuesday, October 30, 2007 3:42 PM *To:* >> Discussion list for ICCAVR and ICCtiny Users. You do NOT >> needtosubscribetoicc-announce if you are a member of this. >> *Subject:* [Icc-avr] Bootloader problem >> >> >> >> Hi, >> >> >> >> I'm currently working on my MegaLoad bootloader and I want to fit >> this one in 256k size. when compiling >> >> I get not large enough... I need only couple of byte more. I don't >> use any interrupt, is there some way to >> >> get a bit more maybe in the startup file? but I never had work with >> the startup and I don't really now how >> >> to do this. Any help will be welcome. >> >> >> >> Thanks >> >> Sylvain Bissonnette >> From jh.bodin at telia.com Thu Nov 1 02:52:05 2007 From: jh.bodin at telia.com (Johan H. Bodin) Date: Thu Nov 1 03:04:58 2007 Subject: [Icc-avr] IDE windows In-Reply-To: <200711010752.lA17qPmG035031@dragonsgate2.imagecraft.com> References: <200711010752.lA17qPmG035031@dragonsgate2.imagecraft.com> Message-ID: <4729AFD5.6090607@telia.com> Hi Richard, when you are looking at the IDE code, please check why the terminal window cannot be opened with ctrl-T. Also, please copy or move the "Clear Window" button from the Terminal drop down menu to the rightmost part of the terminal window (where the Browse/Download/Open Com Port/Show Editors buttons are). Sometimes I use the terminal a lot and it would be nice to have all related buttons in the same place. Regards Johan Bodin SM6LKM Richard skrev: > Which boundaries? There are code to keep track of the different window > sizes, but may be something got broken. If you give me a specific thing > to look for, I will check it out. > > At 11:11 AM 10/31/2007, Albert vanVeen wrote: > >> Every time I open the IDE, I have to shift the boundaries between the >> windows to where I like them to be. Why is this setting not saved >> automatically, and can I force it to be saved? >> >> Thanks, >> >> Albert van Veen >> software engineer >> Pertronic Industries >> 17 Eastern Hutt Road >> Wingate, Lower Hutt >> From graham at altongate.co.uk Thu Nov 1 03:28:30 2007 From: graham at altongate.co.uk (Graham Whyte) Date: Thu Nov 1 03:41:01 2007 Subject: [Icc-avr] HTML mails on the list In-Reply-To: Message-ID: I agree completely, Problem I think is Outlook & Outlook Express use HTML format by default A lot of people don't know the difference, far less how to change it Other lists that I subscribe to automatically strip out non-text content The reason primarily is for security It is difficult to embed a virus in a text mail It is very easy in HTML to slip in some Javascript nasty I wonder if Richard's system allows automatic conversion to text Graham -----Original Message----- From: icc-avr-bounces@imagecraft.com [mailto:icc-avr-bounces@imagecraft.com]On Behalf Of Andy Syms Sent: 01 November 2007 10:34 To: Discussion list for ICCAVR and ICCtiny Users. You do NOT needtosubscribeto icc-announce if you are a member of this. Subject: RE: SV: [Icc-avr] Bootloader problem > (Rant - could people please not post hideous html emails on mailing > lists like this? Plain text email works much better, and makes it > easier to track attributions and quotations from different posters.) I agree. Now, how do we stop people top posting and massively over-quoting ? ;-) Andy _______________________________________________ Icc-avr mailing list Icc-avr@imagecraft.com http://dragonsgate.net/mailman/listinfo/icc-avr From david_brown at hotpop.com Thu Nov 1 04:10:29 2007 From: david_brown at hotpop.com (David Brown) Date: Thu Nov 1 03:51:53 2007 Subject: SV: [Icc-avr] Bootloader problem In-Reply-To: References: Message-ID: <4729C235.5090205@hotpop.com> Andy Syms wrote: >> (Rant - could people please not post hideous html emails on mailing >> lists like this? Plain text email works much better, and makes it >> easier to track attributions and quotations from different posters.) > > I agree. Now, how do we stop people top posting and massively over-quoting > ? ;-) > > Andy > Top-posting can make sense when others have top-posted first (then it is at least consistent), although bottom-posting is best. But I guess you caught me out on the lack of snipping! mvh., David From sl at ecpower.dk Thu Nov 1 05:06:20 2007 From: sl at ecpower.dk (Steven Lose) Date: Thu Nov 1 05:19:12 2007 Subject: SV: SV: SV: [Icc-avr] Bootloader problem References: <663810.87987.qm@web60416.mail.yahoo.com><001d01c81b3d$ad0cc770$0301a8c0@Sylvain><002d01c81b4f$23afcfb0$0301a8c0@Sylvain> <002a01c81c31$1f609e20$0301a8c0@Sylvain><072D96786BFC014AAEBA9EB07A8070EA2CF0AD@seattle.ecpower.dk> <47298DDD.8010109@hotpop.com><072D96786BFC014AAEBA9EB07A8070EA30797C@seattle.ecpower.dk> <4729B30D.9090907@hotpop.com> Message-ID: <072D96786BFC014AAEBA9EB07A8070EA3079C6@seattle.ecpower.dk> Hi David. Of cause you should always know what the variables are used fore, but thinking that you know is a source for trouble, the prefix just helps being sure. (Helps me anyway) I don't follow the "Hungarian notation" in its complete form, but I like the prefix and got so much used to it, that now the variables kind of looking strange to me without it. ;o) By the way, can you always be sure that the compiler will promote the variable?. All compilers? Casting them my self make me safer, but it also makes the code less readable at times. 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 David Brown Sendt: 1. november 2007 12:06 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: SV: SV: [Icc-avr] Bootloader problem Steven Lose wrote: > Hi. > > You're right; I'm not a native English speaker too. ;o) I had guessed that from the Danish address, but I don't think I have noticed any errors in your writing until now - "I'm not a native English speaker *either*" :-) Of course, you'd see plenty more errors in my written Norwegian, even though I've lived here for 15 years. > > But an extra cast may be needed in front of tmpLo: > > uint8_t tmpLo = RxChar(); > uint8_t tmpHi = RxChar(); > PageAddressHigh = (uint16_t)tmpLo | (((uint16_t) tmpHi) << 8); > The extra cast is not necessary (tmpLo will be promoted to uint16_t automatically - the cast for tmpHi is actually only to make sure you are using unsigned ints, since the "<< 8" would normally cause the left argument to be promoted to a signed int). However, if it makes the working of the code clearer, use it! > And if this is 1000 lines below the define of PageAddressHigh, you > might be unsure. "Did I declare it as char or int?" That's why I > always use letters in front to remind me > > Unsigned int uiPageAddressHigh > You should always know what your variables are and what they are for before using them - if you are not absolutely sure of what PageAddressHigh is, you should look it up before writing the code! Adding "ui" and similar prefixes is not a convention I like in the general case - it makes code less readable, and gives you no extra information that you don't already have. There are certainly cases where it makes sense, because it makes the code clearer - a prefix of "p" for pointers is often helpful, and I often use prefixes for enumerated types ("typedef enum { colourRed, colourBlue, colourGreen } colours"), and I use prefixes somewhat in gui programming on PC's. In this, I follow the original "Hungarian notation", rather than the excessive usage that some people like. mvh., David > 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 David Brown > Sendt: 1. november 2007 09:27 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: SV: [Icc-avr] Bootloader problem > > > (Rant - could people please not post hideous html emails on mailing > lists like this? Plain text email works much better, and makes it > easier to track attributions and quotations from different posters.) > > C does not *execute* from left to right. It *parses* from left to > right, but the order of expressions within a sequence is not > guaranteed in any way. The concept to understand here is "sequence > points". The various expressions and statements of your program are > separated by these sequence points, and the compiler's generated code > preserves the order at each point. Thus all source code before a > sequence point is executed before the given point, and none of the > code from after that point has run. (Note that we are talking about > the code's effect on the C virtual machine - optimising can re-order > or change the code at any time, as long as it *acts* the same in the > end.) > > Important sequence points are the ";" at the end of statements, just > before a function call or return, and at the && and || operators. > Other operators do not have sequence points, and there are no > sequence points when evaluating function parameters. > > Thus the code: (A && B) will first evaluate A, then B (assuming that > A evaluated to non-zero). > > However, the code (A + B) can evaluate A first, or B first - the > order is not determined, as there is no sequence point. > > Similarly, foo(A, B) may evaluate A or B first. You might have come > across this with examples like "foo(i, i++)" being undefined in C, > since the order of evaluation is not specified. > > > Thus the code: PageAddressHigh = RxChar() + (RxChar() << 8); is > wrong. > > A good way to write this, ensuring that evaluation order is correct > and is clear from the code, is: > > uint8_t tmpLo = RxChar(); uint8_t tmpHi = RxChar(); PageAddressHigh = > tmpLo | (((uint16_t) tmpHi) << 8); > > > mvh., > > David > > > > > > Steven Lose wrote: >> Hi Sylvian. >> >> >> >> C executes from left to right, so #1 will be executes first. >> >> >> >> Just like this: >> >> >> >> If( ucCount && --!ucCount) >> >> { >> >> } >> >> >> >> Will detect the transition from non zero to zero >> >> >> >> But, is it readable? >> >> I avoid it and make an extra line, then it is clear what happens. >> >> >> >> Hence you ask, it is not clear what is happening, and then it is >> best to avoid it. >> >> Or as some would says, if you read some code and have to stop at a >> line and use time to understand what is happening, then it is not >> clear enough. >> >> >> >> 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 *Sylvain >> Bissonnette *Sendt:* 1. november 2007 03:44 *Til:* Discussion list >> for ICCAVR and ICCtiny Users. You do NOT >> needtosubscribetoicc-announce if you are a member of this. *Emne:* >> Re: [Icc-avr] Bootloader problem >> >> >> >> Hi Rodney, >> >> >> >> Thanks for your email that can not be more clear! a last question, >> if I have >> >> >> >> PageAddressHigh = RxChar() + (RxChar() << 8); >> >> #1 #2 >> >> >> >> witch one of the 2 RxChar() will be execute first? >> >> >> >> Thanks >> >> Sylvain >> >> >> >> >> >> ----- Original Message ----- >> >> *From:* Rodney Pearson >> >> *To:* Discussion list for ICCAVR and ICCtiny Users. You do NOT >> needtosubscribeto icc-announce if you are a member of this. >> >> >> *Sent:* Wednesday, October 31, 2007 9:01 AM >> >> *Subject:* RE: [Icc-avr] Bootloader problem >> >> >> >> Sylvain - >> >> >> >> To repeat what John mentioned in his email and to answer your >> question: >> >> >> >> 1 - Make a copy of init.s (found in ICCAVR/libsrc.avr). Name it >> something like 'initboot.s' >> >> 2 - Make a copy of the appropriate crtbootXXX.s file based on the >> device (found in ICCARV/libsrc.avr). Name it whatever makes sense. >> >> 3 - Edit the new crtboot.s file to include the 'initbot.s' >> >> 4 - Edit the 'initboot.s' to only set up the HW & SW stack >> pointers. Remove unneeded code. >> >> 5 - Open the new crtboot.s (if not already open) in ICCAVR >> >> 6 - Go to File->Compile File->Start Up File to Object. This will >> gernerate a new *.o library with the same name as the crtboot.s >> file. >> >> 7 - Copy the new startup library to the library directory >> (ICCAVR/lib) >> >> 8 - You will need to tell the compiler to use the new startup >> library when building the bootloader: >> >> A - Go to Compiler Options->Target->Advanced->Non-default Startup >> >> B - Enter in the name of the new startup library (include the .o >> extension) >> >> C - Perform a "Rebuild All" to force the compiler to perform a >> clean build and use the new library (not technically necessary, but >> I've found that the >> >> compiler will sometimes not use the new library until it needs to >> perform a clean build.) >> >> 9 - You should be good to go. >> >> 10 - You can verify that the new startup library code is included >> by looking at the output listing and comparing it the changes you >> made in the 'initboot.s' file >> >> >> >> See the ICCAVR help "Startup File" for a bit more explanation on >> the startup code and how to use it. >> >> >> >> Cheers! >> >> >> >> Rodney Pearson >> >> Software Engineer >> >> Juniper Systems, Inc. >> >> www.junipersys.com >> >> >> >> ------------------------------------------------------------------------ >> >> >> *From:* icc-avr-bounces@imagecraft.com >> [mailto:icc-avr-bounces@imagecraft.com] *On Behalf Of *Sylvain >> Bissonnette *Sent:* Tuesday, October 30, 2007 5:47 PM *To:* >> Discussion list for ICCAVR and ICCtiny Users. You do NOT >> needtosubscribetoicc-announce if you are a member of this. >> *Subject:* Re: [Icc-avr] Bootloader problem >> >> >> >> Hi Rodney, >> >> >> >> Hmmm, it's 256 word, 256k for a bootloader is a little big, If I >> modify the init.s what I must do to say to the >> >> compiler to use my init.s and not the original one? >> >> >> >> Thanks >> >> Sylvain >> >> ----- Original Message ----- >> >> *From:* Rodney Pearson >> >> *To:* Discussion list for ICCAVR and ICCtiny Users. You do NOT >> needtosubscribeto icc-announce if you are a member of this. >> >> >> *Sent:* Tuesday, October 30, 2007 4:37 PM >> >> *Subject:* RE: [Icc-avr] Bootloader problem >> >> >> >> Hi Sylvain - >> >> >> >> I'm assuming you meant 256 bytes, not 256k? (words? Bytes?) >> >> >> >> Either way you can save space in the start up file be removing the >> code that initializes the memory of SRAM (assuming you are not >> using SRAM in the same manner as "normal" application code). Take >> a look in the init.s startup file - that is where the >> initialization code is located. It is in Assembly. >> >> >> >> Cheers! >> >> >> >> Rodney Pearson >> >> Software Engineer >> >> Juniper Systems, Inc. >> >> www.junipersys.com >> >> >> >> ------------------------------------------------------------------------ >> >> >> *From:* icc-avr-bounces@imagecraft.com >> [mailto:icc-avr-bounces@imagecraft.com] *On Behalf Of *Sylvain >> Bissonnette *Sent:* Tuesday, October 30, 2007 3:42 PM *To:* >> Discussion list for ICCAVR and ICCtiny Users. You do NOT >> needtosubscribetoicc-announce if you are a member of this. >> *Subject:* [Icc-avr] Bootloader problem >> >> >> >> Hi, >> >> >> >> I'm currently working on my MegaLoad bootloader and I want to fit >> this one in 256k size. when compiling >> >> I get not large enough... I need only couple of byte more. I don't >> use any interrupt, is there some way to >> >> get a bit more maybe in the startup file? but I never had work with >> the startup and I don't really now how >> >> to do this. Any help will be welcome. >> >> >> >> Thanks >> >> Sylvain Bissonnette >> _______________________________________________ Icc-avr mailing list Icc-avr@imagecraft.com http://dragonsgate.net/mailman/listinfo/icc-avr From paul.aa9gg at gmail.com Thu Nov 1 05:12:08 2007 From: paul.aa9gg at gmail.com (Paul Mateer) Date: Thu Nov 1 05:24:56 2007 Subject: [Icc-avr] IDE windows In-Reply-To: <4729AFD5.6090607@telia.com> References: <200711010752.lA17qPmG035031@dragonsgate2.imagecraft.com> <4729AFD5.6090607@telia.com> Message-ID: <20f5efc40711010612y1e29f689wf4d287b800e5ba05@mail.gmail.com> I always thought the "Clear Window" should be there too. Kind of a pain having to go to the DDM every time On Nov 1, 2007 5:52 AM, Johan H. Bodin wrote: > Hi Richard, > > when you are looking at the IDE code, please check why the terminal window > cannot be opened with ctrl-T. Also, please copy or move the "Clear Window" > button from the Terminal drop down menu to the rightmost part of the terminal > window (where the Browse/Download/Open Com Port/Show Editors buttons are). > Sometimes I use the terminal a lot and it would be nice to have all related > buttons in the same place. > > > Regards > Johan Bodin SM6LKM > > > Richard skrev: > > Which boundaries? There are code to keep track of the different window > > sizes, but may be something got broken. If you give me a specific thing > > to look for, I will check it out. > > > > At 11:11 AM 10/31/2007, Albert vanVeen wrote: > > > >> Every time I open the IDE, I have to shift the boundaries between the > >> windows to where I like them to be. Why is this setting not saved > >> automatically, and can I force it to be saved? > >> > >> Thanks, > >> > >> Albert van Veen > >> software engineer > >> Pertronic Industries > >> 17 Eastern Hutt Road > >> Wingate, Lower Hutt > >> > > > _______________________________________________ > 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 david_brown at hotpop.com Thu Nov 1 06:05:14 2007 From: david_brown at hotpop.com (David Brown) Date: Thu Nov 1 05:46:34 2007 Subject: [Icc-avr] HTML mails on the list In-Reply-To: References: Message-ID: <4729DD1A.3070905@hotpop.com> Graham Whyte wrote: > I agree completely, > > Problem I think is Outlook & Outlook Express use HTML format by default > A lot of people don't know the difference, far less how to change it > For some incomprehensible reason, Thunderbird also defaults to HTML. HTML in itself is not *so* bad when used sensibly - the real pain is people who want their emails to look "cool" with bright background colours, weird fonts, logos, absurd disclaimers, etc. > Other lists that I subscribe to automatically strip out non-text content > The reason primarily is for security > It is difficult to embed a virus in a text mail > It is very easy in HTML to slip in some Javascript nasty > You can only get an virus or javascript nasty in an email if you use a broken email client, or actively click on dodgy attachments and links while ignoring all the warnings your email program gives you. By broken email client, I mean in effect Outlook and Outlook Express unless you have taken care to lock down its settings properly. > I wonder if Richard's system allows automatic conversion to text > > Graham > > :-) From david_brown at hotpop.com Thu Nov 1 06:36:10 2007 From: david_brown at hotpop.com (David Brown) Date: Thu Nov 1 06:17:39 2007 Subject: SV: SV: SV: [Icc-avr] Bootloader problem In-Reply-To: <072D96786BFC014AAEBA9EB07A8070EA3079C6@seattle.ecpower.dk> References: <663810.87987.qm@web60416.mail.yahoo.com><001d01c81b3d$ad0cc770$0301a8c0@Sylvain><002d01c81b4f$23afcfb0$0301a8c0@Sylvain> <002a01c81c31$1f609e20$0301a8c0@Sylvain><072D96786BFC014AAEBA9EB07A8070EA2CF0AD@seattle.ecpower.dk> <47298DDD.8010109@hotpop.com><072D96786BFC014AAEBA9EB07A8070EA30797C@seattle.ecpower.dk> <4729B30D.9090907@hotpop.com> <072D96786BFC014AAEBA9EB07A8070EA3079C6@seattle.ecpower.dk> Message-ID: <4729E45A.4020702@hotpop.com> Steven Lose wrote: > Hi David. > > Of cause you should always know what the variables are used fore, but > thinking that you know is a source for trouble, the prefix just helps > being sure. (Helps me anyway) I don't follow the "Hungarian notation" > in its complete form, but I like the prefix and got so much used to > it, that now the variables kind of looking strange to me without it. > ;o) > > By the way, can you always be sure that the compiler will promote the > variable?. All compilers? Casting them my self make me safer, but it > also makes the code less readable at times. > You can always be sure that C will follow its promotion rules. Basically, with any arithmetic operator, both sides will be promoted until you get a type that is at least an "int", and can cover the types used in both sides of the operator. Things can be a little awkward when mixing unsigned and signed types, but you can rely on promotion to "int" (whether you want it or not!). But as always, write your code so that it is clear as well as correct - add or omit extra casts accordingly. mvh., David > > 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 David Brown > Sendt: 1. november 2007 12:06 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: SV: SV: [Icc-avr] Bootloader problem > > Steven Lose wrote: >> Hi. >> >> You're right; I'm not a native English speaker too. ;o) > > I had guessed that from the Danish address, but I don't think I have > noticed any errors in your writing until now - "I'm not a native > English speaker *either*" :-) Of course, you'd see plenty more > errors in my written Norwegian, even though I've lived here for 15 > years. > >> But an extra cast may be needed in front of tmpLo: >> >> uint8_t tmpLo = RxChar(); uint8_t tmpHi = RxChar(); PageAddressHigh >> = (uint16_t)tmpLo | (((uint16_t) tmpHi) << 8); > > The extra cast is not necessary (tmpLo will be promoted to uint16_t > automatically - the cast for tmpHi is actually only to make sure you > are using unsigned ints, since the "<< 8" would normally cause the > left argument to be promoted to a signed int). However, if it makes > the working of the code clearer, use it! > >> And if this is 1000 lines below the define of PageAddressHigh, you >> might be unsure. "Did I declare it as char or int?" That's why I >> always use letters in front to remind me >> >> Unsigned int uiPageAddressHigh >> > > You should always know what your variables are and what they are for > before using them - if you are not absolutely sure of what > PageAddressHigh is, you should look it up before writing the code! > Adding "ui" and similar prefixes is not a convention I like in the > general case - it makes code less readable, and gives you no extra > information that you don't already have. There are certainly cases > where it makes sense, because it makes the code clearer - a prefix of > "p" for pointers is often helpful, and I often use prefixes for > enumerated types ("typedef enum { colourRed, colourBlue, colourGreen > } colours"), and I use prefixes somewhat in gui programming on PC's. > In this, I follow the original "Hungarian notation", rather than the > excessive usage that some people like. > > mvh., > > David > > > >> 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 David Brown >> Sendt: 1. november 2007 09:27 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: SV: [Icc-avr] Bootloader problem >> >> >> (Rant - could people please not post hideous html emails on mailing >> lists like this? Plain text email works much better, and makes it >> easier to track attributions and quotations from different >> posters.) >> >> C does not *execute* from left to right. It *parses* from left to >> right, but the order of expressions within a sequence is not >> guaranteed in any way. The concept to understand here is "sequence >> points". The various expressions and statements of your program >> are separated by these sequence points, and the compiler's >> generated code preserves the order at each point. Thus all source >> code before a sequence point is executed before the given point, >> and none of the code from after that point has run. (Note that we >> are talking about the code's effect on the C virtual machine - >> optimising can re-order or change the code at any time, as long as >> it *acts* the same in the end.) >> >> Important sequence points are the ";" at the end of statements, >> just before a function call or return, and at the && and || >> operators. Other operators do not have sequence points, and there >> are no sequence points when evaluating function parameters. >> >> Thus the code: (A && B) will first evaluate A, then B (assuming >> that A evaluated to non-zero). >> >> However, the code (A + B) can evaluate A first, or B first - the >> order is not determined, as there is no sequence point. >> >> Similarly, foo(A, B) may evaluate A or B first. You might have >> come across this with examples like "foo(i, i++)" being undefined >> in C, since the order of evaluation is not specified. >> >> >> Thus the code: PageAddressHigh = RxChar() + (RxChar() << 8); is >> wrong. >> >> A good way to write this, ensuring that evaluation order is correct >> and is clear from the code, is: >> >> uint8_t tmpLo = RxChar(); uint8_t tmpHi = RxChar(); PageAddressHigh >> = tmpLo | (((uint16_t) tmpHi) << 8); >> >> >> mvh., >> >> David >> >> >> >> >> >> Steven Lose wrote: >>> Hi Sylvian. >>> >>> >>> >>> C executes from left to right, so #1 will be executes first. >>> >>> >>> >>> Just like this: >>> >>> >>> >>> If( ucCount && --!ucCount) >>> >>> { >>> >>> } >>> >>> >>> >>> Will detect the transition from non zero to zero >>> >>> >>> >>> But, is it readable? >>> >>> I avoid it and make an extra line, then it is clear what happens. >>> >>> >>> >>> >>> Hence you ask, it is not clear what is happening, and then it is >>> best to avoid it. >>> >>> Or as some would says, if you read some code and have to stop at >>> a line and use time to understand what is happening, then it is >>> not clear enough. >>> >>> >>> >>> 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 *Sylvain >>> Bissonnette *Sendt:* 1. november 2007 03:44 *Til:* Discussion >>> list for ICCAVR and ICCtiny Users. You do NOT >>> needtosubscribetoicc-announce if you are a member of this. >>> *Emne:* Re: [Icc-avr] Bootloader problem >>> >>> >>> >>> Hi Rodney, >>> >>> >>> >>> Thanks for your email that can not be more clear! a last >>> question, if I have >>> >>> >>> >>> PageAddressHigh = RxChar() + (RxChar() << 8); >>> >>> #1 #2 >>> >>> >>> >>> witch one of the 2 RxChar() will be execute first? >>> >>> >>> >>> Thanks >>> >>> Sylvain >>> >>> >>> >>> >>> >>> ----- Original Message ----- >>> >>> *From:* Rodney Pearson >>> >>> *To:* Discussion list for ICCAVR and ICCtiny Users. You do NOT >>> needtosubscribeto icc-announce if you are a member of this. >>> >>> >>> *Sent:* Wednesday, October 31, 2007 9:01 AM >>> >>> *Subject:* RE: [Icc-avr] Bootloader problem >>> >>> >>> >>> Sylvain - >>> >>> >>> >>> To repeat what John mentioned in his email and to answer your >>> question: >>> >>> >>> >>> 1 - Make a copy of init.s (found in ICCAVR/libsrc.avr). Name it >>> something like 'initboot.s' >>> >>> 2 - Make a copy of the appropriate crtbootXXX.s file based on the >>> device (found in ICCARV/libsrc.avr). Name it whatever makes >>> sense. >>> >>> 3 - Edit the new crtboot.s file to include the 'initbot.s' >>> >>> 4 - Edit the 'initboot.s' to only set up the HW & SW stack >>> pointers. Remove unneeded code. >>> >>> 5 - Open the new crtboot.s (if not already open) in ICCAVR >>> >>> 6 - Go to File->Compile File->Start Up File to Object. This will >>> gernerate a new *.o library with the same name as the crtboot.s >>> file. >>> >>> 7 - Copy the new startup library to the library directory >>> (ICCAVR/lib) >>> >>> 8 - You will need to tell the compiler to use the new startup >>> library when building the bootloader: >>> >>> A - Go to Compiler Options->Target->Advanced->Non-default Startup >>> >>> >>> B - Enter in the name of the new startup library (include the .o >>> extension) >>> >>> C - Perform a "Rebuild All" to force the compiler to perform a >>> clean build and use the new library (not technically necessary, >>> but I've found that the >>> >>> compiler will sometimes not use the new library until it needs to >>> perform a clean build.) >>> >>> 9 - You should be good to go. >>> >>> 10 - You can verify that the new startup library code is included >>> by looking at the output listing and comparing it the changes >>> you made in the 'initboot.s' file >>> >>> >>> >>> See the ICCAVR help "Startup File" for a bit more explanation on >>> the startup code and how to use it. >>> >>> >>> >>> Cheers! >>> >>> >>> >>> Rodney Pearson >>> >>> Software Engineer >>> >>> Juniper Systems, Inc. >>> >>> www.junipersys.com >>> >>> >>> >>> ------------------------------------------------------------------------ >>> > >>> >>> *From:* icc-avr-bounces@imagecraft.com >>> [mailto:icc-avr-bounces@imagecraft.com] *On Behalf Of *Sylvain >>> Bissonnette *Sent:* Tuesday, October 30, 2007 5:47 PM *To:* >>> Discussion list for ICCAVR and ICCtiny Users. You do NOT >>> needtosubscribetoicc-announce if you are a member of this. >>> *Subject:* Re: [Icc-avr] Bootloader problem >>> >>> >>> >>> Hi Rodney, >>> >>> >>> >>> Hmmm, it's 256 word, 256k for a bootloader is a little big, If I >>> modify the init.s what I must do to say to the >>> >>> compiler to use my init.s and not the original one? >>> >>> >>> >>> Thanks >>> >>> Sylvain >>> >>> ----- Original Message ----- >>> >>> *From:* Rodney Pearson >>> >>> *To:* Discussion list for ICCAVR and ICCtiny Users. You do NOT >>> needtosubscribeto icc-announce if you are a member of this. >>> >>> >>> *Sent:* Tuesday, October 30, 2007 4:37 PM >>> >>> *Subject:* RE: [Icc-avr] Bootloader problem >>> >>> >>> >>> Hi Sylvain - >>> >>> >>> >>> I'm assuming you meant 256 bytes, not 256k? (words? Bytes?) >>> >>> >>> >>> Either way you can save space in the start up file be removing >>> the code that initializes the memory of SRAM (assuming you are >>> not using SRAM in the same manner as "normal" application code). >>> Take a look in the init.s startup file - that is where the >>> initialization code is located. It is in Assembly. >>> >>> >>> >>> Cheers! >>> >>> >>> >>> Rodney Pearson >>> >>> Software Engineer >>> >>> Juniper Systems, Inc. >>> >>> www.junipersys.com >>> >>> >>> >>> ------------------------------------------------------------------------ >>> > >>> >>> *From:* icc-avr-bounces@imagecraft.com >>> [mailto:icc-avr-bounces@imagecraft.com] *On Behalf Of *Sylvain >>> Bissonnette *Sent:* Tuesday, October 30, 2007 3:42 PM *To:* >>> Discussion list for ICCAVR and ICCtiny Users. You do NOT >>> needtosubscribetoicc-announce if you are a member of this. >>> *Subject:* [Icc-avr] Bootloader problem >>> >>> >>> >>> Hi, >>> >>> >>> >>> I'm currently working on my MegaLoad bootloader and I want to fit >>> this one in 256k size. when compiling >>> >>> I get not large enough... I need only couple of byte more. I >>> don't use any interrupt, is there some way to >>> >>> get a bit more maybe in the startup file? but I never had work >>> with the startup and I don't really now how >>> >>> to do this. Any help will be welcome. >>> >>> >>> >>> Thanks >>> >>> Sylvain Bissonnette >>> > From sbissonnette at microsyl.com Thu Nov 1 08:12:13 2007 From: sbissonnette at microsyl.com (sbissonnette@microsyl.com) Date: Thu Nov 1 08:25:02 2007 Subject: SV: [Icc-avr] Bootloader problem In-Reply-To: <47298DDD.8010109@hotpop.com> References: <663810.87987.qm@web60416.mail.yahoo.com><001d01c81b3d$ad0cc770$0301a8c0@Sylvain><002d01c81b4f$23afcfb0$0301a8c0@Sylvain> <002a01c81c31$1f609e20$0301a8c0@Sylvain> <072D96786BFC014AAEBA9EB07A8070EA2CF0AD@seattle.ecpower.dk> <47298DDD.8010109@hotpop.com> Message-ID: <29447.204.19.71.2.1193933533.squirrel@www.microsyl.com> Hi, Thanks for all your reply! The main reason I`m asking the question I need more space in my code and those line take less space PageAddressHigh = RxChar() + (RxChar() << 8); and this one take more space uint8_t tmpLo = RxChar(); uint8_t tmpHi = RxChar(); PageAddressHigh = tmpLo | (((uint16_t) tmpHi) << 8); So with your reply I will try to find another way to reduce my code space,..... Thanks Sylvain Bissonnette From jh.bodin at telia.com Thu Nov 1 08:26:36 2007 From: jh.bodin at telia.com (Johan H. Bodin) Date: Thu Nov 1 08:39:23 2007 Subject: [Icc-avr] IDE windows In-Reply-To: <20f5efc40711010612y1e29f689wf4d287b800e5ba05@mail.gmail.com> References: <200711010752.lA17qPmG035031@dragonsgate2.imagecraft.com> <4729AFD5.6090607@telia.com> <20f5efc40711010612y1e29f689wf4d287b800e5ba05@mail.gmail.com> Message-ID: <4729FE3C.7070908@telia.com> It wouldn't hurt to have the port and baud rate selection there too. Another thing on my wish list is to make the editor remove trailing spaces or at least make the end key go to the "real" end of line (in case of trailing spaces), not just to the "visible" end of line... Now I need to put the cursor at the beginning of the *next* line and use the back arrow key to reach the trailing space(s). Regards Johan Bodin Paul Mateer wrote: > I always thought the "Clear Window" should be there too. Kind of a > pain having to go to the DDM every time > > On Nov 1, 2007 5:52 AM, Johan H. Bodin wrote: >> Hi Richard, >> >> when you are looking at the IDE code, please check why the terminal window >> cannot be opened with ctrl-T. Also, please copy or move the "Clear Window" >> button from the Terminal drop down menu to the rightmost part of the terminal >> window (where the Browse/Download/Open Com Port/Show Editors buttons are). >> Sometimes I use the terminal a lot and it would be nice to have all related >> buttons in the same place. >> >> >> Regards >> Johan Bodin SM6LKM From j_baraclough at zetnet.co.uk Thu Nov 1 09:31:51 2007 From: j_baraclough at zetnet.co.uk (John Baraclough) Date: Thu Nov 1 09:44:45 2007 Subject: SV: [Icc-avr] Bootloader problem In-Reply-To: <29447.204.19.71.2.1193933533.squirrel@www.microsyl.com> References: <663810.87987.qm@web60416.mail.yahoo.com> <001d01c81b3d$ad0cc770$0301a8c0@Sylvain> <002d01c81b4f$23afcfb0$0301a8c0@Sylvain> <002a01c81c31$1f609e20$0301a8c0@Sylvain> <072D96786BFC014AAEBA9EB07A8070EA2CF0AD@seattle.ecpower.dk> <47298DDD.8010109@hotpop.com> <29447.204.19.71.2.1193933533.squirrel@www.microsyl.com> Message-ID: At 16:12 01/11/2007, you wrote: >Hi, > > Thanks for all your reply! The main reason I`m asking the question I >need more space in my code and those line take less space > >PageAddressHigh = RxChar() + (RxChar() << 8); > >and this one take more space > > uint8_t tmpLo = RxChar(); > uint8_t tmpHi = RxChar(); > PageAddressHigh = tmpLo | (((uint16_t) tmpHi) << 8); > >So with your reply I will try to find another way to reduce my code >space,..... > >Thanks >Sylvain Bissonnette Hi Sylvain, You could always compromise on this: uint8_t tmpLo = RxChar(); PageAddressHigh = tmpLo | (((uint16_t)(RxChar())) << 8); which will certainly ensure the calls to RxChar() are done in the correct order and may be smaller in code size. Are you still trying to fit your bootloader into 256 bytes for a mega256x, or is it too large for the 512 block? John From Albert.vanVeen at pertronic.co.nz Thu Nov 1 11:19:05 2007 From: Albert.vanVeen at pertronic.co.nz (Albert vanVeen) Date: Thu Nov 1 11:32:00 2007 Subject: [Icc-avr] IDE windows In-Reply-To: References: <200711010752.lA17qPmG035031@dragonsgate2.imagecraft.com> Message-ID: Yes, that's exactly it. On the subject, there is something else. >From other editor's I'm used to "things", e.g. ctrl-T delete word, ctrl-Y delete line. This can be defined in the project setup, but this too gets lost sometimes, and I don't know how often I've had to define ctrl-T again. So it seems, that context saving is not complete or not at all. Speaking about context: when I open "projectA.prj" I expect ICCAVR to open projectA, however it always just opens the last project I was working on before. This not very helpful, as you then have to go into Project->Open again AND change directories. Sorry to have started another list of complaints. All for now, Albert. ________________________________ From: icc-avr-bounces@imagecraft.com [mailto:icc-avr-bounces@imagecraft.com] On Behalf Of John Baraclough Sent: Thursday, November 01, 2007 11:00 PM To: Discussion list for ICCAVR and ICCtiny Users. You do NOT need tosubscribe to icc-announce if you are a member of this. Subject: RE: [Icc-avr] IDE windows Hi Richard, It is the boundary between the main edit window and the Project/Browser window that keeps moving. The strange thing is that it doesn't seem to happen every time the IDE is closed and reopened just often enough to be irritating. I've sent you a picture off-list. All the best for now, John At 08:39 01/11/2007, you wrote: Which boundaries? There are code to keep track of the different window sizes, but may be something got broken. If you give me a specific thing to look for, I will check it out. At 11:11 AM 10/31/2007, Albert vanVeen wrote: Every time I open the IDE, I have to shift the boundaries between the windows to where I like them to be. Why is this setting not saved automatically, and can I force it to be saved? Thanks, Albert van Veen software engineer Pertronic Industries 17 Eastern Hutt Road Wingate, Lower Hutt // richard (This email is for mailing lists. To reach me directly, please use richard at imagecraft.com) _______________________________________________ Icc-avr mailing list Icc-avr@imagecraft.com http://dragonsgate.net/mailman/listinfo/icc-avr Scanned by Bizo EmailFilter -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20071102/65e368af/attachment.html From Albert.vanVeen at pertronic.co.nz Thu Nov 1 11:49:05 2007 From: Albert.vanVeen at pertronic.co.nz (Albert vanVeen) Date: Thu Nov 1 12:01:56 2007 Subject: SV: [Icc-avr] Bootloader problem In-Reply-To: <29447.204.19.71.2.1193933533.squirrel@www.microsyl.com> References: <663810.87987.qm@web60416.mail.yahoo.com><001d01c81b3d$ad0cc770$0301a8c0@Sylvain><002d01c81b4f$23afcfb0$0301a8c0@Sylvain><002a01c81c31$1f609e20$0301a8c0@Sylvain><072D96786BFC014AAEBA9EB07A8070EA2CF0AD@seattle.ecpower.dk><47298DDD.8010109@hotpop.com> <29447.204.19.71.2.1193933533.squirrel@www.microsyl.com> Message-ID: Again: a matter of theory (and 'good' practice) and real (experienced) practice. I haven't come across a case in any of my 4 compilers that PageAddressHigh = RxChar() + (RxChar() << 8); did not produce what I expected. Albert. -----Original Message----- From: icc-avr-bounces@imagecraft.com [mailto:icc-avr-bounces@imagecraft.com] On Behalf Of sbissonnette@microsyl.com Sent: Friday, November 02, 2007 05:12 AM To: Discussion list for ICCAVR and ICCtiny Users. You do NOT need tosubscribe to icc-announce if you are a member of this. Subject: Re: SV: [Icc-avr] Bootloader problem Hi, Thanks for all your reply! The main reason I`m asking the question I need more space in my code and those line take less space PageAddressHigh = RxChar() + (RxChar() << 8); and this one take more space uint8_t tmpLo = RxChar(); uint8_t tmpHi = RxChar(); PageAddressHigh = tmpLo | (((uint16_t) tmpHi) << 8); So with your reply I will try to find another way to reduce my code space,..... Thanks Sylvain Bissonnette _______________________________________________ Icc-avr mailing list Icc-avr@imagecraft.com http://dragonsgate.net/mailman/listinfo/icc-avr Scanned by Bizo Email Filter From Albert.vanVeen at pertronic.co.nz Thu Nov 1 11:58:38 2007 From: Albert.vanVeen at pertronic.co.nz (Albert vanVeen) Date: Thu Nov 1 12:11:35 2007 Subject: [Icc-avr] IDE windows In-Reply-To: References: Message-ID: Five minutes after writing this, and opening my project that I closed yesterday at lunchtime: ICCAVR now opened completely blank !?!?! no project or anything opened. This must be the system's revenge for complaining. From: icc-avr-bounces@imagecraft.com [mailto:icc-avr-bounces@imagecraft.com] On Behalf Of Albert vanVeen Sent: Friday, November 02, 2007 08:19 AM To: Discussion list for ICCAVR and ICCtiny Users. You do NOT needtosubscribeto icc-announce if you are a member of this. Subject: RE: [Icc-avr] IDE windows Yes, that's exactly it. On the subject, there is something else. >From other editor's I'm used to "things", e.g. ctrl-T delete word, ctrl-Y delete line. This can be defined in the project setup, but this too gets lost sometimes, and I don't know how often I've had to define ctrl-T again. So it seems, that context saving is not complete or not at all. Speaking about context: when I open "projectA.prj" I expect ICCAVR to open projectA, however it always just opens the last project I was working on before. This not very helpful, as you then have to go into Project->Open again AND change directories. Sorry to have started another list of complaints. All for now, Albert. ________________________________ From: icc-avr-bounces@imagecraft.com [mailto:icc-avr-bounces@imagecraft.com] On Behalf Of John Baraclough Sent: Thursday, November 01, 2007 11:00 PM To: Discussion list for ICCAVR and ICCtiny Users. You do NOT need tosubscribe to icc-announce if you are a member of this. Subject: RE: [Icc-avr] IDE windows Hi Richard, It is the boundary between the main edit window and the Project/Browser window that keeps moving. The strange thing is that it doesn't seem to happen every time the IDE is closed and reopened just often enough to be irritating. I've sent you a picture off-list. All the best for now, John At 08:39 01/11/2007, you wrote: Which boundaries? There are code to keep track of the different window sizes, but may be something got broken. If you give me a specific thing to look for, I will check it out. At 11:11 AM 10/31/2007, Albert vanVeen wrote: Every time I open the IDE, I have to shift the boundaries between the windows to where I like them to be. Why is this setting not saved automatically, and can I force it to be saved? Thanks, Albert van Veen software engineer Pertronic Industries 17 Eastern Hutt Road Wingate, Lower Hutt // richard (This email is for mailing lists. To reach me directly, please use richard at imagecraft.com) _______________________________________________ Icc-avr mailing list Icc-avr@imagecraft.com http://dragonsgate.net/mailman/listinfo/icc-avr Scanned by Bizo EmailFilter Scanned by Bizo EmailFilter -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20071102/671fe79c/attachment.html From david_brown at hotpop.com Thu Nov 1 13:42:11 2007 From: david_brown at hotpop.com (David Brown) Date: Thu Nov 1 13:55:22 2007 Subject: SV: [Icc-avr] Bootloader problem In-Reply-To: References: <663810.87987.qm@web60416.mail.yahoo.com><001d01c81b3d$ad0cc770$0301a8c0@Sylvain><002d01c81b4f$23afcfb0$0301a8c0@Sylvain><002a01c81c31$1f609e20$0301a8c0@Sylvain><072D96786BFC014AAEBA9EB07A8070EA2CF0AD@seattle.ecpower.dk><47298DDD.8010109@hotpop.com> <29447.204.19.71.2.1193933533.squirrel@www.microsyl.com> Message-ID: <472A4833.8000406@hotpop.com> Albert vanVeen wrote: > Again: a matter of theory (and 'good' practice) and real (experienced) > practice. > Not in this case - it's a matter of writing incorrect code, and getting lucky. This sort of thing can change between different versions of compilers, or identical compilers with different optimisation options. It's silly to rely on something so specifically noted as "undefined" by the C language standards, and it's borderline irresponsible to post on a mailing list (which includes inexperienced programmers) that this is somehow a question of choosing "real practice" instead of good theory. Choosing programming conventions that lead to better, more reliable and more maintainable source code rather than ugly but legally correct source is arguably a matter of "theory" (though in fact it is more based on real, experienced practice). This is a case of incorrect code according to the standards of the language, and is not debatable in the same way. As John wrote in his post, there are other ways to code this particular example that maintain the correctness (based on sequence points) but may happen to produce smaller compiled code with icc-avr. That's a matter of choice - picking the best balance to give good generated code and clear source code. Look at: http://en.wikipedia.org/wiki/Sequence_point http://www.embedded.com/story/OEG20020625S0041 This link is about scope in C, which may also be of interest: http://www.embedded.com/columns/technicalinsights/202600398 mvh., David > I haven't come across a case in any of my 4 compilers that > PageAddressHigh = RxChar() + (RxChar() << 8); > did not produce what I expected. > > Albert. > > > -----Original Message----- > From: icc-avr-bounces@imagecraft.com > [mailto:icc-avr-bounces@imagecraft.com] On Behalf Of > sbissonnette@microsyl.com > Sent: Friday, November 02, 2007 05:12 AM > To: Discussion list for ICCAVR and ICCtiny Users. You do NOT need > tosubscribe to icc-announce if you are a member of this. > Subject: Re: SV: [Icc-avr] Bootloader problem > > Hi, > > Thanks for all your reply! The main reason I`m asking the question > I need more space in my code and those line take less space > > PageAddressHigh = RxChar() + (RxChar() << 8); > > and this one take more space > > uint8_t tmpLo = RxChar(); > uint8_t tmpHi = RxChar(); > PageAddressHigh = tmpLo | (((uint16_t) tmpHi) << 8); > > So with your reply I will try to find another way to reduce my code > space,..... > > Thanks > Sylvain Bissonnette > From Albert.vanVeen at pertronic.co.nz Thu Nov 1 19:27:44 2007 From: Albert.vanVeen at pertronic.co.nz (Albert vanVeen) Date: Thu Nov 1 19:40:39 2007 Subject: SV: [Icc-avr] Bootloader problem In-Reply-To: <472A4833.8000406@hotpop.com> References: <663810.87987.qm@web60416.mail.yahoo.com><001d01c81b3d$ad0cc770$0301a8c0@Sylvain><002d01c81b4f$23afcfb0$0301a8c0@Sylvain><002a01c81c31$1f609e20$0301a8c0@Sylvain><072D96786BFC014AAEBA9EB07A8070EA2CF0AD@seattle.ecpower.dk><47298DDD.8010109@hotpop.com> <29447.204.19.71.2.1193933533.squirrel@www.microsyl.com> <472A4833.8000406@hotpop.com> Message-ID: Okay, sorry! Too impulsive first thing in the morning. (I am usually more careful, honest!) Albert. -----Original Message----- From: icc-avr-bounces@imagecraft.com [mailto:icc-avr-bounces@imagecraft.com] On Behalf Of David Brown Sent: Friday, November 02, 2007 10:42 AM To: Discussion list for ICCAVR and ICCtiny Users. You do NOT need tosubscribe to icc-announce if you are a member of this. Subject: Re: SV: [Icc-avr] Bootloader problem Albert vanVeen wrote: > Again: a matter of theory (and 'good' practice) and real (experienced) > practice. > Not in this case - it's a matter of writing incorrect code, and getting lucky. This sort of thing can change between different versions of compilers, or identical compilers with different optimisation options. It's silly to rely on something so specifically noted as "undefined" by the C language standards, and it's borderline irresponsible to post on a mailing list (which includes inexperienced programmers) that this is somehow a question of choosing "real practice" instead of good theory. Choosing programming conventions that lead to better, more reliable and more maintainable source code rather than ugly but legally correct source is arguably a matter of "theory" (though in fact it is more based on real, experienced practice). This is a case of incorrect code according to the standards of the language, and is not debatable in the same way. As John wrote in his post, there are other ways to code this particular example that maintain the correctness (based on sequence points) but may happen to produce smaller compiled code with icc-avr. That's a matter of choice - picking the best balance to give good generated code and clear source code. Look at: http://en.wikipedia.org/wiki/Sequence_point http://www.embedded.com/story/OEG20020625S0041 This link is about scope in C, which may also be of interest: http://www.embedded.com/columns/technicalinsights/202600398 mvh., David > I haven't come across a case in any of my 4 compilers that > PageAddressHigh = RxChar() + (RxChar() << 8); did not produce what I > expected. > > Albert. > > > -----Original Message----- > From: icc-avr-bounces@imagecraft.com > [mailto:icc-avr-bounces@imagecraft.com] On Behalf Of > sbissonnette@microsyl.com > Sent: Friday, November 02, 2007 05:12 AM > To: Discussion list for ICCAVR and ICCtiny Users. You do NOT need > tosubscribe to icc-announce if you are a member of this. > Subject: Re: SV: [Icc-avr] Bootloader problem > > Hi, > > Thanks for all your reply! The main reason I`m asking the > question I need more space in my code and those line take less space > > PageAddressHigh = RxChar() + (RxChar() << 8); > > and this one take more space > > uint8_t tmpLo = RxChar(); > uint8_t tmpHi = RxChar(); > PageAddressHigh = tmpLo | (((uint16_t) tmpHi) << 8); > > So with your reply I will try to find another way to reduce my code > space,..... > > Thanks > Sylvain Bissonnette > _______________________________________________ Icc-avr mailing list Icc-avr@imagecraft.com http://dragonsgate.net/mailman/listinfo/icc-avr Scanned by Bizo Email Filter From edi.imhof.ml at ihe.ch Thu Nov 1 23:09:25 2007 From: edi.imhof.ml at ihe.ch (Edi Im Hof) Date: Thu Nov 1 23:22:20 2007 Subject: SV: [Icc-avr] Bootloader problem In-Reply-To: <29447.204.19.71.2.1193933533.squirrel@www.microsyl.com> References: <663810.87987.qm@web60416.mail.yahoo.com><001d01c81b3d$ad0cc770$0301a8c0@Sylvain><002d01c81b4f$23afcfb0$0301a8c0@Sylvain> <002a01c81c31$1f609e20$0301a8c0@Sylvain> <072D96786BFC014AAEBA9EB07A8070EA2CF0AD@seattle.ecpower.dk> <47298DDD.8010109@hotpop.com> <29447.204.19.71.2.1193933533.squirrel@www.microsyl.com> Message-ID: <472ACD25.2070805@ihe.ch> Hi Silvian I don't know, but is it possible to force the order with brackets? Like this: PageAddressHigh = (( RxChar() ) + (RxChar() ) << 8); You can test this, if you reorder the brackets to force a false result: PageAddressHigh = ( RxChar() + ( (RxChar() ) ) << 8); Edi sbissonnette@microsyl.com schrieb: > Hi, > > Thanks for all your reply! The main reason I`m asking the question I > need more space in my code and those line take less space > > PageAddressHigh = RxChar() + (RxChar() << 8); > > and this one take more space > > uint8_t tmpLo = RxChar(); > uint8_t tmpHi = RxChar(); > PageAddressHigh = tmpLo | (((uint16_t) tmpHi) << 8); > > So with your reply I will try to find another way to reduce my code > space,..... > > Thanks > Sylvain Bissonnette > > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr > -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + IH electronic + Phone: ++41 52 320 90 00 + + Edi Im Hof + Fax: ++41 52 320 90 04 + + Doernlerstrasse 1, Sulz + URL: http://www.ihe.ch + + CH-8544 Rickenbach-Attikon + E-Mail: edi.imhof@ihe.ch + + Switzerland + + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ From david_brown at hotpop.com Fri Nov 2 00:03:37 2007 From: david_brown at hotpop.com (David Brown) Date: Thu Nov 1 23:45:03 2007 Subject: SV: [Icc-avr] Bootloader problem In-Reply-To: References: <663810.87987.qm@web60416.mail.yahoo.com><001d01c81b3d$ad0cc770$0301a8c0@Sylvain><002d01c81b4f$23afcfb0$0301a8c0@Sylvain><002a01c81c31$1f609e20$0301a8c0@Sylvain><072D96786BFC014AAEBA9EB07A8070EA2CF0AD@seattle.ecpower.dk><47298DDD.8010109@hotpop.com> <29447.204.19.71.2.1193933533.squirrel@www.microsyl.com> <472A4833.8000406@hotpop.com> Message-ID: <472AD9D9.8090406@hotpop.com> Albert vanVeen wrote: > Okay, sorry! Too impulsive first thing in the morning. > (I am usually more careful, honest!) > Albert, it's much better to post what you think and get corrected than not to ask the questions at all. That's one way we learn - making a mistake and learning the correct way. Another way to learn is by explaining things to others - it forces us to think through ideas a little more carefully, which is part of why I post here. And since there are many people reading this list, the hope is that there will be others who learn a little from the discussion even if they are not taking part. mvh., David > Albert. > From johan at edab.nu Thu Nov 1 23:39:57 2007 From: johan at edab.nu (=?iso-8859-1?Q?Johan_Wallstr=F6m?=) Date: Thu Nov 1 23:49:51 2007 Subject: SV: [Icc-avr] Bootloader problem References: <663810.87987.qm@web60416.mail.yahoo.com><001d01c81b3d$ad0cc770$0301a8c0@Sylvain><002d01c81b4f$23afcfb0$0301a8c0@Sylvain> <002a01c81c31$1f609e20$0301a8c0@Sylvain> <072D96786BFC014AAEBA9EB07A8070EA2CF0AD@seattle.ecpower.dk> <47298DDD.8010109@hotpop.com><29447.204.19.71.2.1193933533.squirrel@www.microsyl.com> <472ACD25.2070805@ihe.ch> Message-ID: <001b01c81d23$91441c40$64026e0a@EDAB1> > Hi Silvian > > I don't know, but is it possible to force the order with brackets? > Like this: > > PageAddressHigh = (( RxChar() ) + (RxChar() ) << 8); > > You can test this, if you reorder the brackets to force a false result: > PageAddressHigh = ( RxChar() + ( (RxChar() ) ) << 8); > > Edi Nooo, it doesn't make it clearer. I hardly think the following code would produce alot more instructions. After all, it's just local variables that the compiler can put in any registers it want to, just like it does when reading both chars on the same line. char firstRxChar = RxChar(); char secondRxChar = RxChar(); PageAddressHigh = firstRxChar + (secondRxChar << 8); From david_brown at hotpop.com Fri Nov 2 00:24:40 2007 From: david_brown at hotpop.com (David Brown) Date: Fri Nov 2 00:06:02 2007 Subject: SV: [Icc-avr] Bootloader problem In-Reply-To: <472ACD25.2070805@ihe.ch> References: <663810.87987.qm@web60416.mail.yahoo.com><001d01c81b3d$ad0cc770$0301a8c0@Sylvain><002d01c81b4f$23afcfb0$0301a8c0@Sylvain> <002a01c81c31$1f609e20$0301a8c0@Sylvain> <072D96786BFC014AAEBA9EB07A8070EA2CF0AD@seattle.ecpower.dk> <47298DDD.8010109@hotpop.com> <29447.204.19.71.2.1193933533.squirrel@www.microsyl.com> <472ACD25.2070805@ihe.ch> Message-ID: <472ADEC8.9070401@hotpop.com> Edi Im Hof wrote: > Hi Silvian > > I don't know, but is it possible to force the order with brackets? > Like this: > No, you can't force the order of execution with brackets. Brackets change the grouping for evaluation, but not the ordering. Thus if you write "a + (b + c)", then the compiler can chose to do the calculation as "a + (b + c)", "(b + c) + a", "a + (c + b)" or "(b + c) + a". All you have ruled out is orders such as "(a + b) + c". The compiler can in fact be even freer in its ordering, as long as it is sure the results will be the same in the end. mvh., David > PageAddressHigh = (( RxChar() ) + (RxChar() ) << 8); > > You can test this, if you reorder the brackets to force a false result: > PageAddressHigh = ( RxChar() + ( (RxChar() ) ) << 8); > > Edi > > > sbissonnette@microsyl.com schrieb: >> Hi, >> >> Thanks for all your reply! The main reason I`m asking the question I >> need more space in my code and those line take less space >> >> PageAddressHigh = RxChar() + (RxChar() << 8); >> >> and this one take more space >> >> uint8_t tmpLo = RxChar(); >> uint8_t tmpHi = RxChar(); >> PageAddressHigh = tmpLo | (((uint16_t) tmpHi) << 8); >> >> So with your reply I will try to find another way to reduce my code >> space,..... >> >> Thanks >> Sylvain Bissonnette >> >> >> _______________________________________________ >> Icc-avr mailing list >> Icc-avr@imagecraft.com >> http://dragonsgate.net/mailman/listinfo/icc-avr >> > From t.jaspers at cpseurope.com Fri Nov 2 00:21:07 2007 From: t.jaspers at cpseurope.com (Jaspers, Ton) Date: Fri Nov 2 00:33:38 2007 Subject: [Icc-avr] HTML mails on the list In-Reply-To: Message-ID: <7B0EB27CF1CC93439B5CFB7526E5D74C4FBCB3@mickey.PBNV.local> Ohw, Come on, grow up. Wether you like it our not HTML email is a fact of life thanks to Microsoft, learn to live with it. In contrast to an RFC It is what is commonly called a de-facto standard I suppuse you also still drive a Ford model-T ? And truly believe a Comodore 64 is the greatest comuter ever? Ton > -----Original Message----- > From: Graham Whyte > > I agree completely, > > Problem I think is Outlook & Outlook Express use HTML format > by default A lot of people don't know the difference, far > less how to change it > > Other lists that I subscribe to automatically strip out > non-text content The reason primarily is for security It is > difficult to embed a virus in a text mail It is very easy in > HTML to slip in some Javascript nasty > > I wonder if Richard's system allows automatic conversion to text > > Graham > > > -----Original Message----- > From: icc-avr-bounces@imagecraft.com > [mailto:icc-avr-bounces@imagecraft.com]On Behalf Of Andy Syms > Sent: 01 November 2007 10:34 > To: Discussion list for ICCAVR and ICCtiny Users. You do NOT > needtosubscribeto icc-announce if you are a member of this. > Subject: RE: SV: [Icc-avr] Bootloader problem > > > > (Rant - could people please not post hideous html emails on mailing > > lists like this? Plain text email works much better, and makes it > > easier to track attributions and quotations from different posters.) > > I agree. Now, how do we stop people top posting and > massively over-quoting ? ;-) > > Andy > > > _______________________________________________ > 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 edi.imhof.ml at ihe.ch Fri Nov 2 02:39:58 2007 From: edi.imhof.ml at ihe.ch (Edi Im Hof) Date: Fri Nov 2 02:52:58 2007 Subject: SV: [Icc-avr] Bootloader problem In-Reply-To: <472ADEC8.9070401@hotpop.com> References: <663810.87987.qm@web60416.mail.yahoo.com><001d01c81b3d$ad0cc770$0301a8c0@Sylvain><002d01c81b4f$23afcfb0$0301a8c0@Sylvain> <002a01c81c31$1f609e20$0301a8c0@Sylvain> <072D96786BFC014AAEBA9EB07A8070EA2CF0AD@seattle.ecpower.dk> <47298DDD.8010109@hotpop.com> <29447.204.19.71.2.1193933533.squirrel@www.microsyl.com> <472ACD25.2070805@ihe.ch> <472ADEC8.9070401@hotpop.com> Message-ID: <472AFE7E.80105@ihe.ch> David Brown schrieb: > Edi Im Hof wrote: >> Hi Silvian >> >> I don't know, but is it possible to force the order with brackets? >> Like this: >> > > No, you can't force the order of execution with brackets. OK, learned again something new, thanks. I always thought the compiler evaluates from the inside to the outside. Edi Brackets > change the grouping for evaluation, but not the ordering. Thus if you > write "a + (b + c)", then the compiler can chose to do the calculation > as "a + (b + c)", "(b + c) + a", "a + (c + b)" or "(b + c) + a". All > you have ruled out is orders such as "(a + b) + c". The compiler can in > fact be even freer in its ordering, as long as it is sure the results > will be the same in the end. > > mvh., > > David > > >> PageAddressHigh = (( RxChar() ) + (RxChar() ) << 8); >> >> You can test this, if you reorder the brackets to force a false result: >> PageAddressHigh = ( RxChar() + ( (RxChar() ) ) << 8); >> >> Edi >> -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + IH electronic + Phone: ++41 52 320 90 00 + + Edi Im Hof + Fax: ++41 52 320 90 04 + + Doernlerstrasse 1, Sulz + URL: http://www.ihe.ch + + CH-8544 Rickenbach-Attikon + E-Mail: edi.imhof@ihe.ch + + Switzerland + + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ From david_brown at hotpop.com Fri Nov 2 04:31:28 2007 From: david_brown at hotpop.com (David Brown) Date: Fri Nov 2 04:12:45 2007 Subject: SV: [Icc-avr] Bootloader problem In-Reply-To: <472AFE7E.80105@ihe.ch> References: <663810.87987.qm@web60416.mail.yahoo.com><001d01c81b3d$ad0cc770$0301a8c0@Sylvain><002d01c81b4f$23afcfb0$0301a8c0@Sylvain> <002a01c81c31$1f609e20$0301a8c0@Sylvain> <072D96786BFC014AAEBA9EB07A8070EA2CF0AD@seattle.ecpower.dk> <47298DDD.8010109@hotpop.com> <29447.204.19.71.2.1193933533.squirrel@www.microsyl.com> <472ACD25.2070805@ihe.ch> <472ADEC8.9070401@hotpop.com> <472AFE7E.80105@ihe.ch> Message-ID: <472B18A0.7030602@hotpop.com> Edi Im Hof wrote: > David Brown schrieb: >> Edi Im Hof wrote: >>> Hi Silvian >>> >>> I don't know, but is it possible to force the order with brackets? >>> Like this: >>> >> >> No, you can't force the order of execution with brackets. > > OK, learned again something new, thanks. > I always thought the compiler evaluates from the inside to the outside. There's a subtle difference between evaluation order and execution order. The compiler will evaluate expressions from the inside out, from left to right, and according to the precedence of the operators used (i.e., it does "*" before "+"). But for any parts of the expression that cause other effects (such as function calls, or things like "i++"), there are no guarantees about the order of execution. So for something like "(bar1(x) * bar2(y)) / bar3(z)", you do not know the order in which the different bar's will be called, nor whether the multiplication will be done before or after bar3(). But you *do* know that the multiplication will be done before the division, which will have a major influence on potential overflows and rounding. (Technically speaking, the compiler does not actually have to do the arithmetic in this order - it must simply ensure that the results are as though it were done in order. Of course, following the order is normally the easiest way to do this.) mvh., David > Edi > > Brackets >> change the grouping for evaluation, but not the ordering. Thus if you >> write "a + (b + c)", then the compiler can chose to do the calculation >> as "a + (b + c)", "(b + c) + a", "a + (c + b)" or "(b + c) + a". All >> you have ruled out is orders such as "(a + b) + c". The compiler can >> in fact be even freer in its ordering, as long as it is sure the >> results will be the same in the end. >> >> mvh., >> >> David >> >> >>> PageAddressHigh = (( RxChar() ) + (RxChar() ) << 8); >>> >>> You can test this, if you reorder the brackets to force a false result: >>> PageAddressHigh = ( RxChar() + ( (RxChar() ) ) << 8); >>> >>> Edi >>> > > > From paul.aa9gg at gmail.com Fri Nov 2 06:02:22 2007 From: paul.aa9gg at gmail.com (Paul Mateer) Date: Fri Nov 2 06:15:15 2007 Subject: [Icc-avr] HTML mails on the list In-Reply-To: <7B0EB27CF1CC93439B5CFB7526E5D74C4FBCB3@mickey.PBNV.local> References: <7B0EB27CF1CC93439B5CFB7526E5D74C4FBCB3@mickey.PBNV.local> Message-ID: <20f5efc40711020702l6aa82744of8f8eb97d4c0aa69@mail.gmail.com> Sounds like you all need a vacation to get away from your computers for awhile!!!! On Nov 2, 2007 3:21 AM, Jaspers, Ton wrote: > Ohw, Come on, grow up. > > Wether you like it our not HTML email is a fact of life > thanks to Microsoft, learn to live with it. In contrast > to an RFC It is what is commonly called a de-facto standard > > I suppuse you also still drive a Ford model-T ? > And truly believe a Comodore 64 is the greatest comuter ever? > > Ton > > > > -----Original Message----- > > From: Graham Whyte > > > > I agree completely, > > > > Problem I think is Outlook & Outlook Express use HTML format > > by default A lot of people don't know the difference, far > > less how to change it > > > > Other lists that I subscribe to automatically strip out > > non-text content The reason primarily is for security It is > > difficult to embed a virus in a text mail It is very easy in > > HTML to slip in some Javascript nasty > > > > I wonder if Richard's system allows automatic conversion to text > > > > Graham > > > > > > -----Original Message----- > > From: icc-avr-bounces@imagecraft.com > > [mailto:icc-avr-bounces@imagecraft.com]On Behalf Of Andy Syms > > Sent: 01 November 2007 10:34 > > To: Discussion list for ICCAVR and ICCtiny Users. You do NOT > > needtosubscribeto icc-announce if you are a member of this. > > Subject: RE: SV: [Icc-avr] Bootloader problem > > > > > > > (Rant - could people please not post hideous html emails on mailing > > > lists like this? Plain text email works much better, and makes it > > > easier to track attributions and quotations from different posters.) > > > > I agree. Now, how do we stop people top posting and > > massively over-quoting ? ;-) > > > > Andy > > > > > > _______________________________________________ > > Icc-avr mailing list > > Icc-avr@imagecraft.com > > http://dragonsgate.net/mailman/listinfo/icc-avr > > > > _______________________________________________ > > Icc-avr mailing list > > Icc-avr@imagecraft.com > > http://dragonsgate.net/mailman/listinfo/icc-avr > > > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr > -- Paul Mateer, AA9GG Elan Engineering Corp. www.elanengr.com From ira at extrasensory.com Thu Nov 1 22:59:01 2007 From: ira at extrasensory.com (Ira) Date: Fri Nov 2 08:30:18 2007 Subject: SV: [Icc-avr] Bootloader problem In-Reply-To: <29447.204.19.71.2.1193933533.squirrel@www.microsyl.com> References: <663810.87987.qm@web60416.mail.yahoo.com> <001d01c81b3d$ad0cc770$0301a8c0@Sylvain> <002d01c81b4f$23afcfb0$0301a8c0@Sylvain> <002a01c81c31$1f609e20$0301a8c0@Sylvain> <072D96786BFC014AAEBA9EB07A8070EA2CF0AD@seattle.ecpower.dk> <47298DDD.8010109@hotpop.com> <29447.204.19.71.2.1193933533.squirrel@www.microsyl.com> Message-ID: <0MKpCa-1InzCu1Cej-0000Cl@mrelay.perfora.net> At 09:12 AM 11/1/2007, you wrote: This is more efficient. > uint8_t tmpLo = RxChar(); > PageAddressHigh = tmpLo | (((uint16_t) RxChar()) << 8); From MDipperstein at CalAmp.com Fri Nov 2 09:27:18 2007 From: MDipperstein at CalAmp.com (Michael Dipperstein) Date: Fri Nov 2 09:40:12 2007 Subject: SV: [Icc-avr] Bootloader problem In-Reply-To: <0MKpCa-1InzCu1Cej-0000Cl@mrelay.perfora.net> Message-ID: The source that results in the least amount of AVR instructions depends on a number of factors including how PageAddressHigh is allocated and the number of available registers. More often then not, I get the most compact results that I can think of using code that looks like this: #define AssignMSB16(var, value) *((uint8_t *)(&(var)) + 1) = (value) #define AssignLSB16(var, value) *((uint8_t *)(&(var) + 1) - 2) = (value) AssignLSB16(PageAddressHigh, RxChar()); AssignMSB16(PageAddressHigh, RxChar()); The + 1 and then -2 in AssignLSB16 was something I came up with to make the compiler generate code the way I thought it should look. Without it, there are some cases where an extra set of registers get used. I'll let others chime in about the safety of these kinds of operations. -Mike -----Original Message----- From: icc-avr-bounces@imagecraft.com [mailto:icc-avr-bounces@imagecraft.com] On Behalf Of Ira Sent: Thursday, November 01, 2007 11:59 PM To: icc-avr@imagecraft.com Subject: Re: SV: [Icc-avr] Bootloader problem At 09:12 AM 11/1/2007, you wrote: This is more efficient. > uint8_t tmpLo = RxChar(); > PageAddressHigh = tmpLo | (((uint16_t) RxChar()) << 8); _______________________________________________ Icc-avr mailing list Icc-avr@imagecraft.com http://dragonsgate.net/mailman/listinfo/icc-avr From david_brown at hotpop.com Fri Nov 2 13:22:29 2007 From: david_brown at hotpop.com (David Brown) Date: Fri Nov 2 13:35:34 2007 Subject: SV: [Icc-avr] Bootloader problem In-Reply-To: References: Message-ID: <472B9515.3010400@hotpop.com> Michael Dipperstein wrote: > The source that results in the least amount of AVR instructions depends > on a number of factors including how PageAddressHigh is allocated and > the number of available registers. > > More often then not, I get the most compact results that I can think of > using code that looks like this: > #define AssignMSB16(var, value) *((uint8_t *)(&(var)) + 1) = (value) > #define AssignLSB16(var, value) *((uint8_t *)(&(var) + 1) - 2) = > (value) > > AssignLSB16(PageAddressHigh, RxChar()); > AssignMSB16(PageAddressHigh, RxChar()); > > The + 1 and then -2 in AssignLSB16 was something I came up with to make > the compiler generate code the way I thought it should look. Without > it, there are some cases where an extra set of registers get used. > > I'll let others chime in about the safety of these kinds of operations. > These macros look perfectly safe to me. They're a little ugly - all such macros are - but hiding them away in a header file lets you keep your main source code neat and clear. They will make your source code a little more complicated, but sometimes that's the price you pay to get smaller and faster code in critical functions. mvh., David > -Mike > > -----Original Message----- > From: icc-avr-bounces@imagecraft.com > [mailto:icc-avr-bounces@imagecraft.com] On Behalf Of Ira > Sent: Thursday, November 01, 2007 11:59 PM > To: icc-avr@imagecraft.com > Subject: Re: SV: [Icc-avr] Bootloader problem > > At 09:12 AM 11/1/2007, you wrote: > > This is more efficient. > >> uint8_t tmpLo = RxChar(); >> PageAddressHigh = tmpLo | (((uint16_t) RxChar()) << 8); > > _______________________________________________ > 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 sbissonnette at microsyl.com Sun Nov 4 18:42:56 2007 From: sbissonnette at microsyl.com (Sylvain Bissonnette) Date: Sun Nov 4 18:58:50 2007 Subject: [Icc-avr] Bootloader problem PROBLEM FOUND References: <663810.87987.qm@web60416.mail.yahoo.com> <001d01c81b3d$ad0cc770$0301a8c0@Sylvain> <002d01c81b4f$23afcfb0$0301a8c0@Sylvain> <002a01c81c31$1f609e20$0301a8c0@Sylvain> <072D96786BFC014AAEBA9EB07A8070EA2CF0AD@seattle.ecpower.dk> <072D96786BFC014AAEBA9EB07A8070EA2CF0AF@seattle.ecpower.dk> Message-ID: <001b01c81f55$92045da0$0301a8c0@Sylvain> Hi, The problem was not the JMP 0x0000 but something strange check: unsigned char RxChar(void) { unsigned int TimeOut = 0; while(!(_UCSRA & 0x80)) { if (TimeOut++ > 65530) break; } return _UDR; } If I don't initialize the TimeOut = 0; the code didn't work (that's in bootloader application) Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20071104/823e26fc/attachment.html From johan at edab.nu Sun Nov 4 23:40:53 2007 From: johan at edab.nu (=?iso-8859-1?Q?Johan_Wallstr=F6m?=) Date: Sun Nov 4 23:50:54 2007 Subject: [Icc-avr] Bootloader problem PROBLEM FOUND References: <663810.87987.qm@web60416.mail.yahoo.com><001d01c81b3d$ad0cc770$0301a8c0@Sylvain><002d01c81b4f$23afcfb0$0301a8c0@Sylvain><002a01c81c31$1f609e20$0301a8c0@Sylvain><072D96786BFC014AAEBA9EB07A8070EA2CF0AD@seattle.ecpower.dk><072D96786BFC014AAEBA9EB07A8070EA2CF0AF@seattle.ecpower.dk> <001b01c81f55$92045da0$0301a8c0@Sylvain> Message-ID: <002501c81f7f$31fa1600$64026e0a@EDAB1> > If I don't initialize the TimeOut = 0; the code didn't work (that's in > bootloader application) > > Sylvain Yeah, (uninitialized) global and static data get's initialized to zero by the compiler, while (uninitialized) local data does not - they get whatever value happens to be there. regards Johan Wallstr?m Elektronik Design AB +4660169550 From asyms at technosoft.co.uk Mon Nov 5 01:14:49 2007 From: asyms at technosoft.co.uk (Andy Syms) Date: Mon Nov 5 01:36:31 2007 Subject: [Icc-avr] Bootloader problem PROBLEM FOUND In-Reply-To: <001b01c81f55$92045da0$0301a8c0@Sylvain> Message-ID: > The problem was not the JMP 0x0000 but something strange check: > If I don't initialize the TimeOut = 0; the code didn't work (that's in bootloader application) Not strange at all. Local variables allocated on the stack contain whatever garbage was currently on the stack. Andy. From jh.bodin at telia.com Mon Nov 5 03:17:34 2007 From: jh.bodin at telia.com (Johan H. Bodin) Date: Mon Nov 5 03:30:35 2007 Subject: [Icc-avr] Bootloader problem PROBLEM FOUND In-Reply-To: <002501c81f7f$31fa1600$64026e0a@EDAB1> References: <663810.87987.qm@web60416.mail.yahoo.com><001d01c81b3d$ad0cc770$0301a8c0@Sylvain><002d01c81b4f$23afcfb0$0301a8c0@Sylvain><002a01c81c31$1f609e20$0301a8c0@Sylvain><072D96786BFC014AAEBA9EB07A8070EA2CF0AD@seattle.ecpower.dk><072D96786BFC014AAEBA9EB07A8070EA2CF0AF@seattle.ecpower.dk> <001b01c81f55$92045da0$0301a8c0@Sylvain> <002501c81f7f$31fa1600$64026e0a@EDAB1> Message-ID: <472EFBCE.7010009@telia.com> And the global/static variables only gets initialized ONCE (at program start-up). No variables are initialized automagically upon function entry (except the argument(s) of course). You must do this explicitly in your code. Regards Johan Bodin ---- Johan Wallstr?m wrote: > >> If I don't initialize the TimeOut = 0; the code didn't work (that's >> in bootloader application) >> >> Sylvain > > Yeah, (uninitialized) global and static data get's initialized to zero > by the compiler, while (uninitialized) local data does not - they get > whatever value happens to be there. > > regards > Johan Wallstr?m > Elektronik Design AB > +4660169550 > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr > From stephan.daub at sap.com Mon Nov 5 05:05:54 2007 From: stephan.daub at sap.com (Daub, Stephan) Date: Mon Nov 5 05:19:19 2007 Subject: AW: Re: [Icc-avr] Bootloader problem PROBLEM FOUND Message-ID: Hi all, >You must do this explicitly in your >code. ...But is this good programming style anyway (in all programming languages), isn't it ? Best, stephan -----Original Message----- From: icc-avr-bounces@imagecraft.com To: Johan Wallstr?m ; Discussion list for ICCAVR and ICCtiny Users. You do NOT need tosubscribe to icc-announce if you are a member of this. Sent: Mon Nov 05 12:17:34 2007 Subject: Re: [Icc-avr] Bootloader problem PROBLEM FOUND And the global/static variables only gets initialized ONCE (at program start-up). No variables are initialized automagically upon function entry (except the argument(s) of course). You must do this explicitly in your code. Regards Johan Bodin ---- Johan Wallstr?m wrote: > >> If I don't initialize the TimeOut = 0; the code didn't work (that's >> in bootloader application) >> >> Sylvain > > Yeah, (uninitialized) global and static data get's initialized to zero > by the compiler, while (uninitialized) local data does not - they get > whatever value happens to be there. > > regards > Johan Wallstr?m > Elektronik Design AB > +4660169550 > > _______________________________________________ > 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 david_brown at hotpop.com Mon Nov 5 06:22:35 2007 From: david_brown at hotpop.com (David Brown) Date: Mon Nov 5 06:03:54 2007 Subject: AW: Re: [Icc-avr] Bootloader problem PROBLEM FOUND In-Reply-To: References: Message-ID: <472F272B.8060503@hotpop.com> Daub, Stephan wrote: > Hi all, > >> You must do this explicitly in your >code. > ...But is this good programming style anyway (in all programming > languages), isn't it ? > > Best, stephan > It is always important to initialise your local variables before using them - using a variable before it has a value assigned is not a matter of style, but a matter of correct code. However, there is no need to explicitly initialise a variable if it is latter set before using it: void foo(void) { int i = 0; // unnecessary explicit initialisation for (i = 0; i < 10; i++) ... } For non-static local variables, there is no difference between giving a value when the variable is declared, and a simple assignment. It is therefore often convenient to assign the initial value just before the variable is first used, rather than where it is declared - this may also lead to better code generation (on C99 compilers, you may want to leave the declaration until later as well, but that's a matter of style). It is also unnecessary to explicitly initialise file-scope data that should start at 0 - this is done automatically, and explicit initialisation is a waste of space. There are exceptions - if you have an enumerated type, or a variable normally used with a set of #define'd constants, you should probably explicitly initialise it with the enumeration value even if that is represented by 0. mvh., David > -----Original Message----- From: icc-avr-bounces@imagecraft.com > To: Johan Wallstr?m ; > Discussion list for ICCAVR and ICCtiny Users. You do NOT need > tosubscribe to icc-announce if you are a member of this. > Sent: Mon Nov 05 12:17:34 2007 Subject: Re: > [Icc-avr] Bootloader problem PROBLEM FOUND > > And the global/static variables only gets initialized ONCE (at > program start-up). No variables are initialized automagically upon > function entry (except the argument(s) of course). You must do this > explicitly in your code. > > Regards Johan Bodin > > ---- > > Johan Wallstr?m wrote: >>> If I don't initialize the TimeOut = 0; the code didn't work >>> (that's in bootloader application) >>> >>> Sylvain >> Yeah, (uninitialized) global and static data get's initialized to >> zero by the compiler, while (uninitialized) local data does not - >> they get whatever value happens to be there. >> >> regards Johan Wallstr?m Elektronik Design AB +4660169550 >> From sbissonnette at microsyl.com Mon Nov 5 07:17:30 2007 From: sbissonnette at microsyl.com (sbissonnette@microsyl.com) Date: Mon Nov 5 07:30:26 2007 Subject: AW: Re: [Icc-avr] Bootloader problem PROBLEM FOUND In-Reply-To: <472F272B.8060503@hotpop.com> References: <472F272B.8060503@hotpop.com> Message-ID: <56428.204.19.71.2.1194275850.squirrel@www.microsyl.com> Thanks for all of your reply, With all your information I will need to check all my code in more than 100 software,... Thanks Sylvain Bissonnette From richard at imagecraft.com Mon Nov 5 19:31:23 2007 From: richard at imagecraft.com (Richard) Date: Mon Nov 5 19:44:47 2007 Subject: [Icc-avr] RFC: __flash vs. const Message-ID: <200711060344.lA63iiaH002775@dragonsgate2.imagecraft.com> For the upcoming release that supports __flash, it turns out to be more difficult to add a backward compatibility than I thought. The problem is mainly the library functions. For example, properly, the strcpy is declared as char *strcpy(char *src, const char *dst); The const qualifier of the "dst" argument will cause trouble with the new release if there is a backward compatibility switch on. The best solution is probably something like declaring it as char *strcpy(char *, _CONST char *) where _CONST is #define'd as nothing if the backward compat switch is on, and const otherwise. Or we will bite the bullet and request all users henceforth only use __flash to mean flash space. This would of course make it difficult to have compatible sources for multiple releases. Comments? Suggestions? // 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 david_brown at hotpop.com Tue Nov 6 00:16:48 2007 From: david_brown at hotpop.com (David Brown) Date: Mon Nov 5 23:58:00 2007 Subject: [Icc-avr] RFC: __flash vs. const In-Reply-To: <200711060344.lA63iiaH002775@dragonsgate2.imagecraft.com> References: <200711060344.lA63iiaH002775@dragonsgate2.imagecraft.com> Message-ID: <473022F0.30004@hotpop.com> Richard wrote: > For the upcoming release that supports __flash, it turns out to be more > difficult to add a backward compatibility than I thought. The problem is > mainly the library functions. For example, properly, the strcpy is > declared as > > char *strcpy(char *src, const char *dst); > I hope you meant: char *strcpy(char *dst, const char *src); > The const qualifier of the "dst" argument will cause trouble with the > new release if there is a backward compatibility switch on. The best > solution is probably something like declaring it as > > char *strcpy(char *, _CONST char *) > > where _CONST is #define'd as nothing if the backward compat switch is > on, and const otherwise. > > Or we will bite the bullet and request all users henceforth only use > __flash to mean flash space. This would of course make it difficult to > have compatible sources for multiple releases. > > Comments? Suggestions? > I'd go with your _CONST plan (although such compiler-defined macros should perhaps have two leading underscores, like __flash?). It's clear what it is doing, and gives people the choice. When compiling in backwards compatibility mode, perhaps __flash should be a macro expanding to "const" ? This would, I think, give a smoother transition, as "__flash" will then give the expected effect in both modes. I'd also have *two* switches to control the mode. You would have one to enable the new __flash mode, and one to enable the old const mode. If neither switch is used, the code will compile in the old const mode but give a warning that an explicit switch should be used. In later versions, change the warning to an error. That would, I think, minimise the possibility of accidents. mvh., David From sl at ecpower.dk Mon Nov 5 23:46:01 2007 From: sl at ecpower.dk (Steven Lose) Date: Mon Nov 5 23:58:58 2007 Subject: SV: [Icc-avr] RFC: __flash vs. const References: <200711060344.lA63iiaH002775@dragonsgate2.imagecraft.com> Message-ID: <072D96786BFC014AAEBA9EB07A8070EA307AFA@seattle.ecpower.dk> Hi. The const in ICC is only used there were we would normally use flash, so the only thing that a backward compatibility options is saving is the time for the search and replace. It is optional if someone afterwards will use time on going through all of the functions in SW to add const to variables and arguments. So even through I understand the concern from others on the list that just like me will have to spend some extra time on a ton of SW, I say bite the bullet and go for the right solution. (In hope that someone will not bite my head of) 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 Richard Sendt: 6. november 2007 04:31 Til: icc-avr@imagecraft.com Emne: [Icc-avr] RFC: __flash vs. const For the upcoming release that supports __flash, it turns out to be more difficult to add a backward compatibility than I thought. The problem is mainly the library functions. For example, properly, the strcpy is declared as char *strcpy(char *src, const char *dst); The const qualifier of the "dst" argument will cause trouble with the new release if there is a backward compatibility switch on. The best solution is probably something like declaring it as char *strcpy(char *, _CONST char *) where _CONST is #define'd as nothing if the backward compat switch is on, and const otherwise. Or we will bite the bullet and request all users henceforth only use __flash to mean flash space. This would of course make it difficult to have compatible sources for multiple releases. Comments? Suggestions? // 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. ] _______________________________________________ Icc-avr mailing list Icc-avr@imagecraft.com http://dragonsgate.net/mailman/listinfo/icc-avr From rodney at junipersys.com Tue Nov 6 07:22:34 2007 From: rodney at junipersys.com (Rodney Pearson) Date: Tue Nov 6 07:36:22 2007 Subject: [Icc-avr] RFC: __flash vs. const In-Reply-To: <200711060344.lA63iiaH002775@dragonsgate2.imagecraft.com> References: <200711060344.lA63iiaH002775@dragonsgate2.imagecraft.com> Message-ID: Since I only have a minimal amount of SW (compared to others here), my top vote goes to "biting the bullet". I agree with Steven that it is better to go with a correct solution and have the dev perform the find/replace. But I also do not have to update numerous projects spanning numerous years... =) If a compromise needs to be struck, then I feel that what David suggested is a good one. Perhaps this type of change should be reserved for ICCAVR v.8? That makes it clearer that there are major changes that may require code migration from v7 to compile in v8. Just my 2-cents. Cheers! Rodney Pearson Software Engineer Juniper Systems, Inc. www.junipersys.com -----Original Message----- From: icc-avr-bounces@imagecraft.com [mailto:icc-avr-bounces@imagecraft.com] On Behalf Of Richard Sent: Monday, November 05, 2007 8:31 PM To: icc-avr@imagecraft.com Subject: [Icc-avr] RFC: __flash vs. const For the upcoming release that supports __flash, it turns out to be more difficult to add a backward compatibility than I thought. The problem is mainly the library functions. For example, properly, the strcpy is declared as char *strcpy(char *src, const char *dst); The const qualifier of the "dst" argument will cause trouble with the new release if there is a backward compatibility switch on. The best solution is probably something like declaring it as char *strcpy(char *, _CONST char *) where _CONST is #define'd as nothing if the backward compat switch is on, and const otherwise. Or we will bite the bullet and request all users henceforth only use __flash to mean flash space. This would of course make it difficult to have compatible sources for multiple releases. Comments? Suggestions? // 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. ] _______________________________________________ Icc-avr mailing list Icc-avr@imagecraft.com http://dragonsgate.net/mailman/listinfo/icc-avr From tozetd at gmail.com Tue Nov 6 08:32:38 2007 From: tozetd at gmail.com (Hamba Allah Laki-laki) Date: Tue Nov 6 08:45:38 2007 Subject: [Icc-avr] Interfacing Epson LCD EG7502 Message-ID: <48aab2470711060832y40adf075q3f0e180e16d68edf@mail.gmail.com> Hi, World Is there some guys / girls who is knowing about EPSON LCD EG7502 pinout? I appreciate, if someone help me to understanding how to interface a micro with EPSON LCD EG7502. thanks Rijal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20071106/11b38103/attachment.html From dittybop at sbcglobal.net Tue Nov 6 08:48:40 2007 From: dittybop at sbcglobal.net (Jerry Ross) Date: Tue Nov 6 09:01:44 2007 Subject: [Icc-avr] RFC: __flash vs. const In-Reply-To: References: <200711060344.lA63iiaH002775@dragonsgate2.imagecraft.com> Message-ID: <47309AE8.9040707@sbcglobal.net> My procedure for locking down "final releases" of major code projects is to include archive copies of the development tools; compiler(s), assembler(s), linker(s), etc. used to create the project(s). This allows me to do sustaining work on the project(s) for customers without incurring needless work, many times a lot of work, caused by using the "latest and greatest" development tools. My vote: Make the change. Jerry Ross Rodney Pearson wrote: > Since I only have a minimal amount of SW (compared to others here), my > top vote goes to "biting the bullet". I agree with Steven that it is > better to go with a correct solution and have the dev perform the > find/replace. But I also do not have to update numerous projects > spanning numerous years... =) > > If a compromise needs to