I want to create a small project that will be located outdoors. St7735 is written to also work at -30 * C. In real winter, the temperature in Latvia drops below -20 * C. Does anyone have experience with this display, or can you suggest something else?
I have built one project using this display, I am satisfied. In the project I use PIC16F1938, a microchip (28 pin) used in demo examples. Now I want to use a different chip with less pins. For example, the PIC16F15325 or 16F18446 I purchased. In the old project ST7735 I connected to 161938 as shown in the example so that there is no need to look for problems. What should I consider when choosing chip outputs to connect to this display?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks Anobium! However, I choose option 3, stick to my chips :) I ask more about the display ST7735, because this driver has been manufactured for a long time and is still used.
Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Assuming software SPI works ( you need to ensure this does work. As the software SPI ensure you have connectivity). Then, you need to config PPS. I have used PPSTool - selecting the SDO1, SDI1 and SCK1 for your chip.
Please check the ports I have assigned!
'Generated by PIC PPS Tool for Great Cow Basic'PPS Tool version: 0.0.6.2'PinManager data: Not available (3)'Generated for 16f18446''Template comment at the start of the config file'
#startupInitPPS, 85
#definePPSToolPart16f18446SubInitPPS'Module: MSSP1SSP1DATPPS=0x0014'RC4 > SDI1RB4PPS=0x0014'SDO1 > RB4RB6PPS=0x0013'SCK1 > RB6SSP1CLKPPS=0x000E'RB6 > SCK1 (bi-directional)EndSub'Template comment at the end of the config file
Now, add this to the program. reinstate the constant ST7735_HardwareSPI and all should work.. a lot faster than the software SPI option.
Which tab did the ST7735 have? options are shown below.
#defineST7735TABCOLORST7735_BLACKTAB' can be ST7735_BLACKTAB, ST7735_GREENTAB or ST7735_REDTAB. Each tab is a different ST7735 configuration.' you may have to try all three - if you do not know what ST7735 chipset you have.
Last edit: Anobium 2022-04-06
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
As I mentioned, I started with a standard demo example, first setting up the connection between the display and the microcontroller. When it's ok, I'll continue my program. step by step.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
As usual, careless mistakes make me ... Thanks Anobium! Everything is working now and I have to start implementing the project code :) many questions will start from me in the forum :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks Stan! There is a lot of work in the workplace, but when I have an idea to improve or change something or invent something new and beautiful in the equipment built on PIC and GCB in my home, I have to mature and take action.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Brill bro. I get a buzz when my code works eventually.
When I code I create my own problems and fix them. I find it good mind logic exercise.. honest. I don't get annoyed when things don't work as planned. NOT!
Last edit: stan cartwright 2022-04-06
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I did use a temp/humidity sensor from ebay and Anobium said I was ripped off as it didn't have humidity but I didn't lose sleep over it. It was just an experiment but it made me think why do this when there's cheap ebay alternatives?
my bike £1 back light turns leds on and off.
It's hard to think of new projects ideas that's not been done before but some things have not been done on gcb. A lot really... see arduino library's.
Anobium sorts stuff like VL53L0x laser rangefinder, I think I had to send him one but he did all the work to get it working with gcb and I built an obstacle avoiding robot using it. The whole robot used gcb like interrupt for the stepper motors and the servo for the laser
I couldn't have bought one for the price it cost me... £15 with nano but it's nice I think to make something from not a kit. This is years ago but it's I made it. https://www.youtube.com/watch?v=YO7ghMglLkA
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The display cannot display a single line sentence (a sentence consists of a few words). To display a sentence, how should I create a running string correctly? Could you give an example of a small one?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I notice my code has #define GLCD_EXTENDEDFONTSET1 in it. Yours doesn't mention fonts.
As Anobium said define a font. After all your bother I hope it is a nice display.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks Stan and Anobium. You do not understand the question of scrolling text on the display. I asked how to create a scrolling text on the display. I've done it with LED 7-segment indicators.
But now the next question. Before the project, I try out all the features I will need in the project. I plan to use 2 timers at a time. I've already done this in one other project where I use timer0 and timer1 at the same time. There was no GLCD and I am using pic16f18855. But in this code I want to use GLCD and want to run both timers at the same time.
With both timers, the display hangs, leaving one side in one color and the other side in another color. :)
I tried to use timer0, timer3, the same thing happens.
If use any only 1 timer, it's ok!
#chip 16f18446,32''#optionexplicit#config Osc = INT, MCLRE_ON, CLKOUTEN_OFF';''=====================#include<glcd.h>;==============================#define BUTTON portc.7dirportc.7in;===============================#define GLCD_TYPE GLCD_TYPE_ST7735 ''i change BLACKTAB, REDTAB, it doesn't change anything, the display works'PinmappingsforSPI#define GLCD_DI portc.4 ' NOT CONNECTED - can loop back if required#define GLCD_DO portb.4 ' > SDA#define GLCD_SCK portb.6 ' > SCL ====SCK#define GLCD_DC portc.6 ' > DC ==== A0#define GLCD_CS porta.5 ' > CS ==== p16#define GLCD_RESET porta.4 ' > RES===== p15'GeneratedbyPICPPSToolforGreatCowBasic'PPSToolversion:0.0.6.2'PinManagerdata:v1.65.2'Generatedfor16lf18446'Templatecommentatthestartoftheconfigfile#startup InitPPS, 85#define PPSToolPart 16lf18446SubInitPPS'Module:MSSP1SSP1DATPPS=0x0014'RC4>SDI1SSP1CLKPPS=0x000E'RB6>SCK1RB6PPS=0x0013'SCK1>RB6(bi-directional)RB4PPS=0x0014'SDO1>RB4EndSub#define ST7735_HardwareSPI ' remove comment out if you want to use software SPI.'===================GLCDCLS''==================================================================================#define TMR1_16bitInitTimer1osc,PS1_8''Timer1un3=16bitutimeris(32MHzinternal)(32000000/4/65536(16bittimeris)/8=15reizesoverflowsekundee)StartTimer1OnInterruptTimer1OverflowCallTimer_1''TMR1IE=1whydonotwork?''==============================inittimer2PS2_128,0''InitTimer2,prescaler,postscaler'Timer2=8bitutimeris(32MHzinternal)(32000000/4/255(8bittimeris)/128=245reizesoverflowsekundee)starttimer2TMR2IE=1''======================================#defineGLCD_EXTENDEDFONTSET1GLCDfntDefaultsize=3sec=0:secfull=0:min=0;========================main:ifsec<>sec_dispthenGLCDPrint(2,2,sec)sec_disp=sec'endififsec<>sec_dispthengotomainsubTimer_1secfull++''==================================ifsecfull>14thensec++:secfull=0''=================================ifsec>59thensec=0endifendsubsubInterrupt''timer2TMR2IF=0endsub
Then when I try separately, any timer only one, then everything works, the display does not hang.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have another question also. When I try Timer 1 and Timer 2 separately, Why can't Timer 1 work with the TMR1IE = 1 flag, I can't write like this?
Timer 1 should write: On Interrupt Timer1Overflow Call xxxxx
But Timer 2 can write :TMR2IE = 1
Then:
sub Ineterrupt
TMR2IE = 0
...........................................
..................................
end sub
Why can't it be done with Timer 1?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You need to study the interrupts more. Use PICINFO the Interrupt tab. The interrupts bit are handled correctly if you use the correct On Interrupt method.
See below.
#define TMR1_16bit
InitTimer1 osc , PS1_8 '' Timer1 un 3 = 16 bitu timeris (32MHz internal) (32000000/4/ 65536 (16 bit timeris)/8 = 15 reizes overflow sekundee)
StartTimer 1
On Interrupt Timer1Overflow Call Timer_1_ISR
TMR1IE = 1
''==============================
inittimer2 PS2_128, 0'' InitTimer2 , prescaler, postscaler
'Timer2 = 8 bitu timeris (32MHz internal) (32000000/4/ 255 (8 bit timeris)/ 128 = 245 reizes overflow sekundee)
starttimer 2
On Interrupt Timer2Match Call Timer_2_ISR
Also. using an ISR method called interrupt will change the behaviour of the interrupt handler. See the help on this. So, in the code above I have correctly called the isr's.
See if this helps.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I want to create a small project that will be located outdoors. St7735 is written to also work at -30 * C. In real winter, the temperature in Latvia drops below -20 * C. Does anyone have experience with this display, or can you suggest something else?
I have built one project using this display, I am satisfied. In the project I use PIC16F1938, a microchip (28 pin) used in demo examples. Now I want to use a different chip with less pins. For example, the PIC16F15325 or 16F18446 I purchased. In the old project ST7735 I connected to 161938 as shown in the example so that there is no need to look for problems. What should I consider when choosing chip outputs to connect to this display?
I would get an LGT328p from Aliexpress (I order 10 more today) - fastest 8bit.
Then, I would use an 18F then either of the chips you have chosen.
Thanks Anobium! However, I choose option 3, stick to my chips :) I ask more about the display ST7735, because this driver has been manufactured for a long time and is still used.
Thanks!
It would be cheaper and easier to buy a temp/weather module from ebay.
they're so cheap why bother build your own?
Stan, Of course, I will build something interesting and individual. I probably chose the wrong pin. the example created on 16f1938 doesn't work. :(
The following is the code from the demo example. I configured the pin incorrectly. There problem. I didn't really understand anything.
I am confused. Are you saying you have this working with a 16F1938 ? I will now assume the answer is yes.
PPS Setup
Assuming software SPI works ( you need to ensure this does work. As the software SPI ensure you have connectivity). Then, you need to config PPS. I have used PPSTool - selecting the SDO1, SDI1 and SCK1 for your chip.
Please check the ports I have assigned!
Now, add this to the program. reinstate the constant ST7735_HardwareSPI and all should work.. a lot faster than the software SPI option.
Which tab did the ST7735 have? options are shown below.
Last edit: Anobium 2022-04-06
Thanks Anobium Hmm compiler compiles error for this sub. Should I try to choose other pins?
I am guessing without your source code....
Yes, here's this part compiled ok!
Here is the part of the demo program to which the compiler finds an error when adding to execution:
As I mentioned, I started with a standard demo example, first setting up the connection between the display and the microcontroller. When it's ok, I'll continue my program. step by step.
And configuration setting also not valid: PLLEN_ON
As usual, careless mistakes make me ... Thanks Anobium! Everything is working now and I have to start implementing the project code :) many questions will start from me in the forum :)
Pleasure.
When you get the base demo working.. please send to me so I can include in the demo folder.
So what's the weather like outside? I just look out the window but serious, nice if you got it working. Great when a program works.
Thanks Stan! There is a lot of work in the workplace, but when I have an idea to improve or change something or invent something new and beautiful in the equipment built on PIC and GCB in my home, I have to mature and take action.
Brill bro. I get a buzz when my code works eventually.
When I code I create my own problems and fix them. I find it good mind logic exercise.. honest. I don't get annoyed when things don't work as planned. NOT!
Last edit: stan cartwright 2022-04-06
I did use a temp/humidity sensor from ebay and Anobium said I was ripped off as it didn't have humidity but I didn't lose sleep over it. It was just an experiment but it made me think why do this when there's cheap ebay alternatives?
my bike £1 back light turns leds on and off.
It's hard to think of new projects ideas that's not been done before but some things have not been done on gcb. A lot really... see arduino library's.
Anobium sorts stuff like VL53L0x laser rangefinder, I think I had to send him one but he did all the work to get it working with gcb and I built an obstacle avoiding robot using it. The whole robot used gcb like interrupt for the stepper motors and the servo for the laser
I couldn't have bought one for the price it cost me... £15 with nano but it's nice I think to make something from not a kit. This is years ago but it's I made it.
https://www.youtube.com/watch?v=YO7ghMglLkA
The display cannot display a single line sentence (a sentence consists of a few words). To display a sentence, how should I create a running string correctly? Could you give an example of a small one?
Try changing the fonts set.
I notice my code has #define GLCD_EXTENDEDFONTSET1 in it. Yours doesn't mention fonts.
As Anobium said define a font. After all your bother I hope it is a nice display.
Thanks Stan and Anobium. You do not understand the question of scrolling text on the display. I asked how to create a scrolling text on the display. I've done it with LED 7-segment indicators.
But now the next question. Before the project, I try out all the features I will need in the project. I plan to use 2 timers at a time. I've already done this in one other project where I use timer0 and timer1 at the same time. There was no GLCD and I am using pic16f18855. But in this code I want to use GLCD and want to run both timers at the same time.
With both timers, the display hangs, leaving one side in one color and the other side in another color. :)
I tried to use timer0, timer3, the same thing happens.
If use any only 1 timer, it's ok!
Then when I try separately, any timer only one, then everything works, the display does not hang.
The code does not compile. See the attachment.
Errors have been found:
janis01.gcb (57): Error: If without matching End If
janis01.gcb (61): Error: If without matching End If
So, If I ignore those errors but making into comments then we can analyse the scroll.
The easy way to make the screen scroll would be to use function 0x33 in the datasheet. https://www.waveshare.com/w/upload/e/e2/ST7735S_V1.1_20111121.pdf section 33h. this show how to scroll vertical or horizontal.
I have another question also. When I try Timer 1 and Timer 2 separately, Why can't Timer 1 work with the TMR1IE = 1 flag, I can't write like this?
Timer 1 should write: On Interrupt Timer1Overflow Call xxxxx
But Timer 2 can write :TMR2IE = 1
Then:
sub Ineterrupt
TMR2IE = 0
...........................................
..................................
end sub
Why can't it be done with Timer 1?
You need to study the interrupts more. Use PICINFO the Interrupt tab. The interrupts bit are handled correctly if you use the correct
On Interrupt
method.See below.
Also. using an ISR method called
interrupt
will change the behaviour of the interrupt handler. See the help on this. So, in the code above I have correctly called the isr's.See if this helps.