Henrik,
The problem was that I did not set
the ANSEL0 register to digital i/o.
Great tip on counter overflow.
I will definately incorporate.
Thank You again.
Richard
Henrik,
The problem was that I did not set
the ANSEL0 register to digital i/o.
Great tip on counter overflow.
I will definately incorporate.
Thank You again.
Richard
Isn't that an awesome controller? The motion feedback module with pulse width & frequency measurement is really handy.
Note: On the 28-pin version, forget using RE3 as an input. I tried, and submitted a support ticket to Microchip. Here's what I received back;
RE3 pin in PIC18F2331/2431 has been removed as a digital input. Hence, pin no. 1 of PIC18F2331/2431 can be used for MCLR/ Vpp only.
This change will be notified in a datasheet's (DS39616B.pdf) future update.
Last edited by Bruce; - 19th February 2007 at 23:36.
Hi Bruce,
Thank you for info regarding RE3/MCLR as input.
It sure is a cool device. Using Darrel's interupt routines I managed to get motor controller for my robot working, with PID filter and all. Very fun project.
However.....I never managed to get QEI module going in velocity mode. I made a few attempts to begin with but could never quite figure it out so I went for my own velocity calcs (newPos-oldPos). Any pointers?
Thanks!
/Henrik Olsson.
Hi Henrik,
I haven't messed with QEI yet, but if I do get something going, I'll port it from C to PBP and post it here.
My primary interest in this one was the new high-speed A/D, and motion feedback module for background pulse & freq measurements.
Hi!
i got hold of Microchip PICDEm MC LV board with 3-phase BLDC motor.It has a CD that conatins source code in assembly. I was wondering if someone has done same thing in pic basic i.e used power PWM module of 18F4431.I tried according to application note but to no avail. Here is my code.could someone point me out in right direction.some code snipet would be appreciated.
thanks
while true
PTCON0=00000000 'page 8,step 1
PTPERL=$37 'a guess
PTPERH=$01
PWMCON0=01001111 'step 3
PWMCON1=00000001 'step 4
DTCON=00000000 ' a guess
OVDCOND=00000000 'step 6
OVDCONS=00000000
FLTCONFIG=00000000
'POVD=00000000
'SEVTCMP=$0000
'step 8
SEVTCMPL=$00
SEVTCMPH=$00
PDC0L=$00
PDC0H=$00
PDC1L=$00
PDC1H=$00
PDC2L=$00
PDC2H=$00
PDC3L=$00
PDC3H=$00
TRISC.0=1
PTCON1=10000000 'or PTCON1.7=1
wend
Hi!
i got hold of Microchip PICDEm MC LV board with 3-phase BLDC motor.It has a CD that conatins source code in assembly. I was wondering if someone has done same thing in pic basic i.e used power PWM module of 18F4431.I tried according to application note but to no avail. Here is my code.could someone point me out in right direction.some code snipet would be appreciated.
thanks
while true
PTCON0=00000000 'page 8,step 1
PTPERL=$37 'a guess
PTPERH=$01
PWMCON0=01001111 'step 3
PWMCON1=00000001 'step 4
DTCON=00000000 ' a guess
OVDCOND=00000000 'step 6
OVDCONS=00000000
FLTCONFIG=00000000
'POVD=00000000
'SEVTCMP=$0000
'step 8
SEVTCMPL=$00
SEVTCMPH=$00
PDC0L=$00
PDC0H=$00
PDC1L=$00
PDC1H=$00
PDC2L=$00
PDC2H=$00
PDC3L=$00
PDC3H=$00
TRISC.0=1
PTCON1=10000000 'or PTCON1.7=1
wend
I wish I could help but I am using the 18F4431 in a completely
different manner.
Richard
Bookmarks