Display puts up unknown characters

JPB33

Senior Member
Following on from an earlier post, to avoid any timing issues I've got this program working from a external 1Hz pulse (200ms on, 800ms off) generated by an 8M2 into Pin.C.3. The program originally "self ran" but 10k resistors from the inputs to 0v cured that and I've also got 100nf decoupling and 470uf. Its the first part part of a larger program on a similar theme.

It runs ok but occasionally seemingly random numbers like 0064, or 1033 etc appear in the display after "Holiday" The second part of the program "Hols Rest" suffers the same problem but the second line, which I dont use, sometimes reads the second line of the bootup sequence www.picaxe.com as well as the numbers in the top line.

Needless to say it runs fine in hours of running in simulation--what have I got wrong?

Thanks

Code:
#Picaxe 20m2
	#No_Data	
	Disconnect    
	output B.0,B.1,B.2,B.3,B.4,B.5,B.6,B.7,C.0,C.1,C.3,C.4,C.5,C.7
	input C.0,C.1,C.2,C.3,C.6
							  'pin 1 = +
							  'pin 20 = -
	
	Symbol Inner_Sensor 	= pinC.0      'pin 10
	Symbol Outer_Sensor	= pinC.1	  'pin 9
	Symbol Dummy_1Hz		= pinc.2      'pin 8
	Symbol Clock_In         = pinc.3	  'pin 7 1Hz input
	Symbol Disp_out         = pinc.4	  'pin 6 DIDNT WORK ???
	
	Symbol Aerate_Sol      		= B.1	  'pin 17
	Symbol Pump_Outer_Sol 		= B.2	  'pin 16
	Symbol Pump_Inner_Out_sol     = B.3   'pin 15
	Symbol LED_Hol_Rest     	= B.4   'pin 14
	Symbol LED_Aerate_Rest  	= B.5   'pin 13
	Symbol Led_Spare_Count        = B.6   'pin 12
	Symbol Air_Pump         	= B.7   'pin 11
	
	Symbol 	  Timer      = w0
	Symbol Spare_Count       = w3
	Symbol Xtra_Aerate	 = w4
	
	pause 5000
	
	 do 'do 
		 
Holiday_Mode:  '2hrs, 7200secs aerate  then 2 hrs settle, repeat infinitum until interuppted by high outer signal from Pin C.1

'Aerate
	Timer = 0
	serout C.4  , n2400, ( 254,1)
	do	do	
	Loop until Clock_In  = 1				'1 Hz input	
	high Aerate_sol, Air_pump 
	inc Timer
	pause 250
	if Outer_Sensor = 1 then				'sensor for outer tank, goes high when ready to pump to inner
	goto Outer_to_Inner
	endif			
	bintoascii Timer,b23,b24,b25,b26,b27
	serout C.4, N2400, (254, 128,b24,b25,b26,b27, " Holiday")
	loop until Timer >= 7200				'Timed period	
	Timer  = 0 Spare_Count = 0				'Resets spare counter and others

	pause 5000
	
'Aerate rest 2hrs 7200 secs nothing happening unless sensor on outer goes high.
	Timer = 0
	serout C.4, n2400, ( 254,1)
	do do
	low Aerate_Sol, Air_Pump   					
	Loop until Clock_In  = 1				'1 hz input
	high LED_Hol_Rest						'Puts LED on to say whats happening as no other activity
	inc Timer
	pause 250
	inc Xtra_Aerate						'Xtra Aerate Counting minutes of rest.							
	bintoascii Timer,b23,b24,b25,b26,b27
	serout C.4, N2400, (254, 128,b24,b25,b26,b27, " Hols Rest")
	if Outer_Sensor = 1 then
	goto Outer_to_Inner
	endif								
	loop until Timer >= 7200					'Timed period
	Timer = 0 Xtra_Aerate = 0 low LED_Hol_Rest
	loop
	
Outer_to_Inner:       						'Pumping inner to outer now timed
 

bfgstew

Senior Member
Been a while since I did any stuff with a display but think you may need to add a 1 after the 254, to clear screen and reset to first line????

serout C.4, N2400, (254,1,128,b24,b25,b26,b27, " Holiday")
 

eggdweather

Senior Member
254,1 clears the screen, but really needs say 200mS or sometimes more to do that, so I suggest adding some delay statements after the 254,1 lines.

254,128 resets the cursor OK, so no obvious problems with that.

There are no serial commands after 'holiday' had been printed, so suggests some timing issue.

Is this a full copy of your programme?
 

Technical

Technical Support
Staff member
Symbol Disp_out = pinc.4 'pin 6 DIDNT WORK ???
Use

Symbol Disp_out = C.4

serout is an outputting command, so needs the direct pin number C.4 to output on (not the input variable pinC.4, which can only ever contain the number 0 or 1)

The second line shows the bootup sequence would imply that everything is occasionally resetting, ie a power supply dropout?
 

JPB33

Senior Member
Thanks for the help.

I have the power plugged together with 5.5/2.1mm connectors. I've found one where it disconnects the power if carefully pulled in the right direction so changed it, hopeful that may be the reboot.

I've changed to Symbol Disp_out = C.4 as suggested but Its still adding digits after the last word, see pic. Its a brand new display, I checked the soldering/connections and all ok but wonder if its got a fault somewhere?

Disp 10-11-16 .jpg
 

JPB33

Senior Member
I've put a spare LCD display on in parallel to the OLED and its reading normally while the OLED is adding extra digits so it looks like the OLED display is the problem.

The OLED is brand new, I've checked it previously and it looked fine but I'll give it another going over later. Could the 18M2 be corrupt?
 

Technical

Technical Support
Staff member
Look at your own photo of the soldering on the LCD above - photos are easier to look at for soldering than the real thing. Looks like there could be a short between a couple of the pins (5 and 6 from left) and all the pads could do with a bit more solder.

If the 18M2 was corrupt both screens wouldn't work. If the soldering was dodgy on one display then that display wouldn't work....
 

JPB33

Senior Member
The bridge between the tracks turned out to be a spec of sawdust, yes pics are really useful to check soldering, most examples look pretty awful!

The displays are driven off different PSU's so I thought that the OLED one may have a problem but when I looked this morning the both displays are showing a number after holiday. The bootup on the LCD may be there as I dont have a clear for the second line as I'm not using it? The circuit appears to be working fine, 2hrs on, 2hrs off.

Thanks


Disp 11-11-16-1 .jpgDisp 11-11-16-2 .jpg
 

Technical

Technical Support
Staff member
Then the issue is with the circuit. Photos / schematics of the setup would be useful. the 18M2 chip is fine, if it wasn't you wouldn't get the holiday msg.
 

eggdweather

Senior Member
I would write a short programme that clears the screen and then writes "5544 Holiday" waits a short while then repeats to see if it's a screen PICAXE system or timing error. If you get random characters then it's the display. To my eye, those characters are all related to LF/CR in some way, so I'm wondering if there is a timing error somewhere.

If you printed say 10,000 characters to the screen and used an external timer (watch/phone) it should take ~42-secs (1/2400*10*10,000) and any less or more would indicate a timing error in the programme picaxe assuming the display one is OK.
 

JPB33

Senior Member
Thanks for the suggestions. I ran the code below with another board and PSU for a couple of days without any errors appearing in the display which was heartning. Put the 20M2 from there into the original board and it was producing garbage within a count of 2000 or so with remnants of the boot up message. Tried another 12v plug top PSU and it now seems error free so looks like the problem is the PSU which looked fine on the scope and reads 12.1v.


The PSU in trouble was the usual e-bay job. Question is can anyone reccomend a decent 12v 1a plug top PSU that wont break the bank?

Thanks




top:
pause 2000
serout C.4,n2400, (254,1)
pause 500
serout C.4, N2400, (254, 128," Hello", " 13-11-16")
pause 2000
serout C.4, N2400, (254, 192," Here We Go!")
pause 2000
serout C.4,n2400, (254,1)
pause 100


Do do
Loop until pinc.3 = 1
high b.7
pause 500
inc w0
bintoascii w0,b23,b24,b25,b26,b27
serout C.4, N2400, (254,128,b23,b24,b25,b26,b27)
low b.7
loop until w0 >= 65530
w0 = 0
goto top:
 
Top