Device=16F628A
Xtal 20
DECLARE Hserial_Baud
= 9600 ' Set baud rate to 9600 DECLARE Hserial_TXSTA
= %
00100100 ' Enable transmit and asynchronous mode DECLARE Hserial_RCSTA
= %
10010000 ' Enable continuous receive DECLARE Hserial_Clear
= ON ' Clear the buffer before receiving DelayMS 200 ' tiempo para estabilizar la alimentación
INICIO:
HSerIn 50,INICIO,[Dec CONTROL]
SELECT CASE CONTROL
CASE 1
High PORTB.6:Low PORTB.0
CASE 2
Low PORTB.6:Low PORTB.0
CASE 3
High PORTA.0:Low PORTA.1
CASE 4
High PORTA.1:Low PORTA.0
CASE 5
High PORTA.2:Low PORTA.3
CASE 6
High PORTA.3:Low PORTA.2
CASE 7
Low PORTA.0:Low PORTA.1:Low PORTA.2:Low PORTA.3
CASE 8
HPWM 1,200,2000
CASE 9
HPWM 1,226,2000
CASE 10
HPWM 1,254,2000
CASE ELSE
FOR A=0 TO 20 STEP 1
High PORTB.0 ' RB0 = 1
DelayUS CONTROL ' Pausa en microsegundos
Low PORTB.0 ' RB0 = 0
DelayMS 20 ' Pausa de 20 milisegundos
NEXT
EndSelect
GOTO INICIO