I cannot make relatively simple code to work. I get "out of registers" errors all the time.
#chipTINY102DimLedbankaswordaliasportb, portcDimAdcvalAsword'Ensemble LEDsLedbank=0wait1ms'Lire la tensionadcval=readad10(an0)Ledbank=Ledbank*2Ledbank=Ledbankor1
This is using the latest code from Sourceforge compiles up as 0.98.<<>> 2020-08-07.
Is this just broken ?
Patrick
Pardon. Modifie pour corriger la mise en page de la post.
Last edit: AVR 2020-08-27
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Indeed, GCB creates too many SYSTEMP type variables. Anobium has done much to make reduced instruction set devices work. Manual manipulation of the registers may be required.
Not knowing your specific case use for this device, a few suggestions:
There is no PORTC, it has PORTA and PORTB.
Re-thinking how you want to display the leds. By discarding the Dim ledbank as Word Alias statement frees up several variables and does compile. Using bit names like PortA.0 = adcval.7 PortA.1=adcval.6 etc. might work?
The tiny102 only has five effective output pins for leds, PA0, PA1, PB1, PB2, PB3, so this could be handled with ReadAD(ANx).
P.S. Aside from the cost, 8 pin devices like the tiny13a, 25, 45, 85 have worked well for me.
Last edit: kent_twt4 2020-08-27
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
All I can say is the too many register variables error is well known, but the solution is not so simple.
When developing programs it is always easier to use a much more capable chip in terms of RAM, program data space, and even pins. Then optimize and see if it will fit a smaller and less featured and costly device if desired.
Your code does not compile.
Do you have the tiny102? What do you what to do with it? I can test with a tiny104.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Support for AVRrc chips. With Hugh to complete development to handle systempN variables. AVRrc chips are: ATtiny10,ATtiny20,ATtiny4,ATtiny40.ATtiny5,ATtiny9
You will have to reduce the code to just simple code for the time being.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Tested and working on tiny104 using tiny102 pinouts. Uses upper nibble of the adcval.
You will need the extra effort to provide the solution :-) with the tiny10 type reduced instruction set devices.
'The TPIDATA/ADC (PA0) and TPICLK (PA1) pins'have to be "lifted" to program the chip
#chipTINY104,1
#optionexplicitDimadcvalAsByte'led display used common anode configPortB=0b1110PortA.1=1Main:
adcval=ReadAD(AN0)'PortA.0 is adc reading'PortA.2 is RESETadcval=adcval&0b11110000PortB.3=!adcval.7PortB.2=!adcval.6PortB.1=!adcval.5PortA.1=!adcval.4wait5msgotoMain
EDITS: sorry multiple edits, had to make comments on display type and program pins to clarify
Last edit: kent_twt4 2020-08-27
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
#chipTINY104,1
#optionexplicitDimadcvalAsByte'led display used common anode configPortB=0b1110PortA.1=1Main:
adcval=ReadAD(AN0)'PortA.0 is adc reading'PortA.2 is RESETadcval=!adcval&0b11110000PortB.3=adcval.7PortB.2=adcval.6PortB.1=adcval.5PortA.1=adcval.4wait5msgotoMain
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Should not be too hard. The tiny102 is capable of basic operations.
@AVR and @Kato, until a use case is stated, like for example "I want to control motor operation, or speed, with a potentiometer or joystick", OR I want to port PicAxe code, I and others will have a hard time helping.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Please wait for an update, I will ask Hugh to look at the core issue.
Meanwhile, I understand the fustration but if the error happens you need to simplify your code. Less use of WORDs variable, no use of AND/OR etc (use oher methods), and, use in-build timer rather than WAIT.
@AVR and @KATO. I have sent you a PM with the URL to the latest Release Candidate software. This does not resolve the issues you have but it ensures that your complete installation is the most up to date.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There is a danger that people forget that Great Cow Basic is very generously written and maintained at no cost to the end user.
If this was commercial software, sold on the basis that it did work with these specific devices, you might be justified in expecting a swift resolution. As it is provided entirely free of charge and with known limitations for the devices being used, suggesting that a different device is selected is a sensible path forward
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In hindsight I should have made this issue clear when a user used the updated compiler. A few more moments of thought when we were adding the new capability and we could have added compiler messages to inform. Will do this in the future :-)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
No, do not delete the chip files. They are fully functional for these resource limited chips. Just like the PIC 10f series chips, the tiny10 family have entered the manual register manipulation and assembly instructions Zone.
Even if more RAM becomes available thru optimization, people could be sorely disappointed with the 256 or 512 word data program size.
The tiny10 family will never live up to do all devices like the m328p. Not enough on chip periperals at hand. But no one should not be denied to develop, even if GCB commands and libraries will be limited.
If I were to have stopped a project after only a few hours, do to some roadblock; many, many would never have seen completion.
Perhaps a warning in the output window? that one is dealing with limited capability device. And/Or, refer to link explaining the device family limitations?
My $0.02
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
We can do the warning (see below) and I will write a limitations document but the point as initially posted. Simple Great Cow BASIC source code should sort of work
I could change the error message to more frank. Only for these chips.
Error: Out of registers. Please break up any complex calculations
to
Error: Out of registers. This specific microcontroller has limited registers. Please use BYTE variables where ever possible, do not use logic (OR/AND etc) on anything but BYTE variables, use ROTATE rather than mutliplication. Essentially keep the code very simple.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I cannot make relatively simple code to work. I get "out of registers" errors all the time.
This is using the latest code from Sourceforge compiles up as 0.98.<<>> 2020-08-07.
Is this just broken ?
Patrick
Pardon. Modifie pour corriger la mise en page de la post.
Last edit: AVR 2020-08-27
Indeed, GCB creates too many SYSTEMP type variables. Anobium has done much to make reduced instruction set devices work. Manual manipulation of the registers may be required.
Not knowing your specific case use for this device, a few suggestions:
There is no PORTC, it has PORTA and PORTB.
Re-thinking how you want to display the leds. By discarding the Dim ledbank as Word Alias statement frees up several variables and does compile. Using bit names like PortA.0 = adcval.7 PortA.1=adcval.6 etc. might work?
The tiny102 only has five effective output pins for leds, PA0, PA1, PB1, PB2, PB3, so this could be handled with ReadAD(ANx).
P.S. Aside from the cost, 8 pin devices like the tiny13a, 25, 45, 85 have worked well for me.
Last edit: kent_twt4 2020-08-27
Thank you.
The code is just example code to prouver the error. Making program with compiler issue happens with lots of different code for this chip.
Is the posted AVR code working? Do you try my simple program ?
I remove the references to the ports. Same error.
All I can say is the too many register variables error is well known, but the solution is not so simple.
When developing programs it is always easier to use a much more capable chip in terms of RAM, program data space, and even pins. Then optimize and see if it will fit a smaller and less featured and costly device if desired.
Your code does not compile.
Do you have the tiny102? What do you what to do with it? I can test with a tiny104.
@AVR and @kent_twt4
Sorry but this error is caused by the compiler and we are waiting for Hugh to resolve. See item 12 in post https://sourceforge.net/p/gcbasic/discussion/579125/thread/8aafd62637/#9e23
You will have to reduce the code to just simple code for the time being.
This will resolved when?
I have same issue. Any fix available? The seems to happen at random and it very hard to workaround.
Please sort.
Somtimes there is a workaround.
Tested and working on tiny104 using tiny102 pinouts. Uses upper nibble of the adcval.
You will need the extra effort to provide the solution :-) with the tiny10 type reduced instruction set devices.
EDITS: sorry multiple edits, had to make comments on display type and program pins to clarify
Last edit: kent_twt4 2020-08-27
Slightly optimized.
Kent thanks - too hard
Should not be too hard. The tiny102 is capable of basic operations.
@AVR and @Kato, until a use case is stated, like for example "I want to control motor operation, or speed, with a potentiometer or joystick", OR I want to port PicAxe code, I and others will have a hard time helping.
My point is - the compiler does not work. Basic operations that are only a few lines long do not work.
Be best to add something an error message that means something to a normal person. I spent hours before giving up.
Please wait for an update, I will ask Hugh to look at the core issue.
Meanwhile, I understand the fustration but if the error happens you need to simplify your code. Less use of WORDs variable, no use of AND/OR etc (use oher methods), and, use in-build timer rather than WAIT.
Also, see the demos - they may help https://github.com/Anobium/Great-Cow-BASIC-Demonstration-Sources/tree/master/ChipFamily121_AVRrc_Specific_Solutions
The compiler code for these specific chips is NOT completed and we need your help and patience.
@AVR and @KATO. I have sent you a PM with the URL to the latest Release Candidate software. This does not resolve the issues you have but it ensures that your complete installation is the most up to date.
Thank you.
My simple exampke program works with other chips but not these chips. So, it looks like a huge bug to me.
@w_cholmondeley Question is. When will this be fixed? Or, when will you delete the chipfiles to stop this from happening to others?
There is a danger that people forget that Great Cow Basic is very generously written and maintained at no cost to the end user.
If this was commercial software, sold on the basis that it did work with these specific devices, you might be justified in expecting a swift resolution. As it is provided entirely free of charge and with known limitations for the devices being used, suggesting that a different device is selected is a sensible path forward
@mkstevo - thanks for the support.
In hindsight I should have made this issue clear when a user used the updated compiler. A few more moments of thought when we were adding the new capability and we could have added compiler messages to inform. Will do this in the future :-)
No, do not delete the chip files. They are fully functional for these resource limited chips. Just like the PIC 10f series chips, the tiny10 family have entered the manual register manipulation and assembly instructions Zone.
Even if more RAM becomes available thru optimization, people could be sorely disappointed with the 256 or 512 word data program size.
The tiny10 family will never live up to do all devices like the m328p. Not enough on chip periperals at hand. But no one should not be denied to develop, even if GCB commands and libraries will be limited.
If I were to have stopped a project after only a few hours, do to some roadblock; many, many would never have seen completion.
Perhaps a warning in the output window? that one is dealing with limited capability device. And/Or, refer to link explaining the device family limitations?
My $0.02
@kent_twt4
Agree with your post.
We can do the warning (see below) and I will write a limitations document but the point as initially posted. Simple Great Cow BASIC source code should sort of work
I could change the error message to more frank. Only for these chips.
Error: Out of registers. Please break up any complex calculations
to
Error: Out of registers. This specific microcontroller has limited registers. Please use BYTE variables where ever possible, do not use logic (OR/AND etc) on anything but BYTE variables, use ROTATE rather than mutliplication. Essentially keep the code very simple.
Yes, that looks good.
Revised and commited as follows:
:-)
Let us see if we can resolve the real issue. The compiler is capable of managing the variables for the core operations.
I have asked Hugh, previously, to have to look at the issue.
Evan
Why not use like a 08 picaxe chip and use peek and poke. Data sheet says 32 bytes ram,
program memory 1K
Stan... these are the low level compiler management of the system variables. These chip are very very different from any PIC chip.