AXE133 question

edmunds

Senior Member
Dear all,

I took me about two hours of tinkering to discover that the only thing wrong with my display and setup was the contrast pot had to be turned a little :). While I would have expected this to be stated somewhere in the manual we are past that and I have no problem displaying anything anywhere on the display.

I have two questions, though.

1) As many people have already written in these forums, one problem is speed. I can get okeish result with 16MHz, but at 32MHz I would not have anything to complain about. Is this possible? In one forum reply it is mentioned that you can get it up to 4800_32, but not more. That would suffice, but I don't seem to be able to get it to work by changing the code on the "sender". Do I have to adjust this in the firmware of the display picaxe 18M2+ as well?

2) I'm working with temperature readings. Sometimes it is a two digit number, sometimes it is three. The brutal code I'm using for testing for now looks like this:

Code:
  serout LCD, N2400_16, (254,128)
  serout LCD, N2400_16, ("H-E: ",#pot1C,"C")
The last "C" is for celsius. What happens when the temperature goes down to a two digit number, the C from the three digit number remains on and thus I get 60CC instead of 60C. How do I correct this?


Thank you for your time,

Edmunds
 

binary1248

Senior Member
I had a similar problem with another display. My solution was to send a clear cmnd to the display before each write of data. Or simply write a blank character in the "C" spot before each display update.
 

edmunds

Senior Member
I had a similar problem with another display. My solution was to send a clear cmnd to the display before each write of data. Or simply write a blank character in the "C" spot before each display update.
Thank you, this worked and did not slow anything down much as I was afraid.

Regards,

Edmunds
 

Technical

Technical Support
Staff member
I took me about two hours of tinkering to discover that the only thing wrong with my display and setup was the contrast pot had to be turned a little :). While I would have expected this to be stated somewhere in the manual we are past that and I have no problem displaying anything anywhere on the display.
See step 4 of the assembly instructions in the datasheet:

4. LCD kits only (not required for OLED kits) - Solder the 10k preset resistor in position
VR1. This is used to adjust the contrast of the LCD display
 

edmunds

Senior Member
See step 4 of the assembly instructions in the datasheet:
Not worth arguing, but that does not explain not adjusting VR1 could mean you see nothing. More or less of a contrast is nice to have, not something you expect to have an effect of "works"/"does not work". Especially, since there are no status led or any other visual indication the board is actually powered and doing something. When I got there, I did remember, of course, I have seen it before, but stating clearly in troubleshooting section or similar that the first thing with a dead display to try after connecting is to adjust the contrast, should reduce the number of cases with this problem open with support and would just be a better customer service. IMHO, of course :).

Edmunds
 

jims

Senior Member
...edmunds...I have a similar project and use this routine to handle and format the data. Terminal "A" reads data from 1x LDR light probe and 3x DS18B20 temperature probes; (converts temperature from C to F) and transmits the data serially to Terminal "B".
Terminal "B" uses the "poke" command to set-up templates in RAM storage. The serial data is received from "A" using the "serin" command. Data from "A" is processed and written into the templates using "poke" commands. "B" sends these formatted templates to a Picaxe 2x16 character OLED display (data is right justified by replacing leading zero's with spaces). The PE6 simulator can step you through this process. Jims
Code:
'*******************************************************
'* 20M2/20x2 receives 4 bytes of serial data from terminal "A".
'* Converts Ascii data to decimal & writes to RAM.
'* Reads data from RAM using "peek"then sequences thru data 
'* using variable b1.
'*******************************************************

'#picaxe 20M2
#picaxe 20x2	

symbol RCV = B.6
symbol oled = B.1
symbol RLED = B.2
symbol GLED = B.0
symbol sw1 = pinB.3
symbol h_beat = B.4
symbol rcv1 = b2	'Value (=>100) Lights ON & (<100) Lights OFF.
symbol rcv2 = b3	'Value of DS18B20 probe 1.
symbol rcv3 = b4	'Value of DS18B20 probe 2.
symbol rcv4 = b5	'Value of DS18B20 probe 3.
symbol rcv5 = b6	'value (0) "A" is idling & (1) "A" is logging.
symbol temp_dig= b10
symbol dig1 = b16
symbol dig2 = b17
symbol dig3 = b18

' 175,111,222,123,1  (Typical Msg when Lights are ON & "A" is logging). 
'  56,1,2,3,0 	(Typical Msg when Lights are OFF & "A" is idling.

pause 1000
init:	'Load Template for fixed OLED data into RAM.
	poke 30,254,128,76,49,58  'at pos 128 write (L,I,:).
	poke 38,254,138,84,49,58  'at pos 138 write (T,1,:).
	poke 46,254,192,84,50,58  'at pos 192 write (T,2,:).
	poke 54,254,202,84,51,58  'at pos 202 write (T,3,:).
	
pause 1000    'Pause to initialize system on power-up.
serout oled,n2400,(254,1):pause 30 'Clear OLED.

'** Receive & process serial data from terminal "A".
Main:
	serin [25000,oled_off],rcv,N4800,rcv1,rcv2,rcv3,rcv4,rcv5
	'serin rcv,N4800,rcv1,rcv2,rcv3,rcv4,rcv5
	high H_BEAT:pause 800:low H_BEAT
	call check_stat	'check_data if terminal "A" lights are ON/OFF.
	if sw1 is off then oled_off
	
'** Process rcv data & convert binary to Ascii.		
process_data:	
	call check_data
	poke 35,dig1,dig2,dig3	'Writes to RAM address 35,36,37.
	BinToAscii  rcv2,dig1,dig2,dig3
	call check_data
	poke 43,dig1,dig2,dig3	'Writes to RAM address 43,44,45.
	BinToAscii  rcv3,dig1,dig2,dig3
	call check_data
	poke 51,dig1,dig2,dig3	'Writes to RAM address 51,52,53.
	BinToAscii  rcv4,dig1,dig2,dig3
	call check_data
	poke 59,dig1,dig2,dig3	'Writes to RAM address 59,60,61
	call see_data
	goto main
	
'** Analyze 1st & 5th character received.
check_stat:	'** check_data to see if terminal "A" ilghts are ON/OFF.
	if rcv1 =>100 then let dig1=32:dig2=79:dig3=78	'space, O,N.
	else  let dig1=79:dig2=70dig3=70:endif		'O,F,F.
	'return
	'** check_data to see if terminal "A" is Logging or idling.
	if rcv5 = 0 then high GLED low RLED:endif 'Rcv "0". GLED =idling.
	if rcv5 = 1 then high RLED low GLED:endif 'Rcv "1". RLED =logging.
	return
'** Analyze 2nd,3rd,4th received characters.
'** Replace leading zero's with spaces.
check_data:
	if dig1 =48 and dig2 =48 then  char_1
	if dig1=48 then  char_2
	goto char_3
char_1:
	dig1 = 32:dig2 = 32 :pause 10
	'pinsB=b1	'Watch data on pinsB.
	return
	'goto main
char_2: 
	dig1 = 32:pause 10
	'pinsB=b1	'Watch data on pinsB.
	return
char_3:
	'pinsB=b1	'Watch data on pinsB.
	return
	
see_data:	'** Uses "peek" command to read RAM.
	b0=30
	for b21=1 to 32
	peek b0,b19',254,128,76,49,58	
	serout oled,n2400,(b19)
	inc b0
	next b21
	return
	
oled_off:	'* Turn OLED OFF due to (sw1 OFF or serin timed out).
	serout oled,n2400,(254,1):pause 30 'Clear OLED.
	goto main
 

edmunds

Senior Member
...edmunds...I have a similar project and use this routine to handle and format the data. Terminal "A" reads data from 1x LDR light probe and 3x DS18B20 temperature probes; (converts temperature from C to F) and transmits the data serially to Terminal "B".
Terminal "B" uses the "poke" command to set-up templates in RAM storage. The serial data is received from "A" using the "serin" command. Data from "A" is processed and written into the templates using "poke" commands. "B" sends these formatted templates to a Picaxe 2x16 character OLED display (data is right justified by replacing leading zero's with spaces). The PE6 simulator can step you through this process. Jims

Thank you. Came up with something similar myself by now, but this is more elegant way of doing it.


Regards,

Edmunds
 
Last edited by a moderator:
Top