I am trying to get an e-paper display to work (pervasive displays 2.7"). It is pre-mounted on an embedded artists board.
First problem is the MOSI and MISO pins for the examples they give (none for microchip unfortunately) the MOSI is connected to the MOSI on the processor and the MISO to the MISO.
Would I be correct in thinking that on a PIC the MISO should go to the SDI and the MOSI to the SDO?
There are also a few other settings for SPI that are not in the help files like CKE. Any ideas what I need to set.
You may assume that I can't seem to open communications and as I've tried reversing the SDI and SDO I may have damaged someting already.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I can help. I have just completed two new SPI GLCD drivers for the next Hot Release,
A few ask first. Post a link to the URL of the product and a link to the Datasheet. What version of GCB are you using? I do have an updated SPI driver and I have also provided a software SPI solution in the new Hot Release. What chip are you planning to use?
Back to your questions. MOSI is chip data out, MISO is chip data in, SDA and SDI respectively. On CKE I think I need to see the product and datasheet.
If you are UK you can send the device to me and I can write a complete driver in a few hours... I think I set a new personal best for the ILI9340 driver a few weeks ago :-)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am trying to drive it with a PIC16F1788.
(I am in Trinidad and Tobago).
Thanks for the help by the way. You will notice that my previous question is also related as the device needs a PWM signal between 100-300 kHz.
GCBasic is version .94
Last edit: David Stephenson 2015-08-12
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Here is the code. I've tried a few variations.
Note at this stage I would be happy if I could turn the screen balck then white so I have not included all the 4 stages recommended for a refresh. Yes I do have an oscilloscope (borrowed), but I was hoping it would not have to get it out.
Looking at the datasheet, the chip and the capabilities of the chip I am not 100% certain this work.
If I am wrong, then sorry.
The max frequency of hardware clock on SPI is 1.64Mhz. I have tested this on the scope. If I look at the datasheet here the minimum clock speed required is 4Mhz. The chip is not fast enough? Software SPI is much slower. Do I have this all wrong?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've got the oscilloscope out and I'm measuring a SPI clock of 3.3 MHz.
Looking at the datasheet 16F1788 it seems the clock should be Fosc/4 so 8MHz (am I interpreting this correctly?)
I will check the ASM to see just waht values GCBasic is putting in the registers.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
A new measurement (I had the variable timebase knob on). I am now getting a 8MHz clock.
I have to say it looks a bit shitty but that may be the capacitance of the probe. It has a longer on time than off and the rise time is about 30 ns.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Oh my what a mistake. It now works.
I have changed back a few things I was trying so I will attach the version that works.
It produces a series of black and white stripes.
Are you using the SYN@GCB IDE? I find all my errors like by selecting the variable and use the match feature. This should be turned by default since the March 2015 release.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I probably should use the IDE (I use notepad!).
A couple of other things are causing problems now. As you probably realize this type of display stays on without power. So if not updated too often can last on (small) batteries for several years.
The controller therefore needs to go into a low power sleep also.
So how do I completely turn off SPI mode and PWM. The PWM is still consuming power during sleep(even after a PWMoff) and the input pin of the SPI stays as an input even after a "DIR out" instruction.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Re power-down. You need to turn the module off. This is a bit somewhere. I am traveling, I would look at the datasheet for the chip. I also remember a Microchip Appnote on low power management and shutting ports down.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
A thought. Now you have the device initialised. Do you want some guidance on making the display driver compliant with the GCG GLCD drivers? The driver would essentially support all the standard GLCD commands and then you can add the extra device specific commands.
It would be very good to have the display driver as a standard driver within Great Cow Basic.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am trying to get an e-paper display to work (pervasive displays 2.7"). It is pre-mounted on an embedded artists board.
First problem is the MOSI and MISO pins for the examples they give (none for microchip unfortunately) the MOSI is connected to the MOSI on the processor and the MISO to the MISO.
Would I be correct in thinking that on a PIC the MISO should go to the SDI and the MOSI to the SDO?
There are also a few other settings for SPI that are not in the help files like CKE. Any ideas what I need to set.
You may assume that I can't seem to open communications and as I've tried reversing the SDI and SDO I may have damaged someting already.
I can help. I have just completed two new SPI GLCD drivers for the next Hot Release,
A few ask first. Post a link to the URL of the product and a link to the Datasheet. What version of GCB are you using? I do have an updated SPI driver and I have also provided a software SPI solution in the new Hot Release. What chip are you planning to use?
Back to your questions. MOSI is chip data out, MISO is chip data in, SDA and SDI respectively. On CKE I think I need to see the product and datasheet.
If you are UK you can send the device to me and I can write a complete driver in a few hours... I think I set a new personal best for the ILI9340 driver a few weeks ago :-)
The link to the display (I have the 2.7" version)
http://repaper.org/doc/cog_driving.html
I am trying to drive it with a PIC16F1788.
(I am in Trinidad and Tobago).
Thanks for the help by the way. You will notice that my previous question is also related as the device needs a PWM signal between 100-300 kHz.
GCBasic is version .94
Last edit: David Stephenson 2015-08-12
ok. I am on my way!!! It is raining here and cold.
Do you have an oscilliscope? I think we need to check your timing, see datasheet.
What code do you already have? Please post. I need to look at all your timings. Are you using hardware spi?
Here is the code. I've tried a few variations.
Note at this stage I would be happy if I could turn the screen balck then white so I have not included all the 4 stages recommended for a refresh. Yes I do have an oscilloscope (borrowed), but I was hoping it would not have to get it out.
Last edit: David Stephenson 2015-08-13
Thanks.
Looking at the datasheet, the chip and the capabilities of the chip I am not 100% certain this work.
If I am wrong, then sorry.
The max frequency of hardware clock on SPI is 1.64Mhz. I have tested this on the scope. If I look at the datasheet here the minimum clock speed required is 4Mhz. The chip is not fast enough? Software SPI is much slower. Do I have this all wrong?
I've got the oscilloscope out and I'm measuring a SPI clock of 3.3 MHz.
Looking at the datasheet 16F1788 it seems the clock should be Fosc/4 so 8MHz (am I interpreting this correctly?)
I will check the ASM to see just waht values GCBasic is putting in the registers.
A new measurement (I had the variable timebase knob on). I am now getting a 8MHz clock.
I have to say it looks a bit shitty but that may be the capacitance of the probe. It has a longer on time than off and the rise time is about 30 ns.
Me too! I am getting 8Mhz clock. So, that is ruled out! :-)
Error spotted in the init code. This will prevent things from worgking.
Line 196 spitransfer dat,r1 should read spitransfer datw,r1
Oh my what a mistake. It now works.
I have changed back a few things I was trying so I will attach the version that works.
It produces a series of black and white stripes.
No problem.
Are you using the SYN@GCB IDE? I find all my errors like by selecting the variable and use the match feature. This should be turned by default since the March 2015 release.
I probably should use the IDE (I use notepad!).
A couple of other things are causing problems now. As you probably realize this type of display stays on without power. So if not updated too often can last on (small) batteries for several years.
The controller therefore needs to go into a low power sleep also.
So how do I completely turn off SPI mode and PWM. The PWM is still consuming power during sleep(even after a PWMoff) and the input pin of the SPI stays as an input even after a "DIR out" instruction.
Yes you should. You are missing out on the syntax checking, highligthing and the intergrated Help. We have a great IDE will even more to come!
Re power-down. You need to turn the module off. This is a bit somewhere. I am traveling, I would look at the datasheet for the chip. I also remember a Microchip Appnote on low power management and shutting ports down.
A thought. Now you have the device initialised. Do you want some guidance on making the display driver compliant with the GCG GLCD drivers? The driver would essentially support all the standard GLCD commands and then you can add the extra device specific commands.
It would be very good to have the display driver as a standard driver within Great Cow Basic.