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.

Nokia 5110 HW in Oshonsoft

camerart

Active Member
Hi,
I have Nokia 5110 screens working with software in Oshonsoft, but I want them to work in Hardware.

Here is a program that posted by 'Ian rogers' back in 2017: https://www.electro-tech-online.com/threads/lcd-spi-projects.152107/post-1309652
which works, but not with a Font I have as an INCLUDE.

I have a HW program, which I haven't got working yet. I think it could be SPICSON/OFF in HW.
Here is an example:
'===========================================
'Initialize BMP280
init_BMP280:
'Compensation parameters
SPICSOn
For i = 0 To 23
altmtr_cs = 0 'CHIP SELECT BMP280 ON
adr = 0x88 + i
SPISend adr
SPIReceive data
b(i) = data
altmtr_cs = 1 'CHIP SELECT BMP280 OFF
Next i
SPICSOff
'=======================================
What does SPICON and OFF actually do, and how can I write it in HW, please?

Cheers, Camerart
 

camerart

Active Member
In oshonsoft you can set constants

const SPICS = PORTB.1 ' or whatever!

then use
SPICS = 0 ' to turn on
and
SPICS = 1 ' to turn off
Hi I and J,
I now read it as SPI CS ON, so it was in front of me all of the time.
To me, something doesn't add up! I have a 5110_CS, so what does SPICSON (meaning LOW) select? or are they the same, so I only need 5110_cs?
NOTE: The PIC is in MASTER mode
C
 
Last edited:

Ian Rogers

User Extraordinaire
Forum Supporter
Most Helpful Member
The nokia connects via SPI so the CS is on the nokia, so you call it what is best for you... I used SPICS as there was a single use.. When multi SPI is used, I'll name each one by device...

Eeprom_Cs, Lcd_ Cs etc..
 

camerart

Active Member
The nokia connects via SPI so the CS is on the nokia, so you call it what is best for you... I used SPICS as there was a single use.. When multi SPI is used, I'll name each one by device...

Eeprom_Cs, Lcd_ Cs etc..
Hi I,
Ok, so my LCD_CS plus COMP_CS plus ALT_CS, is fine. I was puzzled by both the CS and SPICSON, but now I see I only need one of them.
Thanks, all.
C
 

camerart

Active Member
Hi I,
The program link in #1 works, and I've played with it a bit, but so far I've only played with BYTEs which fill the screen or make pattern.
Using a digital analyser on this program,bives unusual results, as the SCK clock doesn't look as I'm used to! See attached.

A friend of mine is helping me to integrate the 5110 screen ito a longer program I've been working on for years (I'm sure you remember), but I can't it to work.

I want to use FONTS see attached:

Can 'your' program be modified to use Fonts?
Cheers, C.
 

Attachments

  • FONT.SML.txt
    4.1 KB · Views: 32
  • Ian SCK.png
    Ian SCK.png
    122.3 KB · Views: 32
Last edited:

camerart

Active Member
Give me a day (ish) Can you post the program??
Hi I,
Here is the FULL program plus the 3x INCLUDES.
The FULL program is very long, so if I am asking too much, please don't hesitate to say no.
Let me know if you are happy to integrate the 5110 into this program, I'll be happy either way.
No hurry at all! This has taken me and a friend of mine a month or two so far.
There's lots commented out, which is left to remind me it was there, remove it if you want.
Good luck :)
Cheers, C
 

Attachments

  • 18F46K20 32MHz EXT PCB_8 FIN_BASE FULL 5110 180722 0800.bas
    39.1 KB · Views: 32
  • fontsml.bas
    4.1 KB · Views: 28
  • Main MCU config.bas
    2.7 KB · Views: 28
  • Peripheral setup.bas
    5.8 KB · Views: 30

camerart

Active Member
Hi Ian,
I was having issues with LCD_CS (5110) and while checking for conflicts found this:
It relates to LCD_CD (COMMAND/DATA), but I think it is a conflict.
Cheers, C
 

Attachments

  • Muliplexed.png
    Muliplexed.png
    38.7 KB · Views: 31

Ian Rogers

User Extraordinaire
Forum Supporter
Most Helpful Member
Wow..... What a piggin struggle... I thought it was the SPI mode at first as it wouldn't work.
The problem ended up in the fonts library... select case will not accept a string object even though only one character is sent...

I have a lil file called ianstest.bas and a new font file... play with it first then you can copy it in as you need.

If you look at my "dospi()" function it has to wait for the SPI to be unbusy... This write the MSG to the screen.
 

Attachments

  • fontsml.bas
    4.5 KB · Views: 24
  • ianstest.bas
    4.4 KB · Views: 25

camerart

Active Member
Wow..... What a piggin struggle... I thought it was the SPI mode at first as it wouldn't work.
The problem ended up in the fonts library... select case will not accept a string object even though only one character is sent...

I have a lil file called ianstest.bas and a new font file... play with it first then you can copy it in as you need.

If you look at my "dospi()" function it has to wait for the SPI to be unbusy... This write the MSG to the screen.
Hi I,
Thank you, it works :)

I, plus a friend of mine, who is a better CODEr than me, have spent weeks almost getting there.

Even though you posted the BYTE to 5110 approx 5 years ago, I've only just returned to it, as now it is needed. It will avoid radio link clashes. I use a radio to computer terminal to feedback of what's happening.

This is the final peripheral, so once we've learnt how your CODE works, we will integrate it into the FULL program, then a bit of tidying (A week or so) and the project will be ready to have the RC program written into it. This phase is like having a brilliant tool and learning how to play with it.

The original idea is to radio control a Tricopter, for videos, but on the occassions, that I think about what it could do, the mind boggles.

My friend who's helping me, is wheelchair bound and a radio Ham, as I am, and sometimes before he's been helped out of bed, he is unable to use his radio, but with radio control, with the feedback it has, should be able to have a dashboard at the side of his bed, or other places.
Cheers, thanks again, C
 

Latest threads

Top