| David 
 
 
 Joined: 20 Jul 2005
 Posts: 1
 Location: BANGKOK, THAILAND
 
 
			    
 
 | 
			
				| serial command to an HCR330 reader |  
				|  Posted: Wed Aug 10, 2005 9:04 pm |   |  
				| 
 |  
				| Hello 
 My name's David and I begin to use CCS compiler with MPLAB.
 
 I have a problem to send a serial command to a HCR330 smartcard reader.
 The reader specifications are :
 - 9600 baud rate
 - 8 bits data length
 - parity none
 - 1 stop bit
 
 I want to send the command "<ESC>E" and I made this little program ->
 
 
 #if defined(__PCM__)
 #include <16F877.h>
 #fuses HS,NOWDT,NOPROTECT,NOLVP
 #use delay(clock=20000000)
 #use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7)  // Jumpers: 8 to 11, 7 to 1
 
 #elif defined(__PCB__)
 #include <16c56.h>
 #fuses HS,NOWDT,NOPROTECT
 #use delay(clock=20000000)
 #use rs232(baud=9600, xmit=PIN_A3, rcv=PIN_A2)  // Jumpers: 11 to 17, 12 to 18
 
 #elif defined(__PCH__)
 #include <18F452.h>
 #fuses HS,NOWDT,NOPROTECT,NOLVP
 #use delay(clock=20000000)
 #use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7)  // Jumpers: 8 to 11, 7 to 12
 #endif
 
 
 void main() {
 
 int a, b;
 
 a = 0x1b
 b = 0x45
 
 printf(a, b)
 
 }
 
 I tried to set a and b in Dec like this a = 27 and b = 69 but It doesn't working too and I don't know why.
 
 Have you an idea about that and can you help me ?
 
 Thank you
 
 Best regards
 
 David
 |  |