Ismael M. Khangane wrote: > > Hi Miguel, > Yes I have been looking around the MICROCHIP application's note but I failed t o come > across the complete examples especially on ' I2C and Serial Port Communication s'. > P'se if u know exactly where to find them, I'll appreciate to u very much!. N o > matter they are in C or Assembly. > Regards, > Hear from u soon. > Ismael. > > ************************************************************* > WF AUTOMACAO - KITS EDUCACIONAIS NACIONAIS escribis: > > > Mauricio Jancic wrote: > > > > > > Hi, I'm Mauricio. I need something like what Ismael need's. Do you have an ythi > > ng in assembly?? > > > > > > Thanks in advance, > > > > > > Mauricio Jancic > > > Republica Argentina > > > > > > -----Mensaje original----- > > > De: WF AUTOMACAO - KITS EDUCACIONAIS NACIONAIS [SMTP:wf@BLUSOFT.ORG.BR ] > > > Enviado el: Jueves, 09 de Diciembre de 1999 08:46 p.m. > > > Para: PICLIST@MITVMA.MIT.EDU > > > Asunto: Re: Worked Examples for PIC17CXXX > > > > > > Ismael M. Khangane wrote: > > > > > > > > Hi, > > > > Is there a place or anybody has worked examples for PIC17CXXX? > > > > Ismael. > > > > > > In C or assembly? > > > > > > Miguel > > > > Yes, i have... but,,,did you see the MICROCHIP application's note? here a C sample Miguel Wisintainer #include <17c42.h> #include long far *p; char far *q; unsigned char Tam_H; unsigned char Tam_L; long Total, L; long I,Pausa; unsigned char Lixo; unsigned int w; unsigned char c,t,o; void __PIV() { #asm MOVFP W,0x1F MOVLW 0x20 MOVPF W,PCLATH LCALL 0x20 MOVFP 0x1f,W RETFIE #endasm } /////////////////////////////////////////////////////////// void __INT() { #asm MOVFP W,0x1F MOVLW 0x20 MOVPF W,PCLATH LCALL 0x08 MOVFP 0x1f,W RETFIE #endasm } /////////////////////////////////////////////////////////// void __TMR0() { #asm MOVFP W,0x1F MOVLW 0x20 MOVPF W,PCLATH LCALL 0x10 MOVFP 0x1f,W RETFIE #endasm } /////////////////////////////////////////////////////////// void __RTpin() { #asm MOVFP W,0x1F MOVLW 0x20 MOVPF W,PCLATH LCALL 0x18 MOVFP 0x1f,W RETFIE #endasm } void Transmite(unsigned char c) { while(!PIR.TBMT); TXREG=c; } unsigned char Recebe() { while(!PIR.RBFL); return(RCREG); } void inicializa_serial() { SPBRG=7; //19200 a 10MHZ TXSTA=0xA0; RCSTA=0x90; } void Delay() { for(Pausa=0;Pausa<=250;Pausa++); } void main() { inicializa_serial(); Transmite('M'); o=Recebe(); //P=PROGRAMA N=NORMAL Transmite('M'); Tam_H=Recebe(); Transmite(Tam_H); Lixo=Recebe(); Transmite('M'); Tam_L=Recebe(); Transmite(Tam_L); Lixo=Recebe(); Total=Tam_L+(Tam_H*256); for(I=0x2000;I<(0x2000+Total);I++) { p=I; q=I; Transmite('M'); w=Recebe(); *p=w; if(o=='P') Delay(); w=*p; Transmite(w); t=Recebe(); Transmite('M'); c=Recebe(); *q=c; if(o=='P') Delay(); c=*q; Transmite(c); t=Recebe(); } t=Recebe(); #asm MOVLW 0x20 MOVPF W,PCLATH LCALL 0x00 #endasm }