Welcome
Welcome to PICPROJECTS Support Forum

We only provide help and support for projects on the PICPROJECTS website. We cannot assist with more general PIC related queries

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access features. By joining the forum, you will have access to post topics. Registration is fast, simple, and absolutely free. Click to join the PICPROJECTS Forum

PWM controller. how do I change the linear map?

Support for the PWM DC Motor Controller project

PWM controller. how do I change the linear map?

Postby thewizardsapprentice on Sat Jul 04, 2009 4:32 pm

Hi all,

I am trying to alter the last 60% of the linear map, so that when the ADC input voltage is zero, the PWM output is zero, but when the ADC is at 20%, then the PWM output is 100% (and stays at 100% all the way to 5V input). I am still very new to programming, and the last time I did anything was on an Amstrad CPC 464 back in 1984..... (so it has been 'a while').

Thanks in advance,

Dave
thewizardsapprentice
 
Posts: 1
Joined: Sat Jul 04, 2009 4:24 pm

Re: PWM controller. how do I change the linear map?

Postby picprojects on Sun Jul 05, 2009 10:35 am

Hi Dave

Try using the attached include file.

Custom_Dave.inc
Custom remap data include file
(5.98 KiB) Downloaded 7 times


In this file the period value is 0 which corresponds to 15.6Khz. Change this from 0 to 1 or 2 if you need a different period for the PWM.
; 0 -> 15.6Khz -> 64uS
; 1 -> 3.8Khz -> 263uS
; 2 -> 980Hz -> 1mS

You will need to add the file name to the bdcm_rempa.asm file by commenting out the existing entry.

; 3rd include -> remapSelect 1 -> LED 1.5Hz
;#include remapData3.inc -< comment this line by adding a semi-colon
;#include remapData4.inc
#include Custom_Dave.inc

Then reassemble to generate the HEX file for the PIC programmer.
User avatar
picprojects
Site Admin
 
Posts: 79
Joined: Fri Mar 27, 2009 9:50 am


cron