nerdegutta
- Joined Dec 15, 2009
- 2,684
Is this another project?
How does your code look?
How does your code look?
First you look up the spec of the 4017 to see how to control the clock pin 14 and the reset pin 15 of the 4017.Hi,
I am working with 4017 connected through 877 for controling LED as per schematic the problem is that i am not getting how to control the Reset pin 15 of 4017 to avoid counting upto 10 i.e. stop at 8 only..??
Not like project just moving forward after using if else. foor loop to simple output to LEDs..Is this another project?
How does your code look?
Everything work fine while connecting the reset pin to serial output at 9 of 4017 but when i connect the uC to Led matrix it start from any Row but i want it to start from 1st Row only!!First you look up the spec of the 4017 to see how to control the clock pin 14 and the reset pin 15 of the 4017.
Then you use the clock pin to "bit bang" the clock line to count up to the desired number.
Once you know you are at that number and want to "count back to zero" you hit the reset line instead of the clock line.
I guess that is not your whole code....TRISB=0X00;
PORTB=0B00101010;
LIKE THIS WORKING FINE BUT THE PROBLEM IS RESET..
Of course you want that, so why don't you do that?Everything work fine while connecting the reset pin to serial output at 9 of 4017 but when i connect the uC to Led matrix it start from any Row but i want it to start from 1st Row only!!
LIKE THIS WORKING FINE BUT THE PROBLEM IS RESET..
If you are still using the 16F877a you will have enough pins to drop using the CD4017
#include <htc.h>
__CONFIG(LVP_OFF & BOREN_OFF & PWRTE_ON & WDTE_OFF & FOSC_XT);
#define _XTAL_FREQ 4000000
#define DAD PORTB
#define RST RD7
#define CLK RD4
#define DATA RD5
#define D 1
extern const unsigned char Font2[32][7];
int data(int a);
main (){
TRISD=0B00000000;
TRISB=0B00000000;
while(1){
DAD=0X00;
int a;
for(int i=1;i<32;i++){
for (int k=0;k<100;k++){
int o=0;
a=Font2[o];
data(a);
DAD=0X80;
__delay_ms(D);
o++;
a=Font2[o];
data(a);
DAD=0X40;
__delay_ms(D);
o++;
a=Font2[o];
data(a);
DAD=0X20;
__delay_ms(D);
o++;
a=Font2[o];
data(a);
DAD=0X10;
__delay_ms(D);
o++;
a=Font2[o];
data(a);
DAD=0X08;
__delay_ms(D);
o++;
a=Font2[o];
data(a);
DAD=0X04;
__delay_ms(D);
o++;
a=Font2[o];
data(a);
DAD=0X02;
__delay_ms(D);
o++;
}
}
}
}
int data(int a)
{
RST=0;
RST=1;
DAD=0X00;
for (int k=0; k<8;k++) {
CLK = 0;
if ((a & 0x01)==1) DATA = 1;
else DATA =0;
CLK =1;
a >>=1;
} }
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
T | Microcontroller/Programming help needed! simple DIY project | Microcontrollers | 8 | |
Pic programming help needed | Microcontrollers | 13 | ||
E | help needed with PIC programming | Microcontrollers | 9 | |
E | Arduino programming help needed | Programming & Languages | 2 | |
R | (memory storing) help needed with programming of PIC18F45K20 | Microcontrollers | 13 |