PIC 16F88 project for birthday gift

dl324

Joined Mar 30, 2015
18,394
I am actually a beginner in C. The next project I'd do is to make 8x8 matrix LED version of the same project for my wife whose birthday is 2 months away.
Are you planning to make a scrolling display? Or just change characters?
 

Brian Griffin

Joined May 17, 2013
64
Hello @absf ,

Nice little project you are doing! By the way, I'm pretty curious - why not use the timer and its interrupts to multiplex the digits? I did the multiplexing using the interrupt on a 2-digit display using the AVR earlier.
 

Thread Starter

absf

Joined Dec 29, 2010
1,968
Hello @absf ,

Nice little project you are doing! By the way, I'm pretty curious - why not use the timer and its interrupts to multiplex the digits? I did the multiplexing using the interrupt on a 2-digit display using the AVR earlier.
Everything started so fast with the glimpse of an idea one morning, to make something special for my daughter's and wife's birthdays.

I doubt if I can finish the first one in time for my daughter's birthday which falls on 1st of July. I have to make the text "Happy Birthday Iris from Daddy" and now I am only displaying continuous counting hex numbers. I am not good in the indexing of a string in C. And I dont understand how to do string manipulations for PIC16Fxxx in assembly. That's why I turned to the "Evil Genius" book by Myke Preoko. So once the string displaying is working, then I could implement the interrupt mechanism. Shouldn't be too hard I guess. Just a interrupt routine for each display every 2 mS, right ?

The 8x8 matrice project still has a grace time of 2 months so I don't have to rush so badly.

Allen
 
Last edited:

jayanthd

Joined Jul 4, 2015
945
Hi absf,

I have an extra licence for mikroC PRO PIC Compiler. If you are interested then email me at jayanthd2k12(at)gmail(dom(com)

I will be happy to provide you the licence. With mikroC Compiler you can quickly complete your project.
 

Brian Griffin

Joined May 17, 2013
64
Everything started so fast with the glimpse of an idea one morning, to make something special for my daughter's and wife's birthdays.

I doubt if I can finish the first one in time for my daughter's birthday which falls on 1st of July. I have to make the text "Happy Birthday Iris from Daddy" and now I am only displaying continuous counting hex numbers. I am not good in the indexing of a string in C. And I dont understand how to do string manipulations for PIC16Fxxx in assembly. That's why I turned to the "Evil Genius" book by Myke Preoko. So once the string displaying is working, then I could implement the interrupt mechanism. Shouldn't be too hard I guess. Just a interrupt routine for each display every 2 mS, right ?

The 8x8 matrice project still has a grace time of 2 months so I don't have to rush so badly.

Allen
Hey there, so far, how does the first circuit goes now? Still showing a same number for both digits?
 

xox

Joined Sep 8, 2017
936
I have to make the text "Happy Birthday Iris from Daddy" and now I am only displaying continuous counting hex numbers. I am not good in the indexing of a string in C.
Feel free to send me a message if you have any questions with the "straight C" stuff. Don't know much about programming microcontrollers, but I can write C code in my sleep. :)
 

Thread Starter

absf

Joined Dec 29, 2010
1,968
Hey there, so far, how does the first circuit goes now? Still showing a same number for both digits?
Yesterday morning, after finishing the hardware on strip-board. I used the UIC00B programmer from cytron to program the 16F88 by inserting F88 into the 16F628 development board SK18B.

As I have not used the programmer for a long time, the programmer didnt recognize the F88 chip. The problem was a dirty mini USB socket on the programmer. After the chip was programmed, I inserted it into the strip-board and power from my Prokit adapter through a breadboard regulator from eBay. After power on both LEDs are flashing rapidly but no number was displaying. I touched the 16F88 and it burned one of my fingers, so I quickly switched off the PS.

Everything was too lateand when I verified on the programmer, the chip was gone. I programmed another new one and this time it worked with just one digit flashing "0". I have to do some more trouble-shooting today and see if I can find the problem.

[my guess:] the chip was toasted due to my power adapter read o/p 12V DC but actually supplying 16V. The poor LM1117 5V must be not able to with-stand the 15V and got toasted first.

Here are some pictures of the stripboard....
MB-16F88 stripboard 25%.jpg MB-the 5V regulator from eBay 25%.jpg
 
Last edited:

Thread Starter

absf

Joined Dec 29, 2010
1,968
I have the same setup on an Arduino before I construction the 16F88 board just in case the PIC deosn't work as planned.

MB-arduino with 7seg 25%.jpg
Allen
 

Thread Starter

absf

Joined Dec 29, 2010
1,968
Feel free to send me a message if you have any questions with the "straight C" stuff. Don't know much about programming microcontrollers, but I can write C code in my sleep. :)
Thanks so much for help and kindness, I'll contact you when I really got stuck.

Cheers.

Allen
 

Thread Starter

absf

Joined Dec 29, 2010
1,968
Hi absf,

I have an extra licence for mikroC PRO PIC Compiler. If you are interested then email me at jayanthd2k12(at)gmail(dom(com)

I will be happy to provide you the licence. With mikroC Compiler you can quickly complete your project.
I think I have too much food at the moment and digestion is slow. I wish I have time to learn another uC C just for PIC. My concern now is how to slim down on all my uC and uP stock that I have accumulated throughout the years.

Thanks anyway and I'd let you know when I need it.

Allen
 
Last edited:

Thread Starter

absf

Joined Dec 29, 2010
1,968
Just found one fault- the decoupling capacitor 1000uF before the 7805 is opened. After replacing the cap.,the display alternate between the tenth and units slowly displaying "00" for a number of times then it becomes "01".

Problem looks like it is operating at 30 KHz as described in this thread here

I have changed the configured to use external 4MHz clock and MCLR was enabled. But why does it switch to internal 31.25 KHz clock?

C:
#include <pic.h>
/* c2x7seg.c
HI-TECH C compiler V9.80

roll through 16 digit on a dual 7 segment LED display
Display HEX 16 digits on 2x CA LED display.

RB6    -    seg a
RB5 -    seg b
RB4 -    seg c
RB3 -    seg d
RB2 -    seg e
RB1 -    seg f
RB0 -    seg g
RA0 -    Right 7 seg disp
RA1 -    Left  7 seg disp
*/
__CONFIG (WDTDIS & PWRTEN & MCLREN & UNPROTECT & CCPRB3 & LVPDIS & XT);
//LVPDIS is needed so that RB3 will not be used by Low voltage programming to use it as I/O
//pin and also be used by CCP1 control.**
//see CONFIG word on datasheet.
// CONFIG1=2F61, CONFIG2=0003

#define _XTAL_FREQ 4000000

unsigned int i,j;
unsigned int disp_value, disp_LED;

const char LEDdigit []=
{
//abcdefg  -    LED segments
0b0000001,        //0
0b1001111,        //1
0b0010010,        //2
0b0000110,        //3
0b1001100,        //4
0b0100100,        //5
0b0100000,        //6
0b0001111,        //7
0b0000000,        //8
0b0000100,        //9
0b0001000,        //"A"
0b1100000,        //"b"
0b0110001,        //"C"
0b1000010,        //"d"
0b0110000,        //"E"
0b0111000};     //"F"

void main()
{
static int bumptimer = 0;      // 1-second interval timer
    CMCON=7;                    //TURN OFF COMPARATOR
    CCP1CON=0;                    //disable CCP1 functions ON RB0 & RB3
    ANSEL=0;                    //TURN OFF ADC
    PORTB=0b01111111;              // LED segments 'off'
    PORTA=0b00000001;              // RA1 (tens) digit on (0)
    TRISA=0b11111100;              // RA1-RA0 outputs
    TRISB=0b00000000;              //
    disp_value = 0x00;             // start disp at 0x00
while (1)
{
       PORTB |= 0b01111111;         // blank the display (segments off)
       PORTA ^= 0b00000011;         // toggle digit select lines
       if(PORTA & 1)                // if 'tens' digit selected
         PORTB = LEDdigit[disp_value/16];
       else                         // if 'ones' digit selected
         PORTB = LEDdigit[disp_value%16];
       __delay_ms(2);               // 2-ms on time (250-Hz refresh rate)
       if(bumptimer++ == 499)       // if ~1-second interval
       { bumptimer = 0;             // reset interval timer and
         disp_value++;              // bump display value, 0x00..0xFF
       }                            //
     }                              //
   }                                //
Allen
 
Last edited:

jayanthd

Joined Jul 4, 2015
945
See attached project which I did in mikroC PRO PIC. You can open the .c file in notepad to view the C code. Proteus 7.10 SP1 and 8.7 SP3 format simulation files are included. Also Proteus Simulation video is included.

 

Attachments

Last edited:

Ian Rogers

Joined Dec 12, 2012
1,136
@absf

Allen.... Here is the pic code! You need the font and both anim[] arrays, but I can only find one..

Its is commented so I hope you understand everything...I'm always about so any questions...
 

Attachments

Thread Starter

absf

Joined Dec 29, 2010
1,968
@absf

Allen.... Here is the pic code! You need the font and both anim[] arrays, but I can only find one..

Its is commented so I hope you understand everything...I'm always about so any questions...
I have printed your software in hardcopy and will need a few to study it first. Tomorrow I'll go with my wife and son to another town where my daughter lives and stay there for a couple of days.

Now about the hardware. Are you driving both the rows and columns with HC595 without further driver chips and current limiters for the LED?

As my matrice (8x16) is small, so I need 2x hc595 for the Columns and 1x for the Rows, right? Is 4KW enough space for the software? Or do I need a 28-pin chip like 16F886 (I have a tube). I also have some enhanced pic 16F18xx. Can't remember the last 2 digits.

Once I have the PIC version working, I'll convert it to work on 89C4051 and put it in my "Learning 8051" in ETO for continuation of the thread.

Cheers and thanks for the software.

Allen
 

Thread Starter

absf

Joined Dec 29, 2010
1,968
See attached project which I did in mikroC PRO PIC. You can open the .c file in notepad to view the C code. Proteus 7.10 SP1 and 8.7 SP3 format simulation files are included. Also Proteus Simulation video is included.

Thanks for the schematics and software in MikroC. I'd take some time to study it first. The schematic looks familiar and I think I've seen it in the EDA forum, right?

My friend Brian Griffin is very good in MikroC and I'd discuss with him about the learning of this language....

Thanks again for your kindness in help......

Allen
 

jayanthd

Joined Jul 4, 2015
945
Thanks for the schematics and software in MikroC. I'd take some time to study it first. The schematic looks familiar and I think I've seen it in the EDA forum, right?

My friend Brian Griffin is very good in MikroC and I'd discuss with him about the learning of this language....

Thanks again for your kindness in help......

Allen
No, it is not posted at EDABoard.com. Ofcourse I have edaboard.com account and my schematics look like them that is pin connections named like that.

I just made that project today for you. I am now making 8x8 Matrix display project for you in mikroC with scrolling message. I want to know few things.

1.How many 8x8 matrix displays will you use ?

2. Do you want to use row scanning or column scanning ?


BitFont Creator GreyScale is a nice tool to create the matrix display array data.
 

Thread Starter

absf

Joined Dec 29, 2010
1,968
No, it is not posted at EDABoard.com. Ofcourse I have edaboard.com account and my schematics look like them that is pin connections named like that.

I just made that project today for you. I am now making 8x8 Matrix display project for you in mikroC with scrolling message. I want to know few things.

1.How many 8x8 matrix displays will you use ?

2. Do you want to use row scanning or column scanning ?


BitFont Creator GreyScale is a nice tool to create the matrix display array data.
1. The final version is 8x16 and I'll try with 8x8 first.

2. I am not sure what is row scanning and column scanning. My idea is something like this

8X16 MATRIX.PNG
The text message should scroll from right to left horizontally.

Does it make sense?

Thanks.

Allen
 
Top