Hi folk,
Would you like show me an example, how can I set ADE7169F16 rising ADE_ISR() interrupt subroutine.
Thanks & Best Regards,
Cuong,
#include<reg51.h> void send_seg(int,int,int,int); unsigned char n=1; unsigned char thou=2,hun=0,ten=0,single=6; unsigned char a[10]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90}; void DelayMs(unsigned char); void main() { P0=P2=0; while(1) { send_seg(thou,hun,ten,single); } } void send_seg(int thou,int hun,int ten,int single) { if(n==1) { P0=0x08; P2=a[single]; n=2; DelayMs(5); } else if(n==2) { P0=0x04; P2=a[ten]; n=3; DelayMs(5); } else if(n==3) { P0=0x02; P2=a[hun]; n=0; DelayMs(5); } else { P0=0x01; P2=a[thou]; n=1; DelayMs(5); } } void DelayMs(unsigned char Ms) { int i; for(i=0;i<Ms*48;i++); }
Hi,
Thanks for your help. But I don't understand, what are you doing?
Thanks & Best regards, Cuong,
It isn't what he is doing. It is what he isn't doing.
No code there to use a ADE7169F16 with any interrupt.
No code there to use a ADE7169F16 with any interrupt. 'code' has comments, 'scribbles' do not.
Erik
View all questions in Keil forum