PDA

View Full Version : pic+shift register+lcd



eworld
- 2nd October 2012, 05:19
Hi guys
I am using pic12f675 and a shift register from 74 series. I don't know why my shift register doesn't do anything. I am sure that the program is wrong but I can not find any sample program in pbp that used a shift registre (74ls794).I am not sure if the problem is about the clock or it's just about the IC . Here is the code:

@ __config _INTRC_OSC_NOCLKOUT & _WDT_OFF & _MCLRE_OFF & _PWRTE_OFF & _BODEN_OFF

INCLUDE "modedefs.bas" ' Include serial modes

TRISIO = %11010000
OPTION_REG.7=0 ' Enable pull-ups
WPU=%00010000 ' Enable pull-ups on GP0, GP1,GP4
CMCON=%00000100
VRCON=%10100000
ANSEL=0
' Define LCD connections
DEFINE LCD_CLK GPIO.1
DEFINE LCD_D GPIO.2
DEFINE LCD_BITS 4


DEFINE LCD_DREG GPIO
DEFINE LCD_DBIT 4
DEFINE LCD_RSREG GPIO
DEFINE LCD_RSBIT 5
DEFINE LCD_EREG GPIO
DEFINE LCD_EBIT 0
DEFINE LCD_LINES 2
DEFINE LCD_COMMANDUS 2000
DEFINE LCD_LCDUS 50


Main:
PAUSE 500


SEROUT GPIO.2,N2400,[$FE,1]
PAUSE 50
SEROUT GPIO.2,N2400,["HELLO,",10,13]
PAUSE 50
SEROUT GPIO.2,N2400,["WORLD,",10,13,10,13]
PAUSE 500
GOTO Main

mackrackit
- 2nd October 2012, 08:54
The 74ls794 is not a shift register and the SHIFTIN/SHIFTOUT command is commonly used with shift registers.

eworld
- 3rd October 2012, 05:11
Hi
I am sorry ,It was my mistake, the shift register is 74ls194 :D and thank you for reply.I'll test shiftout command.