please dont rip this site

Piclist Jal Jpwm

-- 
--         file     : jPWMpin.jal
--       author     : Branko Karaklajic
--         date     : 21-MAY-2000
--      purpose     : PWM-Output on PIC pin
--     requires     : jPWMpin.jal
--
-- Copyright (C) 2000 Branko Karaklajic, branek@eunet.yu
--
-- This library is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Library General Public
-- License as published by the Free Software Foundation; either
-- version 2 of the License, or (at your option) any later version.
--
-- This library is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-- Library General Public License for more details.
-- 
-- You should have received a copy of the GNU Library General Public
-- License along with this library; if not, write to the
-- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-- Boston, MA  02111-1307, USA.

include jPWMpin

procedure PWM_OUT(byte in PWM, byte in TRA) is

var byte LoPWM
var byte HiPWM
PWM_out_pin_direction = output

assembler
	
	local PWMa
	local PWMb
	local PWMtra
	local PWMend

	bsf status, status_rp0
	movlw 0b_1000_0011
	OPTION
	bcf status, status_rp0
	movf PWM, W   
        movwf LoPWM
	sublw 0xFF         
        movwf HiPWM

PWMa:
	bcf INTCON, intcon_t0if
	movf HiPWM, W
	movwf TMR0
PWMb:
        bsf PWM_out_pin
	call PWMtra
	bcf INTCON, intcon_t0if
	movf LoPWM, W
	movwf TMR0
	bcf PWM_out_pin
	call PWMtra
	decfsz TRA,f
	goto PWMa
	goto PWMend


PWMtra:
	btfss INTCON, intcon_t0if
	goto PWMtra
	return
	
PWMend:

end assembler

PWM_out_pin_direction = input

end procedure

file: /Techref/piclist/jal/jPWM.jal, 1KB, , updated: 2000/8/15 11:02, local time: 2017/10/19 06:27,
TOP NEW HELP FIND: 
54.80.211.135:LOG IN

 ©2017 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE! / 

<A HREF="http://www.piclist.com/techref/piclist/jal/jPWM.jal"> piclist jal jPWM</A>

Did you find what you needed?

  PICList 2017 contributors:
o List host: MIT, Site host massmind.org, Top posters @20171019 RussellMc, Van Horn, David, James Cameron, Sean Breheny, IVP, alan.b.pearce, Neil, David C Brown, Bob Blick, Denny Esterline,
* Page Editors: James Newton, David Cary, and YOU!
* Roman Black of Black Robotics donates from sales of Linistep stepper controller kits.
* Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters.
* Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated!
* Contributors: Richard Seriani, Sr.
 

Welcome to www.piclist.com!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .