Yes, the library is in SF BASIC. Makes it real easy to extend and/or modify to suit.
Yes, the library is in SF BASIC. Makes it real easy to extend and/or modify to suit.
I totally agree, but it's not much use unless you own the compiler. PBP libraries are pure
assembler. You can modify them as needed, learn asembler by understanding them, and
cut/paste sections into your own assembler programs.
And of course PBP supports the whole PIC series unlike Swordfish or C18, which are only
for 18F parts, and very limiting.
Most C compilers have open libraries as well, but it's not anything like the PBP library where
you have the assembly language equivalent of each command. Huge difference.
I wrote a small program , mostly copied it from one of the post here. it works but the frequency it gives me is 2,2kHz when I program 500hz, I am doing a HPWM: using picF88.
can someone help me?
INCLUDE "modedefs.bas"
@ DEVICE PIC16F88 , HS_OSC , WDT_OFF , PWRT_ON , BOD_ON , LVP_OFF , PROTECT_OFF, CCPMX_OFF
'HS 20mhz, watchdog off, powerup timer on, mclr external, brown out detect on, low volt program off , code protect off
DEFINE OSC 20 'use external 20mhz crystal
PAUSE 100 ' start-up delay
TRISB=0
DEFINE CCP1_REG PORTB
DEFINE CCP1_BIT 3
HPWM 1,127,500
HERE: GOTO HERE
end
Hi,
I think you are hitting the bottom of the frequency range for that oscillator speed, try changing to 4Mhz x-tal.
EDIT: Just checked the manual....with a 20Mhz clock the lowest HPWM frequency is stated as 1221Hz for the 14bit core PICs - isn't the F88 a 14bit PIC? Don't know why you'd get 2.2kHz.....
/Henrik.
Rmteo..
you mentionned earlier
"A better solution would be to use a PIC with an ECCP (Enhanced Compare Capture) module. Many of the newer PIC's have this feature. Set it up to operate in Half-Bridge mode and you will get a PWM signal on the P1A pin and a complementary signal on P1B. Plus you can control the programmable dead-band delay which is used to prevent shoot-through current in half-bridge devices."
I understand what a half bridge is, but I am bit confused about configuring the pic in half bridge mode.. what do you mean by that?
So far I added an inverter at my HPWM output, I would still like to get two ports, I ordered chips which includes the eccp mode.
K
From the PIC16F690 datasheet:
REGISTER 11-1: CCP1CON: ENHANCED CCP1 CONTROL REGISTER
bit 7-6 P1M<1:0>: PWM Output Configuration bits
If CCP1M<3:2> = 00, 01, 10:
xx = P1A assigned as Capture/Compare input; P1B, P1C, P1D assigned as port pins
If CCP1M<3:2> = 11:
00 = Single output; P1A modulated; P1B, P1C, P1D assigned as port pins
01 = Full-Bridge output forward; P1D modulated; P1A active; P1B, P1C inactive
10 = Half-Bridge output; P1A, P1B modulated with dead-band control; P1C, P1D assigned as port pins
11 = Full-Bridge output reverse; P1B modulated; P1C active; P1A, P1D inactive
Bookmarks