Autor Tema: problemas con picbasic  (Leído 1784 veces)

0 Usuarios y 1 Visitante están viendo este tema.

Desconectado Chrisbaf

  • PIC16
  • ***
  • Mensajes: 178
problemas con picbasic
« en: 01 de Mayo de 2008, 02:11:57 »
fijense que he adaptado un programa para recibir los datos de un control remoto y manejar un pic 16f84 y me funciona bien, ahora que lo quiero correr en un
pic 12f629 al compilarlo me muesta, error:  unable to fit variable control,total total1 y total2 el programa es el siguiente:


include "bs2defs.bas"
 
     
        @ DEVICE pic12F629, INTRC_OSC_NOCLKOUT
                ' System Clock Options (Internal)       
        @ DEVICE pic12F629, WDT_Off
                ' Watchdog Timer
        @ DEVICE pic12F629, PWRT_ON
                ' Power-On Timer
        @ DEVICE pic12F629, MCLR_OFF
                ' Master Clear Options (Internal)
        @ DEVICE pic12F629, BOD_ON
                ' Brown-Out Detect
        @ DEVICE pic12F629, CPD_OFF
                ' Data Memory Code Protect
        @ DEVICE pic12F629, PROTECT_OFF
 
control var byte
almacena var word
entrada var gpio.0
salida1 var gpio.1
salida2 var gpio.2
total1 var byte
total2 var byte
total  var byte

inicio:
pulsin entrada,1,almacena  'chequea entrada
serout 0,N2400,[almacena]
if almacena < 350 then inicio
serout 0,N2400,[almacena]
for control = 1 to 7
pulsin entrada,1,b20
next control

pulsin entrada,1,b0
pulsin entrada,1,b1
pulsin entrada,1,b2
pulsin entrada,1,b3

for control = 1 TO 8
pulsin entrada,1,b21
next control

pulsin entrada,1,b4
pulsin entrada,1,b5
pulsin entrada,1,b6
pulsin entrada,1,b7

if b0 < 100 then
b0 = 0
else
b0 = 1
endif

if b1 < 100 then
b1 = 0
else
b1 = 1
endif

if b2 < 100 then
b2 = 0
else
b2 = 1
endif

if b3 < 100 then
b3 = 0
else
b3 = 1
endif

if b4 < 100 then
b4 = 0
else
b4 = 1
endif

if b5 < 100 then
b5 = 0
else
b5 = 1
endif

if b6 < 100 then
b6 = 0
else
b6 = 1
endif

if b7 < 100 then
b7 = 0
else
b7 = 1
endif

total1 =(128*b0)+(64*b1)+(32*b2)+(16*b3)+(8*b4)+(4*b5)
total2 = (2*b2)+(1*b1)
total = total1 + total2
if total = 195 then
toggle salida1
endif

if total = 192 then
toggle salida2
endif

pause 800
goto inicio

end
« Última modificación: 01 de Mayo de 2008, 15:35:55 por Chrisbaf »


 

anything