PDA

View Full Version : 18f2550 + 24lc512



mpardinho
- 20th December 2007, 20:59
In code in 18F2550 letra not work.......letra = " ", but in 24lc512 have "AAAAAAA"
usb work 100% if i use
Contador = 1
Dados[0] = "A"
gosub USB_Envia


In 18F252 work 100%


18F252
osc 32 - PLL ON
------------------------------------------------------------------------
For I = 1 To Memoria_Posicao
I2CREAD Memoria_Data, Memoria_Clock, Controle, I, [Letra]
PAUSE 10

IF (Letra <> $FF) THEN hserout [Letra]
Next I


------------------------------------------------------------------------
18F2550
osc 48

For I = 1 To Memoria_Posicao
I2CREAD Memoria_Data, Memoria_Clock, Controle, I, [Letra]
PAUSE 10

IF (Letra <> $FF) THEN
Contador = 1
Dados[0] = Letra
gosub USB_Envia
ENDIF
Next I

..........................

USB_Envia:
USBService
IF (Contador > 0) THEN USBOut 3, Dados, Contador, USB_Envia
Contador = 0
Resume
-----------------------------------------------------------------

mister_e
- 20th December 2007, 22:02
you may need to reduce your pause... and/or playing around the famous POST 148

http://www.picbasic.co.uk/forum/showpost.php?p=30682&postcount=148

HTH