SUB Impulso_US(Time_us AS INTEGER)#NR
DIM SoftPWM,Cuenta,Ciclo_us AS INTEGER
Time_us=Time_us/25
FOR SoftPWM=1 TO Time_us
MOVLW 0x0C
MOVWF Cuenta
bsf PORTD,2
Ciclo_us
DECFSZ Cuenta,1
goto Ciclo_us
MOVLW 0x0C
MOVWF Cuenta
bcf PORTD,2
Ciclo_us
DECFSZ Cuenta,1
goto Ciclo_us
NEXT SoftPWM
END SUB
Errors.txt
/home/User/GCBasicIDE/16F877A/16F877A_Robot_4WD/16F877A_Robot_4WD_Sonar/16F877A_Robot_4WD_Sonar.gcb (35): Message TYPEERROR not defined in messages.dat!: Error de Sintaxis
/home/User/GCBasicIDE/16F877A/16F877A_Robot_4WD/16F877A_Robot_4WD_Sonar/16F877A_Robot_4WD_Sonar.gcb (41): Message TYPEERROR not defined in messages.dat!: Error de Sintaxis
where am I wrong to place the code asm??
sorry for my english
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The address labels need a colon at the end and they should be unique. DIMing Ciclo_us as an integer is also causing a problem. The following code should compile.
SUB Impulso_US(Time_us AS INTEGER)#NR
DIM SoftPWM,Cuenta AS INTEGER
Time_us=Time_us/25
FOR SoftPWM=1 TO Time_us
MOVLW 0x0C
MOVWF Cuenta
bsf PORTD,2
Ciclo_us_hi:
DECFSZ Cuenta,1
goto Ciclo_us_hi
MOVLW 0x0C
MOVWF Cuenta
bcf PORTD,2
Ciclo_us_lo:
DECFSZ Cuenta,1
goto Ciclo_us_lo
NEXT SoftPWM
END SUB
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
trivial question.
I need to insert asm code in the code I'm writing in GCBASIC.
how do you?
Hi just type it in like any other code. Ed.
SUB Impulso_US(Time_us AS INTEGER)#NR
DIM SoftPWM,Cuenta,Ciclo_us AS INTEGER
Time_us=Time_us/25
FOR SoftPWM=1 TO Time_us
MOVLW 0x0C
MOVWF Cuenta
bsf PORTD,2
Ciclo_us
DECFSZ Cuenta,1
goto Ciclo_us
MOVLW 0x0C
MOVWF Cuenta
bcf PORTD,2
Ciclo_us
DECFSZ Cuenta,1
goto Ciclo_us
NEXT SoftPWM
END SUB
Errors.txt
where am I wrong to place the code asm??
sorry for my english
The address labels need a colon at the end and they should be unique. DIMing Ciclo_us as an integer is also causing a problem. The following code should compile.
ok, now compile correctly.
but does not work well.
obviously the timing is not correct to get with 40khz pic with a 4mhz