HSEROUT works SEROUT does not

crazynight

Senior Member
I found this code online and it works perfectly with the BV4513 4X7 SEGMENT display from BYVAC.CO.UK but I want to use several of these so tried to convert the code to serout bu its not working any ideas?


Code:
setfreq m8 'Min BAUD on Display 9600
 symbol long=w5 'Pause long enough to view
 symbol short=w6 'Pause for system
 long=1000 'Increase for longer view
 short=100 'Can be zero or even omitted

 pause short


hsersetup B9600_8,0 'Set BAUD 

 pause 1000
hserout 0,(cr) 'Synchronise BAUD (may need to repeat 3 times)
hserout 0,("bb25",cr) 'Set brightness (0=Dim 25=Bright)
hserout 0,("bc",cr) 'Clear display
pause short


hserout 0,("bn0 15",cr) 'Write character"F" on 1st digit
 hserout 0,("bn1 ",#10,cr) 'Write character"A" on 2nd digit (alt style)
hserout 0,("bn2 13",cr) 'Write character"d" on 3rd digit
 hserout 0,("bn3 14",cr) 'Write character"E" on 4th digit
 pause short


 for b5=0 to 5
 for b4=25 to 0 step -5
 hserout 0,("bb",#b4,cr) 'Progressively dim display
 pause short
 next b4
 for b4=0 to 25 step 5
 hserout 0,("bb",#b4,cr) 'Progressively brighten display
 pause short
 next b4
 next b5
ameded code

Code:
setfreq m8 'Min BAUD on Display 9600
 symbol long=w5 'Pause long enough to view
 symbol short=w6 'Pause for system
 long=1000 'Increase for longer view
 short=100 'Can be zero or even omitted

 pause short
 
 SEROUT B.5, N9600_8,(cr)
 pause 1000
SEROUT B.5, N9600_8,("bb25",cr))
SEROUT B.5, N9600_8,("bc",cr) 
pause short
SEROUT B.5, N9600_8,("bn0 15",cr) 'Write character"F" on 1st digit
SEROUT B.5, N9600_8,("bn1 ",#10,cr) 'Write character"A" on 2nd digit (alt style)
SEROUT B.5, N9600_8,("bn2 13",cr) 'Write character"d" on 3rd digit
SEROUT B.5, N9600_8,("bn3 14",cr) 'Write character"E" on 4th digit
pause short
 

neiltechspec

Senior Member
I have just bought a BV4614, arrived yesterday.

This morning quickly wrote the following code to test it.

Code:
#rem

BV4614 Test
Default 9600 baud

#endrem

#picaxe 08m2
#no_data

symbol baud = T9600_16
symbol led = C.1
symbol digit = b1
symbol value = b2
symbol short = 1000
symbol long = 2000

init:
	setfreq m16
	pause long
	serout led,baud,("bc",13) 
	pause long

main:
	value=0
	
	do
	
	digit=0
		
	serout led,baud,("bn",#digit,",",#value,13)
	pause short
	inc digit
	
	serout led,baud,("bn",#digit,",",#value,13)
	pause short
	inc digit
	
	serout led,baud,("bn",#digit,",",#value,13)
	pause short
	inc digit
	
	serout led,baud,("bn",#digit,",",#value,13)
	pause short
	
	inc value
	
	if value=17 then
	 let value=0
	 for digit=0 to 3	
	 serout led,baud,("bp",#digit,",1",13)
	 pause long
	 next digit
	 serout led,baud,("bc",13)
	 pause long
	endif
	
	loop
Neil.
 

Goeytex

Senior Member
Picaxe serout @ NT9600_8 / T9600_8 is actually sending data data at 9250 baud. This likely too far off spec for your device.
Either change your device to 4800 baud, or increase the Picaxe clock to 16MHz with SETFREQ M16 and use serout N9600_16.
 
Top