Bienvenido(a),
Visitante
. Por favor,
ingresa
o
regístrate
.
¿Perdiste tu
email de activación?
22 de Mayo de 2013, 21:21:54
1 Hora
1 Día
1 Semana
1 Mes
Siempre
Ingresar con nombre de usuario, contraseña y duración de la sesión
Buscar:
Búsqueda Avanzada
328938
Mensajes en
36659
Temas por
37264
Usuarios
Último usuario:
fiorellaab
Buscar en TodoPIC
TODOPIC
Simuladores, editores de PCB, etc
Ejemplos para simular
(Moderadores:
pocher
,
xocas
)
PicAxe 08M y 18x -Programas para Compartir Isis
0 Usuarios y 1 Visitante están viendo este tema.
« anterior
próximo »
Páginas:
[
1
]
Autor
Tema: PicAxe 08M y 18x -Programas para Compartir Isis (Leído 3405 veces)
IAO
Colaborador
PIC24F
Desconectado
Sexo:
Venezuela
Mensajes: 683
PicAxe 08M y 18x -Programas para Compartir Isis
«
:
06 de Diciembre de 2010, 17:35:20 »
Hola Para Todos...
Me propuse abrir aquí esta publicación porque son simulaciones en si y no unos proyectos reales..
Esto de los picaxe hay que tomarselo con calma. Ni odiarlos ni quererlos. Solo dejarlos existir..
Todos tenemos derecho a vivir y dejar vivir a los demás..
Ellos son muy claros en sus respuestas...
Si necesitas más utiliza un pic y un compilador profesional...
Una aclaratoria, insertada hoy 07/12/10.
Se me olvidaba decir, que hacer correr los picaxe en el simulador Isis 7.4 ó 7.7 no es tan fácil....
Por lo menos a mi, me dió muchos problemas...
Como un regalo de fin de año, para aquellos que estan aprendiendo todavía...
No hay mucha explicación. Trata de comprender el código fuente en sí. No es tan difícil,
solo hay que acostumbrarse a nuevas formas y métodos que en otros compilaores no acostumbramos a usar.
Aquí les dejo dos ejemplos con medición temperatura.
Son muy, muy, básicos...
Código:
'''18x_Temp1.bas
loop1: pause 500
readtemp 0,b1
if b1>127 then neg
'serout 4,N2400,(254,128,"Temp is ",#b1," ",cr,lf) '''Send via OutPut_4
'''Serial output via the serout programming pin (baud 4800, 8 data, no parity, 1 stop). Inverted
sertxd("Temp is: ",#b1,"C",13,10)
' Debug
goto loop1
neg: let b1=b1-128
'serout 4,N2400,(254,128,"Temp is ","-",#b1," ",cr,lf) '''Send via OutPut_4
'''Serial output via the serout programming pin (baud 4800, 8 data, no parity, 1 stop). Inverted
sertxd("Temp is: ","-",#b1,"C",13,10)
goto loop1
Aquí está el otro...
Código:
'''‘**************************************
'''‘****** Termostato electrónico ************
'''‘**************************************
'''18x_Temp1.bas
inicio:
low 0 ''''‘outputs off '''output 0
low 1 '''output 1
bucle:
'sound 2,(50,50) '''‘clic en piezo
readtemp 0,b1 '''‘lectura de temperatura y almacena en b1 '''Input_0
if b1 > 30 then caliente '''‘si b1 es superior a 30 saltar a rutina caliente(Hot)
if b1 < 20 then frio '''‘si b1 es superior a 20 saltar a rutina frio(cold)
goto inicio '''‘otuputs off
caliente:
high 1 '''‘on dispositivo en output (calefactor) '''output 1
sound 2,(50,50) '''‘clic en piezo
goto bucle '''‘salta a rutina de lectura y comparación
frio:
high 0 '''‘LED on '''output 0
goto bucle
Saludos
Aquí abajo el esquemático..
«
Última modificación: 07 de Diciembre de 2010, 14:33:49 por IAO
»
En línea
"No hay caminos para lograr la PAZ. La PAZ es el camino"... (Mahatma Gandhi).
Mentes Superiores discuten Ideas, Proyectos. Mentes Promedio discuten Acontecimientos y Sucesos. Mentes Pobres discuten sobre Personas.
IAO
Colaborador
PIC24F
Desconectado
Sexo:
Venezuela
Mensajes: 683
Re: PicAxe 08M 18x Programas para Compartir Isis
«
Respuesta #1 :
06 de Diciembre de 2010, 17:42:09 »
Hola otra vez...
Este ejemplo es con un lcd 16x2 y otro ejemplo con un lcd 20x4..
Igual, no explico nada, tratar de usar un poco el material del cerebro..
Código:
'''**** LCD 16X2 **************************************************************
''' Adaptado para trabajar con 2 Lineas y 16 Caracteres.
''' This program runs on PicAxe -18X @ 4Mhz.
''' It interfaces with an LM016L-Based 16X2 LCD Display.
'''
'''
''*****************************************************************************
''' **** Constant Definitions ****
symbol En = 3 '''LCD Enable pin connected to PicAxe output-3
symbol RS = 2 '''LCD Regsel pin connected to PicAxe output-2
''' **** Variable Defintions ****
symbol char = b1 '''Character to be sent to LCD
symbol index = b2 '''Used as counter in For-Next loops
''' **** Data Definitions ****
'''Debo rellenar con 16 caracteres entre las comillas, no más de 16 caracteres.
data 0, ("Prueba para 18X") ''' LCD row 1 stored in EEPROM memory
data 20, ("Es lo Mejor 16X2") ''' LCD row 2 stored in EEPROM memory
''' **** Main Program *******************************************************
Main: GoSub Init '''Initialize LCD
For index = 0 to 15 '''Output data to 1st row of LCD (0 to 15 = 16 caracteres)
read index, char '''Read character from EEPROM
GoSub wrchr '''Send character to LCD
Next index
char = 192 '''Instruction: start of 2nd row of LCD
GoSub wrins '''Send instruction to LCD
For index = 20 to 35 '''Output data to 2nd row of LCD (20 to 35 = 16 caracteres)
read index, char '''Read character from EEPROM
GoSub wrchr '''Send character to LCD
Next index
End
''' **** End Main Program - Subroutines Follow *************************
''' **** Subroutine init ****
Init: pins = 0 '''Clear all PicAxe output lines
pause 200 '''Pause 200 mS for LCD initialization
pins = 48 '''Instruction: set to 8-bit operation
pulsout En,1 '''Send data to LCD
pulsout En,1 '''Send data (necessary)
pins = 32 '''Instruction: set to 4-bit operation
pulsout En,1 '''Send data to LCD
pulsout En,1 '''Send data (necessary in 4-bit mode)
pins = 128 '''Instruction: set to 2 line operation
pulsout En,1 '''Send data to LCD
char = 14 '''Instruction: screen on, cursor on
GoSub wrins '''Send instruction to LCD
char = 1 '''Instruction: clear display, cursor home
GoSub wrins '''Send instruction to LCD
char = 12 '''Instruction: hide cursor
GoSub wrins '''Send instruction to LCD
Return
''' **** Subrutine wrchr ****
wrchr: pins = char & 240 '''Place high nibble of char onto pins
high RS '''Make sure RS is high
pulsout En,1 '''Send data to LCD
pins = char * 16 '''Place low nibble of char onto pins
high RS '''Make sure RS is high
pulsout En,1 '''Send data to LCD
Return
''' **** Subrutine wrins ****
wrins: pins = char & 240 '''Place high nibble of char onto pins
pulsout En,1 '''Send data to LCD
pins = char * 16 '''Place low nibble of char onto pins
pulsout En,1 '''Send data to LCD
Return
Aquí el 20x4, original código de una revista que no recuerdo.
Código:
'''**** LCD 20X4 **************************************************************
'''
''' This program runs on PicAxe -18X @ 4Mhz.
''' It interfaces with an HD4478-Based 20X4 LCD Display.
'''
'''
''********************************************************************************
''' **** Constant Definitions ****
symbol En = 3 '''LCD Enable pin connected to PicAxe output-3
symbol RS = 2 '''LCD Regsel pin connected to PicAxe output-2
''' **** Variable Defintions ****
symbol char = b1 '''Character to be sent to LCD
symbol index = b2 '''Used as counter in For-Next loops
''' **** Data Definitions ****
data 0, ("Nice PicAxe Display!") ''' LCD row 1 stored in EEPROM memory
data 40, ("With all this space,") ''' LCD row 3 stored in EEPROM memory
data 20,("you can control your") ''' LCD row 2 stored in EEPROM memory
data 60,("corner of the world!") ''' LCD row 4 stored in EEPROM memory
''' **** Main Program *******************************************************
Main: GoSub Init '''Initialize LCD
For index = 0 to 39 '''Output data to 1st (& 3rd!) row of LCD
read index, char '''Read character from EEPROM
GoSub wrchr '''Send character to LCD
Next index
char = 192 '''Instruction: start of 2nd row of LCD
GoSub wrins '''Send instruction to LCD
For index = 40 to 79 '''Output data to 2nd (& 4th!) row of LCD
read index, char '''Read character from EEPROM
GoSub wrchr '''Send character to LCD
Next index
End
''' **** End Main Program - Subroutines Follow *************************
''' **** Subroutine init ****
Init: pins = 0 '''Clear all PicAxe output lines
pause 200 '''Pause 200 mS for LCD initialization
pins = 48 '''Instruction: set to 8-bit operation
pulsout En,1 '''Send data to LCD
pulsout En,1 '''Send data (necessary)
pins = 32 '''Instruction: set to 4-bit operation
pulsout En,1 '''Send data to LCD
pulsout En,1 '''Send data (necessary in 4-bit mode)
pins = 128 '''Instruction: set to 2 line operation
pulsout En,1 '''Send data to LCD
char = 14 '''Instruction: screen on, cursor on
GoSub wrins '''Send instruction to LCD
char = 1 '''Instruction: clear display, cursor home
GoSub wrins '''Send instruction to LCD
char = 12 '''Instruction: hide cursor
GoSub wrins '''Send instruction to LCD
Return
''' **** Subrutine wrchr ****
wrchr: pins = char & 240 '''Place high nibble of char onto pins
high RS '''Make sure RS is high
pulsout En,1 '''Send data to LCD
pins = char * 16 '''Place low nibble of char onto pins
high RS '''Make sure RS is high
pulsout En,1 '''Send data to LCD
Return
''' **** Subrutine wrins ****
wrins: pins = char & 240 '''Place high nibble of char onto pins
pulsout En,1 '''Send data to LCD
pins = char * 16 '''Place low nibble of char onto pins
pulsout En,1 '''Send data to LCD
Return
Nos veremos
Aqui abajo esquematicos....
En línea
"No hay caminos para lograr la PAZ. La PAZ es el camino"... (Mahatma Gandhi).
Mentes Superiores discuten Ideas, Proyectos. Mentes Promedio discuten Acontecimientos y Sucesos. Mentes Pobres discuten sobre Personas.
IAO
Colaborador
PIC24F
Desconectado
Sexo:
Venezuela
Mensajes: 683
Re: PicAxe 08M 18x Programas para Compartir Isis
«
Respuesta #2 :
06 de Diciembre de 2010, 17:48:44 »
Holaaaa... soy una piña bajo el brazo... fastidioso...
Aquí termómetro con lcd 16x2 y DS18B20
Este me dió un poco de trabajo..no fue tan fácil como se ve ahora....
Código:
'''**** LCD 16X2 **************************************************************
''' Adaptado para trabajar con 2 Lineas y 16 Caracteres.
''' This program runs on PicAxe -18X @ 4Mhz.
''' It interfaces with an LM016L-Based 16X2 LCD Display.
'''
'''
''********************************************************************************
''' **** Constant Definitions ****
symbol En = 3 '''LCD Enable pin connected to PicAxe output-3
symbol RS = 2 '''LCD Regsel pin connected to PicAxe output-2
''' **** Variable Defintions ****
symbol char = b1 '''Character to be sent to LCD
symbol index = b2 '''Used as counter in For-Next loops
''' **** Data Definitions ****
'''Debo rellenar con 16 caracteres entre las comillas, no más de 16 caracteres.
data 0, (" PICAXE THERMO") ''' LCD row 1 stored in EEPROM memory
data 20, ("TEMP = ") ''' LCD row 2 stored in EEPROM memory
''' **** Main Program *******************************************************
Main: GoSub Init '''Initialize LCD
For index = 0 to 15 '''Output data to 1st row of LCD (del 0 al 15 = 16 caracteres)
read index, char '''Read character from EEPROM
GoSub wrchr '''Send character to LCD
Next index
REM char = 192 '''Instruction: start of 2nd row of LCD
REM GoSub wrins '''Send instruction to LCD
REM For index = 20 to 35 '''Output data to 2nd row of LCD (del 20 al 35 = 16 caracteres)
REM read index, char '''Read character from EEPROM
REM GoSub wrchr '''Send character to LCD
REM Next index
Repeat:
GoSub Postemps
GoTo Repeat
End
'''===============================================
''' Read DS18B20 with readtemp command.
'''===============================================
Postemps:
Setfreq m4
Pause 500
''''*** w3 = b7 : b6
readtemp 0,b6
'''Serial output via the serout programming pin (baud 4800, 8 data, no parity, 1 stop). Inverted
If b6 > 128 then Negtemps
sertxd("Temp is: ", #b6, " C", 13, 10)
char = 192 '''Instruction: start of 2nd row of LCD
GoSub wrins '''Send instruction to LCD
char = "T"
GoSub wrchr
char = "E"
GoSub wrchr
char = "M"
GoSub wrchr
char = "P"
GoSub wrchr
char = "="
GoSub wrchr
char = " "
GoSub wrchr
char = " "
GoSub wrchr
REM For b3 = 0 to 8
REM char = 20
REM GoSub wrins
REM Next
Bintoascii b6, b11, b12, b13
if b6 > 99 then
char = b11
GoSub wrchr
endif
if b6 > 9 then
char = b12
GoSub wrchr
endif
char = b13 '''More rigth number
GoSub wrchr
char = "ß" '''Alt-225 degrees symbol
GoSub wrchr
char = "C"
GoSub wrchr
char = " "
GoSub wrchr
char = " "
GoSub wrchr
'setfreq m8 ''''
Return
'''===============================================
Negtemps:
let b6 = b6 - 128
'''Serial output via the serout programming pin (baud 4800, 8 data, no parity, 1 stop). Inverted
sertxd("Temp is: ", "-", #b6, " C" ,13, 10)
char = 192 '''Instruction: start of 2nd row of LCD
GoSub wrins '''Send instruction to LCD
char = "T"
GoSub wrchr
char = "E"
GoSub wrchr
char = "M"
GoSub wrchr
char = "P"
GoSub wrchr
char = "="
GoSub wrchr
char = " "
GoSub wrchr
REM char = " "
REM GoSub wrchr
char = "-"
GoSub wrchr
Bintoascii b6, b11, b12, b13
if b6 > 99 then
char = b11
GoSub wrchr
endif
if b6 > 9 then
char = b12
GoSub wrchr
endif
char = b13 '''
GoSub wrchr
char = "ß" '''Alt-225 degrees symbol
GoSub wrchr
char = "C"
GoSub wrchr
'setfreq m8 ''''
Return
'''====================================================
''' **** End Main Program - Subroutines Follow *************************
''' **** Subroutine init ****
Init: pins = 0 '''Clear all PicAxe output lines
pause 200 '''Pause 200 mS for LCD initialization
pins = 48 '''Instruction: set to 8-bit operation
pulsout En,1 '''Send data to LCD
pulsout En,1 '''Send data (necessary)
pins = 32 '''Instruction: set to 4-bit operation
pulsout En,1 '''Send data to LCD
pulsout En,1 '''Send data (necessary in 4-bit mode)
pins = 128 '''Instruction: set to 2 line operation
pulsout En,1 '''Send data to LCD
char = 14 '''Instruction: screen on, cursor on
GoSub wrins '''Send instruction to LCD
char = 1 '''Instruction: clear display, cursor home
GoSub wrins '''Send instruction to LCD
char = 12 '''Instruction: hide cursor
GoSub wrins '''Send instruction to LCD
Return
'''====================================================
''' **** Subrutine wrchr ****
wrchr: pins = char & 240 '''Place high nibble of char onto pins
high RS '''Make sure RS is high
pulsout En,1 '''Send data to LCD
pins = char * 16 '''Place low nibble of char onto pins
high RS '''Make sure RS is high
pulsout En,1 '''Send data to LCD
Return
'''====================================================
''' **** Subrutine wrins ****
wrins: pins = char & 240 '''Place high nibble of char onto pins
pulsout En,1 '''Send data to LCD
pins = char * 16 '''Place low nibble of char onto pins
pulsout En,1 '''Send data to LCD
Return
'''====================================================
'''Below is a list of useful control commands: -
'''Control Command Operation
'''$FE, 1 Clear display
'''$FE, 2 Return home (beginning of first line)
'''$FE, $0C Cursor off
'''$FE, $0E Underline cursor on
'''$FE, $0F Blinking cursor on
'''$FE, $10 Move cursor left one position
'''$FE, $14 Move cursor right one position '''Decimal 20
'''$FE, $C0 Move cursor to beginning of second line '''Decimal 192
'''$FE, $94 Move cursor to beginning of third line
'''$FE, $D4 Move cursor to beginning of fourth line
Saludos...
Aquí el esquemático..
En línea
"No hay caminos para lograr la PAZ. La PAZ es el camino"... (Mahatma Gandhi).
Mentes Superiores discuten Ideas, Proyectos. Mentes Promedio discuten Acontecimientos y Sucesos. Mentes Pobres discuten sobre Personas.
IAO
Colaborador
PIC24F
Desconectado
Sexo:
Venezuela
Mensajes: 683
Re: PicAxe 08M 18x Programas para Compartir Isis
«
Respuesta #3 :
06 de Diciembre de 2010, 17:58:43 »
Hola....
Aquí termómetro con picaxe 18x, DS18B20, Nokia glcd 3310.
Les soy muy sincero, a veces me falla la simulación, pero creo que es por
la carga al cpu, (sobrecargado)....
Sr. Chavaquiah and Sr. Westaust55 me ayudaron mucho con esto.
Son dos ejemplos, con programación un tanto diferentes, pero mismo objetivo...
Código:
; Picaxe Forum member - Anobium
;
; http://www.picaxeforum.co.uk/showthread.php?t=10014
; initial version svn 1.02
;
; Set the number of GoSubs to 256 en el PicAxe Program Editor.
;
#picaxe 18x
' Display pin 1 Vcc+ 3.2v
SYMBOL SCLK = 0 '''Display pin 2 to PICAXE out 0 (junction 6)
SYMBOL SDA = 1 '''Display pin 3 to PICAXE out 5 (junction 7)
SYMBOL DC = 2 '''Display pin 4 to PICAXE out 2 (junction 8)
SYMBOL CS = 3 '''Display pin 5 to PICAXE out 3 (junction 9)
SYMBOL RES = 4 '''Display pin 8 to PICAXE out 6 (junction 10)
' Display pin 6 gnd
' Display pin 7 Cap to Gnd 4.7uf electrolic
SYMBOL value = b0
SYMBOL width = b1
SYMBOL pointer = b2
SYMBOL X = b4
SYMBOL Y = b5
SYMBOL blinkstatus = b3
SYMBOL eeprom_addr = b8
SYMBOL GraphicData = b9
SYMBOL Loop1 = b10
SYMBOL loop3 = b12
SYMBOL SDA_PIN = outpin1
'Pause 5000 '''
Main:
SETFREQ m8
GOSUB InitLCD
'''===================================================
; *****************************************************************
;Main body
REM ; Clear line 1
REM Y=0
REM GOSUB GotoXY
REM FOR pointer = 0 TO 20
REM LookUp pointer,(" "),value
REM GOSUB ValueToLCD
REM NEXT
; Display message
X=0
Y=1
GOSUB GotoXY
FOR pointer = 0 TO 14 '''Debe tener 15 caracteres
LookUp pointer,(" PICAXE THERMO "),value
GOSUB ValueToLCD
NEXT
; Some delay code
Pause 2000 '5000
X=0
Y=3
GOSUB GotoXY
FOR pointer = 0 TO 7
LookUp pointer,(" TEMP "),value
GOSUB ValueToLCD
NEXT
Repeat:
GoSub Postemps
GoTo Repeat
'''===============================================
Postemps:
Setfreq m4
pause 500
X = 42 '40
Y = 3 '4
GOSUB GotoXY
readtemp 0,b6
if b6 > 127 then Negtemps
sertxd("Temp is: ", #b6, " C", 13, 10)
Bintoascii b6, b11, b12, b13
if b6 > 99 then
Value = b11
GoSub ValueToLCD
endif
if b6 > 9 then
Value = b12
GoSub ValueToLCD
endif
Value = b13 '''More raight number
GoSub ValueToLCD
For pointer = 0 to 2
LookUp pointer,(" C "),value
GoSub ValueToLCD
Next
REM Value = " "
REM GoSub CharToLCD
REM Value = "C"
REM GoSub CharToLCD
'setfreq m8 ''''
Return
'''===============================================
Negtemps:
X = 42
Y = 3
GoSub GotoXY
let b6 = b6 - 128
'''Serial output via the serout programming pin (baud 4800, 8 data, no parity, 1 stop). Inverted
sertxd("Temp is: ", "-", #b6, " C" ,13, 10)
Value = "-"
GoSub ValueToLCD 'CharToLCD
Bintoascii b6, b11, b12, b13
if b6 > 99 then
Value = b11
GoSub ValueToLCD
endif
if b6 > 9 then
Value = b12
GoSub ValueToLCD
endif
Value = b13 '''
GoSub ValueToLCD
For pointer = 0 to 2
LookUp pointer,(" C "),value
GoSub ValueToLCD
Next
'setfreq m8 ''''
Return
; end of main body
; *****************************************************************
'''====================================================
fin:
SETFREQ m4
STOP
END
'''===============================================
; version 1.01
;==========================================
; SUBROUTINES - Do not change. Refer to author
;---------------------------------------------------------------------
InitLCD:
LOW SCLK
LOW SDA
LOW DC
LOW CS
LOW RES
PAUSE 50
HIGH RES
HIGH CS
Value=$21 ; $21 ==> H=1 and function set = chip active, horiz addressing & extended instruction set
GOSUB CommandToLCD ; transmit To serial LCD module
Value=$08 ; Set HV multiplier = x 2. For $09 = x3 set Vop at ~$C6 otherwise gives black screen
GOSUB CommandToLCD ; transmit To serial LCD module
Value=$F0 ; set Vop with (PRS = 0 Vlcd = 2.94V TO 6.75V) If HV multiplier = $08 then use ~$C6
; $E0=5.28V, $F0=6.3V, $FF = 6.72V NOTE max allowed is 9V
GOSUB CommandToLCD ; transmit To serial LCD module
Value=$16 ; set bias: $16 ==> n=1 FOR mux rate 1:18 or 1:16 NOTE: n = 2 and n=5 DO NOT work
GOSUB CommandToLCD ; transmit To serial LCD module
Value=$06 ; set temperature coefficient = 2
GOSUB CommandToLCD ; transmit To serial LCD module
Value=$20 ; $20 ==> H=0 and function set = FOR basic instruction set
GOSUB CommandToLCD ; transmit To serial LCD module
Value=$0C ; display config = display non-inverted
GOSUB CommandToLCD ; transmit To serial LCD module
GOSUB GoToHome
GOSUB ClearFast
GOSUB GoToHome
GOSUB Normal
RETURN
'''===============================================
Invert:
Value = 13 ; invert the display light chars on dark background
GOSUB CommandToLCD
RETURN
'''===============================================
Normal:
Value = 12
GOSUB CommandToLCD
RETURN
'''===============================================
Blank:
Value = 8
GOSUB CommandToLCD
RETURN
'''===============================================
Allon:
Value = 9
GOSUB CommandToLCD
RETURN
'''===============================================
GoToHome:
X = 0
Y = 0
GotoXY:
Value = X + 128 ; 128 part = X address command
GOSUB CommandToLCD
Value = Y + 64 ; 64 part = Y address command
GOSUB CommandToLCD
RETURN
'''===============================================
CommandToLCD:
low DC 'Command mode
DataMode1:
low CS
SDA_PIN = bit7
PulsOut SCLK,1
SDA_PIN = bit6
PulsOut SCLK,1
SDA_PIN = bit5
PulsOut SCLK,1
SDA_PIN = bit4
PulsOut SCLK,1
SDA_PIN = bit3
PulsOut SCLK,1
SDA_PIN = bit2
PulsOut SCLK,1
SDA_PIN = bit1
PulsOut SCLK,1
SDA_PIN = bit0
PulsOut SCLK,1
high CS
Return
'''===============================================
DataToLCD:
high DC 'Data mode
DataMode2:
low CS
SDA_PIN = bit7
PulsOut SCLK,1
SDA_PIN = bit6
PulsOut SCLK,1
SDA_PIN = bit5
PulsOut SCLK,1
SDA_PIN = bit4
PulsOut SCLK,1
SDA_PIN = bit3
PulsOut SCLK,1
SDA_PIN = bit2
PulsOut SCLK,1
SDA_PIN = bit1
PulsOut SCLK,1
SDA_PIN = bit0
PulsOut SCLK,1
high CS
return
;
'''===============================================
ValueToLCD:
eeprom_addr=0
IF Value>32 and Value <58 then
eeprom_addr=Value-33
eeprom_addr=eeprom_addr*5+130
ELSEIF Value>64 and Value <91 then
eeprom_addr=Value-65
eeprom_addr=eeprom_addr*5
ELSEIF Value=32 then
Value = 0
GOSUB DataToLCD
GOSUB DataToLCD
GOSUB DataToLCD
GOSUB DataToLCD
ENDIF
IF Value=0 then
RETURN
ENDIF
width = 4
read eeprom_addr, Value
IF value = 0 then ; found a narrow character
width = 2
inc eeprom_addr
ENDIF
FOR Loop1 = 0 TO width
read eeprom_addr, Value
inc eeprom_addr
GOSUB DataToLCD
NEXT Loop1
value = 0
GOSUB DataToLCD ; put a 1 bit space after each character for clarity
BaleOut: RETURN
'''===============================================
ClearFast:
Gosub Blank
low SDA
high DC
low CS
For Loop1 = 1 To 48
For loop3 = 1 To 84
low SCLK
high SCLK
Next loop3
Next Loop1
high CS
Gosub Normal
Return
'''===============================================
eeprom 0,(0x7E, 0x11, 0x11, 0x11, 0x7E) ;A
eeprom (0x7F, 0x49, 0x49, 0x49, 0x36) ; B
eeprom (0x3E, 0x41, 0x41, 0x41, 0x22) ; C
eeprom (0x7F, 0x41, 0x41, 0x22, 0x1C) ; D
eeprom (0x7F, 0x49, 0x49, 0x49, 0x41) ; E
eeprom (0x7F, 0x09, 0x09, 0x09, 0x01) ; F
eeprom (0x3E, 0x41, 0x49, 0x49, 0x7A) ; G
eeprom (0x7F, 0x08, 0x08, 0x08, 0x7F) ; H
eeprom (0x00, 0x41, 0x7F, 0x41, 0x00) ; I
eeprom (0x20, 0x40, 0x41, 0x3F, 0x01) ; J
eeprom (0x7F, 0x08, 0x14, 0x22, 0x41) ; K
eeprom (0x7F, 0x40, 0x40, 0x40, 0x40) ; L
eeprom (0x7F, 0x02, 0x0C, 0x02, 0x7F) ; M
eeprom (0x7F, 0x04, 0x08, 0x10, 0x7F) ; N
eeprom (0x3E, 0x41, 0x41, 0x41, 0x3E) ; O
eeprom (0x7F, 0x09, 0x09, 0x09, 0x06) ; P
eeprom (0x3E, 0x41, 0x51, 0x21, 0x5E) ; Q
eeprom (0x7F, 0x09, 0x19, 0x29, 0x46) ; R
eeprom (0x46, 0x49, 0x49, 0x49, 0x31) ; S
eeprom (0x01, 0x01, 0x7F, 0x01, 0x01) ; T
eeprom (0x3F, 0x40, 0x40, 0x40, 0x3F) ; U
eeprom (0x1F, 0x20, 0x40, 0x20, 0x1F) ; V
eeprom (0x3F, 0x40, 0x38, 0x40, 0x3F) ; W
eeprom (0x63, 0x14, 0x08, 0x14, 0x63) ; X
eeprom (0x07, 0x08, 0x70, 0x08, 0x07) ; Y
eeprom (0x61, 0x51, 0x49, 0x45, 0x43) ; Z
eeprom (0x00, 0x00, 0x2f, 0x00, 0x00) ; !
eeprom (0x00, 0x07, 0x00, 0x07, 0x00) ; "
eeprom (0x14, 0x7f, 0x14, 0x7f, 0x14) ; #
eeprom (0x24, 0x2a, 0x7f, 0x2a, 0x12) ; $
eeprom (0x23, 0x13, 0x08, 0x64, 0x62) ; % - THIS HAS BEEN FIXED HERE was back to front and too low
eeprom (0x36, 0x49, 0x55, 0x22, 0x50) ; &
eeprom (0x00, 0x05, 0x03, 0x00, 0x00) ; '
eeprom (0x00, 0x1c, 0x22, 0x41, 0x00) ; (
eeprom (0x00, 0x41, 0x22, 0x1c, 0x00) ; )
eeprom (0x14, 0x08, 0x3E, 0x08, 0x14) ; *
eeprom (0x08, 0x08, 0x3E, 0x08, 0x08) ; +
eeprom (0x00, 0x00, 0x50, 0x30, 0x00) ; ,
eeprom (0x08, 0x08, 0x08, 0x08, 0x08) ; - - raised 1 pixel (looks better)
eeprom (0x00, 0x60, 0x60, 0x00, 0x00) ; .
eeprom (0x20, 0x10, 0x08, 0x04, 0x02) ; /
eeprom (0x3E, 0x51, 0x49, 0x45, 0x3E) ; 0
eeprom (0x00, 0x42, 0x7F, 0x40, 0x00) ; 1
eeprom (0x42, 0x61, 0x51, 0x49, 0x46) ; 2
eeprom (0x21, 0x41, 0x45, 0x4B, 0x31) ; 3
eeprom (0x18, 0x14, 0x12, 0x7F, 0x10) ; 4
eeprom (0x27, 0x45, 0x45, 0x45, 0x39) ; 5
eeprom (0x3C, 0x4A, 0x49, 0x49, 0x30) ; 6
eeprom (0x01, 0x71, 0x09, 0x05, 0x03) ; 7
eeprom (0x36, 0x49, 0x49, 0x49, 0x36) ; 8
eeprom (0x06, 0x49, 0x49, 0x29, 0x1E) ; 9
Segundo Ejemplo
Código:
; Nokia LCD driver
'''Modified Tue 01 07 08, from Texy's original code 18X
'''Eclectic modified to 28x1
'''Me modified to 18X Nov/07/10
#picaxe 18X
symbol SCLK = 0 '''Display pin 2 to PICAXE out 0
symbol SDA = 1 '''Display pin 3 to PICAXE out 1
symbol DC = 2 '''Display pin 4 to PICAXE out 2
symbol CS = 3 '''Display pin 5 to PICAXE out 3
symbol RES = 4 '''Display pin 8 to PICAXE out 4
symbol Value = b0
symbol X = b3
symbol Y = b4
symbol eeprom_address = b5
symbol Loop1 = b10
symbol Loop3 = b11 'b12
symbol SDA_PIN = outpin1 '''outpin5 ************
'''====================================================
''' **** INICIALIZACION ****
'''====================================================
setfreq m8 '''' or em16 is even better!
GoSub InitLCD
'''====================================================
''' **** PROGRAMA PRINCIPAL ****
'''====================================================
X = 0
Y = 0
GoSub GotoXY
for b12 = 0 to 18 'b13
lookup b12,(" PICAXE ") ,b13
Value=b13
gosub CharToLCD
next b12
X = 0
Y = 2
GoSub GotoXY
for b12 = 0 to 9
lookup b12,(" TEMP * ") ,b13
Value=b13
gosub CharToLCD
next b12
Repeat:
GoSub Postemps
GoTo Repeat
'''====================================================
'GoSub Invert **********
'GoSub Normal ************
setfreq m4
End
'''===============================================
''' Read DS18B20 with readtemp command.
'''===============================================
Postemps:
Setfreq m4
Pause 500
X = 42
Y = 3
GoSub GotoXY
''''*** w3 = b7 : b6
readtemp 0,b6
'''Serial output via the serout programming pin (baud 4800, 8 data, no parity, 1 stop). Inverted
If b6 > 128 then Negtemps '''
sertxd("Temp is: ", #b6, " C", 13, 10)
Bintoascii b6, b11, b12, b13
if b6 > 99 then
Value = b11
GoSub CharToLCD
endif
if b6 > 9 then
Value = b12
GoSub CharToLCD
endif
Value = b13 '''More raight number
for b12 = 0 to 2 'b13
lookup b12,(" C ") ,b13
Value=b13
gosub CharToLCD
next b12
REM Value = " "
REM GoSub CharToLCD
REM Value = "C"
REM GoSub CharToLCD
'setfreq m8 '''' Me da un error en la escritura de negativos pero con el gosub del If b6 > 128 then gosub
Return
'''===============================================
Negtemps:
X = 42
Y = 3
GoSub GotoXY
let b6 = b6 - 128
'''Serial output via the serout programming pin (baud 4800, 8 data, no parity, 1 stop). Inverted
sertxd("Temp is: ", "-", #b6, " C" ,13, 10)
Value = "-"
GoSub CharToLCD
Bintoascii b6, b11, b12, b13
if b6 > 99 then
Value = b11
GoSub CharToLCD
endif
if b6 > 9 then
Value = b12
GoSub CharToLCD
endif
Value = b13 '''More raight number
GoSub CharToLCD
for b12 = 0 to 2 'b13
lookup b12,(" C ") ,b13
Value=b13
gosub CharToLCD
next b12
'setfreq m8 ''''
Return
'''====================================================
InitLCD:
low SCLK
low SDA
low DC
low CS
low RES
pause 50
high RES
high CS
Value = $21
GoSub CommandToLCD '''` transmit to serial LCD module
Value = $C9
GoSub CommandToLCD '''` transmit to serial LCD module
Value = $13
GoSub CommandToLCD '''` transmit to serial LCD module
Value = $20
GoSub CommandToLCD '''` transmit to serial LCD module
Value = $09
GoSub CommandToLCD '''` transmit to serial LCD module
Value = $08
GoSub CommandToLCD '''` transmit to serial LCD module
X = 0
Y = 0
GoSub GotoXY
GoSub ClearFast '''******** REMOVED ''''Lo eliminaron pero yo lo puse....
GoSub Normal
return
'''====================================================
CharToLCD:
eeprom_address = 0
if Value > 32 and Value < 58 then
eeprom_address = Value - 33
eeprom_address = eeprom_address * 5 + 130
elseif Value > 64 and Value < 91 then
eeprom_address = Value - 65
eeprom_address = eeprom_address * 5
elseif Value = 32 then
Value = 0
GoSub DataToLCD
GoSub DataToLCD
GoSub DataToLCD
GoSub DataToLCD
GoSub DataToLCD
end if
if Value = 0 then
return
end if
For Loop1 = 0 To 4
read eeprom_address, Value
inc eeprom_address
GoSub DataToLCD
Next Loop1
Return
'''====================================================
CommandToLCD:
low DC 'Command mode
DataMode1:
low CS
SDA_PIN = bit7
PulsOut SCLK,1
SDA_PIN = bit6
PulsOut SCLK,1
SDA_PIN = bit5
PulsOut SCLK,1
SDA_PIN = bit4
PulsOut SCLK,1
SDA_PIN = bit3
PulsOut SCLK,1
SDA_PIN = bit2
PulsOut SCLK,1
SDA_PIN = bit1
PulsOut SCLK,1
SDA_PIN = bit0
PulsOut SCLK,1
high CS
Return
'''====================================================
DataToLCD:
high DC 'Data mode
DataMode2:
low CS
SDA_PIN = bit7
PulsOut SCLK,1
SDA_PIN = bit6
PulsOut SCLK,1
SDA_PIN = bit5
PulsOut SCLK,1
SDA_PIN = bit4
PulsOut SCLK,1
SDA_PIN = bit3
PulsOut SCLK,1
SDA_PIN = bit2
PulsOut SCLK,1
SDA_PIN = bit1
PulsOut SCLK,1
SDA_PIN = bit0
PulsOut SCLK,1
high CS
Return
'''====================================================
'#REM **********REMOVED
ClearFast:
low SDA
high DC
low CS
For Loop1 = 1 To 48
For Loop3 = 1 To 84
low SCLK
high SCLK
'pulsout SCLK ,1
Next Loop3
Next Loop1
Return
'#ENDREM *** REMOVED
'''====================================================
GotoXY:
Value = X + 128
GoSub CommandToLCD
Value = Y + 64
GoSub CommandToLCD
Return
'''====================================================
Invert:
Value = 13
GoSub CommandToLCD
Return
'''====================================================
Normal:
Value = 12
GoSub CommandToLCD
Return
'''====================================================
eeprom 0,(0x7E, 0x11, 0x11, 0x11, 0x7E) ; A
eeprom (0x7F, 0x49, 0x49, 0x49, 0x36) ; B
eeprom (0x3E, 0x41, 0x41, 0x41, 0x22) ; C
eeprom (0x7F, 0x41, 0x41, 0x22, 0x1C) ; D
eeprom (0x7F, 0x49, 0x49, 0x49, 0x41) ; E
eeprom (0x7F, 0x09, 0x09, 0x09, 0x01) ; F
eeprom (0x3E, 0x41, 0x49, 0x49, 0x7A) ; G
eeprom (0x7F, 0x08, 0x08, 0x08, 0x7F) ; H
eeprom (0x00, 0x41, 0x7F, 0x41, 0x00) ; I
eeprom (0x20, 0x40, 0x41, 0x3F, 0x01) ; J
eeprom (0x7F, 0x08, 0x14, 0x22, 0x41) ; K
eeprom (0x7F, 0x40, 0x40, 0x40, 0x40) ; L
eeprom (0x7F, 0x02, 0x0C, 0x02, 0x7F) ; M
eeprom (0x7F, 0x04, 0x08, 0x10, 0x7F) ; N
eeprom (0x3E, 0x41, 0x41, 0x41, 0x3E) ; O
eeprom (0x7F, 0x09, 0x09, 0x09, 0x06) ; P
eeprom (0x3E, 0x41, 0x51, 0x21, 0x5E) ; Q
eeprom (0x7F, 0x09, 0x19, 0x29, 0x46) ; R
eeprom (0x46, 0x49, 0x49, 0x49, 0x31) ; S
eeprom (0x01, 0x01, 0x7F, 0x01, 0x01) ; T
eeprom (0x3F, 0x40, 0x40, 0x40, 0x3F) ; U
eeprom (0x1F, 0x20, 0x40, 0x20, 0x1F) ; V
eeprom (0x3F, 0x40, 0x38, 0x40, 0x3F) ; W
eeprom (0x63, 0x14, 0x08, 0x14, 0x63) ; X
eeprom (0x07, 0x08, 0x70, 0x08, 0x07) ; Y
eeprom (0x61, 0x51, 0x49, 0x45, 0x43) ; Z
eeprom (0x00, 0x00, 0x2f, 0x00, 0x00) ; !
eeprom (0x00, 0x07, 0x00, 0x07, 0x00) ; "
eeprom (0x14, 0x7f, 0x14, 0x7f, 0x14) ; #
eeprom (0x24, 0x2a, 0x7f, 0x2a, 0x12) ; $
eeprom (0xc4, 0xc8, 0x10, 0x26, 0x46) ; %
eeprom (0x36, 0x49, 0x55, 0x22, 0x50) ; &
eeprom (0x00, 0x05, 0x03, 0x00, 0x00) ; '
eeprom (0x00, 0x1c, 0x22, 0x41, 0x00) ; (
eeprom (0x00, 0x41, 0x22, 0x1c, 0x00) ; )
eeprom (0x14, 0x08, 0x3E, 0x08, 0x14) ; *
eeprom (0x08, 0x08, 0x3E, 0x08, 0x08) ; +
eeprom (0x00, 0x00, 0x50, 0x30, 0x00) ; ,
eeprom (0x10, 0x10, 0x10, 0x10, 0x10) ; -
eeprom (0x00, 0x60, 0x60, 0x00, 0x00) ; .
eeprom (0x20, 0x10, 0x08, 0x04, 0x02) ; /
eeprom (0x3E, 0x51, 0x49, 0x45, 0x3E) ; 0
eeprom (0x00, 0x42, 0x7F, 0x40, 0x00) ; 1
eeprom (0x42, 0x61, 0x51, 0x49, 0x46) ; 2
eeprom (0x21, 0x41, 0x45, 0x4B, 0x31) ; 3
eeprom (0x18, 0x14, 0x12, 0x7F, 0x10) ; 4
eeprom (0x27, 0x45, 0x45, 0x45, 0x39) ; 5
eeprom (0x3C, 0x4A, 0x49, 0x49, 0x30) ; 6
eeprom (0x01, 0x71, 0x09, 0x05, 0x03) ; 7
eeprom (0x36, 0x49, 0x49, 0x49, 0x36) ; 8
eeprom (0x06, 0x49, 0x49, 0x29, 0x1E) ; 9
Espero les agrade...
Esquemático aquí abajo....
«
Última modificación: 06 de Diciembre de 2010, 18:01:58 por IAO
»
En línea
"No hay caminos para lograr la PAZ. La PAZ es el camino"... (Mahatma Gandhi).
Mentes Superiores discuten Ideas, Proyectos. Mentes Promedio discuten Acontecimientos y Sucesos. Mentes Pobres discuten sobre Personas.
IAO
Colaborador
PIC24F
Desconectado
Sexo:
Venezuela
Mensajes: 683
Re: PicAxe 08M 18x Programas para Compartir Isis
«
Respuesta #4 :
06 de Diciembre de 2010, 18:08:50 »
Hola....
Dos ejemplos con picaxe 18X y lcd Serial Milford 2x20
Espero les guste, es muy interesante.... este serial lcd.. y no es gran cosa.
Código:
'''EXAMPLE PROGRAM SHOWING A PICAXE CHIP LINKED TO THE MILFORD LCD 2X20
'''The MILFORD should be configured as follows:
'''
BAUD 2400 or 9600
'''LCDs require approximately 500ms to settle down after powering up and
'''data/control codes should not be sent to it during this period.
'''
'''Similarly a pause of 10ms should be inserted after a Clear Screen or
'''Home command before other data is sent.
#picaxe 18x
setfreq m8 '''Very Important
pause 2000
''''Gives the display time to initialise
serout 4, T2400_8,(254,1)
'''Sends character 1 to the screen - the clear display command
pause 700 '''500ms but I put 700ms
'''Only to remember me
REM Serout 4, T2400_8, ("Hello") '''Make sure the LCD is set for 2400Baud transfer
REM Pause 20
REM Serout 4, T9600_8, ("Hello") '''Make sure the LCD is set for 9600Baud transfer
REM Pause 20
counter:
for b0=65 to 90
'''Start a 'for next' loop
pause 250
'''Wait for 1/250 second to give you a chance to see the display!
serout 4,T2400_8,(254,2)
'''Move to the cursor to the start of line 1 (Home)
pause 700 '''500ms but I put 700ms
'''Print some text, then character b0, then the number value of b0, then carriage return
serout 4,T2400_8,("Counting ", b0," ", #b0)
pause 20 '''10ms but I put 20ms
'''===========
b1=b0-65
'''A bit of maths to create a number between 0-100 from 65-90
b1=b1*4
'''===========
serout 4,T2400_8,(254,192)
'''Move to the cursor to the second line
pause 700
'''
serout 4,T2400_8,("b1 = ", #b1)
pause 20
next b0
'''Do the loop again with the next value of b0
goto counter
'''Go back and start the loop again
'''====================================================
'''MILFORD Instruction/Action Code
'''====================================================
'''Clear Screen 1
'''Scroll display one character left 24
'''Scroll display one character right 28
'''Home (and undo scrolling) 0
'''Move cursor one character left 16
'''Move cursor one character right 20
'''Turn on underline cursor 14
'''Turn on blinking cursor 13
'''Turn off cursor 12
'''Blank the display (retaining data) 8
'''Restore the display (without cursor) 12
'''Set display (DD) RAM address 128 + address
'''Set character (CG) RAM address 64+address
'''====================================================
'''Below is a list of useful control commands: -
'''Control Command Operation
'''$FE, 1 Clear display
'''$FE, 2 Return home (beginning of first line)
'''$FE, $0C Cursor off
'''$FE, $0E Underline cursor on
'''$FE, $0F Blinking cursor on
'''$FE, $10 Move cursor left one position
'''$FE, $14 Move cursor right one position '''Decimal 20
'''$FE, $C0 Move cursor to beginning of second line '''Decimal 192
'''$FE, $94 Move cursor to beginning of third line
'''$FE, $D4 Move cursor to beginning of fourth line
Segundo Código Ejemplo.
Código:
'''Similarly a pause of 10ms should be inserted after a Clear Screen or
'''Home command before other data is sent.
#picaxe 18x
setfreq m8 '''Very Important
pause 2000
'''Gives the display time to initialise
serout 4,T2400_8,(254,1)
'''Sends character 1 to the screen (the clear display command)
pause 700 '''500ms but I put 700ms
main:
readadc10 0,w0
serout 4,T2400_8,(254,2)
'''Move to the cursor to the start of line 1 (Home)
pause 700 '''500ms but I put 700ms
'''Print some text, then the value of w0
serout 4,T2400_8,("w0 = ", #w0 )
pause 20 '''10ms but I put 20ms
'''===========
let w1=w0*10
'''A bit of maths to create a number between 0-100 from 0-1023
let w1=w1/102
'''===========
serout 4,T2400_8,(254,192)
'''Move to the cursor to the second line
pause 700
'''
serout 4,T2400_8,("w1 = ", #w1)
'''Print w1
pause 20
goto main
'''Go back and start the loop again
Espero les agrade... Yo lo disfruté un montón al terminarlo.. Después veran porque...
Aquí abajo esquemático.
«
Última modificación: 06 de Diciembre de 2010, 18:14:45 por IAO
»
En línea
"No hay caminos para lograr la PAZ. La PAZ es el camino"... (Mahatma Gandhi).
Mentes Superiores discuten Ideas, Proyectos. Mentes Promedio discuten Acontecimientos y Sucesos. Mentes Pobres discuten sobre Personas.
IAO
Colaborador
PIC24F
Desconectado
Sexo:
Venezuela
Mensajes: 683
Re: PicAxe 08M y 18x -Programas para Compartir Isis
«
Respuesta #5 :
07 de Diciembre de 2010, 14:07:50 »
Holaa..
Un Sr. llamado kevrus, diseñó un termostato para su vehículo.
Yo quería verlo funcionando en el picaxe, pero no había esquemático.
Después de terminar lo el Lcd Serial Milford, me dispuse a ver correr este
proyecto del sr. kevrus, aquí te dejo el link de su publicación.
Citar
Here a Car AC thermostate by mr. kevrus.
http://www.picaxeforum.co.uk/showthread.php?t=12938
Este es el código..
Código:
#picaxe18x
'-------------------------------------------------------------------------------'
'CAR A/C TEMP CONTROL USING 18X AND DS18B20
'DISPLAYED ON 2X16 ALPHANUMERIC LCD
'-------------------------------------------------------------------------------'
symbol lcd=2
symbol temp_sens=0
symbol backlight=3
symbol car_fan=pin1
symbol setpoint_dwn=pin2
symbol setpoint_up=pin7
symbol aircon=7
symbol setpoint=b13
symbol baud=t2400
symbol read_temp=w0
symbol counter=b6
symbol timer =b7
symbol control_temp=b0
symbol ave_temp=w2
symbol car_temp=w1
initialise:
pause 250
'lets start with a short delay shall we?
high lcd
'sets output high for serial display
pause 5
'just to make sure the output is high
serout lcd,baud,(254,1)
'clears the display
pause 500
'and waits for the display to settle
high backlight
'switch on lcd backlight
setpoint=20
'initial setpoint value
begin:
setint off
gosub display_clear
gosub release_setpoint_dwn_button'wait for button to be released
low aircon
'make sure aircon is off
serout lcd,baud,(254,128,"Kev's AC CONTROL")'here's the header
serout lcd,baud,(254,192," SYSTEM OFF ")'and here's the status
do
loop until setpoint_up=1 or setpoint_dwn=1'press any button to start
gosub release_setpoint_up_button'wait for button to be released
gosub release_setpoint_dwn_button'wait for button to be released
if car_fan=0 then
'if car fan isn't running then
serout lcd,baud,(254,192," TURN ON FAN ")'alert the driver
end if
do
if setpoint_dwn=1 then goto begin'turns system off after 2sec press
loop until car_fan=1
'and wait until it is!
serout lcd,baud,(254,192," SYSTEM ON ")'and now we start checking
'-------------------------------------------------------------------------------'
'MAIN PROGRAM SUB-ROUTINE SEQUENCE
'-------------------------------------------------------------------------------'
run:
setint %10000000,%10000000
'sets interrupt for temp adjustment
gosub temp_reading
'measure the cabin temp
gosub neg_check
'lets see if temp is negative
gosub control
'lets see if we need cooling shall we?
gosub display_values
'displays readings on lcd
goto run
'here we go again
'-------------------------------------------------------------------------------'
'AVERAGE TEMP SAMPLING
'-------------------------------------------------------------------------------'
temp_reading:
if setpoint_dwn=1 or car_fan=0 then goto begin'turns system off after 2sec press or car fan stopping
counter=0
'resets timer to zero and
ave_temp=0
'average temp to zero for next batch of readings
do
readtemp12 0,read_temp
'reads the in car temp
ave_temp=ave_temp+read_temp
'adds latest temp reading to average temp
pause 1000
'1 second delay before next reading
inc counter
'adds 1 to the timer
loop until counter=5
'this allows 5 readings to be taken
ave_temp=ave_temp/5
'this divides total value by 5 for average
return
'-------------------------------------------------------------------------------'
'TEMP CALCULATION ROUTINE
'-------------------------------------------------------------------------------'
neg_check:
car_temp=ave_temp
'load 'cartemp' into w1
bit15 = car_temp/32768
'isolate bit 15
if bit15 = 1 then
'check to see if bit 15 is 1
b8 = "-"
'character if temp is 'negative
car_temp=65535-car_temp+1
'2s compliment for negative temp
else
b8 = "."
end if
temp_calc:
car_temp=car_temp*10
w2=car_temp/16
'divide by 16
b0=w2/10
'divides by 10 and leave the 'whole' number
b1=w2//10
'divides by 10 and leave the remainder
return
'-------------------------------------------------------------------------------'
'TEMP CONTROL ROUTINES
'-------------------------------------------------------------------------------'
control:
if control_temp>setpoint then 'lets see if we need cooling
high aircon
'if so, turn on the aircon
b10="o"
b11="n"
b12=" "
else if control_temp<setpoint then 'and if not
low aircon
'turn off the aircon
b10="o"
b11="f"
b12="f"
end if
return
'-------------------------------------------------------------------------------'
'DISPLAY AND INTERRUPT ROUTINES
'-------------------------------------------------------------------------------'
display_values:
if b0<10 then
serout lcd,baud,(254,192,"Temp..",b8,#b0,".",#b1,223,"C ",b10,b11,b12)
else
serout lcd,baud,(254,192,"Temp.",b8,#b0,".",#b1,223,"C ",b10,b11,b12)
end if
return
display_clear:
serout lcd,baud,(254,192," ")
return
display_setpoint:
serout lcd,baud,(254,192,"S/P ADJUST..",#setpoint,223,"C")
return
interrupt:
gosub release_setpoint_up_button'wait for button to be released
gosub display_clear
serout lcd,baud,(254,192,"S/P ADJUST..",#setpoint,223,"C")
gosub display_setpoint
for timer=0 to 250
'sets value for 'return'timer
pause 2
if setpoint_up=1 then inc_temp'jumps to 'inc_temp' or
if setpoint_dwn=1 then dec_temp'dec_temp' dependent on button push
next timer
'inc timer by 1
setint %10000000,%10000000
'resets the interrupt
timer=0
'makes sure timer is set to zero
return
inc_temp:
if setpoint>26 then let setpoint=15'resets setpoint to 15 if max 26 reached
gosub release_setpoint_up_button'wait for button to be released
end if
for timer=0 to 250
'sets value for 'return'timer
pause 3
if setpoint_up=1 then
inc setpoint
'adds one to the setpoint value
gosub display_setpoint
gosub release_setpoint_up_button'wait for button to be released
goto inc_temp
'loop if another increase is required
end if
'adds one to the setpoint
if setpoint_dwn=1 then dec_temp'jumps dependent on button push
next timer
'inc timer by 1
return
dec_temp:
if setpoint<15 then let setpoint=26'resets setpoint to 26 if min 14 reached
gosub release_setpoint_dwn_button'wait for button to be released
end if
for timer=0 to 250
'sets value for 'return'timer
pause 3
if setpoint_dwn=1 then '
dec setpoint
'takes 1 away from the setpoint value
gosub display_setpoint
gosub release_setpoint_dwn_button'wait for button to be released
goto dec_temp
'loop if another decrease is required
end if
'takes 1 away from the setpoint
if setpoint_up=1 then inc_temp'jumps dependent on button push
next timer
'inc timer by 1
return
release_setpoint_up_button:
do
loop until setpoint_up=0
'wait for button to be released
pause 10
'pause just to make sure
return
release_setpoint_dwn_button:
do
loop until setpoint_dwn=0
'wait for button to be released
pause 10
'pause just to make sure
return
Haz el esquemático, copia y pega el código en un .bas, llamalo con el 18X.
Configura el "Milford LCD 2X16 BKP" para 2400 baud.
******____OJO - ojo - OJO PELAO_____*********
Este esquemático es para simularlo, no para un proyecto verdadero, faltan componentes.
Espero les agrade...
Saludos....
En línea
"No hay caminos para lograr la PAZ. La PAZ es el camino"... (Mahatma Gandhi).
Mentes Superiores discuten Ideas, Proyectos. Mentes Promedio discuten Acontecimientos y Sucesos. Mentes Pobres discuten sobre Personas.
IAO
Colaborador
PIC24F
Desconectado
Sexo:
Venezuela
Mensajes: 683
Re: PicAxe 08M y 18x -Programas para Compartir Isis
«
Respuesta #6 :
07 de Diciembre de 2010, 14:28:44 »
Hola...
Este será el último por un tiempo, que estoy terminando otras cosas...
Se me olvidaba decir, que hacer correr los picaxe en el simulador Isis no es tan fácil....
Por lo menos a mi, me dió muchos problemas...
Voy a publicar esto en la primera parte...
Algunos habrán visto, que proteus tiene la librería del Nokia lcd 7110..
Bueno quería verlo funcionar, y nadie pone un ejemplo con el.
Bueno, después de batallar y batallar, logré ponerlo a funcionar....
Es muy simple, pero ilustrativo....
Código:
; Nokia LCD driver
;Resolution: 96x65, B/W
#picaxe 18x
symbol SCLK = 0 '''Display pin 5 to PICAXE out 0
symbol SDA = 1 '''Display pin 13 to PICAXE out 1
symbol DC = 2 '''Display pin 4 to PICAXE out 2
symbol CS = 3 '''Display pin 2 to PICAXE out 3
symbol RES = 4 '''Display pin 14 to PICAXE out 4
symbol Value = b0
symbol X = b3
symbol Y = b4
symbol eeprom_address = b5
symbol Loop1 = b10
symbol loop3 = b12
SYMBOL SDA_PIN = outpin1 '''
setfreq m8
gosub InitLCD
'''===================================================
Value="H"
gosub CharToLCD
Value="I"
gosub CharToLCD
Value=" "
gosub CharToLCD
Value="P"
gosub CharToLCD
Value="I"
gosub CharToLCD
Value="C"
gosub CharToLCD
Value="A"
gosub CharToLCD
Value="X"
gosub CharToLCD
Value="E"
gosub CharToLCD
Value=" "
gosub CharToLCD
Value="F"
gosub CharToLCD
Value="O"
gosub CharToLCD
Value="R"
gosub CharToLCD
Value="U"
gosub CharToLCD
Value="M"
gosub CharToLCD
Value="!"
gosub CharToLCD
'GoSub Invert
pause 50
'GoSub Normal
setfreq m4
Stop
End
'''===================================================
'''
'''===================================================
InitLCD:
low SCLK
low SDA
low DC
low CS
low RES
pause 50
high RES
high CS
'''===================================================
'''This is for Nokia 7110
value=$A6 ;
GOSUB CommandToLCD ; transmit To serial LCD module
value=$A3 ;
GOSUB CommandToLCD ; transmit To serial LCD module
value=$A1 ;
GOSUB CommandToLCD ; transmit To serial LCD module
value=$C0 ;
GOSUB CommandToLCD ; transmit To serial LCD module
value=$22 ;
GOSUB CommandToLCD ; transmit To serial LCD module
value=$81 ;
GOSUB CommandToLCD ; transmit To serial LCD module
value=$2E ;
GOSUB CommandToLCD ; transmit To serial LCD module
value=$2F ;
GOSUB CommandToLCD ; transmit To serial LCD module
value=$E3 ;
GOSUB CommandToLCD ; transmit To serial LCD module
value=$40 ;
GOSUB CommandToLCD ; transmit To serial LCD module
value=$AF ;
GOSUB CommandToLCD ; transmit To serial LCD module
value=$A5 ;
GOSUB CommandToLCD ; transmit To serial LCD module
Pause 500
value=$AE ;
GOSUB CommandToLCD ; transmit To serial LCD module
GoSub ClearFast '''<====Very important
value=$AF ;
GOSUB CommandToLCD ; transmit To serial LCD module
value=$A4 ;
GOSUB CommandToLCD ; transmit To serial LCD module
X = 0
Y = 0
GoSub GotoXY
GoSub ClearFast
return
'''===================================================
CharToLCD:
eeprom_address = 0
if Value > 32 and Value < 58 then
eeprom_address = Value - 33
eeprom_address = eeprom_address * 5 + 130
elseif Value > 64 and Value < 91 then
eeprom_address = Value - 65
eeprom_address = eeprom_address * 5
elseif Value = 32 then
Value = 0
gosub DataToLCD
gosub DataToLCD
gosub DataToLCD
gosub DataToLCD
gosub DataToLCD
end if
if Value = 0 then
return
end if
For Loop1 = 0 To 4
read eeprom_address, Value
inc eeprom_address
GoSub DataToLCD
Next Loop1
Return
'''===================================================
CommandToLCD:
low DC '''Command mode
DataMode1:
low CS
SDA_PIN = bit7
PulsOut SCLK,1
SDA_PIN = bit6
PulsOut SCLK,1
SDA_PIN = bit5
PulsOut SCLK,1
SDA_PIN = bit4
PulsOut SCLK,1
SDA_PIN = bit3
PulsOut SCLK,1
SDA_PIN = bit2
PulsOut SCLK,1
SDA_PIN = bit1
PulsOut SCLK,1
SDA_PIN = bit0
PulsOut SCLK,1
high CS
Return
'''===================================================
DataToLCD:
high DC '''Data mode
DataMode2:
low CS
SDA_PIN = bit7
PulsOut SCLK,1
SDA_PIN = bit6
PulsOut SCLK,1
SDA_PIN = bit5
PulsOut SCLK,1
SDA_PIN = bit4
PulsOut SCLK,1
SDA_PIN = bit3
PulsOut SCLK,1
SDA_PIN = bit2
PulsOut SCLK,1
SDA_PIN = bit1
PulsOut SCLK,1
SDA_PIN = bit0
PulsOut SCLK,1
high CS
Return
'''===================================================
ClearFast:
low SDA
high DC
low CS
For Loop1 = 1 To 65 '48
For loop3 = 1 To 96 '84
low SCLK
high SCLK
Next loop3
Next Loop1
Return
'''===================================================
GotoXY:
Value = X + 128
GoSub CommandToLCD
Value = Y + 64
GoSub CommandToLCD
Return
'''===================================================
Invert:
Value = 13
GoSub CommandToLCD
Return
'''===================================================
Normal:
Value = 12
GoSub CommandToLCD
Return
'''===================================================
eeprom 0,(0x7E, 0x11, 0x11, 0x11, 0x7E) ; A
eeprom (0x7F, 0x49, 0x49, 0x49, 0x36) ; B
eeprom (0x3E, 0x41, 0x41, 0x41, 0x22) ; C
eeprom (0x7F, 0x41, 0x41, 0x22, 0x1C) ; D
eeprom (0x7F, 0x49, 0x49, 0x49, 0x41) ; E
eeprom (0x7F, 0x09, 0x09, 0x09, 0x01) ; F
eeprom (0x3E, 0x41, 0x49, 0x49, 0x7A) ; G
eeprom (0x7F, 0x08, 0x08, 0x08, 0x7F) ; H
eeprom (0x00, 0x41, 0x7F, 0x41, 0x00) ; I
eeprom (0x20, 0x40, 0x41, 0x3F, 0x01) ; J
eeprom (0x7F, 0x08, 0x14, 0x22, 0x41) ; K
eeprom (0x7F, 0x40, 0x40, 0x40, 0x40) ; L
eeprom (0x7F, 0x02, 0x0C, 0x02, 0x7F) ; M
eeprom (0x7F, 0x04, 0x08, 0x10, 0x7F) ; N
eeprom (0x3E, 0x41, 0x41, 0x41, 0x3E) ; O
eeprom (0x7F, 0x09, 0x09, 0x09, 0x06) ; P
eeprom (0x3E, 0x41, 0x51, 0x21, 0x5E) ; Q
eeprom (0x7F, 0x09, 0x19, 0x29, 0x46) ; R
eeprom (0x46, 0x49, 0x49, 0x49, 0x31) ; S
eeprom (0x01, 0x01, 0x7F, 0x01, 0x01) ; T
eeprom (0x3F, 0x40, 0x40, 0x40, 0x3F) ; U
eeprom (0x1F, 0x20, 0x40, 0x20, 0x1F) ; V
eeprom (0x3F, 0x40, 0x38, 0x40, 0x3F) ; W
eeprom (0x63, 0x14, 0x08, 0x14, 0x63) ; X
eeprom (0x07, 0x08, 0x70, 0x08, 0x07) ; Y
eeprom (0x61, 0x51, 0x49, 0x45, 0x43) ; Z
eeprom (0x00, 0x00, 0x2f, 0x00, 0x00) ; !
eeprom (0x00, 0x07, 0x00, 0x07, 0x00) ; "
eeprom (0x14, 0x7f, 0x14, 0x7f, 0x14) ; #
eeprom (0x24, 0x2a, 0x7f, 0x2a, 0x12) ; $
eeprom (0xc4, 0xc8, 0x10, 0x26, 0x46) ; %
eeprom (0x36, 0x49, 0x55, 0x22, 0x50) ; &
eeprom (0x00, 0x05, 0x03, 0x00, 0x00) ; '
eeprom (0x00, 0x1c, 0x22, 0x41, 0x00) ; (
eeprom (0x00, 0x41, 0x22, 0x1c, 0x00) ; )
eeprom (0x14, 0x08, 0x3E, 0x08, 0x14) ; *
eeprom (0x08, 0x08, 0x3E, 0x08, 0x08) ; +
eeprom (0x00, 0x00, 0x50, 0x30, 0x00) ; ,
eeprom (0x10, 0x10, 0x10, 0x10, 0x10) ; -
eeprom (0x00, 0x60, 0x60, 0x00, 0x00) ; .
eeprom (0x20, 0x10, 0x08, 0x04, 0x02) ; /
eeprom (0x3E, 0x51, 0x49, 0x45, 0x3E) ; 0
eeprom (0x00, 0x42, 0x7F, 0x40, 0x00) ; 1
eeprom (0x42, 0x61, 0x51, 0x49, 0x46) ; 2
eeprom (0x21, 0x41, 0x45, 0x4B, 0x31) ; 3
eeprom (0x18, 0x14, 0x12, 0x7F, 0x10) ; 4
eeprom (0x27, 0x45, 0x45, 0x45, 0x39) ; 5
eeprom (0x3C, 0x4A, 0x49, 0x49, 0x30) ; 6
eeprom (0x01, 0x71, 0x09, 0x05, 0x03) ; 7
eeprom (0x36, 0x49, 0x49, 0x49, 0x36) ; 8
eeprom (0x06, 0x49, 0x49, 0x29, 0x1E) ; 9
Hay que esperar por otros, que estoy terminando
Espero les agrade.. sino, me da igual...
Saludos para todos....
Aquí abajo el esquemático....
En línea
"No hay caminos para lograr la PAZ. La PAZ es el camino"... (Mahatma Gandhi).
Mentes Superiores discuten Ideas, Proyectos. Mentes Promedio discuten Acontecimientos y Sucesos. Mentes Pobres discuten sobre Personas.
IAO
Colaborador
PIC24F
Desconectado
Sexo:
Venezuela
Mensajes: 683
Re: PicAxe 08M y 18x -Programas para Compartir Isis
«
Respuesta #7 :
23 de Diciembre de 2010, 11:15:37 »
Holaaaaaaaa....
Esto lo terminamos ayer 22/12/2010 a las 9:30pm...
Creo que el Padre Celestial junto a los Señores del Destino, me dieron la oportunidad de
reposar con esta tontería que no me terminaba de cuadrar con los Picaxe..
Aquí les dejo el Mini Nokia XY-Mode o Nokia Curve Tracer o no sé como ponerle.
Es para simular en 28X1.
El verdadero montaje comienza hoy, pero en un picaxe 20X2...
Por supuesto la programación cambiará un poco, pero despues pasaré unas fotos ya que
este proyecto quedará terminado fisicamente hablando, en unos dias, si todo sale bien..
Si en realidad quieres entender este diseño, date una mirada a este link...
http://www.techlib.com/electronics/curvetrace.html
La entrada (al acondicionador de voltaje que está antes de la entradas adc)
la realizaré con un transformador de 3Vac y 3 resistencias...
(difierente al mostrado en el anterior enlace que tiene un transformador de 6Vac)
Este es el enlace para el octopus de 3Vac.
http://repairfaq.ece.drexel.edu/sam/curve.gif
Código:
'''***************************************************************
'''Definitions:
#picaxe 28x1
setfreq m8
Symbol Pin_SCLK = 0 '''LCD Clock
Symbol Pin_SDIN = 1 '''LCD Data
Symbol Pin_DC = 2 '''LCD Data/Command
Symbol Pin_SCE = 3 '''LCD Chip select
Symbol Pin_RST = 4 '''LCD Reset
Symbol Pin_Vcc = 5 '''LCD Power
'''Entradas ADC
Symbol SCOPE_A_PIN
= 0
'''ADC Input Pin for Channel A
Symbol SCOPE_B_PIN
= 1
'''ADC Input Pin for Channel B
'''Variables usadas por las rutinas del LCD
Symbol LCD_f = w1 ' b3:b2 '
Symbol lcd_chr = w2 ' b5:b4 '
Symbol PosX = b6
Symbol PosY = b7
Symbol Page = b12 '''Rutina "setScreen"
'''Variables usadas por las rutinas de ADC
Symbol Dato = b8
Symbol i = b9
Symbol X = b10
Symbol Y = b11
'''***************************************************************
'''
'''***************************************************************
Inicio:
X=0
Y=0
Pause 100 ''' Hacemos una pausa de 100 ms para estabilizar todo
gosub InicializaLCD
gosub ConfiguraLCD
gosub borra_lcd
gosub cursor_origen
'''***************************************************************
'''
'''***************************************************************
ciclo:
If pin0 = 1 then
gosub muestreo
Else
gosub Curve_I_V
End IF
'pause 1000 '2000
gosub borra_lcd
goto ciclo
END
'''***************************************************************
'''Rutina para muestreo y almacenamiento de medicion en RAM.
'''***************************************************************
Muestreo:
X = 2
ptr = 1
For i = 1 to 80
ReadAdc SCOPE_A_PIN, b0 '''2 pin ADC0 28X1
b0 = b0 / 16 '8
@ptr = b0 '''save value of b0 in @ptr
'sertxd(#@ptr, " ?", 13, 10)
Y = @ptr '''Coloca value of pointer @ptr into variable Y
gosub setScreen
ReadAdc SCOPE_B_PIN, b1 '''3 pin ADC1 28X1
b1 = b1 / 16 '8
@ptr = b1
Y = 30 + @ptr
gosub setScreen
pause 10
X = X + 1
Next i
'If pin0 = 0 then Curve_I_V
Return
'''=====================================================
'''***************************************************************
'''Esta rutina muestra el Modo X-Y o el I/V.
'''***************************************************************
Curve_I_V:
For i = 1 to 80
ReadAdc SCOPE_A_PIN, b0 '''2 pin ADC0 28X1
b0 = b0 / 8 '8
@ptr = b0 '''save value of b0 in @ptr
'''Si # > va hacia arriba. Si # < va hacia abajo
Y = 12 + @ptr
gosub setScreen
ReadAdc SCOPE_B_PIN, b1 '''3 pin ADC1 28X1
b1 = b1 / 8 '8
@ptr = b1
X = 30 + @ptr
gosub setScreen
pause 10
next i
Return
'''***************************************************************
'''Esta rutina grafica un punto en la pantalla
'''siguiendo coordenadas X,Y (X:0-83; y:0-47).
'''***************************************************************
setScreen:
If Y <= 47 then
PosY = Y / 8 : Endif
Page = Y // 8 : Dato = 1 << Page
PosX = X
gosub Cursor_XY
lcd_chr = Dato
gosub LCD_Data
Return
'''*******************************************************************************************
''' RUTINAS GESTION LCD NOKIA 3310
'''*******************************************************************************************
'''-------------------------------------------------------------------------------------------
InicializaLCD:
HIGH Pin_DC ''' Seleccionamos el registro de datos en RAM
HIGH Pin_SCE ''' Anulamos la seleccion del chip
HIGH Pin_VCC ''' Damos alimentacion al LCD
pause 100 ''' Hacemos una pausa de 100 ms
gosub Reset_LCD ''' Reseteamos el LCD
return
'''-------------------------------------------------------------------------------------------
'''-------------------------------------------------------------------------------------------
ConfiguraLCD:
lcd_chr = %00100001 ''' Chip Activo, Direccionamiento horizontal, uso de instrucciones extendidas
gosub LCD_cmd
lcd_chr = $B5 ''' Configura el voltage de operacion del LCD (Contraste)
gosub LCD_cmd
lcd_chr = $13 ''' Configura bias mux rate a 1:48
gosub LCD_cmd
lcd_chr = %00100000 ''' Chip Activo, Direccionamiento horizontal,uso de instrucciones basicas
gosub LCD_cmd
gosub Segmentos_ON ''' Configura el display (Todos los segmentos ON)
gosub Display_Normal ''' Configura el display (modo Normal)
gosub Direccionamiento_Vertical
return
'''-------------------------------------------------------------------------------------------
'''-------------------------------------------------------------------------------------------
Display_Blanco:
lcd_chr = %00001000 ''' Display Blanco
gosub LCD_cmd
return
'''-------------------------------------------------------------------------------------------
'''-------------------------------------------------------------------------------------------
Display_Inverso:
lcd_chr = %00001101 ''' Display Inverso
gosub LCD_cmd
return
'''-------------------------------------------------------------------------------------------
'''-------------------------------------------------------------------------------------------
Display_Normal:
lcd_chr = %00001100 ''' Display Normal
gosub LCD_cmd
return
'''-------------------------------------------------------------------------------------------
'''-------------------------------------------------------------------------------------------
Segmentos_ON:
lcd_chr = %00001001 ''' Segmentos ON
gosub LCD_cmd
return
'''-------------------------------------------------------------------------------------------
'''-------------------------------------------------------------------------------------------
Direccionamiento_Vertical:
lcd_chr = %00100010 ''' Chip Activo, Direccionamiento Vertical,uso de instrucciones basicas
gosub LCD_cmd
return
'''-------------------------------------------------------------------------------------------
'''-------------------------------------------------------------------------------------------
Direccionamiento_Horizontal:
lcd_chr = %00100000 ''' Chip Activo, Direccionamiento Vertical,uso de instrucciones basicas
gosub LCD_cmd
return
'''-------------------------------------------------------------------------------------------
'''-------------------------------------------------------------------------------------------
Borra_LCD:
gosub Cursor_Origen ''' Colocamos el cursor en el origen
for LCD_f = 0 to 503 ''' Recorremos todas las posiciones del LCD colocando ceros
lcd_chr = 0
gosub LCD_Data
next LCD_f
return
'''-------------------------------------------------------------------------------------------
'''-------------------------------------------------------------------------------------------
Cursor_Origen:
lcd_chr = %01000000 ''' Ponemos la direccion Y a 0 (01000yyy)
gosub LCD_cmd
lcd_chr = %10000000 ''' Ponemos la direccion X a 0 (1xxxxxxx)
gosub LCD_cmd
return
'''-------------------------------------------------------------------------------------------
'''-------------------------------------------------------------------------------------------
Cursor_XY:
lcd_chr = %10000000 | PosX '''128
Gosub LCD_cmd ''' Envia Posicion X
lcd_chr = %01000000 | PosY '''64
Gosub LCD_cmd ''' Envia Posicion Y
return
'''-------------------------------------------------------------------------------------------
'''-------------------------------------------------------------------------------------------
Reset_LCD:
LOW Pin_RST ''' Damos un pulso de reset durante 100 ms
pause 100
HIGH Pin_RST
return
'''-------------------------------------------------------------------------------------------
'''-------------------------------------------------------------------------------------------
LCD_cmd:
LOW Pin_DC ''' Seleccionamos el registro de comandos
goto Data_Out
'''-------------------------------------------------------------------------------------------
'''-------------------------------------------------------------------------------------------
LCD_Data:
HIGH Pin_DC ''' Seleccionamos el registro de datos de RAM
goto Data_Out
'''-------------------------------------------------------------------------------------------
'''-------------------------------------------------------------------------------------------
Data_Out:
LOW Pin_SCE ''' Seleccionamos el chip del LCD
LOW Pin_SCLK ''' Ponemos a cero la señal de reloj
SpiOut Pin_SCLK, Pin_SDIN, 1,(lcd_chr / 8) ''' clock 8 bits from b1
HIGH Pin_SCE ''' Deseleccionamos el chip para liberar el bus
return
'''-------------------------------------------------------------------------------------------
Es todo por los momentos... espero les agrade.
Debo terminar de soldar los coponentes y grabar para realizar pruebas reales...
Después mostraré resultados con fotos, pero en la parte de proyectos terminados....
Saludos y Felices Fiestas para todos....
«
Última modificación: 26 de Diciembre de 2010, 11:23:18 por IAO
»
En línea
"No hay caminos para lograr la PAZ. La PAZ es el camino"... (Mahatma Gandhi).
Mentes Superiores discuten Ideas, Proyectos. Mentes Promedio discuten Acontecimientos y Sucesos. Mentes Pobres discuten sobre Personas.
TODOPIC
En línea
Páginas:
[
1
]
« anterior
próximo »
Ir a:
Por favor selecciona un destino:
-----------------------------
Microcontroladores PIC
-----------------------------
=> Todo en microcontroladores PIC
=> Primeros pasos - Iniciación a los microcontroladores
=> Lenguaje C para microcontroladores PIC
=> Lenguaje Basic para microcontroladores PIC
=> Almacén del Assembler
=> - Niple -
=> - Flowcode -
=> dsPIC
=> Pic32
=> RTOS
=> Programadores
=> * PROYECTOS *
-----------------------------
Misceláneas - Interés General
-----------------------------
=> Compra / Venta
=> Empleo (Ofertas/Demandas) EN PRUEBAS
=> Uso y aplicaciones de los PIC / Curiosidades electrónicas
=> Off Topic
-----------------------------
Otros microcontroladores/dispositivos programables
-----------------------------
=> Arduino
=> ARM
=> ATMEL
=> Freescale
=> PAL - GAL - FPGA - ASIC
===> VHDL (Lenguaje para descripción y modelado de hardware)
=> Rabbit
=> Texas MPS430
=> ** PROYECTOS **
-----------------------------
Mecatrónica
-----------------------------
=> DMX512 - Diseños y Proyectos
=> Robótica
=> CNC - Control Numérico Computarizado
=> Domótica - X-10
=> PLC - Control Lógico Programable
-----------------------------
Simuladores, editores de PCB, etc
-----------------------------
=> Simuladores de circuitos
===> Proteus ISIS
===> Protel Sim
===> PSpice
=> Diseño de placas PCB
===> Ares
===> Eagle
===> Orcad
===> Altium/Protel
===> Tango
===> Otros....
=> Fabricación de placas PCB
=> Ejemplos para simular
-----------------------------
FORO TÉCNICO
-----------------------------
=> Foro Técnico
=> Telefonía, GPS y Microcontroladores
-----------------------------
Lenguajes de programación para PC
-----------------------------
=> Visual Basic
=> C, C#, C++
=> Delphi
Loading...