What am I missing here?

AlbertZ

Senior Member
I breadboarded the attached circuit and hooked it up to an AXE132 which I mated to a 16x2 HD44780 Character LCD Display Module that I got from e-Bay.
I downloaded the attached program which has been tested and runs perfectly on the simulator.
Code:
' ************** TemperatureSensorSerial.bas **************
'This program runs on a PICAXE 18-M2 at 4MHz which reads the temperature from a
' DS18B20 temperature sensor & sends it to an HD44780 compatible 16x2 serial LCD display.
' 
' Developed by Albert Zalner February 6, 2015.

' *** Constants ***
 symbol LCD = C.6     ' Assign LCD to port C.6

 ' *** Variables ***
 symbol  Temp =  b20     	' calculation variable
 symbol  Temperature12 = w11  ' Temperature word using b22 & b23
 symbol  TempC_100 = w12      ' Temperature value in C * 100 (uses b24 & b25)
 symbol  Tempsign = bit0      ' The sign of the temperature reading
 symbol  Whole = b2		'The whole temperature reading
 symbol  Fract = b3		'The fraction temperature reading


' *** Directives ***
 #com 1       	' specify download port
 #picaxe 18M2      ' specify processor
 #no_data       ' save time downloading
 #terminal off      ' disable terminal window
  
' *** Initialize the LCD *** 
' *** Control commands are all prefixed by the number 254 *** 
iniLCD:
serout LCD,N2400, (254,1)		'Clear Display
pause 800					' pause 800 mS for LCD initialization
serout LCD,N2400, (254,128)		'Move to Line 1, Position 1
serout LCD,N2400, ("The Temperature")		'Output Text

main:
	serout LCD,N2400, (254,196)		'Move to line 2, position 4
	call ReadTemp12Sensor			'Read the temperature
	goto main					'loop to beginning
	
ReadTemp12Sensor:
	'**************************************************************
	'** Read DS18B20 & display temperature in 12 bit resolution  **
	'**************************************************************
ReadTemp12 B.3, Temperature12		'Read the DS18B20 temp sensor
Pause 800					'pause 800 ms per DS18B20 spec
'TempSign = Temperature12 / 256 /128	'Isolate the MSB bit
TempSign = Temperature12 / $8000	'Isolate the MSB bit

If TempSign  = 0 then Positive 	'Test for negative
Temperature12 = Temperature12 ^ $ffff + 1		'Take 2's complement

Positive:
TempC_100 = Temperature12 * 6			'TC = value = 0.0625, TC*100 = 6.25
Temperature12 = Temperature12 * 25 / 100	'the rest of the value
TempC_100 = TempC_100 + Temperature12	'the temperature value * 100 in C
Whole = TempC_100 / 100				'separate the whole degrees
Fract = TempC_100 % 100				'separate the fractional degrees
If TempSign  > 0 then				'temp is negative
	Serout LCD,N2400,("-")			'send negative symbol
end if
Serout LCD,N2400,(#Whole)		'Send temp to LCD as a whole number
Serout LCD,N2400,(".")			'send decimal point
'*** To ensure the fraction is double digits ***
Temp = Fract / 10				'Calc the first digit of fract
Serout LCD,N2400,(#Temp)		'send first decimal digit to LCD
Temp = Fract % 10				'Calc the second digit of fract
Serout LCD,N2400,(#Temp)		'send second decimal digit to LCD
Serout LCD,N2400,(%11010010)		'send degree character
Serout LCD,N2400,("C")			'send letter ?C?
Return
Yet when I connect the power, the display reads:
“Serial LCD”
www.picaxe.com”
It seems to me that the AXE 132 is not receiving the data stream from the 18M2. How can I test this?
In addition, as seen from the photo, the lower half of Line 1 on the LCD is cut off. Is this a sign of a defective LCD or am I missing something obvious.
Thanks for your help.

DSC00169.JPGThermometer_Ser.jpg
 

Technical

Technical Support
Staff member
Check the three wires connected to the AXE132, as it does appear to be the C.6 connection which is not correct.

and yes, you have a dodgy screen. Faulty screens are often sold off cheap on auction sites....
Check the screen is pushed hard against its PCB via the metal tags of the screen casing.
 

AlbertZ

Senior Member
and yes, you have a dodgy screen. Faulty screens are often sold off cheap on auction sites....
Check the screen is pushed hard against its PCB via the metal tags of the screen casing.
I applied pressure between the screen and PCB, felt a slight click, and the screen is now functioning normally. Thanks for the tip!

Check the three wires connected to the AXE132, as it does appear to be the C.6 connection which is not correct.
I checked the continuity between the input pin on the AXE132 and C.6 (pin 15) - no open circuit. Could there be a problem with the programming on the AXE132 so that it is not reading the input pin correctly? This is the pin identified as C5 on terminal H2.

DSC00170.JPGDSC00171.JPG
 

Technical

Technical Support
Staff member
Check all your solder joints on the AXE132 PCB, there has to be a connection issue somewhere.
 

inglewoodpete

Senior Member
Looking at your code in post #1, it looks as if the first command executed is "serout LCD,N2400, (254,1) 'Clear Display"

You may find that the AXE132 chip has not booted up properly before it receives the first command. Try adding Pause 1000 at the very top of your program to ensure that the LCD driver is ready for the first serial command.

Also, try resoldering the data pin on the AXE132 (Nearest where is says "C5<-"). It's hard for me to tell from the photo but there may be a dry joint there.
 

AlbertZ

Senior Member
Check all your solder joints on the AXE132 PCB, there has to be a connection issue somewhere.
You're quite correct, the symptoms all point to an open connection. The critical connection is the path from the Data Acquisition chip (C.6, pin 15) to the AXE 132 (C.5, pin4). However when I run a continuity check between the pins of both chips I get a virtual zero resistance reading. This tells me that the socket is soldered in correctly and that the AXE132 is interfacing with the LCD. So what am I missing here?

If I put a scope on C.6 (pin 15) what kind of trace should I expect to see?
 

AlbertZ

Senior Member
You may find that the AXE132 chip has not booted up properly before it receives the first command. Try adding Pause 1000 at the very top of your program to ensure that the LCD driver is ready for the first serial command.
Tried it - no effect. Thanks for responding.
 

Technical

Technical Support
Staff member
You have linked both 0V rails on your breadboard? Continuity check 0V to the AXE132 as well.

Have you tried a different output pin on the breadboard PCB (adjust program as required) in case it is a damaged chip?
 

AlbertZ

Senior Member
You have linked both 0V rails on your breadboard?
Check!

Continuity check 0V to the AXE132 as well.
Check!

Have you tried a different output pin on the breadboard PCB (adjust program as required) in case it is a damaged chip?
Switched to C.7 (pin 16) and adjusted program. Positive pin to pin continuity. Same result. Just not seeing the data stream from the breadboard.

I normally do not come to these forums for what on the surface appears to be a wiring fault. I have built far more complex projects than this and have always managed to debug any wiring errors. However this simple circuit has me talking to myself. Usually it's a case of not seeing the forest due to the trees. However, aint too many trees in this damn forest.
 

hippy

Technical Support
Staff member
If I put a scope on C.6 (pin 15) what kind of trace should I expect to see?
At N2400, an idle low signal with positive going pulses as data bytes are sent ...
Code:
          _   __    __   _
_________| |_|  |__|  |_| |___________
Each pulse should be about 400us or multiples of that. It is usually possible to see such activity with a LED+R. Try a simple test program to see if the LED flashes or the trace can be seen on a scope ...
Code:
Do
  serout C.6, N2400,( "UUUUUUUUUUUUUUUUU" )
  Pause 500
Loop
 

AlbertZ

Senior Member
Each pulse should be about 400us or multiples of that. It is usually possible to see such activity with a LED+R. Try a simple test program to see if the LED flashes or the trace can be seen on a scope ...
What I got was a steady 4 volts dc with some superimposed noise (which looked like the waveform I desired)

Traced the problem to a short on the AXE132 which somehow cleared itself just by my handling it. I re-assembled everything, re-loaded the temperature measurement program and everything now works like a charm.

Thanks to everyone for your patience!

DSC00172.JPG
 
Top