Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC plus-5110 LCD-GPS-BMP280-HMC5983

Status
Not open for further replies.
Hi B,
Thanks for your initialisation set-up, I've attached a program using it as a starting point.

It will take me a little time to go through the programs posted in #15 and test them.

I'll look into your suggestion of (external) eeprom, once I've got some results. The 5110s are in the post:)

Thanks for your input, C.
 

Attachments

  • 16LF1829_5110LCD.txt
    287 bytes · Views: 345
My 14 bit PIC of choice is the 16F1827, but they are a LOT slower than an Arduino (snip)
There's also the huge problem that the free versions of the XC compilers run EXTREMELY slowly and generate excessively large code, as they deliberately add lot's of spurious bloating to the code.

I'm pretty sure the 1827 can run at 32Mhz too - that's twice as fast (not a lot slower) than a typical Arduino (which are usually limited to 16Mhz or 8Mhz depending on the bootloader). The '27s are pretty stingy with RAM, but for driving an LCD should have enough memory. I'm surprised you found them to be a lot slower than an Arduino - I don't know of any (mainstream) Arduino board running at 32Mhz (most are '328 based with either a 16Mhz crystal or an internal oscillator set to 8Mhz).

Free PIC compilers are usually pretty terrible. The code generated by Oshonsoft, however, I've always found to be really tight. Long before I used the Arduino IDE I used to use Oshonsoft AVR simulator to dump code onto AVR chips; the BASIC complier created compiled code nearly a half the size that the Arduino IDE did. Oshonsoft even created (slightly) smaller code than SourceBoost C. I guess it's a trade off - Arduino does make things relatively simple, but at the cost of code bloat and processing speed (try writing an LED POV display using digitalWrite instead of direct port access and you'll get the idea!).

For larger LCDs you can always stream bitmaps off external eeprom; even a mid-range PIC should have enough programming space to store a font-table of upper and lower case characters (you don't need to store the entire font map in RAM, just 8-bytes per character and read each character from ROM as needed). A lot of colour LCDs use R5G6B5 (5-bits red, 6-bits green, 5-bits blue) which means 2 bytes per pixel; on a 320x240 QVGA display, that's 150kb to store the entire screen image in memory! For displaying a bitmap, reading each pixel from eeprom and displaying it on the fly requires maybe 4-6 bytes (2 for the pixel data, maybe 2 or 4 for the pointer to the data?).

I'm pretty sure a PIC 16F1829 will be more than adequate for driving your LCD.
And if it's using SPI/I2C so you can control the clock line, probably twice as fast as an Arduino would, if you crank it up to 32Mhz!
 
I'm pretty sure the 1827 can run at 32Mhz too - that's twice as fast (not a lot slower) than a typical Arduino (which are usually limited to 16Mhz or 8Mhz depending on the bootloader)
Ahh you are forgetting that a pic is only running at FOSC / 4... So a pic with 20Mhz crystal will have a system clock of 5Mhz... Having said that, I have run several graphical screens and I get quite fast refresh rates.. The biggest draw back on a pic 14 is there will only ever be up to 1k of ram...
 
I'm pretty sure the 1827 can run at 32Mhz too - that's twice as fast (not a lot slower) than a typical Arduino

As Ian has already pointed out, your error is confusing clock speeds with MIPS and an Arduino at 16MHz is a lot faster than a 16F at 32MHz.

The 24F series is a different matter though, as it's faster :D

I'm pretty sure a PIC 16F1829 will be more than adequate for driving your LCD.
And if it's using SPI/I2C so you can control the clock line, probably twice as fast as an Arduino would, if you crank it up to 32Mhz!

Just not enough RAM or ROM, the amount of set-up data alone means you're struggling with a 16F - easier to just move to the 24F where you've got the speed, plus more RAM and ROM than an Arduino. Adding an external EEPROM (I'd use a FRAM anyway) is pretty pointless just to make it work, just use a 24F (or better).

As for SPI speeds, again you're confused over clock and running speeds :D
 
Hi I and N,

Can you suggest a more suitable PIC, especially if you used one with one of these screens, please? I'm looking for the minimum needed.

Do either of you have any Oshonsoft programs for these screens, similar to the ones Blinky has posted?

C.
 
As Ian has already pointed out, your error is confusing clock speeds with MIPS and an Arduino at 16MHz is a lot faster than a 16F at 32MHz. As for SPI speeds, again you're confused over clock and running speeds :D

Aha! I did forget the old fosc/4 MIPS!=clock speed issue!

But - and maybe it's to do with the Arduino IDE/compiler or even just the way the code was written - I've found that in practice, code running on a 16F1825/9 runs (or at least appears to run) "faster" than the equivalent on Arduino; for example, when playing audio files from an sd card with Arduino, I struggled to get the data off the card (including navigating the necessary fat tables) quickly enough to play audio at anything better than 8-bit 22khz. The equivalent code on a 16F1825 could play 16-bit audio without any glitching. I found that putting a logic probe on the i/o lines of a PIC at 32Mhz resulted in "faster" performance than the same routines on an Arduino. Similarly, I had to really work to get a flicker-free LED POV working with Arduino, but the PIC (despite having "slower hardware") could keep the LEDs strobing more than quickly enough to maintain the illusion.
I'm by no means an Arduino expert so maybe there's something I should (or shouldn't) be doing to get better performance out of the avr chips with Arduino!
With all that said, I reckon I might need to look at some PIC24/32 chips one of these days - although I don't think the Oshonsoft compiler (that the original poster said he was using) supports these yet.
 
hi C,
I started using the 18F4620 PIC some time ago for SD work, check out the spec.
BTW: Oshonsoft supports the 18F4620.
E.
A002.gif
 
Can you suggest a more suitable PIC, especially if you used one with one of these screens, please? I'm looking for the minimum needed.

Can't help you with Oshonsoft, but the 5110 is perfectly fine with the 16F1827, as it has enough RAM and ROM for that small device, including enough RAM for a full screen buffer, as you need one to draw to and then transfer to the screen (as you can't read back from the screen).
 
Hi,
Ok, thanks for the suggestions, including the Arduino ones, but I prefer my little system using Oshonsoft and PICs.

So for the simplest 5110 driving circuit a 16F1827 is fine.
E, Once I've got this going, I'll look at larger PICs that include hopefully images + screen + program here: https://www.electro-tech-online.com...ceiving-using-scr-radio-modules.149198/page-6

Now we need to select the best program to try out from the selection from #15, using the initialisation in #21
C.
 
I use the pic18f4620.... I have nearly 4k RAM and 64k of Code... This can run at 32Mhz..

As of today, I have moved to the pic18f45k22... This is a beast... 64k code nearly 4k ram 1k eeprom 64Mhz and more peripherals than you can imagine, two seial ports ( Why I need it )... I won't need any more... Pin compatable with my system.... Job done...
 
I use the pic18f4620.... I have nearly 4k RAM and 64k of Code... This can run at 32Mhz..

As of today, I have moved to the pic18f45k22... This is a beast... 64k code nearly 4k ram 1k eeprom 64Mhz and more peripherals than you can imagine, two seial ports ( Why I need it )... I won't need any more... Pin compatable with my system.... Job done...
Hi I,
Thanks, Would you please repeat yourself, following the thread I posted above, and I'll check it once I've got these screens working. (As I soon overload with information:arghh:)
C.
 
Hi,
I've tried a program attached. I changed a few things for 16F877A to 16LF1829 (I chose it instead of 16LF1827)
It compiles, but I'm puzzled about the LCD and readout settings.
C.
 

Attachments

  • 16LF1829 INT32 5110LCD 030417.txt
    12.8 KB · Views: 360
Hi I,
Thanks, Would you please repeat yourself, following the thread I posted above, and I'll check it once I've got these screens working. (As I soon overload with information:arghh:)
C.
Don't let me confuse you... I was just throwing other chips that available into the mix... If you need to use Pic16, by all means.. I'll shut up!!
 
Don't let me confuse you... I was just throwing other chips that available into the mix... If you need to use Pic16, by all means.. I'll shut up!!
Hi I,
I looked up the PIC and it is impressive, I'll note it on the other thread, for when I need it. Thanks for the suggestion. (Don't shut up;))
C.
 
Hi,
I've been thinking!!! My initial plan was to make the smallest PIC controlled screen, which could be unplugged, leaving the rest of any circuit. After re-thinking, and after Ian's suggestion of a larger PIC, my plan now is to use the larger PIC on the main circuit which can control the whole project while also being able to control the screen.
C.
 
Last edited:
Hi,
Can anyone tell, if the screens we are now talking about (84x48 graphic serial type) has a module in the Oshonsoft SIM?
I've looked and don't see how to set up the choices I found, and doesn't appear to be compatible with the programs at #15
C.
 
Hi,
Can anyone tell, if the screens we are now talking about (84x48 graphic serial type) has a module in the Oshonsoft SIM?
I've looked and don't see how to set up the choices I found, and doesn't appear to be compatible with the programs at #15
C.
The beauty of programming micro's is you can write any driver!! If you need to write to a nokia 5110 then write a driver..

This guy has written a nokia 5110 diver in proton basic... You would only need a few functions to get it up and running.. He has a good write up about using pic18's as opposed to pic16's..
 
The beauty of programming micro's is you can write any driver!! If you need to write to a nokia 5110 then write a driver..

This guy has written a nokia 5110 diver in proton basic... You would only need a few functions to get it up and running.. He has a good write up about using pic18's as opposed to pic16's..

Hi I,
Interesting link!
Regarding the Oshonsoft SIM. Can I use the program I posted in #32 to simulate a graphics screen? If so, will you explain how please. For my programming limitations, I need to see it simulate for verification.
C.
 
What you need is some hardware... A pickit3 and MPLAB.... Then you can sim in real time on real hardware..

I'm lucky I have Proteus... All these things are available.... I output an asm file from Oshonsoft then single step from each basic staement to the next... Its very difficult to sim a graphical screen..
 
What you need is some hardware... A pickit3 and MPLAB.... Then you can sim in real time on real hardware..

I'm lucky I have Proteus... All these things are available.... I output an asm file from Oshonsoft then single step from each basic staement to the next... Its very difficult to sim a graphical screen..
Hi I,
I use Pickit3 and MPLAB, but even though I've tried, I have difficulty with ASM. I prefer to simulate in software = Oshonsoft simulator. I can then make the circuit after my findings.

I follow what you say regarding graphical screens, and I'll have to see how I get one once the screens have arrived. Perhaps I can make the circuit and keep trying it with on board programming?

From memory proteus is out of my price range:(
C.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top