CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Help Needed-PIC18F8722 and Extended Memory

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
nmeyer



Joined: 09 Jul 2004
Posts: 70

View user's profile Send private message

Help Needed-PIC18F8722 and Extended Memory
PostPosted: Fri Jan 02, 2009 11:22 am     Reply with quote

Hi, I have been trying to set up the pic18f8722 with the extended memory to use external flash for program space. I would like the flash in the chip to fill with program code and then flow over into the external flash with what is left. I have read through a lot of posts on this forum and i am not sure if i am understanding the whole picture. I am using the PIC18F8722 development kit from CCS to prototype what i am doing for my design. From other posts on this forum i have gathered that i need to set the fuses to EMCU, create a new device that has the sum of the internal memory and external memory, make a new *.h file that contains this new device. Also, it appears that i need to use the #build and #org functions in my program, but that is where i get confused as to why and how to set them up. I have attached a test program that i want to load into the external flash. When i do this on my board, the board does nothing or i get errors that the verify has failed because locations 0x20000 and above have 00 instead of valid information. Does my program logic make sense? Am i missing something in the set up?
Code:

#include <18F8722EX.h>
#device adc=10

#FUSES WDT                    //No Watch Dog Timer
#FUSES WDT128                   //Watch Dog Timer uses 1:128 Postscale
#FUSES HS                       //High speed Osc (> 4mhz)
#FUSES NOPROTECT                //Code not protected from reading
//#FUSES NOBROWNOUT               //No brownout reset
#FUSES BROWNOUT                  //BROWN OUT ON
#FUSES BORV27                    //RESET VOLTAGE AT 2.7V
//#FUSES BORV42                    //RESET VOLTAGE AT 4.2V
//#FUSES BORV25                   //Brownout reset at 2.5V
#FUSES NOPUT                    //No Power Up Timer
#FUSES NOCPD                    //No EE protection
#FUSES STVREN                   //Stack full/underflow will cause reset
#FUSES NODEBUG                  //No Debug mode for ICD
#FUSES NOLVP                    //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOWRT                    //Program memory not write protected
#FUSES NOWRTD                   //Data EEPROM not write protected
#FUSES IESO                     //Internal External Switch Over mode enabled
#FUSES FCMEN                    //Fail-safe clock monitor enabled
//#FUSES PBADEN                   //PORTB pins are configured as analog input channels on RESET
#FUSES NOWRTC                   //configuration not registers write protected
#FUSES NOWRTB                   //Boot block not write protected
#FUSES NOEBTR                   //Memory not protected from table reads
#FUSES NOEBTRB                  //Boot block not protected from table reads
#FUSES NOCPB                    //No Boot Block code protection
//#FUSES LPT1OSC                  //Timer1 configured for low-power operation
#FUSES MCLR                     //Master Clear pin enabled
#FUSES NOXINST                  //Extended set extension and Indexed Addressing mode enabled
#FUSES EMCU
#FUSES ABW20
#FUSES BW16


#include <stdio.h>
#include <math.h>
#include "Z:\Projects\132-Rawson\07-012 AccurateII\Code\Extended Memory\at29c1024.c"
#include "Z:\Projects\132-Rawson\07-012 AccurateII\Code\Extended Memory\bootloader.h"
#include <stdlib.h>

#use delay(clock=20000000,RESTART_WDT)


#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8,RESTART_WDT,ERRORS,stream=SP1)

//#build (memory=0x20000:0x3FFFF)


int count,count_read;
#org 0x20000
void main()
{
   //init_ext_flash_memory();
   count=0;
   while(true)
   {
   //count_read=read_ext_flash_memory(0x50);
   fprintf(SP1,"%c",count_read);
   delay_ms(500);
   count++;
   //write_ext_flash_memory(0x50,count);
   }
}
[/code]
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Fri Jan 02, 2009 1:23 pm     Reply with quote

I see, that all #org statements referencing memory above 0x20000 are causing an error. Thus I wonder if PIC18F8722 extended program memory is supported at all by PCH? You should ask CCS.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group