Virtual 20x4 display in ram on a 12F683


Results 1 to 3 of 3

Threaded View

  1. #3
    Join Date
    Aug 2005
    Location
    Michigan, USA
    Posts
    224


    Did you find this post helpful? Yes | No

    Default Re: Virtual 20x4 display in ram on a 12F683

    I did something like this but it was for a 12F1822 with a 2x16 LCD display using the 4-bit interface and 250 microsecond update intervals.

    Using a faster update interval and modifying the buffer directly does allow you to do some neat things. For example, exclusive-or'ing the colon character positions in the buffer with ':'^' ' every 500 milliseconds will produce the flashing colon effect seen in the video below.



    Here's the interrupt routine from the demo (C code);

    Code:
      /******************************************************************
       *                                                                *
       ******************************************************************/
    
       void interrupt()             // 250 usec (500 cycle) interrupts
       { static char line = 0xC0;   //
         static char bndx = 0;      //
         pir1.TMR2IF = 0;           // clear TMR2 interrupt flag
    
        /*                                                              *
         *  update one LCD character from the display array buffer (34  *
         *  interrupts or 8.5 ms to completely refresh the display).    *
         *                                                              */
         if(line & 0x80)            // if "new line"
           PutCMD(line ^= 0x40);    // set DDRAM address (0x80 or 0xC0)
         else                       // not "new line" so
           PutDAT(lcd[bndx++]);     // refresh display, bump index
         bndx &= 31;                // pseudo %32, 0..31 inclusive
         if((bndx & 15) == 0)       // if new line (0 or 16)
           line ^= 0x80;            // toggle b7 pseudo "new line" flag
       }
    Last edited by Mike, K8LH; - 6th February 2013 at 23:05.

Similar Threads

  1. better coding methods to freeing active ram in small pics
    By longpole001 in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 21st December 2012, 17:47
  2. amount of ram
    By vicce67 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 5th November 2012, 17:15
  3. Pic18f452 with 20x4 LCD Help
    By djmachine in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 6th November 2008, 22:43
  4. 20x4 LCD and P18F2680
    By microuser in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 9th June 2006, 19:26
  5. Serial GPS to 20x4 LCD via PIC16f628-04
    By Almightyrastus in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 8th May 2006, 22:35

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts