Existing methods I had no luck finding. I will try again tomorrow.
Yes, is the answer. You can use the existing methods or write your own.
Sitting here philosophizing, wondering and looking at options... Can GCbasic read and write sequentially to/from a SPI Serial SRAM (like 23LC1024) ? -That is after sending the startadress, continuing without sending the long address for each byte.
Updated policy
My error. I call them CNANO in the Programmer Prefences. They are the Curiosity Nano bo platform.
cant find "cnano" nowhere googli ! that why asking has 8051 family decided?
Privacy Policy for GCBASIC
yes, it made sense.
Cnano/8051. I have to buy boards to test for specific chip families. These come from Microchip Direct or Nuvoton.
cost rising is significant since last year !!!! btw "testing hardware cnano ? whats this ? imho "application certificate" can be removed, i see other small companies/shareware who removed it , as its a ripoff, and only help in a warning of opening app !!! allow it and proceed ... so XOJO goes from 99 to 499 /year... nice pricing guys ;)
cost rising is significant since last year !!!! btw "testing hardware cnano ? whats this ? imho "application certificate" can be removed, i see other small companies/shareware who removed it , as its a ripoff, and only help in a warning of opening app !!! allow it and proceed ...
cost rising is significant since last year !!!! btw "testing hardware cnano ? whats this ?
Did the explaination make sense? The ASM shows the process. In the next release you can walk the program in a real Debugger to see what is happening.
Thanks! That worked
Time to update the compiler... going for the oldest compiler in use award. :-) SMILING Compiled with GCBASIC (2025.11.12 (Windows 64 bit) : Build 1527) using PIC-AS ( not GCASM). dim coef_0 as word coef_0 = FnLSL([WORD]17, 4) print coef_0 Gives 272. Note: You have to case the input variable. The compiler does not really know what the constant 17 is to be treated as. So, the cast tells the compiler to treat as a word.
Correction When I run the code it says coef_0 = 16 not 17
I'm using: GCASM List File (GCBASIC 0.99.01 2022-01-27 (Windows 64 bit) : Build 1073) with an 18F4550. I wrote this simple code: dim coef_0 as word coef_0 = FnLSL(17, 4) print coef_0 When I run the code it says coef_0 = 17. I think it should be 272. What am I doing wrong?
New: Support for 16F175xx by additional isolation of legacy clock sources
New: Add ChipSubFamily = 15006 TX1REG redirection in script section
New PIC16F175xx chipdat files
Fix: Revised 9bit and 10Bit CCP1 support to isolate bits.
New: Add 31k support for 18F4xxx chipfamily
New: Errors in Macros are now reported as the source line in the Macro ( not the calling the method. The implementation extends the metadata model and add new ErrorLog methods.
Donate Here Please donate to support the operational costs of the GCBASIC Project. Thank you! Donate here. Select this URL, then select Send, enter your donation value and then select Next. Follow the process to complete the payment. This year, we are reaching out to anyone and everyone who uses the GCSTUDIO/GCBASIC toolchain to contribute. Please contribute as much as you can afford. If you are a business or are selling products that leverage this project, consider becoming a Platinum supporter....
Donate Here Please donate to support the operational costs of the GCBASIC Project. Thank you! Donate here. Select this URL, then select Send, enter your donation value and then select Next. Follow the process to complete the payment. This year, we are reaching out to anyone and everyone who uses the GCSTUDIO/GCBASIC toolchain to contribute. Please contribute as much as you can afford. If you are a business or are selling products that leverage this project, consider becoming a Platinum supporter....
Fix. Added dependent library to #25: glcd_type_st7735r,glcd_st7735r.h&glcd_st7735.h
Excellent! There have been no functional changes. This was purely the way the libraries were loaded. If you want to see the change. Look at include\glcd.dat This will show you the structure of the libraries being loaded. Enjoy. Please donate to the project. The December fund raising is coming up!!
Thanks! That fixed it and it compiled :) It always me and these LCDs!
No problem. I had missed that specific chip from the post.... so, try a search again. :-)
Greatextraplus! (I did search before asking, but I didn't get any hits on this particular chip. I must have mis-spelled it.)
Chris, All sorted. Download the MPK. Double click the download. If you have the latest GCSTUDIO then it will automatically update applying the fix. Root Cause We change the GLCD library configuration to improve ( decrease ) the compilation time. This optimisation isolated each GLCD library. So, rather than load ALL the GLCD libraries the compiler loads only the GLCD library required. I had missed a dependent GLCD library for your selected GLCD. The file that changed is in the MPK and it will now...
Yes, yes, yes. :-) See https://sourceforge.net/p/gcbasic/discussion/chipfileforum/thread/7859bf7e32/ See https://www.youtube.com/playlist?list=PLN9gcw34mhupJx5YotmF0Ao9O63EbQMFf These chips are great! I am working through the validation by creating the videos/demos but all looks great. Just minor tweaks to the toolchain. :-) Evab
New chipdata files for PIC16F175xx. These are not validated but they will work. PIC16F17524 PIC16F17525 PIC16F17526 PIC16F17544 PIC16F17545 PIC16F17546 PIC16F17554 PIC16F17555 PIC16F17556 PIC16F17574 PIC16F17575 PIC16F17576 Apply using GCSTUDIO and this will be automatically installed.
Also, adding the following to PICKitPlus. Support for 9 new devices to be added: PIC16F17524 PIC16F17525 PIC16F17526 PIC16F17544 PIC16F17545 PIC16F17546 PIC16F17554 PIC16F17555 PIC16F17556 and, PIC16F17574 PIC16F17575 PIC16F17576
Complier: GCBASIC (2025.10.04 (Windows 64 bit) : Build 1523) Chip Model: 16F1778 Great Cow BASIC build version utility (1.06)... Build 319 I am using Synwrite 6.22.2290 The issue: Its been three years since I last looked at this code and in its current state, its running on hardware! I have to make some updates to it and I havent changed the code yet so I figured I'd compile it to make sure things are good. However, I get the following errors: 20:28:23 G+Stool started with parameter 'hex' -> processing...
Hi, Any plans supporting PIC16F17576? It has a 10-bit D/A and is available as a CURIOSITY NANO EVALUATION KIT (EV14L29A). I happen to like these kits, when trying things out. Just asking. Nothing more.
Hi, Any plans supporting PIC16F17576? It has a 10-bit D/A and is available as a CURIOSITY NANO EVALUATION KIT (EV14L29A). I happen to like these kits, when trying things out. Just asking. Nothing more.
Thank you! All uploaded to https://github.com/GreatCowBASIC/Demonstration_Sources/tree/main/Hall_Effect_Solutions/ACS758LCB-100B_Solutions
all in zip
Ok, thank you Anobium for the point out ;correction. i have tested it and it works i attached the reading pictures for more verifications
Ok, thank you Anobium for the point out ;correction. i have tested it and it works i attached the reading pictures for more verifications
Very good work and thank you for sharing. I have adapted for inclusion in the Demos. Can you please review and potentially test if you have time. The ADC setup is not need as the ADC reads does this for you. And, this would look complicated to a new user. I added header etc. Change LCD to SLOW to ensure it works on breadboards. Changed variable i to indexCounter as i can cause issues on chips with a bit called i. Other changes are format.
See the HELP ( press F1 in the IDE ) or see https://gcbasic.sourceforge.io/help/_command_line_parameters.html These two methods will show the same information. They are just different formats.
Cloning GCBASIC Preferences Editor Settings The GCBASIC Preferences Editor saves its configuration in a file called USE.INI. Location Found in the \GCSTUDIO\GCBASIC installation directory It is plain text file, editable with any text editor but use the GCBASIC Preferences Editor to ensure structure is always correct. Purpose Stores compiler, assembler, and programmer preferences. Updated automatically when you change settings in the Preferences Editor.
I have one station in my lab setup to use MELabs Programmer, by using the Preferences Editor. I'd like to clone that setup to all the stations. I can't find the INI file that the Preferences Editor changed, to copy it around. Can someone tell me the best way to do this?
I think this can help some newbie to get started to read current with hall sensor ACS785, the accuracy is 98% ; ============================================================== ; ACS758-100B SENSOR TEST TOOL ; Target: PIC16F886 (20MHz) ; By Samco, maker-brainy ; ============================================================== chip 16F886, 20 option explicit ; --- LCD Setup (Change if your pins differ) --- define LCD_IO 4 define LCD_NO_RW define LCD_Speed fast define LCD_RS PORTB.2 define LCD_Enable PORTB.3...
Very good work! Really nice photos.
Testing new hardware for the tinyscreen. A sandwich with a PIC 16F17115 and programming socket on the back of the screen. One idea is to use the programming socket as game paddle inputs. The whole package measures 15x16x10mm.
Sorry about that. Everything's fine now.
You do need the mpk_build_1526_legcay_pwm_fix.mpk fix. I thought you had applied this. https://sourceforge.net/p/gcbasic/discussion/579125/thread/4c55902b1b/d57d/attachment/mpk_build_1526_legcay_pwm_fix.mpk
Hi Anobium, sorry but the compiler is giving me this error with the new code 18:21:55 G+Stool started with parameter 'hex' -> processing C:\GCstudio\G+Stools\makeHEX.bat Source-File = C:\users\val\0-Motor-Ecoder\Motor-Encoder.gcb WARNINGs / ERRORs reported by GCBASIC (if Syntax Error, doubleclick on the errormessage below) <<< pwm.h ** (460): Error: Cannot store 2.7 in the byte variable DC1B1 (System Include) pwm.h ** (461): Error: Cannot store 2.6 in the byte variable DC1B0 (System Include) Duration:...
Some things were bugging me about this program. The code is fixed at 20mHz The PWM generation is hard coded to the chip Pulls are specific to chip Duplicate and redundant code. Here is an adapted and more modern version. This will work on 100s of PIC chips with CCP1/PWM The changes are 1. Use a script to calculate the INTERRUPT_PERIOD based on the chip frequency. And, make a one line change in the interrupt. 2. Use GCBASIC PWMOn command and the associated constant to set the PWM signal. 3. Isolate...
Some things were bugging me about this program. The code is fixed at 20mHz The PWM generation is hard coded to the chip Pulls are specific to chip Duplicate and redundant code. Here is an adapted and more modern version. This will work on 100s of PIC chips with CCP1/PWM The changes are 1. Use a script to calculate the INTERRUPT_PERIOD based on the chip frequency. And, make a one line change in the interrupt. 2. Use GCBASIC PWMOn command and the associated constant to set the PWM signal. 3. Isolate...
Some things was bugging me about this program. The code is fixed at 20mHz The PWM generation is hard coded to the chip Pulls are specific to chip Duplicate and redundant code. Here is an adapted and more modern version. This will work on 100;s of PIC chips with CCP1/PWM The changes are 1. Use a script to calculate the INTERRUPT_PERIOD based on the chip frequency. And, make a one line change in the interrupt. 2. Use GCBASIC PWMOn command and the associated constant to set the PWM signal. 3. Isolate...
Thank you for your help and explanation.
OSC: HS, 20Mhz (Clock source is not a primary internal oscillator. Ensure the clock source is correctly setup) Chip: 16F628A GCBASIC Warning Explained Message > OSC: HS, 20Mhz (Clock source is not a primary internal oscillator. Ensure the clock source is correctly setup) Chip: 16F628A This is a warning from GCBASIC, not an error. What It Means Part Explanation OSC: HS, 20Mhz Your program is configured to run at 20 MHz using High-Speed Crystal mode. Chip: 16F628A Target microcontroller is the PIC16F628A....
Thank you very much ANOBIUM, it compiles well. In the next few days I will try to assemble and test the mechanics to see if it works. And what does that error mean? OSC: HS, 20Mhz (Clock source is not a primary internal oscillator. Ensure the clock source is correctly setup) Chip: 16F628A
I asked Grok to convert. It gave Grok the rules I wrote. It made one error. ' GCBASIC version of the motor speed control code for PIC16F628A ' Assumes 20MHz clock #chip 16F628A, 20 #option explicit ' Constants #DEFINE MOTOR_PULSE_PERIOD 6944444 #DEFINE MOTOR_PROP_GAIN 10 ' Variables dim rpos as byte ' reference position dim mpos as byte ' actual motor position dim mlag as byte ' amount the motor lags the reference dim enc_new as byte ' holds motor's quadrature encoder data dim enc_last as byte '...
C to GCBASIC Porting Rules High-Level Cheat Sheet for PIC16F628A (MikroC → GCBASIC)) 1. Chip & Clock MikroC C GCBASIC #pragma config FOSC = HS #chip 16F628A, 20 (any config) #option explicit (recommended) Rule: Always start with #chip <model>, <MHz> 2. Functions C GCBASIC void main() Use a label Main: void interrupt() Sub Interrupt Rule: Use Sub and Interrupt End with End Sub 3. Infinite Loop C GCBASIC while(1) { } Do → Loop Rule: No condition needed 4. Variables C Type GCBASIC unsigned char Dim...
I asked Grok to convert. It gave Grok the rules I wrote. It made one error. ' GCBASIC version of the motor speed control code for PIC16F628A ' Assumes 20MHz clock #chip 16F628A, 20 #option explicit ' Constants #DEFINE MOTOR_PULSE_PERIOD 6944444 #DEFINE MOTOR_PROP_GAIN 10 ' Variables dim rpos as byte ' reference position dim mpos as byte ' actual motor position dim mlag as byte ' amount the motor lags the reference dim enc_new as byte ' holds motor's quadrature encoder data dim enc_last as byte '...
original MikroC code // This constant sets the motor speed. The value is in nanoSeconds per pulse, // as we are using a quadrature encoder there are 4 pulses per encoder slot. // My encoder had 36 slots, so that makes 36*4 or 144 pulses per revolution. // Example; 1 motor rev per second = 144 pulses /sec. // nS per pulse = 1 billion / 144 = 6944444 //#define MOTOR_PULSE_PERIOD 1736111 // 4 RPS //#define MOTOR_PULSE_PERIOD 3472222 // 2 RPS define MOTOR_PULSE_PERIOD 6944444 // 1 RPS //#define MOTOR_PULSE_PERIOD...
Thanks Anobium, sorry I posted the wrong version of the code. I asked the AI for help, that's why the AI added all that.
C to GCBASIC Porting Rules High-Level Cheat Sheet for PIC16F628A (MikroC → GCBASIC)) 1. Chip & Clock MikroC C GCBASIC #pragma config FOSC = HS #chip 16F628A, 20 (any config) #option explicit (recommended) Rule: Always start with #chip <model>, <MHz> 2. Functions C GCBASIC void main() Use a label Main: void interrupt() Sub Interrupt Rule: Use Sub and Interrupt End with End Sub 3. Infinite Loop C GCBASIC while(1) { } Do → Loop Rule: No condition needed 4. Variables C Type GCBASIC unsigned char Dim...
C to GCBASIC Porting Rules High-Level Cheat Sheet for PIC16F628A (MikroC → GCBASIC)) 1. Chip & Clock MikroC C GCBASIC #pragma config FOSC = HS #chip 16F628A, 20 (any config) #option explicit (recommended) Rule: Always start with #chip <model>, <MHz> 2. Functions C GCBASIC void main() Use a label Main: void interrupt() Sub Interrupt Rule: Use Sub and Interrupt End with End Sub 3. Infinite Loop C GCBASIC while(1) { } Do → Loop Rule: No condition needed 4. Variables C Type GCBASIC unsigned char Dim...
Also, the original source code. You should share this. As the logic in your code provided does not make sense to me. 'if (enc_new > 1) <> (enc_last & 1) then' this makes no sense. It will compile but the outcome is not what you need. This surely should be a bitwise inspections. The code may not work as expected. Post the C source.
Hello, I am not sure who added this to your code but they gave you good advice. But, not complete. // 1. **Syntax**: GCBasic uses a different syntax than MikroC (Basic-like vs C-like) // 2. **Bit operations**: Used bitwise operators instead of .F0/.F1 notation // 3. **Interrupt handling**: GCBasic uses `oninterrupt` statements // 4. **Variable declaration**: Used `dim` instead of type declarations // 5. **Constants**: Used `const` instead of `#define` // 6. **Delay**: Used `delayms` instead of `Delay_mS()`...
I would be very grateful if someone could help me. I'm trying to compile this code but I can't get it to work. Gbasic version : 2025.10.04 (Windows 64 bit) : Build 1523
Build Note: mpk_build_1527.mpk 📦 Build Identifier Filename: mpk_build_1527_PIC-AS_reverse_fix.mpk Build Number: 1527 Build Type: Library Patch / Config Parser Bugfix Date: 12 November 2025 Author: EvanV 🧩 Components Included Updated configuration file parser for FreeBASIC integration Fix for incomplete loading in ReverseCfgFileLookup array on legacy PIC config files 🛠️ Changes & Fixes Resolved bug where ReverseCfgFileLookup failed to load all relationships during config file parsing Issue previously...
### Changelog Entry
I have added three more devices - remove the existing MPK and reapply the updated MPK.
Build Note: mpk_build_1525 📦 Build Identifier Filename: mpk_build_1525_16F175xx_chipfilles.mpk Build Number: 1525 Build Type: Chipfile Extension / Device Support Update Date: 6 November 2025 Author: Anobium (SourceForge contributor) 🧩 Components Included - added more 11/11/25 New chipdata files for PIC16F175xx series Integration with GCSTUDIO for automatic installation Preliminary support for: PIC16F17524 PIC16F17525 PIC16F17526 PIC16F17544 PIC16F17545 PIC16F17546 PIC16F17554 PIC16F17555 PIC16F17556...
Dang! Embarrassed. I knew that...ahem, more than 10 years ago! Thank you Angel.
hi Lewis and welcome. in deed the compiler is telling you that this part (pic 12f675) didn't have a port B (it's a tinny pic with only 6 IO pins) when you read the datasheet of that part you can see that those pins are called GP0, GP1, GP2, GP3, GP4 and GP5. you can use this designations in GC basic, so for example you can use: dir GP1 out do forever GP1 = 1 wait 1 s GP1 = 0 wait 1 s loop to blink a led on pin 6 happy coding! Angel
I am a Noobie feeling my way around. New GC Studio installation/latest version. Used: first-start-sample.gcb Added #option Explicit No errors were reported using #CHIP 16f886 Changed to an old PIC part in hand. #CHIP 12f675 [{ Line 42 PulseOut PortB.5, 100 ms "resource": "/c:/GCstudio/gcbasic/demos/first-lew-test.gcb", "owner": "gcb", "severity": 8, "message": "Variable PORTB was not explicitly declared", "source": "gcb", "startLineNumber": 42, "startColumn": 1, "endLineNumber": 42, "endColumn":...
Great question. Each is cumulative. Apply each one. If the MPK needs prerequisites then that should be in the package. Want a deep insight? open the MPK in pkzip, 7zip or your favourite archive package. All will be revealed.
Hello, Are the MPK package cumulative? Do we need to install all them one after other, or is always the latest only necessary? Thank
Build Note: mpk_build_1526.mpk 📦 Build Identifier Filename: mpk_build_1526_legcay_pwm_fix.mpk Build Number: 1526 Build Type: Library Patch / PWM Bugfix Date: 5 November 2025 Author: Angel Mier (SourceForge contributor) 🧩 Components Included Updated PWM library for legacy PIC chips Fix for HPWM compilation error on PIC16F876A and similar devices 🛠️ Changes & Fixes Resolved bug where HPWM failed to compile when assigning fractional values to DC1B0 Error previously triggered by code like: Error: Cannot...
Build Note: PWM_build_1526.mpk 📦 Build Identifier Filename: mpk_build_1526_legcay_pwm_fix.mpk Build Number: 1526 Build Type: Library Patch / PWM Bugfix Date: 5 November 2025 Author: Angel Mier (SourceForge contributor) 🧩 Components Included Updated PWM library for legacy PIC chips Fix for HPWM compilation error on PIC16F876A and similar devices 🛠️ Changes & Fixes Resolved bug where HPWM failed to compile when assigning fractional values to DC1B0 Error previously triggered by code like: Error: Cannot...
Build Note: mpk_build_1525 📦 Build Identifier Filename: mpk_build_1525_16F175xx_chipfilles.mpk Build Number: 1525 Build Type: Chipfile Extension / Device Support Update Date: 6 November 2025 Author: Anobium (SourceForge contributor) 🧩 Components Included New chipdata files for PIC16F175xx series Integration with GCSTUDIO for automatic installation Preliminary support for: PIC16F17524 PIC16F17525 PIC16F17526 PIC16F17544 PIC16F17545 PIC16F17546 PIC16F17554 PIC16F17555 PIC16F17556 🛠️ Changes & Fixes...
Build Note: mpk_build_1524 📦 Build Identifier Filename: mpk_build_1524_compiler_sub_parameter_improvements Build Number: 1524 Build Type: Maintenance / Diagnostic Enhancement Date: 25 October 2025 Author: Anobium (as posted on SourceForge) 🧩 Components Included GCBASIC compiler core messages.dat MPK diagnostic subsystem 🛠️ Changes & Fixes Improved error messaging when a Byte is passed to a Sub expecting a String Previously: ambiguous or misleading error output Now: clearer diagnostic to aid debugging...
okay! i have done that and is working now thank you Angel.
Disregard my previous post, Evan just fixed the bug on the library, download this attached package and double click on it to add to GC Studio, this should fix the issue. Test and report back. Angel
it seems to be a bug on the pwm code for the legacy chips, I found that If you change the pic speed to any value lower than 10mhz (like a 8mhz crystal) it compiles successfully on that chip, can you test if this work around produces the expected PWM?
Angel, what could be the problem, i wan to use the sample for something then found out isn't compiling, just stuck here (: samco
here is the gcb
here is the gcb
chip 16F876A,20 ;#option explicit ' --- 'Main code 'freq 40khz 'variable duty from 0% to 100% do 'Turn up brightness over 2.5 seconds For Bright = 1 to 255 HPWM 1, 40, Bright wait 10 ms next 'Turn down brightness over 2.5 seconds For Bright = 255 to 1 HPWM 1, 40, Bright wait 10 ms next loop
can you attach your source file or an example of the code that fails? this will help us to fix this more quickly. Angel.
hey, after i updating my compiler to the new version i got this error please someone should help me on how to solve it, on the old compiler it compile fine but when i copy past on new one it doesnt work rather show this error (2025.10.04 (Windows 64 bit) : Build 1523) pwm.h ** (461): Error: Cannot store 2.6 in the byte variable DC1B0 (System Include)
New chipdata files for PIC16F175xx. These are not validated but they will work. Apply using GCSTUDIO and this will be automatically installed.
Also, adding the following to PICKitPlus. Support for 9 new devices to be added: PIC16F17524 PIC16F17525 PIC16F17526 PIC16F17544 PIC16F17545 PIC16F17546 PIC16F17554 PIC16F17555 PIC16F17556
News. PIC16F175xx. Adding 12 new PICs. Microchip have actually added new PICs. I honestly thought that 8-bit PIC development had ceased. Well I got that wrong.
I went and temporarily edited out the warning for 64x32 in glcd-ssd_1306.h It compiles and seem to work, but it seems not practical for drawing many pixels, since it quickly eats up program memory. One pset in the normal way: Program Memory: 565/16384 words (3.45%) RAM: 304/2048 bytes (14.84%) One pset in low memory mode: Program Memory: 598/16384 words (3.65%) RAM: 178/2048 bytes (8.69%) I'm not sure if this can be made more efficient for the 64x32 and RAM or this as low as it gets. While comparing...
👍
Check the display datasheet.