User Tools

Site Tools


using_pic18f4620

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
using_pic18f4620 [2006/09/18 09:43]
gertius
using_pic18f4620 [2011/11/18 12:14] (current)
lpdunwell removed spam
Line 1: Line 1:
 ====== Using the PIC18F4620 or PIC18F4520 ====== ====== Using the PIC18F4620 or PIC18F4520 ======
 +
 +FIXME This is really outdated!!!
  
 Historically,​ MIOS was developed to run on a core module stuffed with a PIC18F452. Recently, the PIC18F4620 has become available. It is near code-compatible with the 452, but features a significant increase in RAM/​EEPROM/​Codespace. See [[mios_pic18f4620|the PIC18F4620 page]] for details. Historically,​ MIOS was developed to run on a core module stuffed with a PIC18F452. Recently, the PIC18F4620 has become available. It is near code-compatible with the 452, but features a significant increase in RAM/​EEPROM/​Codespace. See [[mios_pic18f4620|the PIC18F4620 page]] for details.
Line 9: Line 11:
 ====== OS Layers ====== ====== OS Layers ======
  
-MIOS v1.9b or above is required. You will need to download the MIOS source from   ​[[http://​www.ucapps.de/​mios_download.html|The uCApps.de Download Page]] or [[http://​www.ucapps.de/​mios/​mios_v1_9b_src.zip|Directly]]. I recommend checking the first link for the latest version, as the '4620 is current in beta.\\+MIOS v1.9b or above is required. You will need to download the MIOS source from   ​[[http://​www.ucapps.de/​mios_download.html|The uCApps.de Download Page]] or [[http://​www.ucapps.de/​mios/​mios_v1_9c_src.zip|Directly]]. I recommend checking the first link for the latest version, as the '4620 is current in beta.\\
 \\ \\
 The Bootloader and MIOS recompile steps which follow should not be necessary for most cases of '4620 use, as these components are now available precompiled and packaged in a zip file [[http://​www.ucapps.de/​mios/​mios_update_v1_9b.zip|hosted on uCApps.de]] Instructions follow for reference only, or for '4520 use.\\ The Bootloader and MIOS recompile steps which follow should not be necessary for most cases of '4620 use, as these components are now available precompiled and packaged in a zip file [[http://​www.ucapps.de/​mios/​mios_update_v1_9b.zip|hosted on uCApps.de]] Instructions follow for reference only, or for '4520 use.\\
Line 162: Line 164:
 goto MIOS_HLP_Dec2BCD goto MIOS_HLP_Dec2BCD
 </​code>​ </​code>​
 +
  
  
  
 ==== Linker Script ==== ==== Linker Script ====
 +
  
 Modifications should be made to the linker script in order to take advantage of the additional capabilities of the 4620/​4520. ​ Modifications should be made to the linker script in order to take advantage of the additional capabilities of the 4620/​4520. ​
Line 251: Line 255:
 \\ \\
 ==Extended Bank Capacity== ==Extended Bank Capacity==
 +
 +__**Be Careful doing this!!**__
 +This can do weird things like make variables always = 0 where the memory that variable is stored in, crosses boundaries of 256b blocks. Do not make banks any larger than required, and try to let them begin at round numbers (100, 200, 300,...). This still might not even work. - stryd_one
 +
  
 The above change will enable SDCC to allocate the variables in your application to any of the specified banks above. The very observant among you may have noticed that these banks are 256 bits each.... So what happens if you want to use a variable which is greater than 256 bits in size, such as a large array, or string of characters? For this, you will need to create a bank of extended size, and you will need to direct your application to use that bank to store your large variable. The above change will enable SDCC to allocate the variables in your application to any of the specified banks above. The very observant among you may have noticed that these banks are 256 bits each.... So what happens if you want to use a variable which is greater than 256 bits in size, such as a large array, or string of characters? For this, you will need to create a bank of extended size, and you will need to direct your application to use that bank to store your large variable.
Line 296: Line 304:
 \\ \\
  
-Or of course you could make the whole lot into one bank if you wanted to: +Or of course you could make the whole lot into one bank if you wanted to. This is NOT recommended though!
 <​code>​ <​code>​
 DATABANK ​  ​NAME=miosram_u ​ START=0x380 ​         END=0x5FF  ​  ​PROTECTED DATABANK ​  ​NAME=miosram_u ​ START=0x380 ​         END=0x5FF  ​  ​PROTECTED
Line 329: Line 337:
  
 You may create as many or as few sections as you require for your application. ​ You may create as many or as few sections as you require for your application. ​
 +
 +
  
 ==== Application Code ==== ==== Application Code ====
Line 340: Line 350:
 <​code>​ <​code>​
 #pragma udata b512 MIDI_Table ​      // This means "store a variable named '​MIDI_Table'​ in the SECTION named '​b512'​ #pragma udata b512 MIDI_Table ​      // This means "store a variable named '​MIDI_Table'​ in the SECTION named '​b512'​
-unsigned ​int MIDI_Table[512]; ​      // Declare the array named '​MIDI_Table',​ and now it will be stored in '​b512'​+unsigned ​char MIDI_Table[512]; ​      // Declare the array named '​MIDI_Table',​ and now it will be stored in '​b512'​
 </​code>​ </​code>​
 +
 +**It is recommended to avoid this wherever possible.** Allow the compiler to allocate the memory wherever possible!
 +
 +Check [[http://​www.midibox.org/​forum/​index.php?​topic=8934.0|An answer to the extended databanks problem]] for more info!!!!!!!!!!
  
 \\ \\
using_pic18f4620.1158572600.txt.gz ยท Last modified: 2006/10/15 09:35 (external edit)