From byron at inhep.com Mon Jun 2 00:05:59 2008 From: byron at inhep.com (Byron Loader) Date: Mon Jun 2 01:12:31 2008 Subject: [Icc-avr] App Builder issue In-Reply-To: <200805302026.m4UKQKpv028319@mail.imagecraft.com> Message-ID: <2EDB5270C4424480B58C5DD28E130D31@inhep> Hi Guys, I recently went through the M164P and found multiple discrepancies between what the app builder generates, and what the processor settings are. To what email address can I send these to get it fixed. Regards, Byron Loader -----Original Message----- From: icc-avr-bounces@imagecraft.com [mailto:icc-avr-bounces@imagecraft.com] On Behalf Of Richard Man Sent: Friday, May 30, 2008 9:22 PM To: Discussion list for ICCAVR and ICCtiny Users. You do NOT need tosubscribe to icc-announce if you are a member of this.; icc-avr@imagecraft.com Subject: Re: [Icc-avr] App Builder issue Hi folks, first of all, if you discover issues with the AppBuilder, do email us, and make sure we acknowledge your email. Sometimes mail get spam trapped. Second, Bob pretty much hit the nails on the problems: we have to manually cull the datasheet to see what features are available for which micro by hand. It's an error prone processing, plus hard on the eyes, so please be a bit patience if you find discrepancies. Thanks. At 11:33 AM 5/30/2008, bobgardner@aol.com wrote: >Maybe what us users need, and the app builder maintainers need, is a >matrix with avr model number and family as one axis, and 'peripheral >version' or 'susbsystem type' as the other axis. Across the AVR >models are several slightly different versions of uart, 8 and 16 bit >timers, a/d, io pins etc. Some thing like: "the 164/324/644 families >have the 'type 2' 8 bit timers found in the mega32". Armed with this >knowledge, a user could use the timer section from another AVR model >to generate the timer init for a new model, if the 'type' was known. // 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 From richard-lists at imagecraft.com Mon Jun 2 00:30:27 2008 From: richard-lists at imagecraft.com (Richard Man) Date: Mon Jun 2 01:35:07 2008 Subject: [Icc-avr] App Builder issue In-Reply-To: <2EDB5270C4424480B58C5DD28E130D31@inhep> References: <200805302026.m4UKQKpv028319@mail.imagecraft.com> <2EDB5270C4424480B58C5DD28E130D31@inhep> Message-ID: <200806020835.m528Z5xN086362@mail.imagecraft.com> support@imagecraft.com At 12:05 AM 6/2/2008, Byron Loader wrote: >Hi Guys, > >I recently went through the M164P and found multiple discrepancies between >what the app builder generates, and what the processor settings are. To what >email address can I send these to get it fixed. // richard (This email is for mailing lists. To reach me directly, please use richard at imagecraft.com) From t.jaspers at cpseurope.com Mon Jun 2 00:41:18 2008 From: t.jaspers at cpseurope.com (Jaspers, Ton) Date: Mon Jun 2 01:42:46 2008 Subject: [Icc-avr] Again assembly question In-Reply-To: <1227.96.21.235.114.1212198835.squirrel@www.microsyl.com> Message-ID: <7B0EB27CF1CC93439B5CFB7526E5D74C6250A9@mickey.PBNV.local> You need to declare the variable as external. I think the syntax for the AVR assembler is: .extern (leading tab is mandatory) Not sure though, check with manual. Another problem may be the missing tabulation in front of ".text" Cheers, Ton > -----Original Message----- > From: icc-avr-bounces@imagecraft.com > [mailto:icc-avr-bounces@imagecraft.com] On Behalf Of > sbissonnette@microsyl.com > Sent: zaterdag 31 mei 2008 3:54 > To: icc-avr@imagecraft.com > Subject: [Icc-avr] Again assembly question > > Hi, > > I still have problem with my project, I need to have a > one variable accessible in C and in ASM. I had try this > > Thanks for your time > Sylvain Bissonnette > > /*********************************/ > > extern ushort SquareLSB; > > /*********************************/ > void main(void) > { > > SquareLSB = 0x15; > } > > /*********************************/ > > .area ram > _SquareLSB::.blkw 1; > > .text > > _ASMSine:: > ldi r24,_SquareLSB; > > > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr > From richard-lists at imagecraft.com Mon Jun 2 13:32:09 2008 From: richard-lists at imagecraft.com (Richard Man) Date: Mon Jun 2 14:37:19 2008 Subject: [Icc-avr] Again assembly question In-Reply-To: <1227.96.21.235.114.1212198835.squirrel@www.microsyl.com> References: <1227.96.21.235.114.1212198835.squirrel@www.microsyl.com> Message-ID: <200806022137.m52LbI43000625@mail.imagecraft.com> What exactly is the question or the problem? Your ldi syntax is wrong of course, but may be you are asking something else? p.s. instead of ldi, you probably meant lds R24,_SquareLSB lds R25,_SquareLSB+1 You can always look at the C generated .s file - keep in mind that the C compiler generates asm code, so really there is nothing special about the C compiler per se... At 06:53 PM 5/30/2008, sbissonnette@microsyl.com wrote: >Hi, > > I still have problem with my project, I need to have a one variable >accessible in C and in ASM. I had try this > >Thanks for your time >Sylvain Bissonnette > >/*********************************/ > >extern ushort SquareLSB; > >/*********************************/ >void main(void) >{ > > SquareLSB = 0x15; >} > >/*********************************/ > > .area ram > _SquareLSB::.blkw 1; > >.text > >_ASMSine:: > ldi r24,_SquareLSB; > // richard (This email is for mailing lists. To reach me directly, please use richard at imagecraft.com) From sbissonnette at microsyl.com Mon Jun 2 17:25:13 2008 From: sbissonnette at microsyl.com (sbissonnette@microsyl.com) Date: Mon Jun 2 18:26:37 2008 Subject: [Icc-avr] Again assembly question Message-ID: <3311.96.21.235.114.1212452713.squirrel@www.microsyl.com> Hi, Thanks Richard, Johannes and others that help me with those line of code now it's work and it's more clear to me! Yours, Sylvain Bissonnette From amsol at amssolutions.co.za Wed Jun 4 00:53:00 2008 From: amsol at amssolutions.co.za (Gerhard at AMS) Date: Wed Jun 4 01:54:29 2008 Subject: [Icc-avr] Richard : ICCAVR upgrade etc References: <200805302026.m4UKQKpv028319@mail.imagecraft.com><2EDB5270C4424480B58C5DD28E130D31@inhep> <200806020835.m528Z5xN086362@mail.imagecraft.com> Message-ID: <000e01c8c618$04331330$1f01a8c0@amsmainxp2> Hi Richard, I am considering to upgrade my AVR compiler. My last paid-up and current 'working-with' compiler is Ver 6.28. 1. Please advise your latest recommended stable version for ICCAVR pro and the upgrade cost-structure. 2. I assume that the old process is still holding whereas I can download the eval copy, on payment I get an unlock-keycode etc. 3. Will it still be possible to allow migration of ICCAVR from one pc to another? 4. Please advise my options - Thx, Gerhard Laubscher amsol@amssolutions.co.za -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080604/b3ee773b/attachment.html From svenn at sleipner.no Wed Jun 4 04:24:55 2008 From: svenn at sleipner.no (=?iso-8859-1?Q?Svenn_Dahlstr=F8m?=) Date: Wed Jun 4 05:26:31 2008 Subject: [Icc-avr] CAN Bootloader with AES or DES Message-ID: <461D162473D69541BAE9440159B299DA19A7D95F64@sm-excsrv.sleipner.local> Skipped content of type multipart/alternative-------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 5888 bytes Desc: image001.gif Url : http://dragonsgate.net/pipermail/icc-avr/attachments/20080604/30bdedf0/image001.gif From andrew_166 at msn.com Wed Jun 4 11:03:45 2008 From: andrew_166 at msn.com (Andrew) Date: Wed Jun 4 12:05:20 2008 Subject: [Icc-avr] AVR230: DES Bootloader References: <1227.96.21.235.114.1212198835.squirrel@www.microsyl.com> <200806022137.m52LbI43000625@mail.imagecraft.com> Message-ID: Hi, Does anybody use the Atmel AVR DES bootloader? (App note number AVR230) If so has anybody managed to get it working with ICCARV as the App note is written for IAR. Thanks, Andy From dfmiller at telus.net Wed Jun 4 12:19:39 2008 From: dfmiller at telus.net (Dave F. Miller) Date: Wed Jun 4 13:21:07 2008 Subject: [Icc-avr] AVR230: DES Bootloader In-Reply-To: References: <1227.96.21.235.114.1212198835.squirrel@www.microsyl.com> <200806022137.m52LbI43000625@mail.imagecraft.com> Message-ID: <20080604191938.2923WVWKCS@priv-edtnaa06.telusplanet.net> Yes we have I will try to ping the person who has done this and ask them to reply At 11:03 AM 6/4/2008, you wrote: >Hi, > >Does anybody use the Atmel AVR DES bootloader? (App note number AVR230) > >If so has anybody managed to get it working with ICCARV as the App >note is written for IAR. > >Thanks, > >Andy > > >_______________________________________________ >Icc-avr mailing list >Icc-avr@imagecraft.com >http://dragonsgate.net/mailman/listinfo/icc-avr Dave F. Miller President DFM Technology Inc. Serving North America since 1986 Finding solutions to your problems. dfmiller@telus.net 604-671-3153 Fax 604-582-1385 From andrew_166 at msn.com Wed Jun 4 13:37:06 2008 From: andrew_166 at msn.com (Andrew) Date: Wed Jun 4 14:38:44 2008 Subject: [Icc-avr] RE; AVR230: DES Bootloader References: <200805302026.m4UKQKpv028319@mail.imagecraft.com><2EDB5270C4424480B58C5DD28E130D31@inhep> <200806020835.m528Z5xN086362@mail.imagecraft.com> Message-ID: Hi, I have downloaded the AES boot loader port from the image craft website, but as i am new to world of ICCARV and AVR's(6-7months - previously worked on PSoC's and PIC's for 2 years) i have never done a Boot loader. I understand the basic principle:- The bootloader resides in the last 2k or so of you uC's flash memory (depending on uC flash size and bootloader size) and when a reset vector is called the bootloader run's. What I am completely unsure of is how you get ICCAVR to compile the bootloader in the correct place in flash memory, from reading the AES bootloader written by Rodney Pearson I think I need to change the start-up file but I am unsure of how and which parameters I need to change. I assume the parameters are page size, memory size etc. Obviously the parameters are different for different AVR's. I understand the encryption part, it is more how i create the Bootloader for a specific AVR (AtMega 640 is the one I am using at the moment). I am not asking somebody to write me the bootlaoader I would rather understand how I do it so i can then go on and use what i have learnt for other AVR's. Many thanks, Andy ----- Original Message ----- From: "Dave F. Miller" To: "Discussion list for ICCAVR and ICCtiny Users. You do NOT need tosubscribe to icc-announce if you are a member of this." Cc: Sent: Wednesday, June 04, 2008 8:19 PM Subject: Re: [Icc-avr] AVR230: DES Bootloader > Yes we have > I will try to ping the person who has done this and ask them to reply > > > At 11:03 AM 6/4/2008, you wrote: > >>Hi, >> >>Does anybody use the Atmel AVR DES bootloader? (App note number AVR230) >> >>If so has anybody managed to get it working with ICCARV as the App note is >>written for IAR. >> >>Thanks, >> >>Andy >> >> >>_______________________________________________ >>Icc-avr mailing list >>Icc-avr@imagecraft.com >>http://dragonsgate.net/mailman/listinfo/icc-avr > > Dave F. Miller > President > DFM Technology Inc. > Serving North America since 1986 > Finding solutions to your problems. > dfmiller@telus.net > 604-671-3153 > Fax 604-582-1385 > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr > From jassenbaum at htp-tel.de Wed Jun 4 16:07:32 2008 From: jassenbaum at htp-tel.de (Johannes Assenbaum) Date: Wed Jun 4 17:09:46 2008 Subject: [Icc-avr] RE; AVR230: DES Bootloader References: <2EDB5270C4424480B58C5DD28E130D31@inhep> <200806020835.m528Z5xN086362@mail.imagecraft.com> Message-ID: On options dialog/target tab there should be "Program Type" selectable. Just enable "Boot Loader" and set "Boot size" as needed. Best regards, Johannes > Hi, > I have downloaded the AES boot loader port from the image craft website, but > as i am new to world of ICCARV and AVR's(6-7months - previously worked on > PSoC's and PIC's for 2 years) i have never done a Boot loader. I understand > the basic principle:- > The bootloader resides in the last 2k or so of you uC's flash memory > (depending on uC flash size and bootloader size) and when a reset vector is > called the bootloader run's. > What I am completely unsure of is how you get ICCAVR to compile the > bootloader in the correct place in flash memory, from reading the AES > bootloader written by Rodney Pearson I think I need to change the start-up > file but I am unsure of how and which parameters I need to change. I assume > the parameters are page size, memory size etc. Obviously the parameters are > different for different AVR's. > I understand the encryption part, it is more how i create the Bootloader for > a specific AVR (AtMega 640 is the one I am using at the moment). I am not > asking somebody to write me the bootlaoader I would rather understand how I > do it so i can then go on and use what i have learnt for other AVR's. > Many thanks, > Andy > ----- Original Message ----- > From: "Dave F. Miller" > To: "Discussion list for ICCAVR and ICCtiny Users. You do NOT need > tosubscribe to icc-announce if you are a member of this." > > Cc: > Sent: Wednesday, June 04, 2008 8:19 PM > Subject: Re: [Icc-avr] AVR230: DES Bootloader >> Yes we have >> I will try to ping the person who has done this and ask them to reply >> >> >> At 11:03 AM 6/4/2008, you wrote: >> >>>Hi, >>> >>>Does anybody use the Atmel AVR DES bootloader? (App note number AVR230) >>> >>>If so has anybody managed to get it working with ICCARV as the App note is >>>written for IAR. >>> >>>Thanks, >>> >>>Andy >>> >>> >>>_______________________________________________ >>>Icc-avr mailing list >>>Icc-avr@imagecraft.com >>>http://dragonsgate.net/mailman/listinfo/icc-avr >> >> Dave F. Miller >> President >> DFM Technology Inc. >> Serving North America since 1986 >> Finding solutions to your problems. >> dfmiller@telus.net >> 604-671-3153 >> Fax 604-582-1385 >> _______________________________________________ >> 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 andrew_166 at msn.com Wed Jun 4 17:03:05 2008 From: andrew_166 at msn.com (Andrew) Date: Wed Jun 4 18:04:40 2008 Subject: [Icc-avr] RE; AVR230: DES Bootloader References: <2EDB5270C4424480B58C5DD28E130D31@inhep><200806020835.m528Z5xN086362@mail.imagecraft.com> Message-ID: Hi john, Thanks i have just found it (via the ICCAVR pdf help file) and finished writting a test program. i will test it tomorrow and see if it works, then i will try and make a VB User interface to do all the DES/AES encoding using the Atmel command line interface as starting point. Why did Rodney Pearson use the ICCAVR bootloader option? because as far as i can see he has written is own asm files there are then modified for differnet AVR's (i maybe wrong) Andy ----- Original Message ----- From: "Johannes Assenbaum" To: Sent: Thursday, June 05, 2008 12:07 AM Subject: Re: [Icc-avr] RE; AVR230: DES Bootloader > On options dialog/target tab there should be "Program Type" selectable. > Just enable "Boot Loader" and set "Boot size" as needed. > > Best regards, > Johannes > >> Hi, > >> I have downloaded the AES boot loader port from the image craft website, >> but >> as i am new to world of ICCARV and AVR's(6-7months - previously worked on >> PSoC's and PIC's for 2 years) i have never done a Boot loader. I >> understand >> the basic principle:- > >> The bootloader resides in the last 2k or so of you uC's flash memory >> (depending on uC flash size and bootloader size) and when a reset vector >> is >> called the bootloader run's. > >> What I am completely unsure of is how you get ICCAVR to compile the >> bootloader in the correct place in flash memory, from reading the AES >> bootloader written by Rodney Pearson I think I need to change the >> start-up >> file but I am unsure of how and which parameters I need to change. I >> assume >> the parameters are page size, memory size etc. Obviously the parameters >> are >> different for different AVR's. > > >> I understand the encryption part, it is more how i create the Bootloader >> for >> a specific AVR (AtMega 640 is the one I am using at the moment). I am not >> asking somebody to write me the bootlaoader I would rather understand how >> I >> do it so i can then go on and use what i have learnt for other AVR's. > > >> Many thanks, > > >> Andy > > >> ----- Original Message ----- >> From: "Dave F. Miller" >> To: "Discussion list for ICCAVR and ICCtiny Users. You do NOT need >> tosubscribe to icc-announce if you are a member of this." >> >> Cc: >> Sent: Wednesday, June 04, 2008 8:19 PM >> Subject: Re: [Icc-avr] AVR230: DES Bootloader > > >>> Yes we have >>> I will try to ping the person who has done this and ask them to reply >>> >>> >>> At 11:03 AM 6/4/2008, you wrote: >>> >>>>Hi, >>>> >>>>Does anybody use the Atmel AVR DES bootloader? (App note number AVR230) >>>> >>>>If so has anybody managed to get it working with ICCARV as the App note >>>>is >>>>written for IAR. >>>> >>>>Thanks, >>>> >>>>Andy >>>> >>>> >>>>_______________________________________________ >>>>Icc-avr mailing list >>>>Icc-avr@imagecraft.com >>>>http://dragonsgate.net/mailman/listinfo/icc-avr >>> >>> Dave F. Miller >>> President >>> DFM Technology Inc. >>> Serving North America since 1986 >>> Finding solutions to your problems. >>> dfmiller@telus.net >>> 604-671-3153 >>> Fax 604-582-1385 >>> _______________________________________________ >>> Icc-avr mailing list >>> Icc-avr@imagecraft.com >>> http://dragonsgate.net/mailman/listinfo/icc-avr >>> > >> _______________________________________________ >> Icc-avr mailing list >> Icc-avr@imagecraft.com >> http://dragonsgate.net/mailman/listinfo/icc-avr > > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr > From andrew_166 at msn.com Thu Jun 5 10:02:56 2008 From: andrew_166 at msn.com (Andrew) Date: Thu Jun 5 11:04:30 2008 Subject: [Icc-avr] IAR to ICCAVR Covertion questions References: <2EDB5270C4424480B58C5DD28E130D31@inhep><200806020835.m528Z5xN086362@mail.imagecraft.com> Message-ID: hi, what would tthe ICCAVR conversrtion be for the following: - #define BOOTFLASH __flash #define APPFLASH __flash and #define BOOTFLASH __farflash #define APPFLASH __hugeflash These two come from the following : - #if MEM_SIZE < 65536 #define BOOTFLASH __flash #define APPFLASH __flash #else #define BOOTFLASH __farflash #define APPFLASH __hugeflash #endif Thanks andy ----- Original Message ----- From: "Johannes Assenbaum" To: Sent: Thursday, June 05, 2008 12:07 AM Subject: Re: [Icc-avr] RE; AVR230: DES Bootloader > On options dialog/target tab there should be "Program Type" selectable. > Just enable "Boot Loader" and set "Boot size" as needed. > > Best regards, > Johannes > >> Hi, > >> I have downloaded the AES boot loader port from the image craft website, >> but >> as i am new to world of ICCARV and AVR's(6-7months - previously worked on >> PSoC's and PIC's for 2 years) i have never done a Boot loader. I >> understand >> the basic principle:- > >> The bootloader resides in the last 2k or so of you uC's flash memory >> (depending on uC flash size and bootloader size) and when a reset vector >> is >> called the bootloader run's. > >> What I am completely unsure of is how you get ICCAVR to compile the >> bootloader in the correct place in flash memory, from reading the AES >> bootloader written by Rodney Pearson I think I need to change the >> start-up >> file but I am unsure of how and which parameters I need to change. I >> assume >> the parameters are page size, memory size etc. Obviously the parameters >> are >> different for different AVR's. > > >> I understand the encryption part, it is more how i create the Bootloader >> for >> a specific AVR (AtMega 640 is the one I am using at the moment). I am not >> asking somebody to write me the bootlaoader I would rather understand how >> I >> do it so i can then go on and use what i have learnt for other AVR's. > > >> Many thanks, > > >> Andy > > >> ----- Original Message ----- >> From: "Dave F. Miller" >> To: "Discussion list for ICCAVR and ICCtiny Users. You do NOT need >> tosubscribe to icc-announce if you are a member of this." >> >> Cc: >> Sent: Wednesday, June 04, 2008 8:19 PM >> Subject: Re: [Icc-avr] AVR230: DES Bootloader > > >>> Yes we have >>> I will try to ping the person who has done this and ask them to reply >>> >>> >>> At 11:03 AM 6/4/2008, you wrote: >>> >>>>Hi, >>>> >>>>Does anybody use the Atmel AVR DES bootloader? (App note number AVR230) >>>> >>>>If so has anybody managed to get it working with ICCARV as the App note >>>>is >>>>written for IAR. >>>> >>>>Thanks, >>>> >>>>Andy >>>> >>>> >>>>_______________________________________________ >>>>Icc-avr mailing list >>>>Icc-avr@imagecraft.com >>>>http://dragonsgate.net/mailman/listinfo/icc-avr >>> >>> Dave F. Miller >>> President >>> DFM Technology Inc. >>> Serving North America since 1986 >>> Finding solutions to your problems. >>> dfmiller@telus.net >>> 604-671-3153 >>> Fax 604-582-1385 >>> _______________________________________________ >>> Icc-avr mailing list >>> Icc-avr@imagecraft.com >>> http://dragonsgate.net/mailman/listinfo/icc-avr >>> > >> _______________________________________________ >> Icc-avr mailing list >> Icc-avr@imagecraft.com >> http://dragonsgate.net/mailman/listinfo/icc-avr > > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr > From jassenbaum at htp-tel.de Thu Jun 5 11:32:27 2008 From: jassenbaum at htp-tel.de (Johannes Assenbaum) Date: Thu Jun 5 12:34:25 2008 Subject: [Icc-avr] Re: IAR to ICCAVR Covertion questions References: Message-ID: What are BOOTFLASH and APPFLASH used for? I guess you don't really need them with ICCAVR. Best regards, Johannes > hi, > what would tthe ICCAVR conversrtion be for the following: - > #define BOOTFLASH __flash > #define APPFLASH __flash > and > #define BOOTFLASH __farflash > #define APPFLASH __hugeflash > These two come from the following : - > #if MEM_SIZE < 65536 > #define BOOTFLASH __flash > #define APPFLASH __flash > #else > #define BOOTFLASH __farflash > #define APPFLASH __hugeflash > #endif > Thanks andy > ----- Original Message ----- > From: "Johannes Assenbaum" > To: > Sent: Thursday, June 05, 2008 12:07 AM > Subject: Re: [Icc-avr] RE; AVR230: DES Bootloader >> On options dialog/target tab there should be "Program Type" selectable. >> Just enable "Boot Loader" and set "Boot size" as needed. >> >> Best regards, >> Johannes >> >>> Hi, >> >>> I have downloaded the AES boot loader port from the image craft website, >>> but >>> as i am new to world of ICCARV and AVR's(6-7months - previously worked on >>> PSoC's and PIC's for 2 years) i have never done a Boot loader. I >>> understand >>> the basic principle:- >> >>> The bootloader resides in the last 2k or so of you uC's flash memory >>> (depending on uC flash size and bootloader size) and when a reset vector >>> is >>> called the bootloader run's. >> >>> What I am completely unsure of is how you get ICCAVR to compile the >>> bootloader in the correct place in flash memory, from reading the AES >>> bootloader written by Rodney Pearson I think I need to change the >>> start-up >>> file but I am unsure of how and which parameters I need to change. I >>> assume >>> the parameters are page size, memory size etc. Obviously the parameters >>> are >>> different for different AVR's. >> >> >>> I understand the encryption part, it is more how i create the Bootloader >>> for >>> a specific AVR (AtMega 640 is the one I am using at the moment). I am not >>> asking somebody to write me the bootlaoader I would rather understand how >>> I >>> do it so i can then go on and use what i have learnt for other AVR's. >> >> >>> Many thanks, >> >> >>> Andy >> >> >>> ----- Original Message ----- >>> From: "Dave F. Miller" >>> To: "Discussion list for ICCAVR and ICCtiny Users. You do NOT need >>> tosubscribe to icc-announce if you are a member of this." >>> >>> Cc: >>> Sent: Wednesday, June 04, 2008 8:19 PM >>> Subject: Re: [Icc-avr] AVR230: DES Bootloader >> >> >>>> Yes we have >>>> I will try to ping the person who has done this and ask them to reply >>>> >>>> >>>> At 11:03 AM 6/4/2008, you wrote: >>>> >>>>>Hi, >>>>> >>>>>Does anybody use the Atmel AVR DES bootloader? (App note number AVR230) >>>>> >>>>>If so has anybody managed to get it working with ICCARV as the App note >>>>>is >>>>>written for IAR. >>>>> >>>>>Thanks, >>>>> >>>>>Andy >>>>> >>>>> >>>>>_______________________________________________ >>>>>Icc-avr mailing list >>>>>Icc-avr@imagecraft.com >>>>>http://dragonsgate.net/mailman/listinfo/icc-avr >>>> >>>> Dave F. Miller >>>> President >>>> DFM Technology Inc. >>>> Serving North America since 1986 >>>> Finding solutions to your problems. >>>> dfmiller@telus.net >>>> 604-671-3153 >>>> Fax 604-582-1385 >>>> _______________________________________________ >>>> Icc-avr mailing list >>>> Icc-avr@imagecraft.com >>>> http://dragonsgate.net/mailman/listinfo/icc-avr >>>> >> >>> _______________________________________________ >>> Icc-avr mailing list >>> Icc-avr@imagecraft.com >>> http://dragonsgate.net/mailman/listinfo/icc-avr >> >> >> _______________________________________________ >> Icc-avr mailing list >> Icc-avr@imagecraft.com >> http://dragonsgate.net/mailman/listinfo/icc-avr >> From andrew_166 at msn.com Thu Jun 5 13:35:07 2008 From: andrew_166 at msn.com (Andrew) Date: Thu Jun 5 14:36:43 2008 Subject: [Icc-avr] RE; AVR230: DES Bootloader References: <2EDB5270C4424480B58C5DD28E130D31@inhep><200806020835.m528Z5xN086362@mail.imagecraft.com> Message-ID: Hi, Has anybody used the AES bootloader from the Atmel website? i have a port sort of working for the ICCAVR compiler but the memory check sum fails every time (basically after thr bootloader restarts and the does not select to bootload the bootloader does a check sum on the entire memory. #ifdef CRC_CHECK // Check that the Application Section contents is undamaged // by calculating the CRC of the whole memory. { unsigned int crc = 0; unsigned i; const unsigned char *p = ( const unsigned char *)0x000000; const unsigned char *n = ( const unsigned char *)MEM_SIZE; busSendText("Skip the Loader routine\r\n"); do { crc = CRC(crc, *p++); } while (--n); // Application Section damaged // do not jump to Reset Vector of the Application Section if (crc) { busSendText("\r\nApplication Section damaged\r\n"); while(1); } } #endif To me the 'if (crc)' should be' if(!crc)' as it cannot be a very good check sum if it passes as long as the crc is any number but zero. If i force the check sum to pass my sent code works fine / as written. Note i changed the above code from IAR which was: - #ifdef CRC_CHECK // Check that the Application Section contents is undamaged // by calculating the CRC of the whole memory. { unsigned int crc = 0; unsigned char APPFLASH *p = (unsigned char APPFLASH *)0x000000; unsigned char APPFLASH *n = (unsigned char APPFLASH *)MEM_SIZE; do { crc = CRC(crc, *p++); } while (--n); // Application Section damaged // -> do not jump to Reset Vector of the Application Section if (crc) { DDRB = 0xff; do { PORTB ^= 0xff; __delay_cycles( 1000000 ); } while(1); // continue; } } #endif Where the folling are defined:- #if MEM_SIZE < 65536 //#define BOOTFLASH __flash //#define APPFLASH __flash #else // #define BOOTFLASH __farflash // #define APPFLASH __hugeflash #endif i have commented the defines out as they don't work with ICCAVR. any Ideas help / sugestion, i will finish commenting my modified code as best i understand and post it. Many Thanks Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080605/2c968c0d/attachment.html From sbeaver at columbus.rr.com Thu Jun 5 13:55:30 2008 From: sbeaver at columbus.rr.com (Stephen Beaver) Date: Thu Jun 5 14:57:12 2008 Subject: [Icc-avr] RE; AVR230: DES Bootloader In-Reply-To: References: <2EDB5270C4424480B58C5DD28E130D31@inhep><200806020835.m528Z5xN086362@mail.imagecraft.com> Message-ID: Perhaps it is a checksum, not a real CRC? It is a common technique to calculate the checksum of some data, and then add whatever value it takes to make it zero to the end of the data. That way, a simple non- zero result indicates an error. Much the same way that parity works. For example, the 8 bit checksum of "ABC" is 0x86. Adding an 0x79 character (z) to the end of our data so that we have "ABCz" produces a checksum of 0. Steve On Jun 5, 2008, at 4:35 PM, Andrew wrote: > Hi, > > Has anybody used the AES bootloader from the Atmel website? i have a > port sort of working for the ICCAVR compiler but the memory check > sum fails every time (basically after thr bootloader restarts and > the does not select to bootload the bootloader does a check sum on > the entire memory. > > #ifdef CRC_CHECK > // Check that the Application Section contents is undamaged > // by calculating the CRC of the whole memory. > { > unsigned int crc = 0; > unsigned i; > > const unsigned char *p = ( const unsigned char *)0x000000; > const unsigned char *n = ( const unsigned char *)MEM_SIZE; > > busSendText("Skip the Loader routine\r\n"); > > do > { > crc = CRC(crc, *p++); > } > while (--n); > > // Application Section damaged > // do not jump to Reset Vector of the Application Section > if (crc) > { > busSendText("\r\nApplication Section damaged\r\n"); > while(1); > } > } > #endif > > To me the 'if (crc)' should be' if(!crc)' as it cannot be a very > good check sum if it passes as long as the crc is any number but > zero. If i force the check sum to pass my sent code works fine / as > written. > > Note i changed the above code from IAR which was: - > > > #ifdef CRC_CHECK > // Check that the Application Section contents is undamaged > // by calculating the CRC of the whole memory. > { > unsigned int crc = 0; > unsigned char APPFLASH *p = (unsigned char APPFLASH *)0x000000; > unsigned char APPFLASH *n = (unsigned char APPFLASH *)MEM_SIZE; > do > { > crc = CRC(crc, *p++); > } > while (--n); > // Application Section damaged > // -> do not jump to Reset Vector of the Application Section > if (crc) { > DDRB = 0xff; > do { > PORTB ^= 0xff; > __delay_cycles( 1000000 ); > } while(1); > // continue; > } > } > #endif > > Where the folling are defined:- > > #if MEM_SIZE < 65536 > //#define BOOTFLASH __flash > //#define APPFLASH __flash > #else > // #define BOOTFLASH __farflash > // #define APPFLASH __hugeflash > #endif > > i have commented the defines out as they don't work with ICCAVR. > > any Ideas help / sugestion, i will finish commenting my modified > code as best i understand and post it. > > Many Thanks > > Andy > > > > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080605/37715113/attachment-0001.html From andrew_166 at msn.com Thu Jun 5 15:40:42 2008 From: andrew_166 at msn.com (Andrew) Date: Thu Jun 5 16:42:16 2008 Subject: [Icc-avr] RE; AVR230: DES Bootloader References: <2EDB5270C4424480B58C5DD28E130D31@inhep><200806020835.m528Z5xN086362@mail.imagecraft.com> Message-ID: Hi, I think i have found the problem, if i check the 'Treat 'const' as '__flash' (backward compatibility' in the compiler options for the bootloader in ICCAVR the check sum now works. Andy ----- Original Message ----- From: Stephen Beaver To: Discussion list for ICCAVR and ICCtiny Users. You do NOT need tosubscribe to icc-announce if you are a member of this. Sent: Thursday, June 05, 2008 9:55 PM Subject: Re: [Icc-avr] RE; AVR230: DES Bootloader Perhaps it is a checksum, not a real CRC? It is a common technique to calculate the checksum of some data, and then add whatever value it takes to make it zero to the end of the data. That way, a simple non-zero result indicates an error. Much the same way that parity works. For example, the 8 bit checksum of "ABC" is 0x86. Adding an 0x79 character (z) to the end of our data so that we have "ABCz" produces a checksum of 0. Steve On Jun 5, 2008, at 4:35 PM, Andrew wrote: Hi, Has anybody used the AES bootloader from the Atmel website? i have a port sort of working for the ICCAVR compiler but the memory check sum fails every time (basically after thr bootloader restarts and the does not select to bootload the bootloader does a check sum on the entire memory. #ifdef CRC_CHECK // Check that the Application Section contents is undamaged // by calculating the CRC of the whole memory. { unsigned int crc = 0; unsigned i; const unsigned char *p = ( const unsigned char *)0x000000; const unsigned char *n = ( const unsigned char *)MEM_SIZE; busSendText("Skip the Loader routine\r\n"); do { crc = CRC(crc, *p++); } while (--n); // Application Section damaged // do not jump to Reset Vector of the Application Section if (crc) { busSendText("\r\nApplication Section damaged\r\n"); while(1); } } #endif To me the 'if (crc)' should be' if(!crc)' as it cannot be a very good check sum if it passes as long as the crc is any number but zero. If i force the check sum to pass my sent code works fine / as written. Note i changed the above code from IAR which was: - #ifdef CRC_CHECK // Check that the Application Section contents is undamaged // by calculating the CRC of the whole memory. { unsigned int crc = 0; unsigned char APPFLASH *p = (unsigned char APPFLASH *)0x000000; unsigned char APPFLASH *n = (unsigned char APPFLASH *)MEM_SIZE; do { crc = CRC(crc, *p++); } while (--n); // Application Section damaged // -> do not jump to Reset Vector of the Application Section if (crc) { DDRB = 0xff; do { PORTB ^= 0xff; __delay_cycles( 1000000 ); } while(1); // continue; } } #endif Where the folling are defined:- #if MEM_SIZE < 65536 //#define BOOTFLASH __flash //#define APPFLASH __flash #else // #define BOOTFLASH __farflash // #define APPFLASH __hugeflash #endif i have commented the defines out as they don't work with ICCAVR. any Ideas help / sugestion, i will finish commenting my modified code as best i understand and post it. Many Thanks 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080605/089075f7/attachment.html From andrew_166 at msn.com Thu Jun 12 07:14:37 2008 From: andrew_166 at msn.com (Andrew) Date: Thu Jun 12 08:16:24 2008 Subject: [Icc-avr] Software Reset References: <2EDB5270C4424480B58C5DD28E130D31@inhep><200806020835.m528Z5xN086362@mail.imagecraft.com> Message-ID: Hi, Is there a software reset on the AVR's (i am using the ATmega 640) as in is there a register i can set to force a reset ? or is the only option to enable the watchdog timer and wait for it to reset the device? ANdy -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080612/ebe4d450/attachment.html From richard-lists at imagecraft.com Thu Jun 12 12:20:21 2008 From: richard-lists at imagecraft.com (Richard Man) Date: Thu Jun 12 13:21:26 2008 Subject: [Icc-avr] Software Reset In-Reply-To: References: <2EDB5270C4424480B58C5DD28E130D31@inhep> <200806020835.m528Z5xN086362@mail.imagecraft.com> Message-ID: <200806122021.m5CKLPEx022474@mail.imagecraft.com> You can always jump to the reset vector: asm("jmp 0"); At 07:14 AM 6/12/2008, Andrew wrote: >Hi, > >Is there a software reset on the AVR's (i am using the ATmega 640) >as in is there a register i can set to force a reset ? or is the >only option to enable the watchdog timer and wait for it to reset the device? // richard (This email is for mailing lists. To reach me directly, please use richard at imagecraft.com) From j_baraclough at zetnet.co.uk Thu Jun 12 12:53:07 2008 From: j_baraclough at zetnet.co.uk (John Baraclough) Date: Thu Jun 12 13:54:47 2008 Subject: [Icc-avr] Software Reset In-Reply-To: <200806122021.m5CKLPEx022474@mail.imagecraft.com> References: <2EDB5270C4424480B58C5DD28E130D31@inhep> <200806020835.m528Z5xN086362@mail.imagecraft.com> <200806122021.m5CKLPEx022474@mail.imagecraft.com> Message-ID: <48517EA3.7090902@zetnet.co.uk> That will only restart the software and will not set any registers to the default state. For a hardware reset you can connect an output pin to the RESET input and simply write 0 to it when you need a reset. If you are not using the timer oscillator then PG4 may be free and it is adjacent to the RESET pin. All the best for now, John Richard Man wrote: > You can always jump to the reset vector: > > asm("jmp 0"); > > At 07:14 AM 6/12/2008, Andrew wrote: >> Hi, >> >> Is there a software reset on the AVR's (i am using the ATmega 640) as >> in is there a register i can set to force a reset ? or is the only >> option to enable the watchdog timer and wait for it to reset the device? > > // 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 > > From jassenbaum at htp-tel.de Thu Jun 12 13:21:58 2008 From: jassenbaum at htp-tel.de (Johannes Assenbaum) Date: Thu Jun 12 14:24:06 2008 Subject: [Icc-avr] Software Reset References: Message-ID: On AVRs there is no true software reset. Jumping to 0 is not safe, as hardware init code may not do all settings needed to shut down and reinit any IO used reliably. To make sure about reset, you must use hardware reset, either by pulling down RESET pin by a spare output, or by letting the watchdog bite. For all of my projects yet, that needed a software reset, I choose the watchdog way... just because I never had spare IO :-) Best regards, Johannes > Hi, > Is there a software reset on the AVR's (i am using the ATmega 640) as in is there a > register i can set to force a reset ? or is the only option to enable the watchdog > timer and wait for it to reset the device? > ANdy From andrew_166 at msn.com Thu Jun 12 14:23:54 2008 From: andrew_166 at msn.com (Andrew) Date: Thu Jun 12 15:25:37 2008 Subject: [Icc-avr] Software Reset References: Message-ID: ----- Original Message ----- From: "Johannes Assenbaum" To: Sent: Thursday, June 12, 2008 9:21 PM Subject: Re: [Icc-avr] Software Reset > On AVRs there is no true software reset. Jumping to 0 is not safe, as > hardware init code may not do all settings needed to shut down and reinit > any IO used reliably. To make sure about reset, you must use hardware > reset, either by pulling down RESET pin by a spare output, or by letting > the watchdog bite. > > For all of my projects yet, that needed a software reset, I choose the > watchdog way... just because I never had spare IO :-) > > Best regards, > Johannes > > >> Hi, > >> Is there a software reset on the AVR's (i am using the ATmega 640) as in >> is there a >> register i can set to force a reset ? or is the only option to enable the >> watchdog >> timer and wait for it to reset the device? > >> ANdy > > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr > From andrew_166 at msn.com Thu Jun 12 14:25:28 2008 From: andrew_166 at msn.com (Andrew) Date: Thu Jun 12 15:27:14 2008 Subject: [Icc-avr] Software Reset References: Message-ID: Hi, asm(0x000); would be fine as i jump to a bootloader after rest which inizalizes all the hardware each time it is run. But just to make sure i will set the watchdog and then sit in a for(;;) loop Thanks, andy ----- Original Message ----- From: "Johannes Assenbaum" To: Sent: Thursday, June 12, 2008 9:21 PM Subject: Re: [Icc-avr] Software Reset > On AVRs there is no true software reset. Jumping to 0 is not safe, as > hardware init code may not do all settings needed to shut down and reinit > any IO used reliably. To make sure about reset, you must use hardware > reset, either by pulling down RESET pin by a spare output, or by letting > the watchdog bite. > > For all of my projects yet, that needed a software reset, I choose the > watchdog way... just because I never had spare IO :-) > > Best regards, > Johannes > > >> Hi, > >> Is there a software reset on the AVR's (i am using the ATmega 640) as in >> is there a >> register i can set to force a reset ? or is the only option to enable the >> watchdog >> timer and wait for it to reset the device? > >> ANdy > > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr > From robertrade at yahoo.com Sat Jun 14 17:12:14 2008 From: robertrade at yahoo.com (Robert Rademacher) Date: Sat Jun 14 18:13:59 2008 Subject: [Icc-avr] Re: Software Reset In-Reply-To: <200806131900.m5DJ03hB045233@mail.imagecraft.com> Message-ID: <519824.7397.qm@web65708.mail.ac4.yahoo.com> Hi, I'm glad someone brought up this reset function, as it was not well-documented. I use this method, which works well for several years: void (*reset)( void ) = 0x0000; in .h file Then, call reset(); function anywhere to reset the AVR system. I agree that asm(0x000) function is much better, as it seems to be much simpler and cleaner to use than my "old" reset command. Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080614/207a894e/attachment.html From t.jaspers at cpseurope.com Mon Jun 16 01:33:15 2008 From: t.jaspers at cpseurope.com (Jaspers, Ton) Date: Mon Jun 16 02:35:03 2008 Subject: [Icc-avr] Re: Software Reset In-Reply-To: <519824.7397.qm@web65708.mail.ac4.yahoo.com> Message-ID: <7B0EB27CF1CC93439B5CFB7526E5D74C66AE31@mickey.PBNV.local> From: Robert Rademacher > Hi, > I'm glad someone brought up this reset function, as it was not well-documented. > I use this method, which works well for several years: > void (*reset)( void ) = 0x0000; > in .h file > Then, call reset(); function anywhere to reset the AVR system. > I agree that asm(0x000) function is much better, as it seems to be much simpler and cleaner to use than my "old" reset command. None of the above is a reset function. Those functions only jump to address zero. Though this is the address the software starts at after a reset, there is no reset signal issued and consequently no device is actually reset. There are only two ways to issue a reset signal: 1. by connecting an output to the reset circuit or 2. by forcing the watchdog to issue a reset signal. The latter is often limited to the CPU and its build in peripherals. Software then still needs to control the reset circuit to reset external devices. But even when a reset circuit is correctly controlled one could argue that a reset signal is not the same as a power on sequence. Some devices can enter a state where only a power off/on sequence can get them out of. Ton Jaspers From Albert.vanVeen at pertronic.co.nz Mon Jun 16 13:24:06 2008 From: Albert.vanVeen at pertronic.co.nz (Albert vanVeen) Date: Mon Jun 16 14:26:00 2008 Subject: [Icc-avr] Re: Software Reset In-Reply-To: <7B0EB27CF1CC93439B5CFB7526E5D74C66AE31@mickey.PBNV.local> References: <519824.7397.qm@web65708.mail.ac4.yahoo.com> <7B0EB27CF1CC93439B5CFB7526E5D74C66AE31@mickey.PBNV.local> Message-ID: <5F8515C5ED67B6439B4F93D7B5E08A36063DD3@sbs.pertronic.local> Windows for instance. What can people possibly have against the watchdog timeout? Simple, reliable, ... Just lucky if "jmp 0" is good enough. Albert. -----Original Message----- From: icc-avr-bounces@imagecraft.com [mailto:icc-avr-bounces@imagecraft.com] On Behalf Of Jaspers, Ton Sent: Monday, June 16, 2008 08:33 PM To: Discussion list for ICCAVR and ICCtiny Users. You do NOT need to subscribeto icc-announce if you are a member of this. Subject: RE: [Icc-avr] Re: Software Reset From: Robert Rademacher > Hi, > I'm glad someone brought up this reset function, as it was not well-documented. > I use this method, which works well for several years: > void (*reset)( void ) = 0x0000; > in .h file > Then, call reset(); function anywhere to reset the AVR system. > I agree that asm(0x000) function is much better, as it seems to be much simpler and cleaner to use than my "old" reset command. None of the above is a reset function. Those functions only jump to address zero. Though this is the address the software starts at after a reset, there is no reset signal issued and consequently no device is actually reset. There are only two ways to issue a reset signal: 1. by connecting an output to the reset circuit or 2. by forcing the watchdog to issue a reset signal. The latter is often limited to the CPU and its build in peripherals. Software then still needs to control the reset circuit to reset external devices. But even when a reset circuit is correctly controlled one could argue that a reset signal is not the same as a power on sequence. Some devices can enter a state where only a power off/on sequence can get them out of. Ton Jaspers _______________________________________________ Icc-avr mailing list Icc-avr@imagecraft.com http://dragonsgate.net/mailman/listinfo/icc-avr Scanned by Bizo Email Filter From JonODonnell at moonlightconsulting.us Mon Jun 16 13:48:23 2008 From: JonODonnell at moonlightconsulting.us (Jon O'Donnell) Date: Mon Jun 16 14:50:20 2008 Subject: [Icc-avr] Re: Software Reset In-Reply-To: <5F8515C5ED67B6439B4F93D7B5E08A36063DD3@sbs.pertronic.local> References: <519824.7397.qm@web65708.mail.ac4.yahoo.com> <7B0EB27CF1CC93439B5CFB7526E5D74C66AE31@mickey.PBNV.local> <5F8515C5ED67B6439B4F93D7B5E08A36063DD3@sbs.pertronic.local> Message-ID: <1213649303.4856d197bef35@webmail.moonlightconsulting.us> Connecting an output to the RSTn line will not necessarily reset all of the external hardware because you cannot control how long the RSTn remains low. As soon as the processor enters reset, RSTn will go back high. A one-shot would do it, but that is getting even more complicated. A separate ExtRSTn with pull-downs connected to another output would give more control over reset durations. Just some pseudo-random thoughts. Jon Quoting Albert vanVeen : > Windows for instance. > > What can people possibly have against the watchdog timeout? Simple, > reliable, ... > Just lucky if "jmp 0" is good enough. > > Albert. > > > > -----Original Message----- > From: icc-avr-bounces@imagecraft.com > [mailto:icc-avr-bounces@imagecraft.com] On Behalf Of Jaspers, Ton > Sent: Monday, June 16, 2008 08:33 PM > To: Discussion list for ICCAVR and ICCtiny Users. You do NOT need to > subscribeto icc-announce if you are a member of this. > Subject: RE: [Icc-avr] Re: Software Reset > > From: Robert Rademacher > > > Hi, > > I'm glad someone brought up this reset function, as it was not > well-documented. > > I use this method, which works well for several years: > > void (*reset)( void ) = 0x0000; > > in .h file > > Then, call reset(); function anywhere to reset the AVR system. > > I agree that asm(0x000) function is much better, as it seems to be > much simpler and cleaner to use than my "old" reset command. > > None of the above is a reset function. > Those functions only jump to address zero. Though this is the address > the software starts at after a reset, there is no reset signal issued > and consequently no device is actually reset. > > There are only two ways to issue a reset signal: > 1. by connecting an output to the reset circuit or > 2. by forcing the watchdog to issue a reset signal. > The latter is often limited to the CPU and its build in peripherals. > Software then still needs to control the reset circuit to reset > external devices. > > But even when a reset circuit is correctly controlled one could > argue that a reset signal is not the same as a power on sequence. > Some devices can enter a state where only a power off/on sequence > can get them out of. > > > Ton Jaspers > > > > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr > > Scanned by Bizo Email Filter > > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr > From t.jaspers at cpseurope.com Tue Jun 17 02:49:21 2008 From: t.jaspers at cpseurope.com (Jaspers, Ton) Date: Tue Jun 17 03:51:10 2008 Subject: [Icc-avr] Re: Software Reset In-Reply-To: <1213649303.4856d197bef35@webmail.moonlightconsulting.us> Message-ID: <7B0EB27CF1CC93439B5CFB7526E5D74C66AEF9@mickey.PBNV.local> > -----Original Message----- > From: Jon O'Donnell > > Connecting an output to the RSTn line will not necessarily > reset all of the external hardware because you cannot control > how long the RSTn remains low. As soon as the processor > enters reset, RSTn will go back high. Obviously, that is why the output has to be connected to the reset circuit Rather then directly to the RST pin. Often the reset circuit is a RC network with a discharge diode. The simpelest solution Is to add another discharge diode and connect it to an output. The RC network should ensure sufficient RST delay. A more reliable solution is available through one of the many cheap reset chips containing some clever circuits, one of them being a smitt trigger based reset circuit. Because these chips are dirt cheap I never use discrete (i.e. smitt trigger) solutions anymore. Ton From benra at imt.liu.se Tue Jun 17 04:38:14 2008 From: benra at imt.liu.se (Bengt Ragnemalm) Date: Tue Jun 17 05:40:02 2008 Subject: [Icc-avr] Really nasty code trick Message-ID: <6342F18E30F44F0EA50B34F2DE89A07A@Shagrat> There are several bad programming tricks out there but this one was new for me: The purpose is to clear a memory area in a FLASH card. The code has an ordinary function that writes a data block to the flash card. The function has two parameters, sector number and a pointer to the 512 bytes large vector with data. To clear the sector this should be the typical method: for (loop=0;loop<512;loop++) { sectorArray[loop]=0; SdFlashWriteSector(sector, sectorArray); } But instead this is how it is done: sectorArray = POINTER_OUTSIDE_RAM; SdFlashWriteSector(sector, sectorArray); The code uses the fact that reading an area outside the actual RAM area will return a fixed value. I guess that on most system this will fill the FLASH with 0xFF and not 0 but 0xFF is the same as an erased memory card so that may be on purpose. The original name of the pointer POINTER_OUTSIDE_RAM was not so self informative so this took some time to figure out. Greatings, Bengt Bengt Ragnemalm, Forskningsingenj?r Tel 013-22 24 97 Leveransadress: Faktureringsadress: FAX: +46 13 10 19 02 Link?pings Universitet Link?pings Universitet bengt.ragnemalm@imt.liu.se Inst. f?r Medicinsk Teknik Faktura support http://www.imt.liu.se S-581 85 Link?ping SWEDEN 581 83 Link?ping Ref 1700 Bengt Ragnemalm M?rk med v?rt Best?llningsnr Vi kan g?ra mer ?n du kan dr?mma om men f?r det om?jliga beh?ver vi en liten leveranstid. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080617/0b42eb68/attachment-0001.html From benra at imt.liu.se Tue Jun 17 04:53:54 2008 From: benra at imt.liu.se (Bengt Ragnemalm) Date: Tue Jun 17 05:55:40 2008 Subject: SV: [Icc-avr] Re: Software Reset In-Reply-To: <7B0EB27CF1CC93439B5CFB7526E5D74C66AEF9@mickey.PBNV.local> References: <1213649303.4856d197bef35@webmail.moonlightconsulting.us> <7B0EB27CF1CC93439B5CFB7526E5D74C66AEF9@mickey.PBNV.local> Message-ID: <99CEF6C4FB2B446F8BC182B3E9C36C03@Shagrat> Note that this shouldn't matter for the AVR itself, only for other circuits that use the same signal. The AVR is designed in such a way that a reset will not occur until the reset pin have been low for a certain minimum time. /Bengt > -----Ursprungligt meddelande----- > Fr?n: icc-avr-bounces@imagecraft.com [mailto:icc-avr- > bounces@imagecraft.com] F?r Jaspers, Ton > Skickat: den 17 juni 2008 11:49 > Till: Discussion list for ICCAVR and ICCtiny Users. You do NOT need to > subscribeto icc-announce if you are a member of this. > ?mne: RE: [Icc-avr] Re: Software Reset > > > > > -----Original Message----- > > From: Jon O'Donnell > > > > Connecting an output to the RSTn line will not necessarily > > reset all of the external hardware because you cannot control > > how long the RSTn remains low. As soon as the processor > > enters reset, RSTn will go back high. > > Obviously, that is why the output has to be connected to the > reset circuit Rather then directly to the RST pin. Often the > reset circuit is a RC network with a discharge diode. The > simpelest solution Is to add another discharge diode and > connect it to an output. The RC network should ensure > sufficient RST delay. > > A more reliable solution is available through one of the many > cheap reset chips containing some clever circuits, one of them > being a smitt trigger based reset circuit. Because these chips > are dirt cheap I never use discrete (i.e. smitt trigger) > solutions anymore. > > > Ton > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr From jh.bodin at telia.com Tue Jun 17 05:28:15 2008 From: jh.bodin at telia.com (Johan H. Bodin) Date: Tue Jun 17 06:30:01 2008 Subject: [Icc-avr] Really nasty code trick In-Reply-To: <6342F18E30F44F0EA50B34F2DE89A07A@Shagrat> References: <6342F18E30F44F0EA50B34F2DE89A07A@Shagrat> Message-ID: <4857ADDF.60908@telia.com> Bengt, I'd suggest that you put the call to SdFlashWriteSector() *after* the zeroing loop. Writing the sector 512 times not only takes a lot of time but puts undue wear on the Flash as well ;-) MVH Johan ---- Bengt Ragnemalm wrote: > To clear the sector this should be the typical method: > > for (loop=0;loop<512;loop++) > { > sectorArray[loop]=0; > SdFlashWriteSector(sector, sectorArray); > } From benra at imt.liu.se Tue Jun 17 05:47:11 2008 From: benra at imt.liu.se (Bengt Ragnemalm) Date: Tue Jun 17 06:49:00 2008 Subject: SV: [Icc-avr] Really nasty code trick In-Reply-To: <4857ADDF.60908@telia.com> References: <6342F18E30F44F0EA50B34F2DE89A07A@Shagrat> <4857ADDF.60908@telia.com> Message-ID: Oh, just a typo from my side. The loop should only clear the array, not write to the flash. Sorry. > -----Ursprungligt meddelande----- > Fr?n: icc-avr-bounces@imagecraft.com [mailto:icc-avr- > bounces@imagecraft.com] F?r Johan H. Bodin > Skickat: den 17 juni 2008 14:28 > Till: Discussion list for ICCAVR and ICCtiny Users. You do NOT need > tosubscribe to icc-announce if you are a member of this. > ?mne: Re: [Icc-avr] Really nasty code trick > > Bengt, > > I'd suggest that you put the call to SdFlashWriteSector() *after* the > zeroing loop. Writing the sector 512 times not only takes a lot of time > but puts undue wear on the Flash as well ;-) > > MVH > Johan > > ---- > > Bengt Ragnemalm wrote: > > To clear the sector this should be the typical method: > > > > for (loop=0;loop<512;loop++) > > { > > sectorArray[loop]=0; > > SdFlashWriteSector(sector, sectorArray); > > } > > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr From t.jaspers at cpseurope.com Tue Jun 17 05:55:05 2008 From: t.jaspers at cpseurope.com (Jaspers, Ton) Date: Tue Jun 17 06:56:56 2008 Subject: [Icc-avr] Really nasty code trick In-Reply-To: <4857ADDF.60908@telia.com> Message-ID: <7B0EB27CF1CC93439B5CFB7526E5D74C66AF21@mickey.PBNV.local> > -----Original Message----- > From: Johan H. Bodin > > Bengt, > > I'd suggest that you put the call to SdFlashWriteSector() > *after* the zeroing loop. Writing the sector 512 times not > only takes a lot of time but puts undue wear on the Flash as well ;-) > Judging by the name of the function Bengt is using an SD memory card. Such a card has a build in controller that takes care of load balancing. Other than that you are right and the write should be outside the loop. Bengt, empty flash is always 0xFF. Though the SD card will manage for you but if you think for a moment what is actually happening inside the SD card you will agree that writing 0xFF is much more efficient and the performance of the card will be better. It has to do with block switching (copying to another block). Flash memory can be written and read byte by byte but it can only be erased a block at a time. Remember that writing turns one's to sero's, once a bit is zero it cannot be made one again unless the entire memory block is Erased (all bytes set to 0xff). If you erase using 0x00 the SD card has an awfull lot to manage the next time you want to write someting to that same area. Your new data has to be merged with the existing zero's and then a new empty block has to be programmed. Because the old one has to be erased. Though the build in controller inside the SD card has a much smpler task if all unused bytes are set to 0xFF. Flash bloks are not the same as sectors. Sectors are usually 512 bytes (FAT). An erase block of a flash is often several KB's in size. If you have a SdFlashWriteSector() function, isnt there a sector erase function as well? BTW, there are several good open source SD drivers, including FAT file system drivers out there. Have you checked AVR freaks yet? Cheers, Ton From Jeff.Milender at goodrich.com Tue Jun 17 06:29:44 2008 From: Jeff.Milender at goodrich.com (Milender, Jeff) Date: Tue Jun 17 07:32:09 2008 Subject: [Icc-avr] What to fill unused memory with (AT90CAN128)? Message-ID: We have been filling unused memory on the AT90CAN128 we are using with 0x00 (NOP) and a question as been raised if there is something better to fill this unused space with. I don't see a "Reset" command so what are you guys filling your unused space with? Thanks Jeff Jeff Milender Systems Engineer Cargo Systems Goodrich Interiors 2604 Highway 20 North Jamestown, ND 58401 Tel: 701-253-7569 jeff.milender@goodrich.com www.goodrich.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080617/81085bbb/attachment.html From benra at imt.liu.se Tue Jun 17 23:36:35 2008 From: benra at imt.liu.se (Bengt Ragnemalm) Date: Wed Jun 18 00:38:21 2008 Subject: SV: [Icc-avr] Really nasty code trick In-Reply-To: <7B0EB27CF1CC93439B5CFB7526E5D74C66AF21@mickey.PBNV.local> References: <4857ADDF.60908@telia.com> <7B0EB27CF1CC93439B5CFB7526E5D74C66AF21@mickey.PBNV.local> Message-ID: I maybe wasn't very clear in my first mail but this code is a peace of student work that I am reading. I wasn't thinking very much about the inside of the SD card. I just wanted to show the code trick which I didn't understood a bit of first. Why fill the sector with data that doesn't exists? But the code worked so I needed to find out why. After a while I figured out that it just should be an erase function but it took a little longer to understand how the erase was done. You say that once you have written something to a SD card sector, you must erase it to be able to write again. Could it be so that the card have a built in function that erases the sector before a new write starts? Otherwise I guess that the write function have it. On the other hand, you also say that you must erase a full block and can not erase sectors so I understand I must investigate this a little bit further. I think that there is an automatic erase function prior to writing and that the code works by pure luck. By the way, how do I find the block size? (This is a 1 Gig micro SD card). Another interesting thing you point out is that it should be possible to write SD card byte by byte. I thought it was only possible to write a full 512 sector. I know that if I start a normal write operation to a sector, I must write 512 bytes before the sector is actually written. /Bengt (Code from original thread, Johan and Ton - please leave the original thread in your answers or it is difficult to follow.) To fill the array with something (0 or 0xFF) to erase the SD card with: for (loop=0;loop<512;loop++) sectorArray[loop]=0; SdFlashWriteSector(sector, sectorArray); But instead this is how it is done: sectorArray = POINTER_OUTSIDE_RAM; SdFlashWriteSector(sector, sectorArray); > -----Ursprungligt meddelande----- > Fr?n: icc-avr-bounces@imagecraft.com [mailto:icc-avr- > bounces@imagecraft.com] F?r Jaspers, Ton > Skickat: den 17 juni 2008 14:55 > Till: Discussion list for ICCAVR and ICCtiny Users. You do NOT need to > subscribeto icc-announce if you are a member of this. > ?mne: RE: [Icc-avr] Really nasty code trick > > > -----Original Message----- > > From: Johan H. Bodin > > > > Bengt, > > > > I'd suggest that you put the call to SdFlashWriteSector() > > *after* the zeroing loop. Writing the sector 512 times not > > only takes a lot of time but puts undue wear on the Flash as well ;-) > > > > Judging by the name of the function Bengt is using an SD memory card. > Such a card has a build in controller that takes care of load balancing. > > Other than that you are right and the write should be outside the loop. > > Bengt, empty flash is always 0xFF. Though the SD card will manage for > you but if you think for a moment what is actually happening inside the > SD card you will agree that writing 0xFF is much more efficient and the > performance of the card will be better. > > It has to do with block switching (copying to another block). Flash > memory can be written and read byte by byte but it can only be erased > a block at a time. Remember that writing turns one's to sero's, once a > bit is zero it cannot be made one again unless the entire memory block > is Erased (all bytes set to 0xff). If you erase using 0x00 the SD card > has an awfull lot to manage the next time you want to write someting to > that same area. Your new data has to be merged with the existing zero's > and then a new empty block has to be programmed. Because the old one has > > to be erased. Though the build in controller inside the SD card has a > much smpler task if all unused bytes are set to 0xFF. Flash bloks are > not the same as sectors. Sectors are usually 512 bytes (FAT). An erase > block of a flash is often several KB's in size. > > If you have a SdFlashWriteSector() function, isnt there a sector erase > function as well? > > BTW, there are several good open source SD drivers, including FAT file > system drivers out there. Have you checked AVR freaks yet? > > Cheers, > Ton > > _______________________________________________ > Icc-avr mailing list > Icc-avr@imagecraft.com > http://dragonsgate.net/mailman/listinfo/icc-avr From andrew_166 at msn.com Wed Jun 18 03:23:17 2008 From: andrew_166 at msn.com (Andrew) Date: Wed Jun 18 04:24:47 2008 Subject: [Icc-avr] Really nasty code trick References: <4857ADDF.60908@telia.com><7B0EB27CF1CC93439B5CFB7526E5D74C66AF21@mickey.PBNV.local> Message-ID: Hi Bengt, I will send you an application note (when i get home) that was written for the PSoC and uses an MMC card (but MMC and SD are the same, just that the command are different) the application note explains in detail the inner workings of the memory device and is written well. It also has code written in C for write/read opertions including block and byte by byte reading / writting.I ahev used the driver for an application and i did not have to erase any memory before starting a write cycle. Andy ----- Original Message ----- From: "Bengt Ragnemalm" To: "'Discussion list for ICCAVR and ICCtiny Users. You do NOT needtosubscribeto icc-announce if you are a member of this.'" Sent: Wednesday, June 18, 2008 7:36 AM Subject: SV: [Icc-avr] Really nasty code trick >I maybe wasn't very clear in my first mail but this code is a peace of > student work that I am reading. I wasn't thinking very much about the > inside > of the SD card. I just wanted to show the code trick which I didn't > understood a bit of first. Why fill the sector with data that doesn't > exists? But the code worked so I needed to find out why. After a while I > figured out that it just should be an erase function but it took a little > longer to understand how the erase was done. > > You say that once you have written something to a SD card sector, you must > erase it to be able to write again. Could it be so that the card have a > built in function that erases the sector before a new write starts? > Otherwise I guess that the write function have it. On the other hand, you > also say that you must erase a full block and can not erase sectors so I > understand I must investigate this a little bit further. I think that > there > is an automatic erase function prior to writing and that the code works by > pure luck. By the way, how do I find the block size? (This is a 1 Gig > micro > SD card). > > Another interesting thing you point out is that it should be possible to > write SD card byte by byte. I thought it was only possible to write a full > 512 sector. I know that if I start a normal write operation to a sector, I > must write 512 bytes before the sector is actually written. > > /Bengt > > (Code from original thread, Johan and Ton - please leave the original > thread > in your answers or it is difficult to follow.) > > To fill the array with something (0 or 0xFF) to erase the SD card with: > for (loop=0;loop<512;loop++) > sectorArray[loop]=0; > SdFlashWriteSector(sector, sectorArray); > > > But instead this is how it is done: > > sectorArray = POINTER_OUTSIDE_RAM; > SdFlashWriteSector(sector, sectorArray); > > > >> -----Ursprungligt meddelande----- >> Fr?n: icc-avr-bounces@imagecraft.com [mailto:icc-avr- >> bounces@imagecraft.com] F?r Jaspers, Ton >> Skickat: den 17 juni 2008 14:55 >> Till: Discussion list for ICCAVR and ICCtiny Users. You do NOT need to >> subscribeto icc-announce if you are a member of this. >> ?mne: RE: [Icc-avr] Really nasty code trick >> >> > -----Original Message----- >> > From: Johan H. Bodin >> > >> > Bengt, >> > >> > I'd suggest that you put the call to SdFlashWriteSector() >> > *after* the zeroing loop. Writing the sector 512 times not >> > only takes a lot of time but puts undue wear on the Flash as well ;-) >> > >> >> Judging by the name of the function Bengt is using an SD memory card. >> Such a card has a build in controller that takes care of load balancing. >> >> Other than that you are right and the write should be outside the loop. >> >> Bengt, empty flash is always 0xFF. Though the SD card will manage for >> you but if you think for a moment what is actually happening inside the >> SD card you will agree that writing 0xFF is much more efficient and the >> performance of the card will be better. >> >> It has to do with block switching (copying to another block). Flash >> memory can be written and read byte by byte but it can only be erased >> a block at a time. Remember that writing turns one's to sero's, once a >> bit is zero it cannot be made one again unless the entire memory block >> is Erased (all bytes set to 0xff). If you erase using 0x00 the SD card >> has an awfull lot to manage the next time you want to write someting to >> that same area. Your new data has to be merged with the existing zero's >> and then a new empty block has to be programmed. Because the old one has >> >> to be erased. Though the build in controller inside the SD card has a >> much smpler task if all unused bytes are set to 0xFF. Flash bloks are >> not the same as sectors. Sectors are usually 512 bytes (FAT). An erase >> block of a flash is often several KB's in size. >> >> If you have a SdFlashWriteSector() function, isnt there a sector erase >> function as well? >> >> BTW, there are several good open source SD drivers, including FAT file >> system drivers out there. Have you checked AVR freaks yet? >> >> Cheers, >> Ton >> >> _______________________________________________ >> 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 andrew_166 at msn.com Sun Jun 22 15:25:13 2008 From: andrew_166 at msn.com (Andrew) Date: Sun Jun 22 16:27:13 2008 Subject: [Icc-avr] AVR Flash Question Message-ID: Hi, I need yo use the Flash in the AVR in the following way: - if have the following variable saved in Flash. which is transfered to SDRAM when my program runs:- unsigned long Graphics[8][8]; My question is: - Can i change the contence of the variable using the USART and save it back to flash instead of using the EEPROM (as i have filled it) ? IF so can somebody please post me a simple exmaple of how this is done. Many Thanks, Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080622/1f65e600/attachment.html From BobGardner at aol.com Sun Jun 22 17:24:48 2008 From: BobGardner at aol.com (BobGardner@aol.com) Date: Sun Jun 22 18:26:46 2008 Subject: [Icc-avr] AVR Flash Question Message-ID: Tell us how big the eepriom is and what you are storing there. Maybe there's a way to encode it so you can keep both in eeprom. In a message dated 6/22/2008 6:27:12 P.M. Eastern Daylight Time, andrew_166@msn.com writes: Hi, I need yo use the Flash in the AVR in the following way: - if have the following variable saved in Flash. which is transfered to SDRAM when my program runs:- unsigned long Graphics[8][8]; My question is: - Can i change the contence of the variable using the USART and save it back to flash instead of using the EEPROM (as i have filled it) ? IF so can somebody please post me a simple exmaple of how this is done. Many Thanks, Andy _______________________________________________ Icc-avr mailing list Icc-avr@imagecraft.com http://dragonsgate.net/mailman/listinfo/icc-avr **************Gas prices getting you down? Search AOL Autos for fuel-efficient used cars. (http://autos.aol.com/used?ncid=aolaut00050000000007) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080622/df29eef7/attachment.html From andrew_166 at msn.com Sun Jun 22 17:38:39 2008 From: andrew_166 at msn.com (Andrew) Date: Sun Jun 22 18:40:40 2008 Subject: [Icc-avr] AVR Flash Question References: Message-ID: Hi, I don't want to use the EPPROM for speed reasons. and i cannot encode it for speed reasons and the information stored is binary 1 (ON) binary 0 (OFF) so it cannot be compressed as i need all the bits Andy ----- Original Message ----- From: BobGardner@aol.com To: icc-avr@imagecraft.com Sent: Monday, June 23, 2008 1:24 AM Subject: Re: [Icc-avr] AVR Flash Question Tell us how big the eepriom is and what you are storing there. Maybe there's a way to encode it so you can keep both in eeprom. In a message dated 6/22/2008 6:27:12 P.M. Eastern Daylight Time, andrew_166@msn.com writes: Hi, I need yo use the Flash in the AVR in the following way: - if have the following variable saved in Flash. which is transfered to SDRAM when my program runs:- unsigned long Graphics[8][8]; My question is: - Can i change the contence of the variable using the USART and save it back to flash instead of using the EEPROM (as i have filled it) ? IF so can somebody please post me a simple exmaple of how this is done. Many Thanks, Andy _______________________________________________ Icc-avr mailing list Icc-avr@imagecraft.com http://dragonsgate.net/mailman/listinfo/icc-avr ------------------------------------------------------------------------------ Gas prices getting you down? Search AOL Autos for fuel-efficient used cars. ------------------------------------------------------------------------------ _______________________________________________ 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/20080623/fc4cbd05/attachment.html From BobGardner at aol.com Sun Jun 22 18:02:51 2008 From: BobGardner at aol.com (BobGardner@aol.com) Date: Sun Jun 22 19:04:52 2008 Subject: [Icc-avr] AVR Flash Question Message-ID: Its always something isn't it? Can't cut the red wire or it will blow up, can't cut the blue wire or it will blow up, what's a fellow to do? What speed are you running at, by the way? (And you didnt answer my question about what you were storing... you think I can't encode binary? You think pkzip does a good job on that?) In a message dated 6/22/2008 8:39:35 P.M. Eastern Daylight Time, andrew_166@msn.com writes: Hi, I don't want to use the EPPROM for speed reasons. and i cannot encode it for speed reasons and the information stored is binary 1 (ON) binary 0 (OFF) so it cannot be compressed as i need all the bits Andy ----- Original Message ----- From: _BobGardner@aol.com_ (mailto:BobGardner@aol.com) To: _icc-avr@imagecraft.com_ (mailto:icc-avr@imagecraft.com) Sent: Monday, June 23, 2008 1:24 AM Subject: Re: [Icc-avr] AVR Flash Question Tell us how big the eepriom is and what you are storing there. Maybe there's a way to encode it so you can keep both in eeprom. In a message dated 6/22/2008 6:27:12 P.M. Eastern Daylight Time, _andrew_166@msn.com_ (mailto:andrew_166@msn.com) writes: Hi, I need yo use the Flash in the AVR in the following way: - if have the following variable saved in Flash. which is transfered to SDRAM when my program runs:- unsigned long Graphics[8][8]; My question is: - Can i change the contence of the variable using the USART and save it back to flash instead of using the EEPROM (as i have filled it) ? IF so can somebody please post me a simple exmaple of how this is done. Many Thanks, Andy _______________________________________________ Icc-avr mailing list Icc-avr@imagecraft.com http://dragonsgate.net/mailman/listinfo/icc-avr ____________________________________ Gas prices getting you down? Search AOL Autos for fuel-efficient _used cars_ (http://autos.aol.com/used?ncid=aolaut00050000000007) . ____________________________________ _______________________________________________ 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 **************Gas prices getting you down? Search AOL Autos for fuel-efficient used cars. (http://autos.aol.com/used?ncid=aolaut00050000000007) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080622/5d94c5f8/attachment.html From webbra.mlist at verizon.net Mon Jun 23 13:24:17 2008 From: webbra.mlist at verizon.net (Rich Webb) Date: Mon Jun 23 14:26:23 2008 Subject: [Icc-avr] AVR Flash Question In-Reply-To: <200806231900.m5NJ08DO045661@mail.imagecraft.com> References: <200806231900.m5NJ08DO045661@mail.imagecraft.com> Message-ID: <48600671.6010301@verizon.net> > I need yo use the Flash in the AVR in the following way: - > > if have the following variable saved in Flash. which is transfered to SDRAM when my program runs:- > unsigned long Graphics[8][8]; > > My question is: - Can i change the contence of the variable using the USART and save it back to flash instead of using the EEPROM (as i have filled it) ? > > IF so can somebody please post me a simple exmaple of how this is done. ... > I don't want to use the EPPROM for speed reasons. and i cannot encode it for > speed reasons and the information stored is binary 1 (ON) binary 0 (OFF) so > it cannot be compressed as i need all the bits It is possible to modify the program code area of the flash on modern AVRs. See the BootLoader section of the datasheet for your particular device for the procedure but in general, yes, you can setup a bootloader to get values from the serial port and write them to flash. It's not as fast as you may want, though, since you'll need to grab the old sector contents to RAM, replace the array values, erase the flash sector, and then write the modified sector from RAM to flash. Then leave the bootloader to re-enter the main program. With regards to the speed issues involved with EEPROM writes, you don't have to write all 64 longs in a single for-loop. Try initiating the write of the first byte and then let the program go off and do the other things that it needs to do. Periodically poll the EEPROM for write completion (or enable the interrupt) and then write the next byte, and so on. In the end, that's probably easier than going the bootloader route. From robertrade at yahoo.com Thu Jun 26 18:38:07 2008 From: robertrade at yahoo.com (Robert Rademacher) Date: Thu Jun 26 19:40:07 2008 Subject: [Icc-avr] AVR Flash Question In-Reply-To: <200806231900.m5NJ08DP045661@mail.imagecraft.com> Message-ID: <452467.97702.qm@web65701.mail.ac4.yahoo.com> Hi Andy, "I don't want to use the EPPROM for speed reasons. and i cannot encode it? for speed reasons and the information stored is binary 1 (ON) binary 0 (OFF)? so it cannot be compressed as i need all the bits" You can use RAMTRON FRAM connected to high speed bus (3.4 M/s High Speed mode) to replace EEPROM for faster loading speed. I use FRAM for storing and reading the web pages and images in there, and is much more cost effective (and save real estate space). Hope it helps. Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080626/7e417ab2/attachment.html From derekr at macom.co.uk Sat Jun 28 19:04:17 2008 From: derekr at macom.co.uk (derekr@macom.co.uk) Date: Sat Jun 28 20:06:22 2008 Subject: [Icc-avr] OUT OF OFFICE In-Reply-To: <452467.97702.qm@web65701.mail.ac4.yahoo.com> References: <200806231900.m5NJ08DP045661@mail.imagecraft.com> <452467.97702.qm@web65701.mail.ac4.yahoo.com> Message-ID: Thank you for your email. I will be back on Monday 30/06/08. E-mails will not be read or forwarded. In urgent cases, please contact Stephen Mackie on +44 141 882 0077.