EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

IAR and memory banking for 128K flash and 8051

Started by Amir February 13, 2008
On Thu, 14 Feb 2008 14:02:06 -0800 (PST), Amir <amiri.amir@gmail.com>
wrote:

>On Feb 14, 5:41&#4294967295;am, GMM50 <gfm5...@gmail.com> wrote: >> On Feb 13, 5:06 pm, Amir <amiri.a...@gmail.com> wrote: >> >> > Hi all, >> >> > I am trying to use code banking for 8051 microcontroller using IAR... >> > Reading the IAR and XLINK documents didnt help...I appreciate some >> > info from any one with some hand on experience.. >> >> > Regards, >> > Amir >> >> IAR has(had) a banked switched memory model in the 1980's 1990's >> vintage C compilers. &#4294967295;I made a lot of money fitting large programs >> into small address spaces. &#4294967295;The compiler option I am familiar with was >> a -m (or perhaps -m0). >> >> The CPU's memory space needed one bank to alway be in place and not >> switchable and then another bank to be switchable. >> >> The compiler/linker sorted out all the bank switching parameters. &#4294967295;If >> a call was made from a routine in one bank to a routine in another >> bank, the new bank number and routine address was passed to a bank >> switching routine in the common bank. &#4294967295;All returns from routines also >> were done through this bank switching routine. >> >> The hardware needed a register to store the bank number and that >> register fed the memory decode logic in my designs. >> >> Hope this helps >> George > >Thank you for the useful information George. I appreciate it..I use a >SOC (cc2430 ), and according to cc2430 datasheet, the banking has to >be done in 4 banks as opposed to 2. I did setup the parameters as >described by IAR compiler documents, but when I program the flash, the >system doesnt seem to find the start up code, thus nothing happens.
Does your code run when you are using a normal non banked test app ? AFACR one has to write one's own banking function when using IAR. You can initially turn this into a test function to switch banks, do a dump of program memory of where you think the code should be, and check if this is in fact the case. As George ha said, IAR sorts out all the nasty details. Regards Anton Erasmus
On Feb 15, 7:29=A0am, Anton Erasmus <nob...@spam.prevent.net> wrote:
> On Thu, 14 Feb 2008 14:02:06 -0800 (PST), Amir <amiri.a...@gmail.com> > wrote: > > > > > > >On Feb 14, 5:41=A0am, GMM50 <gfm5...@gmail.com> wrote: > >> On Feb 13, 5:06 pm, Amir <amiri.a...@gmail.com> wrote: > > >> > Hi all, > > >> > I am trying to use code banking for 8051 microcontroller using IAR...=
> >> > Reading the IAR and XLINK documents didnt help...I appreciate some > >> > info from any one with some hand on experience.. > > >> > Regards, > >> > Amir > > >> IAR has(had) a banked switched memory model in the 1980's 1990's > >> vintage C compilers. =A0I made a lot of money fitting large programs > >> into small address spaces. =A0The compiler option I am familiar with wa=
s
> >> a -m (or perhaps -m0). > > >> The CPU's memory space needed one bank to alway be in place and not > >> switchable and then another bank to be switchable. > > >> The compiler/linker sorted out all the bank switching parameters. =A0If=
> >> a call was made from a routine in one bank to a routine in another > >> bank, the new bank number and routine address was passed to a bank > >> switching routine in the common bank. =A0All returns from routines also=
> >> were done through this bank switching routine. > > >> The hardware needed a register to store the bank number and that > >> register fed the memory decode logic in my designs. > > >> Hope this helps > >> George > > >Thank you for the useful information George. I appreciate it..I use a > >SOC (cc2430 ), and according to cc2430 datasheet, the banking has to > >be done in 4 banks as opposed to 2. I did setup the parameters as > >described by IAR compiler documents, but when I program the flash, the > >system doesnt seem to find the start up code, thus nothing happens. > > Does your code run when you are using a normal non banked test app ? > AFACR one has to write one's own banking function when using IAR. > You can initially turn this into a test function to switch banks, do a > dump of program memory of where you think the code should be, and > check if this is in fact the case. As George ha said, IAR sorts out > all the nasty details. > > Regards > =A0 Anton Erasmus- Hide quoted text - > > - Show quoted text -
Yes. When used for unbanked, it does work, and everything is fine...It is just that I wanna add more stuff to what I have, and to do that, I need more memory, and I have to take advantage of the full size 128K flash already embedded in the SOC... Regards, Amir
On Feb 15, 1:54=A0am, David Brown <da...@westcontrol.removethisbit.com>
wrote:
> Amir wrote: > > On Feb 13, 5:50 pm, larwe <zwsdot...@gmail.com> wrote: > >> On Feb 13, 7:27 pm, "Ulf Samuelsson" <u...@a-t-m-e-l.com> wrote: > > >>> You could also consider moving into the 21st century like the rest of =
us
> >>> by selecting an MCU appropriate for the job. > >> "I'm trying to extract information from a prisoner using the rack, but > >> I'm having real trouble tying him onto it tightly enough. I checked > >> the scrolls in the monastery, but didn't get any useful help. So I'm > >> throwing it out to all my fellow executioners" > > >> "You should move into the 21st century and waterboard him". > > >> Translation: Yes, 8051 is old, but if it's what he's using... > > > Thank you Larwe...I assume u picked the easiest answer...lol. > > But just to let u know that I am using a SOC which is pretty recent > > (2006) and it has an 8051 embedded. > > Brief: If you dont know the answer, or cannot provide any help, u dont > > have to write useless comments! > > Here's a bit of unrelated free advice: > > When you join a newsgroup, remember that you are joining an established > community. =A0A lot of the people here have been around for years - if you=
> don't understand the banter between old hands like Ulf and Lewin, don't > comment on it, as it just makes you look silly. =A0And learn to spell > "you" - you'll be amazed at the increased level of respect you get. > > mvh., > > David- Hide quoted text - > > - Show quoted text -
David, I really donot need any unrelated off-topic free advice. Thank you! We are all mature, and professional, as far as the group members are concerned. I posted a message to seek some help that may be beneficial to everyone. I dont know where all these advicing is coming from..Lets end the unrelated advicing, and talk of beneficial stuff to serve the community as a whole! Regards, Amir
Op Fri, 15 Feb 2008 09:47:38 -0800 (PST) schreef Amir:

<snip>
> David, > > I really donot need any unrelated off-topic free advice. Thank you! We > are all mature, and professional, as far as the group members are > concerned. I posted a message to seek some help that may be beneficial > to everyone. I dont know where all these advicing is coming from..Lets > end the unrelated advicing, and talk of beneficial stuff to serve the > community as a whole!
How in the world do we know that you (or David, or even myself) are mature professionals? -- Coos
In message 
<0b055d7b-c892-46dd-9326-816dc69e9709@s19g2000prg.googlegroups.com>, 
Amir <amiri.amir@gmail.com> writes
>On Feb 15, 1:54&#4294967295;am, David Brown <da...@westcontrol.removethisbit.com> >wrote: >> Amir wrote: >> > On Feb 13, 5:50 pm, larwe <zwsdot...@gmail.com> wrote: >> >> On Feb 13, 7:27 pm, "Ulf Samuelsson" <u...@a-t-m-e-l.com> wrote: >> >> >>> You could also consider moving into the 21st century like the rest of us >> >>> by selecting an MCU appropriate for the job. >> >> "I'm trying to extract information from a prisoner using the rack, but >> >> I'm having real trouble tying him onto it tightly enough. I checked >> >> the scrolls in the monastery, but didn't get any useful help. So I'm >> >> throwing it out to all my fellow executioners" >> >> >> "You should move into the 21st century and waterboard him". >> >> >> Translation: Yes, 8051 is old, but if it's what he's using... >> >> > Thank you Larwe...I assume u picked the easiest answer...lol. >> > But just to let u know that I am using a SOC which is pretty recent >> > (2006) and it has an 8051 embedded. >> > Brief: If you dont know the answer, or cannot provide any help, u dont >> > have to write useless comments! >> >> Here's a bit of unrelated free advice:
Actually I think it is related... If you don't know the format and protocol for asking questions you (u?) won't get the answers u/U/you need.
>> >> When you join a newsgroup, remember that you are joining an established >> community. &#4294967295;A lot of the people here have been around for years - if you >> don't understand the banter between old hands like Ulf and Lewin, don't >> comment on it, as it just makes you look silly. &#4294967295;And learn to spell >> "you" - you'll be amazed at the increased level of respect you get. >> >> mvh., >> >> David- Hide quoted text - >> >> - Show quoted text - > >David, > >I really donot need any unrelated off-topic free advice. Thank you!
It is very much on topic advice. Some of us, such as myself, Ulf, David Lewin have been on here for over a decade and we do have a lot of banter between.... friends, those with different opinions and the insanely misguided who don't joyfully agree with everything I say..... :-)
>We >are all mature, and professional, >as far as the group members are >concerned.
That is an incorrect assumption as you will find out in time. Many are immature students. Some are very mature hobby people (great age but little experience in some cases) and some you wonder how they ever got a job in the industry in the first place. But enough about David, Lewin and Ulf... :-) There are some professionals on here as well .One of whom you have just had a go at! Also some hobby people with more knowledge than some of the professionals in fact all sorts congregate on there.
>I posted a message to seek some help that may be beneficial >to everyone. I dont know where all these advicing is coming from..
The whole world. The Internet is global.
>Lets >end the unrelated advicing,
It was directly related advice. As was the advice to use as far as possible, correct English. "You" has three letters not one.
>and talk of beneficial stuff to serve the >community as a whole!
You have been here a few weeks and are now telling the professionals who have been on here a decade how to behave? I would think again before you ask any more questions of the group. -- \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/ /\/\/ chris@phaedsys.org www.phaedsys.org \/\/\ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
In message <1ryg8yac21kgf$.1q43ofghhrj6s$.dlg@40tude.net>, Coos Haak 
<chforth@hccnet.nl> writes
>Op Fri, 15 Feb 2008 09:47:38 -0800 (PST) schreef Amir: > ><snip> >> David, >> >> I really donot need any unrelated off-topic free advice. Thank you! We >> are all mature, and professional, as far as the group members are >> concerned. I posted a message to seek some help that may be beneficial >> to everyone. I dont know where all these advicing is coming from..Lets >> end the unrelated advicing, and talk of beneficial stuff to serve the >> community as a whole! > >How in the world do we know that you (or David, or even myself) are mature >professionals?
My analyst said I can be what ever I want to be so there !!!!! Today I am a professional and tomorrow I am going to be a Lumberjack..... Chop down trees, work all day and sleep all night...... -- \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/ /\/\/ chris@phaedsys.org www.phaedsys.org \/\/\ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
In message 
<2914c7a5-bbc3-4fd1-a3d2-78e74733119e@s19g2000prg.googlegroups.com>, 
Amir <amiri.amir@gmail.com> writes
>On Feb 13, 5:50&#4294967295;pm, larwe <zwsdot...@gmail.com> wrote: >> On Feb 13, 7:27&#4294967295;pm, "Ulf Samuelsson" <u...@a-t-m-e-l.com> wrote: >> >> > You could also consider moving into the 21st century like the rest of us >> > by selecting an MCU appropriate for the job. >> >> "I'm trying to extract information from a prisoner using the rack, but >> I'm having real trouble tying him onto it tightly enough. I checked >> the scrolls in the monastery, but didn't get any useful help. So I'm >> throwing it out to all my fellow executioners" >> >> "You should move into the 21st century and waterboard him". >> >> Translation: Yes, 8051 is old, but if it's what he's using... > >Thank you Larwe...I assume u picked the easiest answer...lol. >But just to let u know that I am using a SOC which is pretty recent >(2006) and it has an 8051 embedded. >Brief: If you dont know the answer, or cannot provide any help, u dont >have to write useless comments!
So why not use an 8051 core that has linear memory out to 128K rather than code banking? Which core is it? There are many. BTW you have not said what sort of banking strategy you are doing. -- \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/ /\/\/ chris@phaedsys.org www.phaedsys.org \/\/\ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
In message 
<d92cc0e4-0f20-41b5-aed3-983cecb16db7@p73g2000hsd.googlegroups.com>, 
larwe <zwsdotcom@gmail.com> writes
>On Feb 14, 6:59&#4294967295;pm, donald <Don...@dontdoithere.com> wrote: > >> Hasn't the ARM7 been call the "8051" of the new millennium. > >The prices of both cores are asymptotically approaching zero, but they >really don't 100% occupy the same application space.
I think it refers to the fact that both the 8051 and ARM have many many versions from many many silicon vendors, soft cores etc Ironically I think Intel is one of the few silicon companies not to do an 8051 and AFAIK I don't think anyone actually uses the original Intel 8051 core any more. -- \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/ /\/\/ chris@phaedsys.org www.phaedsys.org \/\/\ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
In message <47b4edb8$1@clear.net.nz>, Jim Granville 
<no.spam@designtools.maps.co.nz> writes
>Joerg wrote: >> Ulf Samuelsson wrote: >>> Maybe I should put the signature in BOLD letters... >>> >> I know it's your personal opinion, just wanted to make a point about >>why the 8051 architecture is still widely used. And unless another >>2nd-sourceable series appears it will remain in use. That would be my >>personal opinion, and that of a whole lot of others. > >The 128K in this thread is at the top-end of the 80C51 range,
I thought NXP had some 256K devices and, Dallas/Maxim, NXP and Analouge had parts that will address out to a couple of MB? Though I have never seen the point of adding so much memory to a 51
>Companies like Winbond, Megawin, Myson, Micronas, Coreriver, STC, >Syncmos, ABOV, (etc) are expanding their offerings.
However I thought they were mainly in the specialist market?
>The 80C51 will still be (easily) the worlds highest volume 8 bit uC core.
I think that some one somewhere worked out that 30% of all MCU out there are an 8051 family derivative. Now that was about 4 years ago. So it might have fallen to 1on 5 MCU by now :-) Nothing else comes close. However I expect ARM cores will one day. -- \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/ /\/\/ chris@phaedsys.org www.phaedsys.org \/\/\ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
In message 
<462d6bc9-0768-495d-b638-b91735ea5ddb@m78g2000hsh.googlegroups.com>, 
Amir <amiri.amir@gmail.com> writes
>On Feb 14, 12:25&#4294967295;am, Neil <NeilKu...@worldnet.att.net> wrote: >> Amir wrote: >> > Hi all, >> >> > I am trying to use code banking for 8051 microcontroller using IAR... >> > Reading the IAR and XLINK documents didnt help...I appreciate some >> > info from any one with some hand on experience.. >> >> > Regards, >> > Amir >> >> There are a lot of people who want to Bank with 8052's. &#4294967295;I do not know why. >> I inherited on once, but it was with Keil. >> If you do not get an answer here, An I assume you Post at IAR and look >> for samples there, and in the sample folder that the compiler installed. >> try asking atwww.8052.com( they may also ask why?) > >FYI Neil..Many SOC vendors, use these microncontrollers as they are >small, and well developped/fit for embedded designs using SOCs.
We know this. However I assume ing you are using the 51 core because it is cheap. However the bank switching may not be in terms of setup and programming time, . You may want to see what other cores the ASIC/FPGA vendor has. I assume you mean an ASIC or FPGA when you say SOC? -- \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/ /\/\/ chris@phaedsys.org www.phaedsys.org \/\/\ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

The 2024 Embedded Online Conference