asdf85
Joined: 03 Jan 2011 Posts: 34
|
Problems using dspic33e |
Posted: Tue Sep 04, 2012 5:11 am |
|
|
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 |
|