Yesterday I ran this many times with the same result, bunches of 121 characters. Today, with everything exactly the same, no more 121 characters. ?? The only thing I can figure is that it was some problem with the driver on my computer that cleared up with a reboot this morning. Please disregard this whole mess. Sorry for wasting all your time.
Thank you. Yes, using USART_BLOCKING works, but I still don't understand why it trashed a completely unrelated variable. In the help for HSerGetString, it says to use the USART_TX_BLOCKING, but down in the example, it used USART_BLOCKING, so a little confusing. (Same for HSerGetNum.) I'm not sure what you meant by "Also the the string is can only be up to 40 bytes unless dim ed other." I certainly didn't want the program to set the length of mystr to 121. It seems the length wasn't actually 121,...
don't know why the previous post is showing mystr after HSerGetString <yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy> len=121</yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy> at the end. I've edited it twice, but can't get rid of whatever is causing the post to show extra stuff after len=121, it shouldn't be there.
don't know why the previous post is showing mystr after HSerGetString <yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy> len=121</yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy> at the end. I've edited it twice, but can't get rid of whatever is causing the post to show extra stuff after len=121, it shouldn't be there. s.b. mystr after HSerGetString <yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy> len=121</yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy>
I'm having trouble with HSerGetString trashing one of my string variables. Here is the program #option Explicit #chip 16f1765,32 #startup InitPPS, 85 #define PPSToolPart 16LF1765 Sub InitPPS Dir PORTC.3 Out RC3PPS = 0x0016 // TX > RC3 RXPPS = 0x0004 // RA4 > RX End Sub #define USART_BAUD_RATE 115200 #DEFINE USART_TX_BLOCKING #DEFINE USART_DELAY OFF wait 100 ms dim mystr as string dim t1,t2 as String mystr="123.456" HserPrintCRLF hserprint "mystr before HSerGetString <" HSerPrint mystr hserprint ">...
I'm having trouble with HSerGetString trashing one of my string variables. Here is the program #option Explicit #chip 16f1765,32 #startup InitPPS, 85 #define PPSToolPart 16LF1765 Sub InitPPS Dir PORTC.3 Out RC3PPS = 0x0016 // TX > RC3 RXPPS = 0x0004 // RA4 > RX End Sub #define USART_BAUD_RATE 115200 #DEFINE USART_TX_BLOCKING #DEFINE USART_DELAY OFF wait 100 ms dim mystr as string dim t1,t2 as String mystr="123.456" HserPrintCRLF hserprint "mystr before HSerGetString <" HSerPrint mystr hserprint ">...
I'm having trouble with HSerGetString trashing one of my string variables. Here is the program #option Explicit #chip 16f1765,32 #startup InitPPS, 85 #define PPSToolPart 16LF1765 Sub InitPPS Dir PORTC.3 Out RC3PPS = 0x0016 // TX > RC3 RXPPS = 0x0004 // RA4 > RX End Sub #define USART_BAUD_RATE 115200 #DEFINE USART_TX_BLOCKING #DEFINE USART_DELAY OFF wait 100 ms dim mystr as string dim t1,t2 as String mystr="123.456" HserPrintCRLF hserprint "mystr before HSerGetString <" HSerPrint mystr hserprint ">...
Yup. Too bad it takes hours and hours to find these easy solutions.
Okay, piece of cake. Wish I'd done it a long time ago. edit file "gcblanguage-configuration.json" fourth line says: "lineComment": "//", change the // to ' save restart vscode done. Oh. Don't forget to add this to your list of things to do every time vscode/gccode is updated.
Okay, piece of cake. Wish I'd done it a long time ago. edit file "gcblanguage-configuration.json" fourth line says: "lineComment": "//", change the // to ' save restart vscode done.
Thank you. Color was done long ago. I'm not going to rant here, so we'll just fix it quietly or stop using it.
If I can do it manually with my finger on the keyboard, I can do it with code. So are you going to tell me where this code lives?
For my next question, I'd like to tackle the, to me, single most annoying thing about gccode. Where does the code for the "Toggle line comment" item live? I'd like to make some changes.
Thank you, I appreciate it much. Okay, I'm number 518. It's been over eight years. I can't imagine what the people designing and maintaining this thing are thinking not fixing such and intrinsic part of every editor ever written.
I have more questions, but I'll just post one at a time so none get lost.
Thank you, I appreciate it much. I have more questions, but I'll just post one at a time so none get lost.
Okay, I'm number 518. It's been over eight years. I can't imagine what the people designing and maintaining this thing are thinking not fixing such and intrinsic part of every editor ever written.
I have more questions, but I'll just post one at a time so none get lost.
How does one toggle insert/overtype mode in gccode (now just called code.exe)? The insert key does not work. The help says it should, or type ctrl-shift-i, that does not work either.
Next... want to help FLOATS? See https://sourceforge.net/p/gcbasic/discussion/596084/thread/b867317011/ wow. That's a lot. Let me look into it before I commit.
No, I misspoke badly. My computer isn't that fast! GLCD_Touch_Simple_Demonstration_ATmega2560_SSD1289.gcb which I think you are talking about takes 3.1 secs. If you can do it in 1.921s, I guess it's time for me to upgrade :) The 1.9 is for one of the BitwiseControls.gcb I picked up accidentally at some point (no idea why), while testing my 22 yr old celeron laptop with a whopping 5MB of ram. If everything runs on that we should be good to go. On my computer, the slowest demo to compile is "CAN-Link_18f4550.gcb"...
as I see it, looking at the two compile commands, as you said: fbc.exe $SF\gcbasic.bas -exx -arch 586 -x $SF\gcbasic32.exe or fbc.exe $SF\gcbasic.bas -x $SF\gcbasic64.exe -ex the difference being the options, i.e. 32bit: -exx arch 586 64bit: -ex the default for arch is 486, according to the help. I can see trying to give it a little boost by using pentium instructions. as for the -exx vs. -ex, I think they could both be -exx why would you want to saddle the 32 bit code with array bounds/null-pointer...
So the problem was the -arch 586 okay, probably my bad. I got that from the gcbasic.fbp project file out of the trunk source code, not from gcstudio. Kinda makes sense, the 586 wasn't a 64 bit chip. So just some adjustments to gcbasic.fbp, or I guess you aren't supporting fbedit any more, so just remove it from the trunk. the only occurance of -arch 586 I found in gcstudio were these files which I have no idea what they are or what they are for- "H:\GCstudio\vscode\data\user-data\user\globalStorage\state.vscdb"...
I just tried again to be sure, I tried- H:\GCstudio\FBASIC\x64\fbc.exe -exx -arch 586 gcbasic.bas and I get gcbasic.bas() error 91: Executable not found: "H:\GCstudio\FBASIC\x64\bin\win32\as.exe"
Yes. I originally used \GCstudio\FBASIC\x64\fbc.exe to compile. Since I couldn't get it to work, I tried a fresh download from freebasic, thus the K:\FreeBASIC-1.07.1-win64\ folder shown above. I get the exact same results using either 64-bit freebasic exe. I have checked the path statement, the environment, and scanned the registry, and can not find any trace of where this could be coming from. Does it work for you?
I've been trying to compile the 64 bit version of GCBasic for quite a while now with no luck. I'm using a simple fbc command in a command window. fbc -exx -arch 586 gcbasic.bas I get the error: gcbasic.bas() error 91: Executable not found: "K:\FreeBASIC-1.07.1-win64\bin\win32\as.exe" the error being that fbc 64-bit is looking in the wrong folder, it should be "K:\FreeBASIC-1.07.1-win64\bin\win64\as.exe" I have searched and searched but can not find what is making 64 bit fbc create a folder with win32...
I printed out a log file the name of each file as it was opened. It turns out that 30 of the files were read twice. Only twice. So it processed 54+30=84 files in 2.0878 seconds or 0.025 seconds per file. I could not find any instance of it moving the file pointer using seek, so it wasn't reading files multiple times that way. Unless you have a special case file you want handled, I don't see any advantage to tokenizing the files for only two uses of some files. I'm not saying that there aren't some...
Sorry about that. Apparently gcbasic32.exe is the old one. gcbasic.exe is a copy of the 64 bit one. First thing I did was compile it, just the way have been with no changes, but apparently it produces an exe that's not up to snuff. So everything is working, I just have to figure out why the compile in my setup did not work correctly. It thinks everything was okay. With you exes right out of the rar it works.
okay, I'll run it down
First test- 3 line program: #CHIP 16f1765 #DEFINE GLCD_TYPE GLCD_TYPE_ILI9341 #INCLUDE <glcd.h> produces the following: Error: Message NOFILEOTHER not defined in messages.dat!C:\GCstudio\gcbasic\include\glcd_ili9341.h all occurrences of NoFileOther in the files you sent- "K:\gcbasictest\gcbasic\gcbasic\preprocessor.bi" 1819: Temp = Message("NoFileOther") "K:\gcbasictest\gcbasic\gcbasic\dev\messages.dat" 76: NoFileOther = "Cannot find %Fname%" "K:\gcbasictest\gcbasic\gcbasic\dev\preprocessor.bi" 1819:...
okay, got it. Will give it a try in a few hours, have RL stuff to do
Sounds like all this is still just because we don't have a conditional #include. If we did the original glcd.h would have worked as intended. (assuming you updated the individual device files to have the needed includes). It can still have a great deal of unnecessary things included. eg.- glcd_type_epd_epd7in5 may only need a few of the things in glcd_ssd1289.h, I'm not familiar enough with these to know. But the glcd.dat file seems easier to maintain rather than updating the individual library files,...
Sounds like a real can of worms. Is there anyway to write a program to read the include files to see which devices needs which items, or is it just something you have to know about the device when you are programming it? Is this going to require a complete restructuring of the libraries putting all common items in glcd.h and removing them from the specific device files? I mean isn't this what you are already doing? It just not perfect yet?
Sounds like a real can of worms. Is there anyway to write a program to read the include files to see which devices needs which items, or is it just something you have to know about the device when you are programming it? Is this going to require a complete restructuring of the libraries putting all common items in glcd.h and removing them from the specific device files?
Excellent. And, of course, my simple idea doesn't work. This- #CHIP 16f1765 #define mystuff "zdummy.gcb" #include mystuff gives error- [{ "resource": "/k:/gcbasic-code-r1580-GCBASIC-trunk/zprog.gcb", "owner": "gcb", "severity": 4, "message": "Cannot find #include mystuff", "source": "gcb", "startLineNumber": 4, "startColumn": 1, "endLineNumber": 4, "endColumn": 2147483647 }] Such a simple concept.
I'll give it a try, so long as you aren't expecting something "professional". Also it just dawned on me how to make a conditional include so you wouldn't have to make such a big change in the future if a similar situation comes up. #define mylib dummy 'where dummy is some file always included #if somecondition #undefine mylib #define mylib LibIReallyWant #endif #include mylib ' will be dummy or LibIReallyWant
I'll give it a try, so long as you aren't expecting something "professional". Also it just dawned on me how to make a conditional include so you wouldn't have to make such a big change in the future if a similar situation comes up. #define mylib dummy #if somecondition #undefine mylib #define mylib LibIReallyWant #endif #include mylib ' will be dummy or LibIReallyWant
So I'm guessing we're done here, right?
This wasn't really meaningful to me, if just meant the last thing I did was an error, and that was making that if a #if. zzztest.gcb (284): Error: Syntax Error zzztest.gcb (286): Error: Syntax Error zzztest.gcb (298): Error: ,BANKEDSyntax Error zzztest.gcb (302): Error: Syntax Error zzztest.gcb (305): Error: Syntax Error zzztest.gcb (308): Error: Syntax Error zzztest.gcb (326): Error: Array/Function GLCDDRAWCHAR_SSD1351 has not been declared zzztest.gcb (326): Error: Syntax Error zzztest.gcb (330):...
Well gee. Wish I had known that hours ago :( Perhaps this part of the compiler that handles scripts should be able to ignore includes in a non-executed if.
Excellent. Something else I found- if I convert the following "If" statement a "#if" in glcd.h, eg. #If GLCD_TYPE = GLCD_TYPE_SSD1351 Then //#include <glcd_ssd1351.h> InitGLCD = InitGLCD_SSD1351 GLCDCLS = GLCDCLS_SSD1351 GLCDDrawChar = GLCDDrawChar_SSD1351 GLCDDrawString = GLCDDrawString_SSD1351 FilledBox = FilledBox_SSD1351 Pset = Pset_SSD1351 GLCDRotate = GLCDRotate_SSD1351 GLCDSetContrast = SetContrast_SSD1351 glcd_type_string = "SSD1351" GLCD_WIDTH = 128 GLCD_HEIGHT = 128 SSD1351_GLCD_HEIGHT...
Sounds pretty good to me. I've been working on finding why I was getting the errors I mentioned above. It seem that if I comment out any of these includes- glcd_ssd1289.h glcd_st7920.h glcd_ili9326.h then I get error comments. So there is something in those files that the ILI9341 needs that should probably be in the glcd_ili9341.h file.
Sounds pretty good to me. I've been working on finding why I was getting the errors I mentioned above. It seem that if I comment out and of these includes- glcd_ssd1289.h glcd_st7920.h glcd_ili9326.h then I get error comments. So there is something in those files that the ILI9341 needs that should probably be in the glcd_ili9341.h file.
So, a conditional include would probably be something to look into in the future. You said: Change the For RF- Next loop to a Do While RF <= SourceFiles Loop Set RF = 0 before the new Do-Loop. And, increment RF each time throught the loop In the #DEFINE test, if the usersource program and the GLCD_TYPE constant exists, add the code to extract the correct GLCD library from GLCD.DAT and then add this filename to the sourcefile array, incrementing the SourceFiles variables. Now the new Do While RF <=...
no, rather than modifying the real glcd.h, I just made an experimental version, glcdx.h, and included it in the test program instead of glcd.h, so I could easily switch between the two.
Try this... replace all #include ... in glcd.h with //#include ..., then, enable the one we are using ILI9341. okay, now I'm really confused. I commented all the includes except ILI9341, as you said, and I got a bunch of errors as follows: glcdx.h * (5132): Error: Lookup table BIGFONT32_41 not found (Library Include) glcdx.h * (5132): Error: Syntax Error (Library Include) glcdx.h * (5133): Error: Lookup table BIGFONT42_51 not found (Library Include) glcdx.h * (5133): Error: Syntax Error (Library...
Also, I have no problem with it reading the files twice. It's a two pass compiler, quite normal. Read the files to figure out what you need, get the stuff, read again to apply the stuff. These files are so small that I'm sure windows keeps a copy in memory after the first read for immediate use again without physical disk access. And two pass compilers are nice since you don't have to put in a bunch of superfluous declares up front. I've always felt that if the compiler can read the first line of...
it is the demo file \GCstudio\gcbasic\demos\Vendor_Boards\Great_Cow_Basic_Demo_Board\18F25K42_ChipRange_Demonstrations\340_SPI_GLCD_with_Touch_using_ili9341.gcb
perhaps seeing every file opened and read in order might help- Open1, input as #1 zzztest.gcb Open1, input as #1 ...\include\glcd.h Open1, input as #1 ...\include\glcd_st7789.h Open1, input as #1 ...\include\glcd_ks0108.h Open1, input as #1 ...\include\glcd_nt7108c.h Open1, input as #1 ...\include\glcd_ssd1306.h Open1, input as #1 ...\include\glcd_uc1601.h Open1, input as #1 ...\include\glcd_ssd1306_twin.h Open1, input as #1 ...\include\glcd_ili9341.h Open1, input as #1 ...\include\glcd_ili9340.h...
The following were read twice ...\include\epd_epd2in13d.h ...\include\epd_epd7in5.h ...\include\glcd.h ...\include\glcd_hx8347.h ...\include\glcd_ili9326.h ...\include\glcd_ili9340.h ...\include\glcd_ili9341.h ...\include\glcd_ili9481.h ...\include\glcd_ili9486l.h ...\include\glcd_ili9488.h ...\include\glcd_ks0108.h ...\include\glcd_lt7686.h ...\include\glcd_nextion.h ...\include\glcd_nt7108c.h ...\include\glcd_pcd8544.h ...\include\glcd_sh1106.h ...\include\glcd_ssd1289.h ...\include\glcd_ssd1306.h...
I printed out a log file the name of each file as it was opened. It turns out that 30 of the files were read twice. Only twice. So it processed 54+30=84 files in 2.0878 seconds or 0.025 seconds per file. I could not find any instance of it moving the file pointer using seek, so it wasn't reading files multiple times that way. Unless you have a special case file you want handled, I don't see any advantage to tokenizing the files for only two uses of some files. I'm not saying that there aren't some...
Yes, it takes about 44% of the time to read through the source files in that portion of the preprocessor. Here is a recent result of running- .......................................................... K:\gcbasic-code-r1580-GCBASIC-trunk>GCBASIC.EXE zzztest.gcb /R:text /NP /H:N /P: GCBASIC (1.01.00 2024-01-08 (Windows 32 bit) : Build 1324) Compiling zzztest.gcb loading 54 source files 0.0386 average processing time per file Program compiled successfully (Compile time: 4.736 seconds) Summary: Compiled:...
So I ran some tests using the worst file I could find in the demos with the internal comment of "this program is a simple GLCD demonstration of the ILI9341 GLCD capabilities". I just added some code to keep track of how long each section ran and some prints, no other changes. This is the results: K:\gcbasic-code-r1580-GCBASIC-trunk>GCBASIC.EXE zzztest.gcb /R:text /NP /H:N /P: GCBASIC (1.01.00 2024-01-08 (Windows 32 bit) : Build 1324) Compiling zzztest.gcb loading 54 source files Program compiled...
Thank Angel, very well done. You've put a great deal of work in this and it is appreciated. Until I can get into all that, I'm just doing simple quickies using fbedit which I'm much more comfortable with.
As you literally said in the first post. Duh. I used: H:\GCstudio\FBASIC\x64\fbc -exx -arch 586 "gcbasic.bas" and got the error: Executable not found: "H:\GCstudio\FBASIC\x64\bin\win32\as.exe" Haven't found where it's getting that string with win32 instead of win64 When I did 32 bit: H:\GCstudio\FBASIC\x86\fbc -exx -arch 586 "gcbasic.bas" It ran perfectly. Guess I'll just use 32bit for now. Thanks for your patience.
I remember seeing it somewhere, but I can't find now when I want it. What version of freebasic are you using to compile and link gcbasic for 64 bit? I want to put some timetags on the stuff it prints out when running.
Is this file that takes 34s available for testing? The worst file I have takes less than 3s to make the asm (I'm assuming that compiling to asm is really the only part to focus on). Is this to make changes to gcbasic.exe itself, or to the gawk stuff (preprocessor as you stated above)?
I just wanted to make some simple changes. Say, just for example, I want the " Do ... Loop" code to be presented in red rather than blue. I found a video on how to change some of the colors [https://www.youtube.com/watch?v=w2dXlvPw3qQ] Haven't found the magic json key to changing what I want yet. Okay, a quick edit. This should be the last post on this topic as I imagine not many are interested. This video https://www.youtube.com/watch?v=pGzssFNtWXw tells you just about everything about changing/creating...
I just wanted to make some simple changes. Say, just for example, I want the " Do ... Loop" code to be presented in red rather than blue. I found a video on how to change some of the colors [https://www.youtube.com/watch?v=w2dXlvPw3qQ] Haven't found the magic json key to changing what I want yet.
I have recently started trying to program a pic after several years layoff. I'm trying to get the new GCStudio set up to my liking. Most things I have figured out. The next thing I want to tackle is setting the colors used in various places and for code. I know it can happen since the themes available all change all the colors I am interested in. Is there some way to get to the individual color settings from the preferences menu, or do I have to do it externally by creating/modifying an existing...
Excellent. Thanks for all your efforts!
This is a test to see if the forum is working. I can't see any posts newer then 11/30.
You didn't say anything about using != instead of <>, is that more inefficient, i.e. does it do a "not" before comparing?
You would have loved apl
Evan- Then I would suggest you keep that for yourself, and don't promote the usage of non-basic comment statements.
in basic, that would be- Result=iif(X<>Y,X,Y) iif no need for cryptic c syntax.
Chris- I have no problem with including new capabilities (as long as they are not described as some unintelligible gobbledygook misuse of words that have other meanings like the oop and c proponents are wont to do). The question is syntax. New capabilities should be provided in a Basic like syntax, not copying the syntax from another language. Evan- So you "#include source files generated by MPLAB-IDE MCC ". There must be a lot more problems doing this than the comments! Are you planning on distributing...
How does everyone feel about adding more C syntax to GCB? Please speak up!
v1.79 device files (devices.zip) uploaded to https://sourceforge.net/projects/gcbasic/files/Support%20Files/PPSTool/
v1.79 device files (devices.zip) uploaded to here
p.s. I only use fblite, so please, please make the new option available in fblite.
p.s. I only use fblite, so please, please make the new option in fblite.
substring notation
What do you mean it isn't listed in GCB? There's a dat file for it, so it should be good. i just picked up a program and changed the chip to 16f15376 and it compiled without complaint.
What do you mean it isn't listed in GCB? There's a dat file for it, so it should be good.
did you look at the program in demos \vendor_boards\microchip-curiosity_low_pin_count_demo_board\cvd_touch_button_16f1619.gcb ?
I would start with one of the 16f18424 series and use cvd, that works the best. The absolute best end product is to use the microchip cvd library, in which case any chip with an appropriate adc can do it. I did one using 12F1840 and the microchip library and they worked very well. They have a setting to force a double read which works extremely well. Even passed the dreaded ultrasonic cleaner test without glitching, which every other solution I tried failed. (Before this, every touch circuit I tried...
You can't rely on that. If the second table won't fit within the current page boundary, it will probably be put in the next page. Not sure, you'd have to ask Evan or Hugh or ?
That seems like a quite usable solution. Put it all in one table and just read from where you want. No ifs required.
Yes, use a variable, it doesn't take up much memory for an if around the readtable. e.g. I used this to test and it worked correctly. table xx 1,2,6 end table table yy 3,4,9 end table dim aa,ii,jj cls for ii=1 to 2 ' test 2 tables for jj=1 to 3 if ii=1 then readtable xx,jj,aa else if ii=2 then readtable yy,jj,aa end if printdatax aa next next do:loop sub printdatax (inval) print inval:print " " end sub If you look at the asm, the if portion looks like this: ;if ii=1 then decf II,W btfss STATUS, Z...
Yes, use a variable, it doesn't take up much memory for an if around the readtable. e.g. I used this to test and it worked correctly. table xx 1,2,6 end table table yy 3,4,9 end table dim aa,ii,jj cls for ii=1 to 2 ' test 2 tables for jj=1 to 3 if ii=1 then readtable xx,jj,aa else if ii=2 then readtable yy,jj,aa end if printdatax aa next next do:loop sub printdatax (inval) print inval:print " " end sub I you look at the asm, the if portion looks like this: ;if ii=1 then decf II,W btfss STATUS, Z...
I think he's talking about the actual icon on "PPS Tool.exe"
Excellent job Peter. I finally got the output mostly to my liking. OutputTemplate.txt= #startup InitPPS, 85 'Generated by ppstool for #PPSToolPart Sub InitPPS #UNLOCKPPS [PPS] #PPSSetting #Comment [PPSEnd]End Sub produces something like- #startup InitPPS, 85 'Generated by ppstool for 16F18324 Sub InitPPS #UNLOCKPPS RC5PPS = 0x0018 'SCL1 > RC5 SSP1CLKPPS = 0x0015 'RC5 > SCL1 (bi-directional) RC4PPS = 0x0019 'SDA1 > RC4 SSP1DATPPS = 0x0014 'RC4 > SDA1 (bi-directional) End Sub Nice and compact as...
Is this changelog available somewhere as a file? It's hard to read using the scrollbar to go left and right.