darlingvt
LR44 Battery
Pogi/Ganda Points: 3
Offline
Posts: 1
|
 |
« on: August 24, 2010, 03:36:33 PM » |
|
hello... can i ask help?.. may project kaming ginagawa... disco light gamit ay zilog (z8f042a)... 9x6 leds... our instructor added 8 switches for 8 patterns... hindi namin alam kung paano simulan ang pagprogram gamit ang c language. gumamit din kami ng 8bit shift register na 74LS164... help us pls... malapit na finals... maraming salamat... " TULONG NIYO KINABUKASAN KO"... huhuhu 
|
|
|
|
|
Logged
|
|
|
|
|
The Philippine Electronics and Technology Forum
|
 |
« on: August 24, 2010, 03:36:33 PM » |
|
|
|
|
|
|
Logged
|
|
|
|
|
labgruppen
|
 |
« Reply #1 on: August 24, 2010, 08:22:22 PM » |
|
you should start by defining the sequences of the 8 programs. then you could store the sequences in a two dimmensional array or you could also set up 8 arrays, each of the array containing a particular sequence. then it would only be a matter of selecting which array to display according to which button is pressed. this is imho a very easy project, so kayang kaya nyo yan.. you should post the schematics for comments and improvement suggestion by the forum members. i suggest that you use 74ls595 instead of 74ls164. this way, you could shift out the next pattern with out the leds displaying the shifting process.. so post your schematics first, then we'll see.
|
|
|
|
|
Logged
|
|
|
|
hearty_28
LR44 Battery
Pogi/Ganda Points: 2
Offline
Posts: 1
|
 |
« Reply #2 on: August 25, 2010, 06:54:00 PM » |
|
hi darling,
im new to this forum... i would suggest you would read and research first for the datasheet of that microcontroller...
---char!!!!
|
|
|
|
|
Logged
|
|
|
|
darlingvt
LR44 Battery
Pogi/Ganda Points: 3
Offline
Posts: 1
|
 |
« Reply #3 on: August 30, 2010, 04:11:42 PM » |
|
 here is a similar circuit of our project... are the serial input connection are correct (PA1, PA2,PA3, PA0, PB0)...? we also dont know where to put the switch sir... sir, hope u'l help us with this... we'll wait for your reply... thnx alot... :(C:\Documents and Settings\Mapet\Desktop
|
|
|
|
|
Logged
|
|
|
|
darlingvt
LR44 Battery
Pogi/Ganda Points: 3
Offline
Posts: 1
|
 |
« Reply #4 on: August 30, 2010, 04:38:03 PM » |
|
 here is a similar circuit of our project... are the serial input connection are correct (PA1, PA2,PA3, PA0, PB0)...? we also dont know where to put the switch sir... sir, hope u'l help us with this... we'll wait for your reply... thnx alot...
|
|
|
|
|
Logged
|
|
|
|
|
labgruppen
|
 |
« Reply #5 on: August 30, 2010, 08:41:26 PM » |
|
^akala ko ba disco lights ang gagawin ninyo na 9x6 LED bat 8x5 na yan? tsk,tsk.. clear naman yata yung "post YOUR schematics first..".
|
|
|
|
|
Logged
|
|
|
|
darlingvt
LR44 Battery
Pogi/Ganda Points: 3
Offline
Posts: 1
|
 |
« Reply #6 on: September 11, 2010, 12:29:42 AM » |
|
we have attached already the circuit diagram we have designed using the 8 bit shift register 74HC595 with Zilog(Z8F042A)...we have already decided our 1st pattern to be implemented but we don't know how to program it......actually we have 8 patterns but we would like to try first our first pattern to be done before others....we also used switches for each pattern to be triggered.....we have already made a program for switches: #include <ez8.h > void delay(void){ unsigned int i,j; for(i=1;i<=0xFF;i++) for(j=1;j<=0xFF;j++); } void main(){ PADD = 0x3F; PAFF = 0x00; while(1){ if ((PAIN & 0x01)==0x00){ PATTERN1(): delay(); } if ((PAIN & 0x02)==0x00){ PATTERN2(): delay(); } if ((PAIN & 0x03)==0x00){ PATTERN3(): delay(); } } } our problem now is that we don't know how to make a program for each pattern....actually last time we have tried our best to make a program for our 1st pattern without using switches...but it doesn't work... i hope you will help us sir... 
|
|
|
|
|
Logged
|
|
|
|
darlingvt
LR44 Battery
Pogi/Ganda Points: 3
Offline
Posts: 1
|
 |
« Reply #7 on: September 11, 2010, 12:43:33 AM » |
|
sir paranz,baka nagtaka po kayo kung bakit 8x6 nalang yung nasa circuit diagram namin actually binago namin ang aming design.sana po tulungan nyo kami....
|
|
|
|
|
Logged
|
|
|
|
tiktak
Gas Turbine

Pogi/Ganda Points: 171
Offline
Gender: 
Posts: 2498
|
 |
« Reply #8 on: September 11, 2010, 08:13:36 AM » |
|
how do you send the data to the 74HC595? parang unusual kung saan nakalagay yung switch
|
|
|
|
|
Logged
|
Bakit andaming hindi marunong gumamit ng search? 
|
|
|
darlingvt
LR44 Battery
Pogi/Ganda Points: 3
Offline
Posts: 1
|
 |
« Reply #9 on: September 11, 2010, 12:02:38 PM » |
|
sir tiktak, bawat switch maykanyakangyang pins kebale pagoff sya yung corresponding pattern hindi magdisplay pero if on sya saka cya magdisplay..ang switch yung magpapatrigger ng output sa microcontroller papunta sa 74HC595. 
|
|
|
|
|
Logged
|
|
|
|
|
labgruppen
|
 |
« Reply #10 on: September 14, 2010, 02:27:26 PM » |
|
imho, there are better ways to select which pattern is to be displayed. you could just simply connect the input of the 595 to a GPIO and just select which pattern to display via firmware. you could use the two extra GPIOs to act as next/prev pattern selector. you could even use the column pins (port C) in conjunction with the two pins to make a 2x5 switch matrix to provide instant access to your patterns. with regards on how to display your pattern, please review the datasheet of the 595. you will have to create a routine/function that will bit bang your 595 signal requirements such as clock, ser data, latch, etc. to give you a clue, assuming you started with all pins Low. Let us assign the 8bit pattern to be displayed as OutputByte. do the following steps. 1. Test bit0 of OutputByte and set/reset the serial data line according to bit0 (bit7=MSB, bit0=LSB). 2. Set serial/shift clock. 3. Reset serial/shift clock. 4. Shift OutputByte one step to the right. (OutputByte>>1) 5. Go back to step 1 until all bits are shifted out to the 595. 6. set latch line. 7. reset latch line.
note that the above is only a clue, and if you will implement it you will have to correct it to display the OutputByte in the correct manner, that is LSB of OutputByte should be at the LSB of the 595. i also would want to reiterate the use of arrays to store your pattern data. you could add another column and connect a seven segment display to it. this will provide a display to show which pattern is currently being displayed.
|
|
|
|
|
Logged
|
|
|
|
|
The Philippine Electronics and Technology Forum
|
|
|
|
|
|
Logged
|
|
|
|
|