PDA

View Full Version : hpwm error



cphillips82
- 25th July 2008, 04:50
Can somebody help me find why the hpwm command doesn't compile in this code. I'm using MCS compiler with PBP 2.47

skimask
- 25th July 2008, 12:31
Can somebody help me find why the hpwm command doesn't compile in this code. I'm using MCS compiler with PBP 2.47
No idea which PIC this is for...or even if said PIC has a PWM module in it...
And these lines:


define ccp1_reg = portb
define ccp1_bit = 0

Put them in CAPs, like the book says, and you'll discover a brand new error, also explained in the HPWM section of the book...
And which PIC, exactly, has a PWM module assigned to PortB.0?

cphillips82
- 26th July 2008, 03:49
A 16f88, Putting In Caps Made No Difference?

Darrel Taylor
- 26th July 2008, 05:13
DEFINE's don't use = signs.


define ccp1_reg = portb
define ccp1_bit = 0

manwolf
- 26th July 2008, 05:25
If you have the datasheet did you notice the note?

Note 1: The CCP1 pin is determined by CCPMX in
Configuration Word 1 register. You have a choice of 1 of 2 pins.

Note: The TRISB bit (0 or 3) is dependant upon
the setting of configuration bit 12 (CCPMX).

Darrel Taylor
- 26th July 2008, 05:31
If you have the datasheet did you notice the note?

Note 1: The CCP1 pin is determined by CCPMX in
Configuration Word 1 register. You have a choice of 1 of 2 pins.

Note: The TRISB bit (0 or 3) is dependant upon
the setting of configuration bit 12 (CCPMX).

And looking further in the datasheet, the default values of CONFIG1 are all 1's, which for the CCPMX bit means CCP1 is on PORTB.0.

I'd bet a LARGE sum of money that it's the equal sign.
<br>

manwolf
- 26th July 2008, 06:28
Darrel

I was not trying to override your suggestion, just asking cpillips82 if he noticed the note. It caught me by surprise is all.

I always bow to your experience. I am lucky if I don't get smoke when I plug something in.

I read every post and see if I can follow through on everything. Turns out I searched the datasheet for the wrong thing. Looked for CCPMX not CONFIG1.

PS NO BET, I be flat broke I play with PICs because they be cheaper than cars! :)

But if you every get down my way I'm always good for at least one beer.

Sorry to butt in cphillips82, I will crawl back into my hole now.

skimask
- 26th July 2008, 06:40
DEFINE's don't use = signs.


define ccp1_reg = portb
define ccp1_bit = 0

That was the brand new error I was talking about...
But now I realize that if a DEFINE isn't recognized and/or used by anything, it won't necessarily flag any sort of error. Just ignored...
Which is why I referred back to the HPWM section of the book...

Darrel Taylor
- 26th July 2008, 07:12
Darrel

I was not trying to override your suggestion
...
I read every post and see if I can follow through on everything.
Exactly what you should do. On both accounts.

Beat me up, prove me wrong, show a better way.
And so will I, in reverse. :)


I will crawl back into my hole now.

Don't even.

cphillips82
- 26th July 2008, 10:40
it was the = sign, thankyou very much.