C code...plz need help!!!!

Thread Starter

myra

Joined Mar 10, 2009
4
Good day everyone!!!
Im recently doing my project regarding scrolling message display comprising 7*50 arrays of LEDs. My problem is I dont have the program or code yet to display and scroll alphanumeric set of characters. My project is consist of 10 characters with Z8F082A microcontroller and zilog encore programming cable or dongle a DB9 connector for serial interface. It uses also und2981 and 74HC164 as a LED driver and shift register. The design is attached. Hope you could contribute some significant ideas. Its my great pleasure to read your ideas regarding with this project....

I wish to program it in C...We have the code that blinks the LEDs but we cant display letters or move it left to right which is our goal. We consume so much time in changing and testing different hexa in our code just to attain our goal. Its so difficult to display even a single letter... pls help me guys!!!!!!

http://forum.allaboutcircuits.com/editpost.php?do=editpost&p=125449
 

Attachments

digitalmind

Joined Mar 7, 2009
30
Which microcontroller or microprocessor are you going to use to display letters and move them to the left or right?

First you would need a compiler that can translate C into the machine language of whatever processor you're going to be using (if there is one it might be the GNU Compiler Collection, GCC), then you'd have to figure out how to download the compiled code into the RAM or ROM of the processor. Linking the C code would also be an issue.

It might be easier/the only option to use assembler/machine code for the processor that will be displaying or moving the letters.

Sorry, wish I could have been more useful...
 

RiJoRI

Joined Aug 15, 2007
536
I would start by setting up 2 7x50 char arrays. The one will have the message pattern, the other the pattern for the display. Use an index into the message array, and copy from the index to index-1, wrapping at the end of the array. (This is basically a circular buffer that you are reading from.) Write each character to the display array. Increment the pointer, wrapping it at 50. Loop back and do it again.

TESTING:
Start by just reading the message array and displaying it (no scrolling). Once you do this, you can start working on scrolling the message.

Finally, look into improving the software -- using bytes to convey bits is not at all efficient.

HTH,
--Rich
 

Thread Starter

myra

Joined Mar 10, 2009
4
Ahmmm we are currently doing test and simulation of our project using PIC microcontroller with IAR Embedded workbench as compiler. We have our c code which is attached here. But we could not display and scroll letters which is our aimed. Yup our aim is to move letters from right to left but the LEDs in the array are just blinking but cant display messages, even a single letter. This is my first time with this project. Hope u could give me out some important ideas....help me plszzzzzz....


// RA0,RA1 : CK, CD
// RB0-RB6 : RO-R6

#include <io16f877.h> // The I/O the header file which is defined
#define CK RD0 // 74LS164 clock
#define CD RD1 // 74LS164 data
// "5 7 µµ Æ®" font
const unsigned char FONT57[] = {0x00,0x27,0x25,0x25,0x19,
0x00,0x06,0x01,0x01,0x3f,
0x00,0x47,0x69,0x49,0x49,
0x00,0x57,0x55,0x55,0x55};




const unsigned int CDD[] = {0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x01};




// Delay function
void delay(unsigned long int i)
{
while(i--);
}
// Main
void main(void)
{
unsigned char i;
TRISB = 0x00; // B port output
TRISA = 0x00; // A port output
TRISD = 0x00; // D port output
ADCON1 = 0x06;
// font output OFF
PORTA = 0x00;
PORTB = 0x00;
PORTD = 0x00;
do{
CD = 0; // Line initial price
RD1=0;
for (i=0; i < 20; i++){ // Line until 0-19 loop
PORTB = FONT57; // font output
CK = 1; // clock
CK = 0;
RD0=1;
RD0=0;


RD1=1;
CD=1;
//CD = 1; // line= 1
delay(1000); // Schedule time delay
}

RD1=0;
CD = 0; // Line initial price
}while(1); // Infinite loop
}
 

thatoneguy

Joined Feb 19, 2009
6,359
The code that blinks the LEDs, does it blink all of them on and off, one column, or <other>?

Try scrolling with just one '164, then add more, or try to display a scrolling/blinking checkerboard to make sure the individual addressing is working as intended.
 

nyangirojoe

Joined Jun 11, 2009
1
Myra I too im doing my project regarding scrolling message display comprising 7*50 arrays of LEDs.I have the program/code to display and scroll alphanumeric set of characters.
Here is the Hex code you need to burn into your microcontroller:

:100000000AC022C021C020C02BC01EC01DC074C0A9
:100010001BC01AC019C011241FBECFEDCDBF10E008
:10002000A0E6B0E0E0E6F7E003C0C89531960D9297
:10003000A436B107D1F710E0A4E6B0E001C01D92EC
:10004000A33CB107E1F7B4C2DBCF982F21E08BB11D
:1000500082958695877081708217C9F79CB908953B
:100060001F920F920FB60F9211242F933F934F932D
:100070005F936F937F938F939F93AF93BF93EF9310
:10008000FF93809169008250823030F490916C002F
:1000900084E1891BDADF1FC080916F008823DCF0C8
:1000A000809170008F5F8093700080917000883322
:1000B00010F010927000809163008F5F8093630056
:1000C00080916300883310F01092630080916F007C
:1000D000815080936F00FF91EF91BF91AF919F91FD
:1000E0008F917F916F915F914F913F912F910F90E1
:1000F0000FBE0F901F9018951F920F920FB60F9280
:1001000011248F93EF93FF9380916C00843111F44D
:100110008CB118C080916D00E82FFF27E155FF4F8B
:100120008CB1808380916D008F5F80936D00809192
:100130006D00843111F410926D0080916C008F5F1E
:1001400080936C00FF91EF918F910F900FBE0F90F5
:100150001F90189580916C008823A1F080916E000B
:10016000E82FFF27E155FF4F8F5F80936E00E081FE
:10017000843111F410926E0080916C008150809354
:100180006C008E2F0895089590E080E08F5F8F3F80
:10019000E9F79F5F9236C8F308951F93DBDF8091E4
:1001A0006C008823E1F3D6DF982F8D3DB1F18E3DB1
:1001B00018F48823A1F045C08D3F19F08E3FD9F087
:1001C00040C0809169008093680084E0809369005A
:1001D00080E03BDF10926A0010926B0032C0809189
:1001E00069008093680082E08093690090936A00C0
:1001F00090936B0026C0809169008093680015E0A1
:10020000109369008DED21DF10936A0083E08093E5
:100210006B008FEF8093670014C08091690080931A
:10022000680093E09093690085E080936A00909362
:100230006B008BEF94E090936600809365001092C2
:1002400064001F91089589E00000815087FFFCCF72
:1002500008951F93CF9314E0C1E0959A959888B3C1
:100260008C2B88BB112309F412E0F89420917000C4
:10027000283308F020E0E22FFF27E958FF4F808164
:10028000812309F0929A949A94989298922F2F5FD2
:1002900080916300981761F77894110F9C2F9095C7
:1002A00088B3892388BBCFDFCC0FC7FFD6CFCF91D0
:1002B0001F91089591E080E0392F292F2670E82FB3
:1002C000FF27990F8F5F222321F0EF58FF4F3083D4
:1002D00003C0EF58FF4F2083863078F3089530E055
:1002E00091E0E1E7F0E024E0819180FD392B990F66
:1002F000215027FFF9CF373008F036E090916300A6
:100300009F5F332379F0A1E7B0E0232F983308F003
:1003100090E0E92FFF27E958FF4F8D9180839F5F81
:100320002150A1F7832F0895000000000000000075
:100330000895BF980895BF9A0895C79AF5DF089564
:10034000C798F2DF0895969AEFDF08959698ECDF4C
:100350000895F3DFF8DFF4DFF9DF0895F4DFEDDF70
:10036000F5DFEEDF08951F93CF93E3DFC79A10E028
:10037000C0E8E9DFB7991C2BE9DFC695D1F7DBDFD1
:10038000C798812FCF911F9108951F93CF93182F56
:10039000C0E8812F8C2311F0D0DF01C0D1DFD3DF83
:1003A000D5DFC695B1F7C5DFC8DFCDDF8FEFB799D1
:1003B00005C0C798C0DFCADF80E006C08150B9F72A
:1003C000C5DFBEDFB8DF81E0CF911F910895CF93E5
:1003D000C62F8093610060936000880F806AD5DF2C
:1003E000882319F48C2FD1DF811181E0CF910895FA
:1003F0000F931F93CF93C82F062F142FAADF612FBF
:10040000802FE5DF882329F48C2FBFDF182F882366
:1004100011F081E008C0A2DF809160008F5F8093BF
:100420006000B2DE812FCF911F910F9108951F932D
:10043000CF93C82F162F80916100C81721F48091A7
:100440006000681731F085DF612F8C2FC0DF8823B3
:1004500039F47FDFCC0F8C2F816A97DF882311F06E
:1004600080E014C080DFC82F79DF909160009F5F2B
:1004700090936000992349F4809161008F5F80938D
:100480006100883010F0909361008C2FCF911F9104
:100490000895EF92FF920F931F93CF939927282FE0
:1004A000392F220F331F220F331F280F391F832F9D
:1004B0009927182F1D5FC22F81E7E82E80E0F82EC4
:1004C00004E06C2F812FB3DFFF2DEE2D8193EE2EF4
:1004D000FF2ECF5F09F41F5F015007FFF2CFCF91CE
:1004E0001F910F91FF90EF900895CF93E3DE8091DD
:1004F0006900823008F054C0C0916C00CC2361F5D3
:1005000084E1A3DD80916900882319F58091620060
:100510008F5F809362008B3008F442C084E1809347
:10052000620060916A0080916B0081DF882319F47A
:1005300080936A000BC0ADDF80916A008F5F80936B
:100540006A00882369F580916B008F5F80936B0050
:1005500027C0C093620024C090916C0084E1891B85
:1005600074DD80916E00E82FFF27E155FF4F8081F9
:100570008F3F11F412DE14C0809162008B3020F0A6
:100580008150809362000CC0E5DD882319F08F3F15
:1005900009F07FDF1092620010926A0010926B00E7
:1005A0009EDE90916F00980F90936F00CF91089509
:1005B000CFEDD0E0DEBFCDBFE7E7F0E087E31192FB
:1005C000815087FFFCCF18BA12BA8FEF87BB81BB6F
:1005D00090E499BF8CE08EBD84E08BBD1ABC88E9A5
:1005E0008AB999B97894809169008430E9F45D9B67
:1005F000B0C090E080916B00833020F460916A007D
:1006000016DF982F9CB9992309F45BC080916A008A
:100610008F5F80936A00882309F09BC080916B00F4
:100620008F5F80936B0095C0823059F580916C008C
:100630008823E1F38FDDC82F60916B00633039F0C0
:1006400040916A00D5DE882311F4CC2369F410921E
:100650006A0010926B00809168008093690081307D
:10066000D1F11092620075C080916A008F5F809313
:100670006A008823D9F680916B008F5F80936B00AE
:10068000D5CF853061F5C4E060916A0080916B0040
:10069000CEDEDBDC80916A008F5F80936A00882366
:1006A00029F480916B008F5F80936B00C150C7FF6E
:1006B000EBCF90916700915090936700992309F0D8
:1006C00048C090936A0090936B008091680080937B
:1006D00069008130C9F584E1809362003AC08330BB
:1006E000C1F580916C00882339F134DD40916A00B6
:1006F00060916B007DDE282F882359F4809165007E
:100700009091660001979093660080936500892B15
:1007100021F48FEF80936400E4CF80916A008F5FB3
:1007200080936A00882329F480916B008F5F809307
:100730006B0020936400D5CF909164009F5F9093ED
:100740006400992321F4BDCF9093620002C01CDDA8
:10075000C8CF7FDD80916F0087FF45CFC6DE43CFD6
:04076000FFFF0A315C
:00000001FF

My project is consist of 256 characters with ATtiny2313 microcontroller. It uses seven BD139 and 74HC595 as a LED driver and shift register.
I programmed it in C... the code that scrolls the LEDs is there too(above) but i cant display letters,which is my goal. Does someone know something? ill appreciate
 
Top