Jump to content

Recommended Posts

Hi,

 

As a new user of BoostC I am running into some problems:

 

1) I had assmebly code I could include in Cc5x to save registers during interrupt (W, STATUS and PCLATCH). I have been unsucessful in finding replacement code for a PIC16F870. Any ideas ?

 

2) In Cc5x interrupt routines, the statement "#pragma origin 4". What is the replacement statement foor BoostC?

 

3) PIC configuration statements for Cc5x are:

#pragma config WDTE=0, PWRTE=0, FOSC=XT

#pragma config |= 0x3F71

#pragma config ID=0xe001

 

What are the equivalent statements for BoostC?

 

If anyone could help, than I would truely appreciate it. I am sure these are questions that many Cc5x converts run into.

 

In general I find the IDE environment great, and it really speeds up coding and debugging.

 

Kind regards,

Mark Paanakker

Link to post
Share on other sites

Mark,

 

1) I had assmebly code I could include in Cc5x to save registers during interrupt (W, STATUS and PCLATCH). I have been unsucessful in finding replacement code for a PIC16F870. Any ideas ?
A function declared as void interrupt () will be hooked into the interrupt vector and do the context saving automatically :(

 

2) In Cc5x interrupt routines, the statement "#pragma origin 4". What is the replacement statement foor BoostC?
the void interrupt() function on a PIC16 is hooked into this interrupt vector, so you wont need this pragma.

 

 

3) PIC configuration statements for Cc5x are:

#pragma config WDTE=0, PWRTE=0, FOSC=XT

#pragma config |= 0x3F71

#pragma config ID=0xe001

for this use format to set configuration:

#pragma DATA _CONFIG, _CP_OFF & _PWRTE_OFF & _WDT_OFF & _HS_OSC

to set device ID, you will need:

#pragma DATA xxxx, 0xE001

replace xxxx with the programming address of the device ID.

 

Regards

Dave

Link to post
Share on other sites

Mark,

 

1) I had assmebly code I could include in Cc5x to save registers during interrupt (W, STATUS and PCLATCH). I have been unsucessful in finding replacement code for a PIC16F870. Any ideas ?
A function declared as void interrupt () will be hooked into the interrupt vector and do the context saving automatically :(

 

2) In Cc5x interrupt routines, the statement "#pragma origin 4". What is the replacement statement foor BoostC?
the void interrupt() function on a PIC16 is hooked into this interrupt vector, so you wont need this pragma.

 

 

3) PIC configuration statements for Cc5x are:

#pragma config WDTE=0, PWRTE=0, FOSC=XT

#pragma config |= 0x3F71

#pragma config ID=0xe001

for this use format to set configuration:

#pragma DATA _CONFIG, _CP_OFF & _PWRTE_OFF & _WDT_OFF & _HS_OSC

to set device ID, you will need:

#pragma DATA xxxx, 0xE001

replace xxxx with the programming address of the device ID.

 

Regards

Dave

Link to post
Share on other sites

Hi Dave,

 

Thanks for your help ! I appreciate it.

 

Could you explain a litte more wrt:

 

" for this use format to set configuration:

#pragma DATA _CONFIG, _CP_OFF & _PWRTE_OFF & _WDT_OFF & _HS_OSC

to set device ID, you will need:

#pragma DATA xxxx, 0xE001

replace xxxx with the programming address of the device ID."

 

My additional questions:

 

1) What is the device ID? What kind of ID is 0xe001? How do I find the right adress ?

2) #pragma DATA _CONFIG, _CP_OFF & _PWRTE_OFF & _WDT_OFF & _HS_OSC is the equivalent of #pragma config |= 0x3F71

 

Thanks,

Mark

Link to post
Share on other sites

Mark,

 

1) What is the device ID? What kind of ID is 0xe001? How do I find the right adress ?

#pragma DATA 0x2000, // Add you ID data here config 0x2000-0x2003

See microchip data sheet 39589b.pdf.

 

2) #pragma DATA _CONFIG, _CP_OFF & _PWRTE_OFF & _WDT_OFF & _HS_OSC is the equivalent of #pragma config |= 0x3F71

This was only meant to be an example, so its probably not the configuration you want.

 

Regards

Dave

Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...