Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

anybody familier with nigels tutorials?

Status
Not open for further replies.

kutalinelucas

New Member
hi

i followed nigel goodwins tutorial on lcd display which was great worked perfectly well on a breadboard for part of my project.
i have now put it on a pcb and to make the tracks more straight forward, i have changed the ports of the 4 data lines from ra3 -> ra0, to rb7 -> rb4, and now the lcd just shows nosensical rubbish.
could somebody please help me with a way i could somehow use the new data ports in the lcd_cmd and lcd_char routines?

thanks
 
The routines are specifically designed to work on a single port, trying to use two separate ports will mean altering the source code accordingly - and it was never designed to work that way.
 
no its all on the same port, i just used the upper nibble instead. like in your hardware changes page, i used port b because i am using a 16f876a, but used 7-4 for the data lines, then changed the r/w lines etc in the equates
 
kutalinelucas said:
thats gunna be a nightmare, but if thats all i can do!!
cheers.
It's not so bad if you understand what the code is doing. Simply add/modify some lines to shuffle the bits to where they're needed before sending them out. Everything else stays the same. I've done it multiple times on different boards recently.
 
It's really not difficult and definitely easier that redoing a PCB.

Try,
Code:
; command set routine
LCD_Cmd		movwf	templcd			;send upper nibble
		andlw	0x0f0			;clear lower 4 bits of W
		movwf	LCD_PORT
		bcf	LCD_PORT, LCD_RS	;RS line to 0
		call	Pulse_e			;Pulse the E line high

		swapf	templcd,	w	;send lower nibble
		andlw	0x0f0			;clear lower 4 bits of W
		movwf	LCD_PORT
		bcf	LCD_PORT, LCD_RS	;RS line to 0
		call	Pulse_e			;Pulse the E line high
		call 	Delay5
		retlw	0x00

LCD_CharD	addlw	0x30
LCD_Char	movwf	templcd			;send upper nibble
		andlw	0x0f0			;clear lower 4 bits of W
		movwf	LCD_PORT
		bsf	LCD_PORT, LCD_RS	;RS line to 1
		call	Pulse_e			;Pulse the E line high

		swapf	templcd,	w	;send lower nibble
		andlw	0x0f0			;clear lower 4 bits of W
		movwf	LCD_PORT
		bsf	LCD_PORT, LCD_RS	;RS line to 1
		call	Pulse_e			;Pulse the E line high
		call 	Delay5
		retlw	0x00

Mike.
 
you right, thank you so much. in the end it was just a bit of dogy soldering grounding one of the data lines
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top