-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SPI Settings #1
Comments
Hi, documentation of FT800 says "Only SPI mode 0 is supported", which means that it should work with idle low (CKP=0) and transmit on transition from Idle to active clock state (CKE=0). I don't know how I got it to work in my case. mode 0 and 3 (CKE=1, CKP=1) have similar transmission, so they are interchangeable most of the time, which might explain why your settings work, but I would advise you to test again with CKE=0 and CKP=0 If that works for you I'll adapt the settings in the code |
First Thank you ,i seen your work its fabulous i used yours and Jirka S's Code as Reference(from microchip forum) here my initialization void ini_vGLCD_DRV(void) SYSTEM_PRINTF(("SPI INIT START\n\r")); TRISDbits.TRISD0 = 0; //CLK as OUT PIN_CS = 1; // #define PIN_CS LATBbits.LATB8 PIN_CS_DIR = 0; //#define PIN_CS_DIR TRISBbits.TRISB8 SPI1BRG= 24; // use FPB/4 clock frequency = 2 mhz //used PBCLK2 which 100mhz SYSTEM_PRINTF(("SPI INIT COMPLETE\n\r")); FT800_Init(); } |
@virat92 Have you tried the tweak on the SPI clock polarity that I mentioned? It has been working for me all the while after I made that change. |
yes sir, i did but still not working it got stuck at tr8 #define PIN_CS LATBbits.LATB8 #define PIN_CS_DIR TRISBbits.TRISB8 #define FT800_StartTransmission() PIN_CS_DIR = 0 ``void ini_vGLCD_DRV(void)
} unsigned char tr8(unsigned char value) |
@yamiyukiharu |
I have slightly modified the tr8 function to suit the SPI library generated from MCC Code Configurator. Below are the changes that I made (note that I am using PIC18 platform, it will be a bit different from PIC32):
So I guess we are probably missing out on clearing the write collision flag |
Thank you for your reply :) |
problem remain same ,sir |
Well in that case, I would suggest you to hook up an oscilloscope to check the bits output by the SPI pins to verify if the clock frequency is correct. I've personally encountered many problems with incorrect clock settings in my projects. Hope you solve the issue soon. Cheers |
sir i got something in display but not proper, see my modified code #define PIN_CS LATBbits.LATB8 #define PIN_CS_DIR TRISBbits.TRISB8 #define FT800_StartTransmission() PIN_CS = 0 int dumm; `void ini_vGLCD_DRV(void)
// RPB3R=0X05;
/* SPI1CONbits.ON = 1;
SYSTEM_PRINTF(("CHIP ID=%x\n\r",chipid)); |
Sir , i am able to print logo but it works sometimes and sometimes it is.'t give any responce ,. And it works only with SKP=1 and SKE=1 And sir in PIC32 spi there is no bit of write collision what you suggest for that? |
@yamiyukiharu |
Hi guillaumesmo, thanks for the library as it saved me a lot of development time on the chip! I tested your library with a PIC18F45K80, and I realize that I need to use the following SPI settings in order to make it work:
compared to your settings :
Is there a problem with your settings or am I missing something out?
Thanks!
The text was updated successfully, but these errors were encountered: