diff --git a/README.md b/README.md index 91b3b10..1ad6813 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ Note that once you change the firmware on the calculator, it isn't possible to g Connect to Tx of the USB dongle. - Pin 16 is Tx from the microcontroller (purple wire in the picture). Connect to Rx of the USB dongle. -I recommend soldering Tx and Rx wires into the plated through holes on the PCB while soldering up the kit, so that the connections are more permanent. (In the picture, I just soldered the wire directly to the microcontroller pins, but this isn't as reliable as if they were soldered into a through hole.) Note that you must "cross over" Tx/Rx going between the microcontroller and the USB dongle (i.e. Rx on the microcontroller goes to Tx on the USB dongle, and Tx on the microcontroller goes to Rx on the USB dongle). +I recommend soldering Tx and Rx wires into the plated through holes on the PCB while soldering up the kit, so that the connections are more permanent. (In the picture, I just soldered the wire directly to the microcontroller pins, but this isn't as reliable as if they were soldered into a through hole.) Note that you must "cross over" Tx/Rx going between the microcontroller and the USB dongle (i.e. Rx on the microcontroller goes to Tx on the USB dongle, and Tx on the microcontroller goes to Rx on the USB dongle). You must also connect ground to the dongle. A good point to use is header P1. (You may optionally power the calculator with +5V from the USB dongle instead of using button-cell batteries. Header P1 is again a good location to use.) To program the calculator see the "Programming with stcgal" section below. @@ -264,4 +264,16 @@ Thus, there are special compiler directives to tell it what address space to pla # Licensing -This code is licensed under GPLv3. +This code is licensed under GPLv3+: + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + +(Full license text is in LICENSE.md) diff --git a/qt_gui/calc_main.h b/qt_gui/calc_main.h index 9f89bbb..4a90aa9 100644 --- a/qt_gui/calc_main.h +++ b/qt_gui/calc_main.h @@ -1,3 +1,18 @@ +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + + + //header file for main.c for gui #ifndef QT_GUI_CALC_MAIN_H diff --git a/qt_gui/calculator.cpp b/qt_gui/calculator.cpp index b7ba099..deba5bb 100644 --- a/qt_gui/calculator.cpp +++ b/qt_gui/calculator.cpp @@ -1,3 +1,16 @@ +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + #include #include "calc_main.h" #include "../src/lcd.h" diff --git a/qt_gui/calculator.h b/qt_gui/calculator.h index 876dc4a..ebc1168 100644 --- a/qt_gui/calculator.h +++ b/qt_gui/calculator.h @@ -1,3 +1,16 @@ +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + #ifndef QTGUI_CALCULATOR_H #define QTGUI_CALCULATOR_H @@ -38,7 +51,7 @@ class Calculator : public QObject Q_OBJECT Q_PROPERTY(QString lcdText READ lcdText WRITE setLcdText NOTIFY lcdTextChanged) - + public: explicit Calculator(QObject *parent = 0); ~Calculator(); @@ -48,7 +61,7 @@ public: signals: void lcdTextChanged(); - + public slots: void buttonClicked(const QString& in); void updateLcd(); diff --git a/qt_gui/main.cpp b/qt_gui/main.cpp index 98ead16..91a0112 100644 --- a/qt_gui/main.cpp +++ b/qt_gui/main.cpp @@ -1,3 +1,16 @@ +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + #include #include #include @@ -11,7 +24,7 @@ int main(int argc, char** argv) //QML engine QQmlApplicationEngine engine; engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); - + //calculator Calculator calculator; engine.rootContext()->setContextProperty("_calculator", &calculator); diff --git a/qt_gui/main.qml b/qt_gui/main.qml index 4f608c5..fe0a913 100644 --- a/qt_gui/main.qml +++ b/qt_gui/main.qml @@ -1,3 +1,16 @@ +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import QtQuick 2.0 import QtQuick.Controls 1.0 diff --git a/src/calc.c b/src/calc.c index 31f0e75..14def5c 100644 --- a/src/calc.c +++ b/src/calc.c @@ -1,3 +1,16 @@ +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + /* * calc.c * diff --git a/src/calc.h b/src/calc.h index d79f18b..2602161 100644 --- a/src/calc.h +++ b/src/calc.h @@ -1,3 +1,16 @@ +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + /* * calc.h * diff --git a/src/decn/decn.c b/src/decn/decn.c index 4590b05..2225398 100644 --- a/src/decn/decn.c +++ b/src/decn/decn.c @@ -1,3 +1,16 @@ +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + /* * decn.c * diff --git a/src/decn/decn.h b/src/decn/decn.h index 6975e9a..93da64b 100644 --- a/src/decn/decn.h +++ b/src/decn/decn.h @@ -1,3 +1,16 @@ +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + /* * decn.h * diff --git a/src/decn/decn_test.c b/src/decn/decn_test.c index 40d8b9b..6ef1628 100644 --- a/src/decn/decn_test.c +++ b/src/decn/decn_test.c @@ -1,3 +1,16 @@ +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + /* * decn_test.c * diff --git a/src/decn/proto/div_mfp.cpp b/src/decn/proto/div_mfp.cpp index 8557eca..abf6134 100644 --- a/src/decn/proto/div_mfp.cpp +++ b/src/decn/proto/div_mfp.cpp @@ -1,3 +1,18 @@ +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + + + //prototype for reciprocal function for division based on newton-raphson iteration #include diff --git a/src/decn/proto/exp.cpp b/src/decn/proto/exp.cpp index d48ee1f..ff0c3f7 100644 --- a/src/decn/proto/exp.cpp +++ b/src/decn/proto/exp.cpp @@ -1,3 +1,17 @@ +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + + //prototype for exponential function // complement of ln() function based on HP Journal article // "Personal Calculator Algorithms IV: Logarithmic Functions" diff --git a/src/decn/proto/ln_mfp.cpp b/src/decn/proto/ln_mfp.cpp index 0f2047f..e216a1e 100644 --- a/src/decn/proto/ln_mfp.cpp +++ b/src/decn/proto/ln_mfp.cpp @@ -1,3 +1,18 @@ +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + + + //prototype for natural log function based on HP Journal article // "Personal Calculator Algorithms IV: Logarithmic Functions" diff --git a/src/key.c b/src/key.c index b13d3aa..d01e772 100644 --- a/src/key.c +++ b/src/key.c @@ -1,3 +1,16 @@ +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + /* * key.c * diff --git a/src/key.h b/src/key.h index c01c0de..edeca45 100644 --- a/src/key.h +++ b/src/key.h @@ -1,3 +1,16 @@ +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + /* * key.h * diff --git a/src/lcd.c b/src/lcd.c index dc314db..32777f1 100644 --- a/src/lcd.c +++ b/src/lcd.c @@ -1,3 +1,18 @@ +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + + + //#define DEBUG #include "stc15.h" diff --git a/src/lcd.h b/src/lcd.h index 735e4ad..cff0a7d 100644 --- a/src/lcd.h +++ b/src/lcd.h @@ -1,3 +1,16 @@ +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + #ifndef LCD_H #define LCD_H diff --git a/src/lcd_emulator.c b/src/lcd_emulator.c index f23dc2b..5dc4f7f 100644 --- a/src/lcd_emulator.c +++ b/src/lcd_emulator.c @@ -1,3 +1,16 @@ +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + /* * lcd_emulator.c * diff --git a/src/main.c b/src/main.c index c72f001..3be2a5d 100644 --- a/src/main.c +++ b/src/main.c @@ -1,3 +1,17 @@ +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + + // // STC15 RPN calculator // diff --git a/src/qt_main.cpp b/src/qt_main.cpp index 3e0546b..f24df29 100644 --- a/src/qt_main.cpp +++ b/src/qt_main.cpp @@ -1,3 +1,18 @@ +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + + + // dummy .cpp file, so that this is c++ #include "main.c" diff --git a/src/stc15.h b/src/stc15.h index 13d18bf..b8fb312 100644 --- a/src/stc15.h +++ b/src/stc15.h @@ -1,3 +1,16 @@ +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + #ifndef _STC15_H_ #define _STC15_H_ @@ -31,8 +44,8 @@ __sbit __at (0xcf) P5_7 ; __sfr __at 0x94 P0M0; __sfr __at 0x93 P0M1; -__sfr __at 0x92 P1M0; -__sfr __at 0x91 P1M1; +__sfr __at 0x92 P1M0; +__sfr __at 0x91 P1M1; __sfr __at 0x96 P2M0; __sfr __at 0x95 P2M1; __sfr __at 0xB2 P3M0; @@ -46,7 +59,7 @@ __sfr __at 0xCB P6M1; __sfr __at 0xE2 P7M0; __sfr __at 0xE1 P7M1; -__sfr __at 0x8E AUXR; +__sfr __at 0x8E AUXR; __sfr __at 0xA2 AUXR1; __sfr __at 0xA2 P_SW1; __sfr __at 0x97 CLK_DIV; @@ -89,7 +102,7 @@ __sfr __at 0xA9 SADDR; __sfr __at 0xB9 SADEN; //ADC -__sfr __at 0xBC ADC_CONTR; +__sfr __at 0xBC ADC_CONTR; __sfr __at 0xBD ADC_RES; __sfr __at 0xBE ADC_RESL; @@ -99,42 +112,42 @@ __sfr __at 0xCE SPCTL; __sfr __at 0xCF SPDAT; //IAP/ISP -__sfr __at 0xC2 IAP_DATA; +__sfr __at 0xC2 IAP_DATA; __sfr __at 0xC3 IAP_ADDRH; __sfr __at 0xC4 IAP_ADDRL; __sfr __at 0xC5 IAP_CMD; __sfr __at 0xC6 IAP_TRIG; -__sfr __at 0xC7 IAP_CONTR; +__sfr __at 0xC7 IAP_CONTR; -//PCA/PWM -__sfr __at 0xD8 CCON; +//PCA/PWM +__sfr __at 0xD8 CCON; __sbit __at 0xDF CF; __sbit __at 0xDE CR; __sbit __at 0xDA CCF2; __sbit __at 0xD9 CCF1; __sbit __at 0xD8 CCF0; -__sfr __at 0xD9 CMOD; -__sfr __at 0xE9 CL; -__sfr __at 0xF9 CH; -__sfr __at 0xDA CCAPM0; +__sfr __at 0xD9 CMOD; +__sfr __at 0xE9 CL; +__sfr __at 0xF9 CH; +__sfr __at 0xDA CCAPM0; __sfr __at 0xDB CCAPM1; -__sfr __at 0xDC CCAPM2; -__sfr __at 0xEA CCAP0L; -__sfr __at 0xEB CCAP1L; -__sfr __at 0xEC CCAP2L; -__sfr __at 0xF2 PCA_PWM0; -__sfr __at 0xF3 PCA_PWM1; -__sfr __at 0xF4 PCA_PWM2; -__sfr __at 0xFA CCAP0H; +__sfr __at 0xDC CCAPM2; +__sfr __at 0xEA CCAP0L; +__sfr __at 0xEB CCAP1L; +__sfr __at 0xEC CCAP2L; +__sfr __at 0xF2 PCA_PWM0; +__sfr __at 0xF3 PCA_PWM1; +__sfr __at 0xF4 PCA_PWM2; +__sfr __at 0xFA CCAP0H; __sfr __at 0xFB CCAP1H; -__sfr __at 0xFC CCAP2H; +__sfr __at 0xFC CCAP2H; __sfr __at 0xE6 CMPCR1; __sfr __at 0xE7 CMPCR2; //PWM -__sfr __at 0xf1 PWMCFG; +__sfr __at 0xf1 PWMCFG; __sfr __at 0xf5 PWMCR; __sfr __at 0xf6 PWMIF; __sfr __at 0xf7 PWMFDCR; @@ -178,8 +191,8 @@ __sfr __at 0xf7 PWMFDCR; #define PWM6T2H (*(unsigned char volatile xdata *)0xff42) #define PWM6T2L (*(unsigned char volatile xdata *)0xff43) #define PWM6CR (*(unsigned char volatile xdata *)0xff44) -#define PWM7T1 (*(unsigned int volatile xdata *)0xff50) -#define PWM7T1H (*(unsigned char volatile xdata *)0xff50) +#define PWM7T1 (*(unsigned int volatile xdata *)0xff50) +#define PWM7T1H (*(unsigned char volatile xdata *)0xff50) #define PWM7T1L (*(unsigned char volatile xdata *)0xff51) #define PWM7T2 (*(unsigned int volatile xdata *)0xff52) #define PWM7T2H (*(unsigned char volatile xdata *)0xff52) diff --git a/src/utils.c b/src/utils.c index 18e97d8..38680ed 100644 --- a/src/utils.c +++ b/src/utils.c @@ -1,3 +1,16 @@ +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + #include #include "utils.h" #ifndef DESKTOP diff --git a/src/utils.h b/src/utils.h index fb9709a..7ea239a 100644 --- a/src/utils.h +++ b/src/utils.h @@ -1,3 +1,16 @@ +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + /* * utils.h *