<root>
<document schema='101' license='1,Joerg Gueldner,0BBM29' title='' description='' target='PIC16.24F.24FV32KA304' >
	<config data='!0,fff8!10,ffff!20,ff5a!30,ffba!40,ff58!50,ffd7!60,ffff!70,ff3f%0,0%1,4%10,1%11,1%20,2%25,0%26,1%27,0%30,2%32,0%33,3%35,1%36,2%40,8%44,1%45,0%46,1%50,3%52,1%53,0%54,1%55,2%57,1%60,3%67,1%70,f%74,1%76,0%77,0' clkspd='22118400' simspd='1' usewdt='1' constif='0' />
	<plugins >
		<dll_dbg_icd enabled='0' >
			<data name='debug' value='1' />
			<data name='userpins' value='0' />
			<data name='speed' value='0' />
			<data name='usev9' value='0' />
			<data name='breaks' value='8' />
			<data name='stacks' value='8' />
			<data name='clkport' value='1' />
			<data name='clkbit' value='6' />
			<data name='dataport' value='1' />
			<data name='databit' value='7' />
			<data name='ghostype' value='0' />
			<data name='monitor' value='1' />
			<data name='ictloop' value='0' />
			<data name='ictrate' value='20000' />
			<data name='ictmask' value='0' />
			<data name='anlpres' value='255' />
			<data name='digmask1' value='-1' />
			<data name='digmask2' value='-1' />
		</dll_dbg_icd>
		<dll_models enabled='1' />
		<dll_upgrader enabled='1' />
		<dll_webhelp enabled='1' />
	</plugins>
	<supplement use='0' head='' body='' />
	<debug >
		<watch expr='dac_temp_ulong' />
		<watch expr='dac_i_ref_uint2' />
		<watch expr='dac_i_ref_high_uint' />
		<watch expr='dac_i_ref_low_uint' />
		<watch expr='fram_byte' />
		<watch expr='i2c_transceive_byte' />
		<watch expr='fram_address' />
	</debug>
	<components >
		<settings autoimg='1' center='1' unitscale='0' fixedscale='0' fixedx='1' fixedy='1' fixedz='1' headcode='0' />
		<definition guid='' vstate='40' vmin='0' vmaj='1' srcleaf='' visiblename='' description='' category='Misc' catenable='1' author='' manuname='' manucode='' sysinfo='0' keywords='' dynamic='0' iconpath='' />
		<component class_type='root' codename='panel' x='0' y='0' z='0' xsz='0.001' ysz='0.001' zsz='0.001' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='0' poslock='0' >
			<resources />
			<properties />
			<values />
			<events />
			<apis />
			<variables >
				<variable public='0' >
					<def class_type='variable' name='dac_i_ref_uint2' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='l297_clock_bit' type='b1' description='motor frequency' isconst='0' isinit='1' usrinit='1' setinit='1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='i2c_transceive_byte_temp' type='u16' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='dac_i_ref_high_uint' type='u16' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='i2c_switch' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='dac_u_motor_uint' type='u16' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='i2c_transceive_byte' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='i2c_ack' type='u16' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='i2c_clock_speed' type='u8' description='' isconst='0' isinit='1' usrinit='10' setinit='10' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ub_motor_uint' type='u16' description='actual value of motor ub' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='adc_read_uint' type='u16' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='temp_uint' type='u16' description='actual temperature on board' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='dac_temp_ulong' type='u32' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='dac_i_ref_uint' type='u16' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='dac_u_motor_uint2' type='u16' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='i2c_transceive_bit_counter' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='i2c_ack_temp' type='u16' description='' isconst='0' isinit='1' usrinit='1' setinit='1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='dac_u_motor_low_uint' type='u16' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='dac_u_motor_high_uint' type='u16' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='dac_i_ref_low_uint' type='u16' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='_03_int_tmr4' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='comment' title='' comment='old board = 4800hz : 16 counts = 300hz motor frequency

new board
=========
a.) motor = 125 steps
b.) full step clock = 125 x 4 =  500
c.) half step clock = 125 x 8 = 1000' textarea='12,0,12,0' />
						<command class_type='calculation' title='Berechnung' >
							<exp exp='l297_clock_bit = !l297_clock_bit' />
						</command>
						<command class_type='decision' title='Entscheidung' exp='l297_clock_bit = 1' swap='0' >
							<flowline >
								<command class_type='native' title='C-Code' ccode='PORTA |= (1 &lt;&lt; 7); // Hiermit wird ein Bit in x gesetzt
' language='C' />
							</flowline>
							<flowline >
								<command class_type='native' title='C-Code' ccode='
PORTA &amp;= ~(1 &lt;&lt; 7); // Hiermit wird ein Bit in x geloescht' language='C' />
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='_00_setup_pic24FV32KA304' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='native' title='cpu belegung' ccode='/*  i=in(1) o=out(0) a=analog(1) d=digital(0)
a00 i a = section id
a01 i a = ub_motor (an1)
a02 i d = oscillator
a03 o d = oscillator
a04 o d = motor on /off
a05 i d = prog vpp - master clear
a06 / /
a07 o d = led /version

a08 o d = led /1wire
a09 o d = led /step error
a10 o d = led /stop
a11 o d = led /run
a12 / /
a13 / /
a14 / /
a15 / /
*/
TRISA = 0b0000000000100111;
ANSA  = 0b0000000000000011;
PORTA = 0b0000111110100011;

/*
b00 o d = u2tx - 1wire
b01 i d = u2rx - 1wire
b02 i d = t4ck - over current
b03 o d = fram wp
b04 i a = temp (an15)
b05 i d = prog data
b06 i d = prog clk - tandem address
b07 i d = int0 - /start

b08 o d = scl1 - fram
b09 iod = sda1 - fram
b10 o d = dac /ldac
b11 o d = sck1 - dac
b12 o d = dac /cs
b13 o d = sdo1 - dac
b14 i d = int1 - stop
b15 i d = t2ck - f1 f2
*/
TRISB = 0b1100001011110110;
ANSB  = 0b0000000000010000;
PORTB = 0b1101011011110110;

/*
c00 o d = l297d /clock
c01 o d = l297d enable
c02 o d = l297d /reset
c03 i d = l297d home
c04 i d = l297d h /f
c05 o d = ir2104 sd ab
c06 o d = ir2104 sd cd
c07 o d = u1tx prog monitor

c08 o d = ctrl /f1 f2
c09 o d = aux
c10 / /
c11 / /
c12 / /
c13 / /
c14 / /
c15 / /
*/
TRISC = 0b0000000000011000;
ANSC  = 0b0000000000000000;
PORTC = 0b0000000001111000;

' language='C' />
						<command class_type='comment' title='' comment='adc (pot_trim_finger1)--&gt; read ub_motor' textarea='12,0,12,0' />
						<command class_type='call' title='Aufruf Komponenten-Makro --&gt; ub_motor' disable='1' component='pot_trim_finger1' macro='GetInt' >
							<return exp='adc_read_uint' />
						</command>
						<command class_type='call' title='Aufruf Komponenten-Makro --&gt; ub_motor' component='pot_trim_finger1' macro='GetAverageInt' >
							<return exp='adc_read_uint' />
							<argument exp='5' />
							<argument exp='50' />
						</command>
						<command class_type='calculation' title='Berechnung' >
							<exp exp='ub_motor_uint = adc_read_uint // save value' />
						</command>
						<command class_type='interrupt' title='Unterbrechung' enable='1' name='TMR4' call='_03_int_tmr4' >
							<settings timer='1' prescale='8' postscale='-1' rollover='5529' bitcount='-1' trigger='3' maskhi='--------------------------------------------------------------------------------------------------------------------------------------------------------------------------8' masklo='--------------------------------------------------------------------------------------------------------------------------------------------------------------------------8' >
								<option value='0' />
								<option value='1' />
								<option value='5529' />
								<option value='-1' />
							</settings>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='osc1 = extern 22mhz1184
osc2 = intern 08mhz' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='Makro-Aufruf' macro='_00_setup_pic24FV32KA304' />
						<command class_type='loop' title='Schleife' type='0' exp='1' >
							<flowline />
						</command>
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='8462ac99-ca8f-429b-953a-36dbe58ada72' vmin='4' vmaj='1' codename='pot_trim_finger1' x='24' y='48' z='16.123' xsz='80' ysz='80' zsz='107.487' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='1' poslock='1' >
				<resources />
				<properties />
				<values >
					<value target='angle_start' data='225.000000' />
					<value target='angle_sweep' data='270.000000' />
					<value target='color' data='16777215' />
					<value target='ScopeTraces' data='0' />
					<value target='channel' data='4' />
					<value target='vrefvol' data='3300' />
					<value target='vrefop' data='000' />
					<value target='convspd' data='015' />
					<value target='actime' data='40' />
					<value target='bits' data='10' />
					<value target='bitmul' data='0.004883' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='c73616d1-7ad0-45d9-aada-69ccfa4c5efc' vmin='3' vmaj='1' codename='RS232_channel2' x='32' y='192' z='0.755' xsz='150' ysz='60.0001' zsz='1.51' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='CHANNEL' data='002' />
					<value target='BAUD_LIST' data='000' />
					<value target='BAUD' data='9600' />
					<value target='DBITS' data='008' />
					<value target='RETURN' data='000' />
					<value target='ToutVal' data='255' />
					<value target='FLOWEN' data='000' />
					<value target='ECHO' data='000' />
					<value target='TX' data='$PORTB.0' />
					<value target='RX' data='$PORTB.1' />
					<value target='CTS' data='$PORTB.1' />
					<value target='RTS' data='$PORTB.2' />
					<value target='TXRemap' data='' />
					<value target='RXRemap' data='' />
					<value target='label' data='RS232' />
					<value target='ScopeTraces' data='0' />
					<value target='ConsoleData' data='0' />
					<value target='ConsoleColumns' data='64' />
					<value target='DataSource' data='001' />
					<value target='com_port' data='003' />
					<value target='Injector' data='000' />
					<value target='InjectorHandle' data='' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='96862c4d-debc-45fa-9433-74711a4b9a3b' vmin='3' vmaj='1' codename='SPI_Master1' x='32' y='344' z='0.755' xsz='150' ysz='60.0001' zsz='1.51' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='CHANNEL' data='001' />
					<value target='PR_SCALE' data='016' />
					<value target='CKP' data='001' />
					<value target='CKE' data='000' />
					<value target='SMP' data='000' />
					<value target='MOSI' data='$PORTB.13' />
					<value target='MISO' data='$PORTB.10' />
					<value target='CLK' data='$PORTB.11' />
					<value target='MosiRemap' data='' />
					<value target='MisoRemap' data='' />
					<value target='ClkRemap' data='' />
					<value target='label' data='SPI  Master' />
					<value target='ScopeTraces' data='0' />
					<value target='ConsoleData' data='0' />
					<value target='Injector' data='000' />
					<value target='InjectorHandle' data='0' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='text' codename='label_12' x='32' y='112' z='0' xsz='30.4569' ysz='40' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='Color' data='5767167' />
					<value target='Background' data='-1' />
					<value target='Font' data='Arial' />
					<value target='Text' data='ub_motor (1)' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='text' codename='label_11' x='32' y='248' z='0' xsz='39.5062' ysz='40' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='Color' data='5767167' />
					<value target='Background' data='-1' />
					<value target='Font' data='Arial' />
					<value target='Text' data='1wire' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='text' codename='label_10' x='32' y='400' z='0' xsz='43.6364' ysz='40' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='Color' data='5767167' />
					<value target='Background' data='-1' />
					<value target='Font' data='Arial' />
					<value target='Text' data='dac' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='dfb4d07a-3d70-45d5-83ef-07e3c95d86ab' vmin='4' vmaj='1' codename='lut1' x='0' y='0' z='0' xsz='25' ysz='25' zsz='25' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='0' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='intfixed' data='1, 2, 3, 4, 5' />
					<value target='floatfixed' data='' />
					<value target='fixedexp' data='0' />
					<value target='EmbedIntoC' data='1' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
		</component>
	</components>
	<keymap />
	<panel2d shadows='0' lighting='2' brightness='0' perspective='0' >
		<background rgb='9737364' img='' style='0' />
		<camera xe='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
	</panel2d>
	<panel3d shadows='0' lighting='2' brightness='0' perspective='0' >
		<background rgb='8409120' img='' style='0' />
		<table rgb='7360576' img='' style='0' size='25' />
		<camera xe='0' ye='0' ze='210.495' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
	</panel3d>
	<layout >
		<view type='0' name='_00_setup_pic24FV32KA304' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAAqQUAAJADAAA' zoom='75' scrollx='0' scrolly='460' flags='0' />
		<view type='0' name='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAAqQUAAJADAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='_03_int_tmr4' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAAqQUAAJADAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
