Hi gurus,
anyone knows WHY this piece of code DOES NOT WORK ???!!!???
Basically it should send serially the control byte for a MeLabs LCD display
Instead, I got just junk and instead of receiving 5 character I receice sometimes 2, some other times 3.... But anytime NOT the correct characters.
I've used all the hardware USART, so I can't use no others and I cannot even modify the board to have a different "multiplexing" solution for the hardware serial port...
I'm using a resonator at 25Mhz
My settings for programming the Pic are the following:Code:DEFINE OSC 25 'Set the Crystal Clock speed INCLUDE "modedefs.bas" 'Inline compiler's pre-defined constants ADCON0 = 0 'AD converter module 0 = disabled ADCON1 = %00001111 'Set all analog pins to digital ADCON2 = %00000000 CMCON = %00000111 'Comparator = disabled INTCON = %00111000 INTCON2 = %10000000 INTCON3 = %00000000 RCON.7 = %00000000 EECON2.5 = 0 'Ethernet Module Disabled SSP1CON1.5 = 0 'Disable SPI 1 and set pins as GPIO SSP2CON1.5 = 0 'Disable SPI 2 and set pins as GPIO TRISD.7 = 0 'PortD7 = RS-232 TX output for Display LCD var PORTD.7 Main: SEROUT2 LCD, N9600, [$1B, $30, $1B, $2A, $FF] 'Clear the display and set full-on backlight pause 1000 GOTO Main
Watchdog timer: Enabled
Stack Overflow Reset enable: Enabled
Extended Cpu Enable: Disabled
Code protect 000000 - 01FFFF: Disabled
Oscillator: OSC1/OSC2 as primary, HS Osc
Fail Safe Monitor Clock Enable: Enabled
Internal External Switch Over Enable: Enabled
Watchdog Timer Postscale: 1:512
External Address Bus Shift enable: Enabled
External Memory Bus Address Mode: Microcontroller mode, External bus disabled
Data Bus Width Select: 16-bit
External Bus Wait enabled: Ignore MEMCON.WAIT, Device Will not Wait
CCP2 Mux: ECCP2 I/O MUXED with RC1
ECCP Mux: P1B/P1C On RE6/RE5, P3B/P3C On RE4/RE3
Ethernet Led Enable: LedA/LedB On RA0/RA1 with Ethernet, RA0/AN0 without
I don't know what else to thing about. Any change to have Serout (and even Serout2 and Serin at work) simply does not work.
Could be something weird with the Configuration's Bits settings?
Thank to all in advance.


 
						
					 
			 
			 
			 
					
					 Serout/Serout2 and PIC18F97J60 (100 pin)
 Serout/Serout2 and PIC18F97J60 (100 pin)
		 
				
				
				
				
			

Bookmarks