Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - bsoyer

Pages: [1]
solved!!! After trying lots of combinations, I decided to comment out the initialization code step by step, I noticed that when I removed the master config part (below) from the init code the problem is solved.

// Set Master Config

Hello Paul,
Thanks for the quick reply.I double check my initialization sequence and SPI timing, I noticed that SPI timing is alittle bit faster than controller's expected freq. I fixed it and in order to simplify my code I decide to draw a rectangle but again I get the same result (dark-yellow columns occur above and below). I am using PIC32MX795F512L and my code is below

/* Adds support for PIC32 Peripheral library functions and macros */
#include "plib.h"
#include "proc/p32mx795f512l.h"

extern char ASCII[][5];
extern char logo[][32];

// Configuration Bits
#pragma config FNOSC    = PRIPLL        // Oscillator Selection
#pragma config FPLLIDIV = DIV_5         // PLL Input Divider (PIC32 Starter Kit: use divide by 2 only)
#pragma config FPLLMUL  = MUL_16        // PLL Multiplier
#pragma config FPLLODIV = DIV_1         // PLL Output Divider
#pragma config FPBDIV   = DIV_1         // Peripheral Clock divisor
#pragma config FWDTEN   = OFF           // Watchdog Timer
#pragma config WDTPS    = PS1           // Watchdog Timer Postscale
#pragma config FCKSM    = CSDCMD        // Clock Switching & Fail Safe Clock Monitor
#pragma config OSCIOFNC = OFF           // CLKO Enable
#pragma config POSCMOD  = XT            // Primary Oscillator
#pragma config IESO     = OFF           // Internal/External Switch-over
#pragma config FSOSCEN  = OFF           // Secondary Oscillator Enable
#pragma config CP       = OFF           // Code Protect
#pragma config BWP      = OFF           // Boot Flash Write Protect
#pragma config PWP      = OFF           // Program Flash Write Protect
#pragma config ICESEL   = ICS_PGx1      // ICE/ICD Comm Channel Select
#pragma config DEBUG    = ON           // Debugger Disabled for Starter Kit

// application defines
#define SYS_FREQ      (80000000)

// prototype
void DelayMs(unsigned int);
void DelayUs(unsigned int);
void SPI_1();
void LCD_Initialization();
void LCD_Function();
void lcd_create_rect(int st_row,int st_col,int end_row,int end_col, int color);
void lcd_set_col_addr(int start, int end);
void lcd_set_row_addr(int start, int end);
void LCD_clear();

char spi_data[1048];
char last_row = 56;
char last_col = 0;
//  blink_leds application code
int main(void)
   return 0;

*   DelayMs()
*   This functions provides a software millisecond delay
void DelayMs(unsigned int msec)
   unsigned int tWait, tStart;
    while((ReadCoreTimer()-tStart)<tWait);      // wait for the time to pass
void DelayUs(unsigned int usec)
   unsigned int tWait, tStart;
    while((ReadCoreTimer()-tStart)<tWait);      // wait for the time to pass
void SPI_1()

   int rData;
   IEC0CLR=0x03800000; // disable all interrupts
   SPI1CON = 0; // Stops and resets the SPI1.
   rData=SPI1BUF; // clears the receive buffer
   IFS0CLR=0x03800000; // clear any existing event
   IPC5CLR=0x1f000000; // clear the priority
   IPC5SET=0x0d000000; // Set IPL=3, Subpriority 1
   IEC0SET=0x03800000; // Enable RX, TX and Error interrupts
   SPI1BRG=19; // FPB/2(baud+1) => 80Mhz / 2*20 = 2 Mhz clock frequency
   SPI1STATCLR=0x40; // clear the Overflow
   SPI1CON=0x8260; // SPI ON, 8 bits transfer, SMP=1, Master mode
void SPI_Write(int byte_count, char* data, int dataOrComm)
   int count;
   // give data or command
   // assert CS
   // wait till spi is busy
   for (count=0;count<byte_count;count++)
      while (SPI1STATbits.SPIBUSY==1);
   // deassert CS

void LCD_Initialization()
   int i,j;   
   //Set display off

   //Set Display Clock

   //Set Multiplex Ratio
   //Set Display Offset

   // Set Start Line

   // Set Master Config

   // Set ReMap

   // Set Current Range

   // Set Gray Scale

   // Set Contrast

   //Set Frame Frequency

   //Set Phase Length

   // Set Precharge Voltage

   // Set Precharge Compensation

   //Enable Pre-Charge Compensation

   // Set High Voltage Level of COM Pin

   // Set Low Voltage Level of SEG Pin
   // Set Display Mode
   SPI_Write(1, &spi_data[0],0);

   // Clear Screen
   // Set Display on
void LCD_clear()
   char i,j;
   for (i=0;i<64;i++)
      for ( j=0;j<64;j++)
void LCD_Function()
   char spi_data[1048];
   char start_row = 0x00;
   char start_col = 0x00;
    char character = 0x20;
   // RESET
   // Set D/C bit as output
   //Set CS bit as output
//   Enable Rectangle engine


void lcd_create_rect(int st_row,int st_col,int end_row,int end_col, int color)

void lcd_set_col_addr(int start, int end)
void lcd_set_row_addr(int start, int end)

OLEDs / NHD-2.7-12864UCY3 yellow columns occur under ascii characters
« on: April 01, 2015, 02:43:44 PM »
Hello I am using NHD-2.7-12864UCY3 in serial mode. I write lcd init functions with the help of Lcd and its controller datasheet, example program code. I am able to print ascii characters but under every character there occurs a dark yellow column (as seen in the picture) and I can't handle these columns. Do you have any idea the cause of the columns? I can send my code also
thanks alot.

Pages: [1]