Hi, I've a buffer from a variable string and I need to write a block of bytes from it to file. Is there a way to do that ? I can't pass the pointer to the fwrite ? The only way I see for the moment is to copy byte to byte from the buffer to a string and then write it but.... Thanks.by damato68 - ByPic
Hi, the file function fwrite, fail to write without errors (return 0) if the variable string is flash saved this write 1024 bytes to file dim buff$[1024] function ttt() dim ln,fp,error fp=fopen("test.bin","w") error=fwrite(buff$,1024,?ln,fp) fclose(fp) return endf dim buff$[1024] flsave("") this write 0 bytes to file withoutby damato68 - ByPic
I need to increase the uart buffer size that is 84bytes by default. What's the maximum size allowable ? Many thanks for the support D.by damato68 - ByPic
More infos... the problem seem to be in the parser. I've simplified the things and I've a module with a simple function function fff(buffer,ln,crc ) return 0 endf I load the function (tload) I save the function (flsave("")) I call the function from a ram loaded module dim buffer$[100] dim gg$[10] function ttt() dim a,b,c b= ?buffer$+4 c= ?gg$+4by damato68 - ByPic
Hi, I've a problem that I've insulated in "few" code lines: When i call a function loaded in ram the code seem to works fine. If I save the function in the flash and then I call it, I receive a general exception error: I've modules lut1.bas and lut2.bas that are included in the module msolut.bas and are 2 simple 32x8 bytes data tables then I've a module msocrc.bas that is a modby damato68 - ByPic
Thanks jimer, because the code complexity that i'm porting from c to basic (a communication protocol) it is not easy to use global variables. However, all buffer are globals, we don't use strings as "strings" but like memory buffer (peekc, pokec). Only local counter, flag, temporary variables are local. For us the best solution would to keep protocol functions as c language as library aby damato68 - ByPic
Hi, I need to increase the local variable memory size, I've used flsys(8,600) flsave("") Increasing this block are necessary to reduce any other ? The question is because I've found a problem at runtime in a function where data from a string variable was lost... Many thanks for any support. D.by damato68 - ByPic
Hi, after upgrade to latest version, when the reset is sent the board show an error: ====================================== | ByPic Version 2.06 | Saves 0 | | BV523 Serial# 201229069 | | | Documentation www.bypic.co.uk | | | | Copyright Jim Spence 20by damato68 - ByPic
Hi, Now I'm using the 115800 bps firmware (BV523_11k_V ). Can I use the BV523_2M_V firmware or there is a limitation or risk in the terminal communication ? Thanks D.by damato68 - ByPic
It seem that when used the "<>" can't use the parenthesis give timeout when uploaded if (Status <> 0) ..... seem ok if Status <> 0 ....by damato68 - ByPic
Writing the code I've found some problem with the language parser: 1) Sometime the parser truncate the line in the function definition line even if the line is less than 80chars 2)The following code give a problem when upload the module (terminal) giving "Timeout waiting for ACK" function SPRS232_ReceiveSOP(Typeptr,Firstptr,Lastptr,RCptr,TotalTout) dim State,Byte,Timeout,Nby damato68 - ByPic
Sorry, I've seen that exist but is undocumented. >Hi jimer, >peekc is ok, a function like "pokec" may be useful too :)-Dby damato68 - BV523
Thanks jimeer, you know workarounds ? My regards D-by damato68 - ByPic
This is now fixed with a new version 2.06 - 69 that can be downloaded from here Hi, writing code, I've loose time around the variable definition order: function TestCrc() dim appo$,ln appo$="012345678" ln=strlen(appo$) print appo$ endf This give ERROR (33) variable not found at (vlit) at runtime Changing the variable definition order the problem don't appear functby damato68 - ByPic
Hi,jimeer I've implemented the method suggested to define LUT as constant. The problem is that the only way to extract data from variable is with peek calculating the right offset. "asc" function won't work. Is there a better way ? Many regards D.by damato68 - BV523
Hi, I'm trying to write two 256 bytes LUT (lookup table) from the SD file to the pic flash to avoid to keep these into the PIC ram. The problem is that I don't know the flash mapping and how to reserve a memory block for this data from machineBasic (2.06). Many thanks for any help.by damato68 - BV523