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 CCS Technical Support

Where can I see PDCxL/H register?

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



Joined: 18 Jul 2005
Posts: 14

View user's profile Send private message

Where can I see PDCxL/H register?
PostPosted: Wed Aug 24, 2005 3:30 pm     Reply with quote

Hello.

I am trying to use pwm.
However, there is no signal.
I was trying to use both of assm and c but no result...

now, I am trying to see PDCxL/H, but I do not find where it is.
(I am using ICD-U)
because when I use assm

If I do like this
movf SPEED_REF,W;
movwf PDC0H
movwf PDC1H
movwf PDC2H
movwf PDC3H

PDCOH=0 and PDC1H=0 even if W=0x30

Is there any idea about this problem?
skyforme



Joined: 18 Jul 2005
Posts: 14

View user's profile Send private message

PostPosted: Wed Aug 24, 2005 3:47 pm     Reply with quote

OOPS

I forgot to say this one..My chip is 18f4431 and I am trying to use power pwm.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Aug 24, 2005 4:04 pm     Reply with quote

Quote:
movwf PDC0H
I am trying to see PDCxL/H, but I do not find where it is.

See my post about declaring register addresses with the #byte statement
in this previous thread:
http://www.ccsinfo.com/forum/viewtopic.php?t=24116
skyforme



Joined: 18 Jul 2005
Posts: 14

View user's profile Send private message

PostPosted: Wed Aug 24, 2005 4:48 pm     Reply with quote

Hello

Thank you for your reply first.
However, I double checked about the command and even the example say like this.


int find_parity (int data) {



int count;

#asm

movlw 0x8

movwf count

movlw 0

loop:

xorwf data,w

rrf data,f

decfsz count,f

goto loop

movwf _return_

#endasm

}


and I declared w and others in the *.h file.
so I don't think that it is not parameter problem.
(however, I used #locate not #byte,
can it be problem?)


Thank you
skyforme



Joined: 18 Jul 2005
Posts: 14

View user's profile Send private message

PostPosted: Wed Aug 24, 2005 4:54 pm     Reply with quote

Hello

Thank you for your reply first.
However, I double checked about the command and even the example say like this.


int find_parity (int data) {



int count;

#asm

movlw 0x8

movwf count

movlw 0

loop:

xorwf data,w

rrf data,f

decfsz count,f

goto loop

movwf _return_

#endasm

}


and I declared w and others in the *.h file.
so I don't think that it is not parameter problem.
(however, I used #locate not #byte,
can it be problem?)


Thank you
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Aug 24, 2005 5:12 pm     Reply with quote

Here's an example.
Code:
#include <18F4431.h>
#fuses XT, NOWDT, NOPROTECT,PUT,BROWNOUT,NOLVP
#use delay(clock=4000000)

#define SPEED_REF 0x55
#byte PDC0H = 0xF78

void main()
{

#asm
movf SPEED_REF,W
movwf PDC0H
#endasm

while(1);
}

You seem to be using the CCS compiler only for assembly.
Did you know that Microchip MPLAB comes with a PIC assembler ?
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en019469
MPASM forum:
http://forum.microchip.com/tt.asp?forumid=16
skyforme



Joined: 18 Jul 2005
Posts: 14

View user's profile Send private message

PostPosted: Wed Aug 24, 2005 7:18 pm     Reply with quote

Hello

Thank you very much about your link.
However, I know the mplab and I like it.

and thank you for your code, too.
maybe, some interrupt or other things corrupt my code
I will look up it again.

Anyway, I just double checked because the power pwm command didn't work for me, I feel more comfortable with c code.

and my question was
I could not fine some sfrs related to pwm in the Peripheral tab
in side menu of thd ICD debugger mode.
and ICD is quite slow if I try to read Peripherals - is it ok?

anyway, so I tried to see some sfrs by using assembler..
so where can I see them?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Aug 24, 2005 7:52 pm     Reply with quote

Quote:
I just double checked because the power pwm command didn't work for me

Do you have the latest version of the compiler ? (PCH vs. 3.232)
It has this example file: EX_POWER_PWM.C
It shows a basic example of how to use the CCS power pwm functions.

Look for it in this folder: c:\Program Files\Picc\Examples
skyforme



Joined: 18 Jul 2005
Posts: 14

View user's profile Send private message

PostPosted: Wed Aug 24, 2005 8:06 pm     Reply with quote

Unfortunately, my version is 3.228.

I was wondering why there was no example..
yes that's the reason..

anyway, when did it come out? I upgraded june 14th..
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Aug 24, 2005 8:25 pm     Reply with quote

I think it came out today.

If you can't download the latest version, then email CCS support
and ask them if they will email that example file to you.
skyforme



Joined: 18 Jul 2005
Posts: 14

View user's profile Send private message

PostPosted: Wed Aug 24, 2005 8:39 pm     Reply with quote

wow
thank you very much.
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