![]() ![]() ![]() As this is optional, both codes should work on your LCD. The code on the website you sent me is very similar to my codes, except that the author does not set the gamma control (ST7735_GMCTRP1) of the LCD during initialization. If you're using the PICKit for programming, make sure that none of the pins you use for this LCD conflicts with the pins used for the PICKit – that will cause problems. This ensures that the LCD can receive the proper initialization data. The same applies for other output pins too, make sure that you can set their states from codes. RA6 is a special pin on this PIC, so your configuration bits (_CONFIG() declaration at the beginning of your code) will needs to be set properly to allow using it as output. At minimum, set TRISA = 0x00 and TRISB = 0x00 for all output pins, and remove SDO1SEL because you're going to use software SPI (as in the code you sent me) and not hardware SPI. RA6 a shared pin on the PIC16F1827 so you'll need to set some registers to enable digital input on that pin. In particular, make sure that you are able to control LATAbits.LATA6 freely from code. In fact it is a good practice to make sure all output pins you intend to use can be freely controlled from code and all input pins can recognize digital 0 and digital 1 properly before attempting to connect any devices to the PIC. 100ms) in between and see if you can observe a square wave on your oscilloscope, or 2.5V on your multimeter if you do not own an oscilloscope, on each of the output pins. LATBbits.LATB1, LATAbits.LATA6) with sufficient delay (e.g. You can first try to write a simple program with a while(1) loop to toggle the pins assigned for this LCD (e.g. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |