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

Problems using dspic33e

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



Joined: 03 Jan 2011
Posts: 34

View user's profile Send private message

Problems using dspic33e
PostPosted: Tue Sep 04, 2012 5:11 am     Reply with quote

Hi,

I have 2 problems i'm facing using the dspic33EP64MC502.
Firstly, I'm using the ccs compiler version 4.130

My first problem is that I'm unsure how to set the clock. According to the datasheet, I should be able to set the dspic to run at 70MIPS. However i cant seem to achieve anything close to that.

I tried setting it up this way
Code:
#fuses HS,NOWDT,NOPROTECT
#use delay(clock=100000000, crystal=20MHz )


Shouldn't that have given me a 50MIPS? But in actual fact, i only get about 25MIPS. Could I get some assistance in setting up the frequency, using both the internal oscillator and a crystal..


My 2nd problem is that, whenever I call an interrupt routine, even when there is no C commands in the interrupt service routine, there seems to be many instructions when I view the assembly code.

Code:
68:                #INT_TIMER1
69:                void timer2_isr()
  0282  FE4000     pwrsav #0
70:                {
  0200  F80042     push.w 0x0042
  0202  F80036     push.w 0x0036
  0204  781F80     mov.w 0x0000,[0x001e++]
  0206  200020     mov.w #0x2,0x0000
  0208  09000C     repeat #12
  020A  781FB0     mov.w [0x0000++],[0x001e++]
              
  020C  A96800     bclr.b 0x0800,#3
  020E  2001A0     mov.w #0x1a,0x0000
  0210  09000C     repeat #12
  0212  78104F     mov.w [--0x001e],[0x0000--]
  0214  78004F     mov.w [--0x001e],0x0000
  0216  F90036     pop.w 0x0036
  0218  F90042     pop.w 0x0042
  021A  064000     retfie


Can anyone tell me why this is happening?
Thanks alot
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