CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

8x40 led display

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
isaac aiyanyo
Guest







8x40 led display
PostPosted: Wed Nov 20, 2002 2:02 am     Reply with quote

As for the idea, it sounds like you want to make the unit somewhat self contained so that you don't have to use a PC to send the data.

Yes u r right.
the reason i wanted to add an LCD,is so that i can see
what message is to be displayed.
i don't think i would be able to edit the text on the led
display or can i?
if that is possible that would be really cool.
i should finish adding 2 extra 8x8 modules today giving me
8 x 32.
Let me know what u think
I would leave an RS232 port there just in case iwant to use it in the future.
Isaac
___________________________
This message was ported from CCS's old forum
Original Post ID: 9130
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

Re: 8x40 led display
PostPosted: Wed Nov 20, 2002 9:49 pm     Reply with quote

Certainly you could use the display for entering the text. You would of course have to allow for a longer message by shifting the display string. This is a common thing much like you would find on a calculator. The RS232 port could be useful in the begining while you are getting the display to work and then later adding the manual input.
:=
:=
:=As for the idea, it sounds like you want to make the unit somewhat self contained so that you don't have to use a PC to send the data.
:=
:= Yes u r right.
:= the reason i wanted to add an LCD,is so that i can see
:= what message is to be displayed.
:= i don't think i would be able to edit the text on the led
:= display or can i?
:= if that is possible that would be really cool.
:= i should finish adding 2 extra 8x8 modules today giving me
:= 8 x 32.
:= Let me know what u think
:= I would leave an RS232 port there just in case iwant to use it in the future.
:= Isaac
___________________________
This message was ported from CCS's old forum
Original Post ID: 9196
isaac aiyanyo
Guest







Re: 8x40 led display
PostPosted: Sat Nov 23, 2002 6:20 am     Reply with quote

Hello Mark
its me trouble again.
i completed the hardware for the 8 x 16 display yesterday
and i have being trying to get it working using the
shift_left function like you said.
i have tested my hardware this time using picbasic to
ensure that everything is ok.
i need a bit of guardians from you on this one as my c
knowlege is playing on me.
Could you please let me know where i am going wrong
Thanks in advance
Isaac


#include <16F873.H>
#fuses XT,NOWDT,NOPUT,NOPROTECT,NOBROWNOUT,NOLVP
#use delay(clock=4000000)
#use rs232(baud=9600, xmit=PIN_A0, rcv=PIN_A1,RESTART_WDT,ERRORS,INVERT)


#IFNDEF EXP_OUT_ENABLE

#define EXP_OUT_ENABLE PIN_C2
#define EXP_OUT_CLOCK PIN_C1
#define EXP_OUT_DO PIN_C0
#define NUMBER_OF_74595 2
#ENDIF
#include <74595.C>


#byte port_c=7
#byte port_b=6

char const pat[48]={0,255,255,24,24,255,255,0,0,255,255,219,219,195,195,0,
0,255,255,192,192,192,192,0,0,255,255,192,192,192,192,0,
0,60,126,195,195,126,60,0,0,0,0,0,0,0,0,0};

main()
{
int mask[4]; //since i am using 32 column
//long mask = 0x01; // i shouldn't need this
int data[4]; // array to store our data since i am
// 32 columns

// Initialize our mask
mask[0]=0x01;
mask[1]=0x00;
mask[2]=0x00;
mask[3]=0x00;
int delaycount;
int startposition;
int index;
int i;

set_tris_c(0);
set_tris_b(0);
port_c = 0;
port_b = 0;
startposition = 0;
while(1)
{
delaycount = 3; // adjust this value to control scrolls speed
while (delaycount)
{
index = startposition;
// mask = 0x01;

for (i=0;i<32;i++) // we have 32 columns to drive
{
// store our mask in an array. we need to do this because
// the call to write_expanded_outputs will destroy the value
// passed in.
data[0] = mask[0]; // store which column we are driving
data[1] = mask[1]; // in an array
data[2] = mask[2];
data[3] = mask[3];
index = i + startposition; // point to the next pattern to display
if (index >= sizeof(pat)) // make sure that we don't exceed the array
index -= sizeof(pat);
port_b = 0; // disable driving the LEDs
write_expanded_outputs(data); // enable our column driver
port_b = pat[index]; // drive our LEDs
if (shift_left(mask,4,0))
mask[0] = 0x01;

// mask <<=1; // shift to the next column for next time
delay_ms(1); // adjust this value to control the drive time
//for the leds
}
--delaycount; // decrement our delay loop counter
}
++startposition; // Point to the next data pattern
if (startposition >= sizeof(pat)) // make sure that we don't exceed the array
{
startposition = 0;

}

}

}




:=Certainly you could use the display for entering the text. You would of course have to allow for a longer message by shifting the display string. This is a common thing much like you would find on a calculator. The RS232 port could be useful in the begining while you are getting the display to work and then later adding the manual input.
:=:=
:=:=
:=:=As for the idea, it sounds like you want to make the unit somewhat self contained so that you don't have to use a PC to send the data.
:=:=
:=:= Yes u r right.
:=:= the reason i wanted to add an LCD,is so that i can see
:=:= what message is to be displayed.
:=:= i don't think i would be able to edit the text on the led
:=:= display or can i?
:=:= if that is possible that would be really cool.
:=:= i should finish adding 2 extra 8x8 modules today giving me
:=:= 8 x 32.
:=:= Let me know what u think
:=:= I would leave an RS232 port there just in case iwant to use it in the future.
:=:= Isaac
___________________________
This message was ported from CCS's old forum
Original Post ID: 9310
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

Re: 8x40 led display
PostPosted: Sat Nov 23, 2002 8:16 am     Reply with quote

Hello,

I only saw a couple things. The first was the #define for the number of 74595's. I also moved the init for the mask below the other variables. Then the {} around the last if statement were mismatched. But here it is Smile Let me know how it works.

#include <16F873.H>
#fuses XT,NOWDT,NOPUT,NOPROTECT,NOBROWNOUT,NOLVP
#use delay(clock=4000000)
#use rs232(baud=9600, xmit=PIN_A0, rcv=PIN_A1,RESTART_WDT,ERRORS,INVERT)


#IFNDEF EXP_OUT_ENABLE

#define EXP_OUT_ENABLE PIN_C2
#define EXP_OUT_CLOCK PIN_C1
#define EXP_OUT_DO PIN_C0
#define NUMBER_OF_74595 4
#ENDIF
#include <74595.C>


#byte port_c=7
#byte port_b=6

char const pat[48]={0,255,255,24,24,255,255,0,0,255,255,219,219,195,195,0,
0,255,255,192,192,192,192,0,0,255,255,192,192,192,192,0,
0,60,126,195,195,126,60,0,0,0,0,0,0,0,0,0};

main()
{
int mask[4]; //since i am using 32 column
int data[4]; // array to store our data since i am
// 32 columns
int delaycount;
int startposition;
int index;
int i;

// Initialize our mask
mask[0]=0x01;
mask[1]=0x00;
mask[2]=0x00;
mask[3]=0x00;

set_tris_c(0);
set_tris_b(0);
port_c = 0;
port_b = 0;
startposition = 0;
while(1)
{
delaycount = 3; // adjust this value to control scrolls speed
while (delaycount)
{
index = startposition;
for (i=0;i<32;i++) // we have 32 columns to drive
{
// store our mask in an array. we need to do this because
// the call to write_expanded_outputs will destroy the value
// passed in.
data[0] = mask[0]; // store which column we are driving
data[1] = mask[1]; // in an array
data[2] = mask[2];
data[3] = mask[3];
index = i + startposition; // point to the next pattern to display
if (index >= sizeof(pat)) // make sure that we don't exceed the array
index -= sizeof(pat);
port_b = 0; // disable driving the LEDs
write_expanded_outputs(data); // enable our column driver
port_b = pat[index]; // drive our LEDs
if (shift_left(mask,4,0))
mask[0] = 0x01;
delay_ms(1); // adjust this value to control the drive time
//for the leds
}
--delaycount; // decrement our delay loop counter
}
++startposition; // Point to the next data pattern
if (startposition >= sizeof(pat)) // make sure that we don't exceed the array
startposition = 0;
}
}



:= Hello Mark
:= its me trouble again.
:= i completed the hardware for the 8 x 16 display yesterday
:= and i have being trying to get it working using the
:= shift_left function like you said.
:= i have tested my hardware this time using picbasic to
:= ensure that everything is ok.
:= i need a bit of guardians from you on this one as my c
:= knowlege is playing on me.
:= Could you please let me know where i am going wrong
:= Thanks in advance
:= Isaac
:=
:=
:=#include <16F873.H>
:=#fuses XT,NOWDT,NOPUT,NOPROTECT,NOBROWNOUT,NOLVP
:=#use delay(clock=4000000)
:=#use rs232(baud=9600, xmit=PIN_A0, rcv=PIN_A1,RESTART_WDT,ERRORS,INVERT)
:=
:=
:=#IFNDEF EXP_OUT_ENABLE
:=
:=#define EXP_OUT_ENABLE PIN_C2
:=#define EXP_OUT_CLOCK PIN_C1
:=#define EXP_OUT_DO PIN_C0
:=#define NUMBER_OF_74595 2
:=#ENDIF
:=#include <74595.C>
:=
:=
:=#byte port_c=7
:=#byte port_b=6
:=
:=char const pat[48]={0,255,255,24,24,255,255,0,0,255,255,219,219,195,195,0,
:= 0,255,255,192,192,192,192,0,0,255,255,192,192,192,192,0,
:= 0,60,126,195,195,126,60,0,0,0,0,0,0,0,0,0};
:=
:=main()
:={
:=int mask[4]; //since i am using 32 column
:=//long mask = 0x01; // i shouldn't need this
:=int data[4]; // array to store our data since i am
:= // 32 columns
:=
:=// Initialize our mask
:=mask[0]=0x01;
:=mask[1]=0x00;
:=mask[2]=0x00;
:=mask[3]=0x00;
:=int delaycount;
:=int startposition;
:=int index;
:=int i;
:=
:=set_tris_c(0);
:=set_tris_b(0);
:=port_c = 0;
:=port_b = 0;
:=startposition = 0;
:=while(1)
:= {
:= delaycount = 3; // adjust this value to control scrolls speed
:= while (delaycount)
:= {
:= index = startposition;
:= // mask = 0x01;
:=
:= for (i=0;i<32;i++) // we have 32 columns to drive
:= {
:= // store our mask in an array. we need to do this because
:= // the call to write_expanded_outputs will destroy the value
:= // passed in.
:= data[0] = mask[0]; // store which column we are driving
:= data[1] = mask[1]; // in an array
:= data[2] = mask[2];
:= data[3] = mask[3];
:= index = i + startposition; // point to the next pattern to display
:= if (index >= sizeof(pat)) // make sure that we don't exceed the array
:= index -= sizeof(pat);
:= port_b = 0; // disable driving the LEDs
:= write_expanded_outputs(data); // enable our column driver
:= port_b = pat[index]; // drive our LEDs
:= if (shift_left(mask,4,0))
:= mask[0] = 0x01;
:=
:= // mask <<=1; // shift to the next column for next time
:= delay_ms(1); // adjust this value to control the drive time
:= //for the leds
:= }
:= --delaycount; // decrement our delay loop counter
:= }
:= ++startposition; // Point to the next data pattern
:= if (startposition >= sizeof(pat)) // make sure that we don't exceed the array
:= {
:= startposition = 0;
:=
:= }
:=
:= }
:=
:=}
:=
:=
:=
:=
:=:=Certainly you could use the display for entering the text. You would of course have to allow for a longer message by shifting the display string. This is a common thing much like you would find on a calculator. The RS232 port could be useful in the begining while you are getting the display to work and then later adding the manual input.
:=:=:=
:=:=:=
:=:=:=As for the idea, it sounds like you want to make the unit somewhat self contained so that you don't have to use a PC to send the data.
:=:=:=
:=:=:= Yes u r right.
:=:=:= the reason i wanted to add an LCD,is so that i can see
:=:=:= what message is to be displayed.
:=:=:= i don't think i would be able to edit the text on the led
:=:=:= display or can i?
:=:=:= if that is possible that would be really cool.
:=:=:= i should finish adding 2 extra 8x8 modules today giving me
:=:=:= 8 x 32.
:=:=:= Let me know what u think
:=:=:= I would leave an RS232 port there just in case iwant to use it in the future.
:=:=:= Isaac
___________________________
This message was ported from CCS's old forum
Original Post ID: 9313
isaac aiyanyo
Guest







Re: 8x40 led display
PostPosted: Sat Nov 23, 2002 1:38 pm     Reply with quote

Just as i was about to tell you that i got it working
i received your reply.
i found out about my mistakes after sending you the post.
#define for 74595's.
init for the mask
but not the {}
And i didn't use the last delay you included.

The program works perfectly but with a lot of flicker
i tried adjusting the delay to see if things would improve
by making delay = 1 but it still flicker.
i came to the conclusion that it is because iam running the
pic at 4Mhz.
i think if i use the pic at 20Mhz this would improve things
as it would run 5 times quicker .(Let my know if this isn't
the case as i do have a 16f876-20 at work which i would get
on monday).

Now that you have thought me how to write to the display
you have made 60\% of my dream come true.
The next stage i presume would be how to edit the text
as i don't have a glue on what to do hare.
Refering to you text below :>

Certainly you could use the display for entering the text. You would of course have to allow for a longer message by shifting the display string. This is a common thing much like you would find on a calculator. The RS232 port could be useful in the begining while you are getting the display to work and then later adding the manual input.
From what i am thinking ,i don't know if this is right, i would certainly need a way of converting incoming data (ascii i think) into the bitmaps
and store them in the format as char const pat[max].
As i said in my previous post, i have a text editor that can send ascii characters displayed via rs232 and i left`RC6 & RC7
free on the display.
would i have to something if (character=='A')
{
0,255,255,24,24,255,255,0
}
else
if (character=='B')
{
0,25,25,24,24,25,25,0
}
else
etc for all ascii characters.
please give me an example to follow and any suggestions you
might have as i value them a lot.
Hope to hear from you soon
Isaac
Y R DA MAN!!!





___________________________
This message was ported from CCS's old forum
Original Post ID: 9323
isaac aiyanyo
Guest







Re: 8x40 led display
PostPosted: Tue Nov 26, 2002 2:21 pm     Reply with quote

Mark,
please i do need your help here as i have being really
strugling with writting the program.
i am now using pic16f876 @ 20mhz.
the display is going a lot quicker than before but i still
got a lot of flicker.
Now i don't know which way to go.
i have being experimenting with using an RS232 port
which i managed to get working using the example
in ccs.
This is the flow of the design so far.
My Text editor works an sends the ascii characters
to be displayed via RS232 to the display.
This i have tested using hyperterminal so that if i
want to display "HELLO",i enter it on the text editor
press the send button and its sent to hyperterm
that works fine.
i also tried tried my display to see if the RS232 in
working by using the example below


#define BUFFER_SIZE 32
byte buffer[BUFFER_SIZE];
byte next_in = 0;
byte next_out = 0;


#int_rda
void serial_isr() {
int t;

buffer[next_in]=getc();
t=next_in;
next_in=(next_in+1) \% BUFFER_SIZE;
if(next_in==next_out)
next_in=t; // Buffer full !!
}

#define bkbhit (next_in!=next_out)

byte bgetc() {
byte c;

while(!bkbhit) ;
c=buffer[next_out];
next_out=(next_out+1) \% BUFFER_SIZE;
return(c);
}



main() {

enable_interrupts(global);
enable_interrupts(int_rda);

printf("\r\n\Running...\r\n");

// The program will delay for 10 seconds and then display
// any data that came in during the 10 second delay

do {
delay_ms(10000);
printf("\r\nBuffered data => ");
while(bkbhit)
putc( bgetc() );
} while (TRUE);

}


With ths i know that the RS232 no the display pic is working
as it displays the buffered data.
i have being trying for 2 days now for any example that
could convert the buffered ascii data into the 8x8 bit patterns
we used to drive the display but i can't seem to get it right.
Could you please point me in the right direction whiith this one.
Thanks in advance
Isaac







:=Certainly you could use the display for entering the text. You would of course have to allow for a longer message by shifting the display string. This is a common thing much like you would find on a calculator. The RS232 port could be useful in the begining while you are getting the display to work and then later adding the manual input.
:=:=
:=:=
:=:=As for the idea, it sounds like you want to make the unit somewhat self contained so that you don't have to use a PC to send the data.
:=:=
:=:= Yes u r right.
:=:= the reason i wanted to add an LCD,is so that i can see
:=:= what message is to be displayed.
:=:= i don't think i would be able to edit the text on the led
:=:= display or can i?
:=:= if that is possible that would be really cool.
:=:= i should finish adding 2 extra 8x8 modules today giving me
:=:= 8 x 32.
:=:= Let me know what u think
:=:= I would leave an RS232 port there just in case iwant to use it in the future.
:=:= Isaac
___________________________
This message was ported from CCS's old forum
Original Post ID: 9462
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

Re: 8x40 led display
PostPosted: Tue Nov 26, 2002 6:54 pm     Reply with quote

To try and reduce the flicker, you might try a smaller delay than the delay_ms(1). Use the delay_us() function with numbers less than 1000 and see if it improves. As for the ASCII characters, use a 2 dimensional array. One of the array parameters is the ASCII value. Decide what the lowest ASCII character that you are going to print and use that as the first element. All you have to do from there on is subtract the ASCII value of the first element from any ASCII data to get its index. I would do a dummy test to make sure that CCS can handle an array that size.

Regards,
Mark
:= Just as i was about to tell you that i got it working
:= i received your reply.
:= i found out about my mistakes after sending you the post.
:= #define for 74595's.
:= init for the mask
:= but not the {}
:= And i didn't use the last delay you included.
:=
:= The program works perfectly but with a lot of flicker
:= i tried adjusting the delay to see if things would improve
:= by making delay = 1 but it still flicker.
:= i came to the conclusion that it is because iam running the
:= pic at 4Mhz.
:= i think if i use the pic at 20Mhz this would improve things
:= as it would run 5 times quicker .(Let my know if this isn't
:= the case as i do have a 16f876-20 at work which i would get
:= on monday).
:=
:= Now that you have thought me how to write to the display
:= you have made 60\% of my dream come true.
:= The next stage i presume would be how to edit the text
:= as i don't have a glue on what to do hare.
:= Refering to you text below :>
:=
:= Certainly you could use the display for entering the text. You would of course have to allow for a longer message by shifting the display string. This is a common thing much like you would find on a calculator. The RS232 port could be useful in the begining while you are getting the display to work and then later adding the manual input.
:= From what i am thinking ,i don't know if this is right, i would certainly need a way of converting incoming data (ascii i think) into the bitmaps
:=and store them in the format as char const pat[max].
:= As i said in my previous post, i have a text editor that can send ascii characters displayed via rs232 and i left`RC6 & RC7
:=free on the display.
:= would i have to something if (character=='A')
:= {
:= 0,255,255,24,24,255,255,0
:= }
:= else
:= if (character=='B')
:= {
:= 0,25,25,24,24,25,25,0
:= }
:= else
:= etc for all ascii characters.
:= please give me an example to follow and any suggestions you
:= might have as i value them a lot.
:= Hope to hear from you soon
:= Isaac
:= Y R DA MAN!!!
:=
:=
:=
:=
:=
:=
___________________________
This message was ported from CCS's old forum
Original Post ID: 9475
isaac aiyanyo
Guest







Re: 8x40 led display
PostPosted: Thu Nov 28, 2002 7:19 am     Reply with quote

Mark,
Thanks for the help, i did try reducing the flicker by making the delay 800uS and it works perfectly.
i am now working on the 2 dimensional array for the characters
and i would let you know how i am getting on.

Your help has being very valuable to me
Isaac

___________________________
This message was ported from CCS's old forum
Original Post ID: 9576
Matrix4U



Joined: 20 May 2007
Posts: 7

View user's profile Send private message

LED Moving Message 8X80
PostPosted: Mon Aug 06, 2007 1:33 am     Reply with quote

hello mark

pls can u tell me the hardware how can i use as i connected the rows directly to portd and cols through 595 and uln2803a when i give power my 877a getting heat and not displaying anything i don't no why

pls can u tell me simple schematic and simple code to test

thanks
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Aug 06, 2007 1:41 am     Reply with quote

You are asking questions about posts that are between 3 and 5 years old.
Most of these people are not active on the forum in August 2007.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group