Hello all
What I suspect is a simple problem is driving me nuts.
I got a MikroE clicker1 board, it has a 18F47J53 PIC on it. Doesn't have enough output pins in one port for an LCD so I'm using a serial LCD. The serial LCD is 5 volts, the board is 3.3 so I'm using a level shifter. I'm using the PBP3 default/automatic PIC configuration although I've tried putting the configuration file in the program. My first step with any new pic is usually to send a message to a display, flash a few leds, read an ADC channel and send the value to a display. However, the display is reading garbage. The text string is being ignored although the display clears, and then I'm getting repeated characters that bear no relation to the ADC output. I tried the identical serout2 commands on my easypic 7 with a 18F45K22 at 3.3 volts hooked to the level shifter and it works like a charm so it isn't code I don't think. Any suggestions/thoughts would be appreciated.
Alec
'************************************************* ***************
'* Name : MikroE clicker1.pbp *
'* Author : Alec Noble *
'* Notice : Copyright (c) 2016 Alec Noble *
'* : All Rights Reserved *
'* Date : 7/11/2016 *
'* Version : 1.0 *
'* Notes : pic 18F47J53 *
'* : *
'************************************************* ***************

DEFINE OSC 16


'------------------setup ADC channels----------------------

ADCON1 = %10001011 'Tad = 2, Frc osc
ANCON0 = %11111111 'AN0 - 7 digital
ANCON1 = %00010111 'VBGEN disable, AN11 analog, all others digital

'----------------setup serial LCD-----------------------
txpin var portc.0
mode con 84 '9600 baud 8N1 true
clr con 12
lcdon con 17
first_line con 128

LED1 var portA.0
LED2 var portA.1

'make it high to start
'----------------set port directions---------------------
TRISA = %11111100 'RA0, RA1 outputs, all others inputs
TRISC = %11111100 'RC0, 1 output, others all inputs

'--------------------------------------------------------------
adc_result var word

high txpin 'make txpin high to start

pause 1000 'let LCD wake up

serout2 txpin, mode, [lcdon]
pause 50
serout2 txpin, mode, [clr]
pause 50
serout2 txpin, mode, [first_line, "hello world"]

pause 5000

serout2 txpin, mode, [clr]
pause 50

LED1 = 1
LED2 = 0

main:
'high txpin
toggle LED1
toggle LED2
adcin 11, adc_result

serout2 txpin, mode, [first_line, dec4 adc_result]
pause 500
goto main