<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>MEL PICBASIC Forum - mel PIC BASIC Pro</title>
		<link>https://www.picbasic.co.uk/forum/</link>
		<description>Discussion area for microEngineeringLabs Pic Basic Pro Compiler</description>
		<language>en</language>
		<lastBuildDate>Sat, 07 Mar 2026 08:07:11 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>https://www.picbasic.co.uk/forum/images/misc/rss.png</url>
			<title>MEL PICBASIC Forum - mel PIC BASIC Pro</title>
			<link>https://www.picbasic.co.uk/forum/</link>
		</image>
		<item>
			<title>WORDs count at compile/assembly time</title>
			<link>https://www.picbasic.co.uk/forum/showthread.php/27111-WORDs-count-at-compile-assembly-time?goto=newpost</link>
			<pubDate>Wed, 25 Feb 2026 16:23:49 GMT</pubDate>
			<description><![CDATA[Hi, 
 
I'm searching the way to get the number of WORDs used by a code like one can see it in MCS: 
Attachment 10042...]]></description>
			<content:encoded><![CDATA[<div>Hi,<br />
<br />
I'm searching the way to get the number of WORDs used by a code like one can see it in MCS:<br />
<a href="https://www.picbasic.co.uk/forum/attachment.php?attachmentid=10042"  title="Name:  
Views: 
Size:  ">Attachment 10042</a><br />
<br />
<br />
Any idea how to get this information?</div>


	<div style="padding:10px">

	

	
		<fieldset class="fieldset">
			<legend>Attached Images</legend>
			<div style="padding:10pxpx">
			<img class="attach" src="https://www.picbasic.co.uk/forum/attachment.php?attachmentid=10042&amp;stc=1&amp;d=1772036570" alt="" />&nbsp;
			</div>
		</fieldset>
	

	

	

	</div>
]]></content:encoded>
			<category domain="https://www.picbasic.co.uk/forum/forumdisplay.php/4-mel-PIC-BASIC-Pro">mel PIC BASIC Pro</category>
			<dc:creator>flotulopex</dc:creator>
			<guid isPermaLink="true">https://www.picbasic.co.uk/forum/showthread.php/27111-WORDs-count-at-compile-assembly-time</guid>
		</item>
		<item>
			<title>160 byte framebuffer at 50 fps, internal RAM or external SRAM?</title>
			<link>https://www.picbasic.co.uk/forum/showthread.php/27110-160-byte-framebuffer-at-50-fps-internal-RAM-or-external-SRAM?goto=newpost</link>
			<pubDate>Fri, 20 Feb 2026 05:11:29 GMT</pubDate>
			<description><![CDATA[Hello. 
I'm doing a graphic project, where content of WS0010b OLED display will be updated really fast, 50fps at least. 
The framebuffer size is 160...]]></description>
			<content:encoded><![CDATA[<div>Hello.<br />
I'm doing a graphic project, where content of WS0010b OLED display will be updated really fast, 50fps at least.<br />
The framebuffer size is 160 bytes. Will PBPs arraywrite/arrayread operations provide enough speed at 18F running at 64mhz, to read and write that array at that speed, or better to use external, parallel SRAM for that?</div>

]]></content:encoded>
			<category domain="https://www.picbasic.co.uk/forum/forumdisplay.php/4-mel-PIC-BASIC-Pro">mel PIC BASIC Pro</category>
			<dc:creator>CuriousOne</dc:creator>
			<guid isPermaLink="true">https://www.picbasic.co.uk/forum/showthread.php/27110-160-byte-framebuffer-at-50-fps-internal-RAM-or-external-SRAM</guid>
		</item>
		<item>
			<title>Command Line operation ni a BATCH file</title>
			<link>https://www.picbasic.co.uk/forum/showthread.php/27109-Command-Line-operation-ni-a-BATCH-file?goto=newpost</link>
			<pubDate>Mon, 16 Feb 2026 19:02:11 GMT</pubDate>
			<description><![CDATA[Hi All, 
 
I'd like to launch the compiler/assembler and the PICKit3 programmer, all in COMMAND LINE mode, in a DOS batch file. 
 
Unfortunately, I'm...]]></description>
			<content:encoded><![CDATA[<div>Hi All,<br />
<br />
I'd like to launch the compiler/assembler and the PICKit3 programmer, all in COMMAND LINE mode, in a DOS batch file.<br />
<br />
Unfortunately, I'm getting error messages at compile/assemble time.<br />
<br />
According to Melanie's posts, I have programmed my batch file as here (the PICKit part is left out for now):<br />
<div class="bbcode_container">
	<div class="bbcode_description">Quote:</div>
	<div class="bbcode_quote printable">
		<hr />
		
			Path C:\Program Files (x86)\PBP3_1;C:\Program Files (x86)\PBP3_1\temp<br />
PBPX -p16F690 -aMPASMX Blink_16F690.pbp -v
			
		<hr />
	</div>
</div><br />
Obviously, my PBP3 compiler's location is &quot;C:\Program Files (x86)\PBP3_1&quot; and the assembler's one is C:\Program Files (x86)\PBP3_1\temp.<br />
<br />
Launching the BATCH file, I'll get these messages:<br />
<a href="https://www.picbasic.co.uk/forum/attachment.php?attachmentid=10039"  title="Name:  
Views: 
Size:  ">Attachment 10039</a><a href="https://www.picbasic.co.uk/forum/attachment.php?attachmentid=10040"  title="Name:  
Views: 
Size:  ">Attachment 10040</a><br />
<br />
<br />
I get 5 &quot;Access violation&quot; errror windows I can clear and at final, everything seems okay = every thing works (I get the HEX file I can send to the PIC).<br />
<br />
Any idea how I can make things work the &quot;clean way&quot; please?</div>


	<div style="padding:10px">

	

	
		<fieldset class="fieldset">
			<legend>Attached Images</legend>
			<div style="padding:10pxpx">
			<img class="attach" src="https://www.picbasic.co.uk/forum/attachment.php?attachmentid=10040&amp;stc=1&amp;d=1771268310" alt="" />&nbsp;<img class="attach" src="https://www.picbasic.co.uk/forum/attachment.php?attachmentid=10039&amp;stc=1&amp;d=1771268277" alt="" />&nbsp;
			</div>
		</fieldset>
	

	

	

	</div>
]]></content:encoded>
			<category domain="https://www.picbasic.co.uk/forum/forumdisplay.php/4-mel-PIC-BASIC-Pro">mel PIC BASIC Pro</category>
			<dc:creator>flotulopex</dc:creator>
			<guid isPermaLink="true">https://www.picbasic.co.uk/forum/showthread.php/27109-Command-Line-operation-ni-a-BATCH-file</guid>
		</item>
		<item>
			<title>Converting PBP interrupt to ASM - 18F25K20</title>
			<link>https://www.picbasic.co.uk/forum/showthread.php/27106-Converting-PBP-interrupt-to-ASM-18F25K20?goto=newpost</link>
			<pubDate>Thu, 12 Feb 2026 17:10:48 GMT</pubDate>
			<description><![CDATA[I have a couple interrupt routines using DT's instant interrupts in PBP that I'd like to convert to asm to reduce execution time.  One of the ISRs...]]></description>
			<content:encoded><![CDATA[<div>I have a couple interrupt routines using DT's instant interrupts in PBP that I'd like to convert to asm to reduce execution time.  One of the ISRs uses an external interrupt to time pulses and store the results in an array (<b>ppm</b>) and increments to the array index (<b>ppm_n</b>).  Bit 4 of ppm_n is set to 0 so that ppm_n rolls over from 15 to 0.  I read the array outside of the interrupt and verify the bit <b>ppmwrite</b> hasn't changed while reading the data, else the interrupt could have occured while reading the data.<br />
<br />
This compiles but it appears none of the array values are updating except for index 15, which appears to be randomly assigned and never changes even though the array is cleared at startup.  However it appears the index ppm_n is incrementing and ppmwrite is being toggled.  Typical output from the code below looks like this (first 16 values are the ppm array, red is <font color="#FF0000">ppm_n</font>, and blue is <font color="#000080">ppmwrite</font>):<br />
<br />
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 29184 <font color="#FF0000">8</font> <font color="#000080">0</font>                                         <br />
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 29184 <font color="#FF0000">6</font> <font color="#000080">0</font>                                         <br />
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 29184 <font color="#FF0000">5</font> <font color="#000080">1 </font>                                        <br />
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 29184 <font color="#FF0000">3</font> <font color="#000080">1</font>                                         <br />
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 29184 <font color="#FF0000">2</font> <font color="#000080">0 </font><br />
<br />
I cobbled together the code below from some helpful posts in these forums and the datasheet.  I still include &quot;ReEnterPBP-18.bas&quot; since I use that for another ISR that still uses PBP, but that is not included in this test code.  I'm not that experienced with asm (yet), so any pointers are greatly appreciated!<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">pausetime&nbsp;  var&nbsp;  word<br />
ppm&nbsp; &nbsp; &nbsp; &nbsp;  var&nbsp;  word[16]<br />
ppm_n&nbsp; &nbsp; &nbsp;  var&nbsp;  byte<br />
n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  var&nbsp;  byte<br />
ppmwrite&nbsp; &nbsp; var&nbsp;  bit<br />
<br />
T3CON = %10110000 'ppm timer: Prescaler = 8:1,&nbsp; Timer off; bit 5-4 is prescaler (00=1:1, 01=2:1 ... 11=8:1)<br />
<br />
INCLUDE &quot;DT_INTS-18.bas&quot; ' Base Interrupt System<br />
INCLUDE &quot;ReEnterPBP-18.bas&quot; ' Include if using PBP interrupts<br />
<br />
'----[High Priority PPM Interrupt]----------------------------------------------<br />
ASM<br />
INT_LIST macro ; IntSource, Label, Type, ResetFlag?<br />
INT_Handler INT0_INT, _PULSE_WIDTH, ASM, yes <br />
endm<br />
INT_CREATE ; Creates the interrupt processor<br />
ENDASM<br />
<br />
'clear ppm array<br />
for n=0 to 15<br />
ppm[n]=0<br />
next n<br />
<br />
ppm_n=0<br />
<br />
@ bsf&nbsp; &nbsp;  T3CON, TMR3ON&nbsp;  ; Start timer <br />
@ INT_ENABLE INT0_INT ; enable external (INT) interrupts<br />
<br />
ppmloop:<br />
pause 100<br />
@ INT_DISABLE INT0_INT ; disble external (INT) interrupts<br />
serout2 PIN_OUT,6,[dec ppm[0],&quot; &quot;,dec ppm[1],&quot; &quot;,dec ppm[2],&quot; &quot;,dec ppm[3],&quot; &quot;,dec ppm[4],&quot; &quot;,dec ppm[5],&quot; &quot;,dec ppm[6],&quot; &quot;,dec ppm[7],&quot; &quot;,dec ppm[8],&quot; &quot;,dec ppm[9],&quot; &quot;,dec ppm[10],&quot; &quot;,dec ppm[11],&quot; &quot;,dec ppm[12],&quot; &quot;,dec ppm[13],&quot; &quot;,dec ppm[14],&quot; &quot;,dec ppm[15],&quot; &quot;,dec ppm_n,&quot; &quot;,dec ppmwrite,13,10]<br />
@ INT_ENABLE INT0_INT ; enable external (INT) interrupts<br />
goto ppmloop<br />
<br />
PULSE_WIDTH:<br />
ASM<br />
&nbsp;  movff&nbsp; TMR3L, _pausetime&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ; Read LB and store in variable 'pausetime' - also loads TMR3H into buffer<br />
&nbsp;  movff&nbsp; TMR3H, _pausetime + 1&nbsp; &nbsp; &nbsp;  ; Read HB from buffer<br />
&nbsp;  movf&nbsp;  _ppm_n, W&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ; Get index value from variable 'ppm_n' for array address, store in WREG<br />
&nbsp;  rlncf&nbsp; WREG, W&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ; Multiply by 2 since ppm array is words (16bit)<br />
&nbsp;  addlw&nbsp; _ppm&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; add base address of ppm array to offset in W<br />
&nbsp;  movwf&nbsp; FSR0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; store the calculated address in FSR0<br />
&nbsp;  movf&nbsp;  _pausetime, W&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ; load pausetime LB into WREG<br />
&nbsp;  movwf&nbsp; INDF0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ; move LB into ppm[ppm_n] <br />
&nbsp;  incf&nbsp;  FSR0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; move to next pointer loation for HB<br />
&nbsp;  movf&nbsp;  _pausetime + 1, W&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ; load pausetime HB into WREG<br />
&nbsp;  movwf&nbsp; INDF0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ; move HB into ppm[ppm_n]&nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp;  incf&nbsp;  _ppm_n, f&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ; increment array index variable ppm_n<br />
&nbsp;  bcf&nbsp; &nbsp; _ppm_n, 4&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ; clear bit 4 so array starts over after index 15 (b1111)<br />
&nbsp;  btg&nbsp; &nbsp; _ppmwrite&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ; toggle ppmwrite to check if interrupt occured in main program<br />
INT_RETURN<br />
ENDASM</code><hr />
</div></div>

]]></content:encoded>
			<category domain="https://www.picbasic.co.uk/forum/forumdisplay.php/4-mel-PIC-BASIC-Pro">mel PIC BASIC Pro</category>
			<dc:creator>achilles03</dc:creator>
			<guid isPermaLink="true">https://www.picbasic.co.uk/forum/showthread.php/27106-Converting-PBP-interrupt-to-ASM-18F25K20</guid>
		</item>
	</channel>
</rss>
