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

PIC18F8722 port problem

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



Joined: 07 Jul 2009
Posts: 1

View user's profile Send private message

PIC18F8722 port problem
PostPosted: Tue Jul 07, 2009 2:02 pm     Reply with quote

Hello,

I've a problem with my new PIC18F8722 board. This board has a parallel bus implemented on port J. If i try to write to port J in my main routine the levels on the port J pins are ok. So now my problem: If i take the same code but packed in a function with a int8 parameter value, the ouput of port j is anything but not the parameter value. fast_io on port j is enabled, uC-mode is selected (control ports of external memory on port j). The lst-file seems to be ok, the assembler code looks like it should be.
I previously worked on a PIC16F887 and the code worked fine. Is there anything to be aware of when migrating to a PIC18/PCH?

Thanks for your replies!

Code:

// -- fuses  ---------------
#FUSES NOWDT                    //No Watch Dog Timer
#FUSES WDT128                   //Watch Dog Timer uses 1:128 Postscale
#FUSES H4                       //High speed osc with HW enabled 4X PLL
#FUSES NOPROTECT                //Code not protected from reading
#FUSES IESO                     //Internal External Switch Over mode enabled
#FUSES BROWNOUT                 //Reset when brownout detected
#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 NOCPB                    //No Boot Block code protection
#FUSES NOEBTRB                  //Boot block not protected from table reads
#FUSES NOEBTR                   //Memory not protected from table reads
#FUSES NOWRTD                   //Data EEPROM not write protected
#FUSES NOWRTC                   //configuration not registers write protected
#FUSES NOWRTB                   //Boot block not write protected
#FUSES FCMEN                    //Fail-safe clock monitor enabled
#FUSES NOLPT1OSC                //Timer1 configured for higher power operation
#FUSES NOMCLR                   //Master Clear pin used for I/O
#FUSES XINST                    //Extended set extension and Indexed Addressing mode enabled
#FUSES MCU                      //Microcontroller Mode
#FUSES WAIT                     //Wait selections for Table Reads and Table Writes
#FUSES BW16                     //16-bit external bus mode
#FUSES ABW20                    //20-bit Address bus
#FUSES ECCPE                    //Enhanced CCP PWM outpts multiplexed with RE6 thorugh RE3
#FUSES CCP2E7                   //CCP2 input/output multiplexed with RE7

// -- fast io config  ---------------

#use fast_io(a)
#use fast_io(b)
#use fast_io(c)
#use fast_io(d)
#use fast_io(e)
#use fast_io(f)
#use fast_io(g)
#use fast_io(h)
#use fast_io(j)

// -- I/O-pin defines  ---------------

//peripheral bus
#define Ph_E   PIN_H0
#define Ph_RW  PIN_H1
#define Ph_RS  PIN_H2

// -- section of call in main ------------------

int8 i=0;
i=0x03;
pbus_write(i);

// -- pbus_write(value): writes value to parallel bus ------------------
void pbus_write(int8 val){
   output_j(val);
   output_bit(Ph_E,1);
   #ASM
   //NOP                //timing also ok without delay
   //NOP
   //NOP
   #ENDASM
   output_bit(Ph_E,0);
   }
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Jul 07, 2009 2:47 pm     Reply with quote

Quote:

If i take the same code but packed in a function with a int8 parameter value, the ouput of port j is anything but not the parameter value.

#FUSES XINST

The extended instruction set is not supported by CCS. Enabling it
will cause erratic results in your program. Change it to NOXINST.
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