4bit lcd bargraph

ac21

Member
I'm working on a project where i need a bar graph to display on a 20x4(one line) display to show readadc data from 0 to 100%(0-255).
Ive searched and searched but haven't found a way to do this the closest I've came is this and it has some issues ..
has anyone done this before, I don't want to switch to 8bit but it looks like I'll have to..

can the 8bit version nick12ab created be converted to 4?
 

hippy

Ex-Staff (retired)
It should be possible to convert any 8-bit LCD code to 4-bit LCD code, but what were the issues with the existing 4-bit code ? It may be easier to address those than convert something else.
 

westaust55

Moderator
Yes you could take nick12ab's 8-bit parallel interface code and alter it for 4-bit parallel operation.

There have been quite a few threads in the past covering 4-bit and 8-bit including examples I believe by nick12ab and marks.
You shoul be able to replace the 8-bit subroutine with a 4-bit subroutine (which needs a difference display initialization sequence and then sending as separate high and low nybbles for the 8-bit/byte wide data.
 

ac21

Member
The problem I have with the code that I posted is it won't print 20 blocks and won't go over 80%
Code:
readadc c.0, j				'get some data for testing
	j = j / 3					'scale it a bit
	in = j max 80				'make sure full scale is not exceeded (overflow messes up stuff)
		 
		blocs = j / 5			'number of whole blocks to print
		segs = j // 5			'remainder gives segments in last block
		j = blocs
I tried changing what I think would do it but failed. It will not print from 0-100%. Or 0 to 20 blocks.
I'm not understanding what blocs = or segs= means really but do know it has to do with how many blocks or lines in the blocks "segs" it prints. Changing it produces some strange effects.
 

Rick100

Senior Member
Hello ac21,
It looks like you need to change references to the 16 character width to 20 characters. Each character is made up of 5 divisions so.
Change 5 * 16 = 80
Code:
in = j max 80				'make sure full scale is not exceeded (overflow messes up stuff)
to 5 * 20 = 100
Code:
in = j max 100				'make sure full scale is not exceeded (overflow messes up stuff)
and change 16 + 1
Code:
j = 17 - blocs  		'j is counter again, limiting number of characters to clear
to 20 + 1
Code:
j = 21 - blocs  		'j is counter again, limiting number of characters to clear
I don't have the hardware so I can't test it and there may be something I missed. The number 16 is also used in the LCD_WrChr and LCD_WrIns routines to shift the bits 4 bits to the left, so don't change those.

Good luck,
Rick
 

ac21

Member
that worked great thanks guys especially Rick100
Code:
           [color=Purple]LCD1 [/color][color=DarkCyan]= [/color][color=Navy]64                [/color][color=Green]'move to user memory slot 0
           [/color][color=Blue]gosub [/color][color=Black]wrins
           
           [/color][color=Blue]for [/color][color=Purple]j [/color][color=DarkCyan]= [/color][color=Navy]0 [/color][color=Blue]to [/color][color=Navy]63                [/color][color=Green]'write the data to LCD user memory
           [/color][color=Blue]read [/color][color=Purple]j[/color][color=Black], [/color][color=Purple]LCD1
           [/color][color=Blue]gosub [/color][color=Black]wrchr              
           [/color][color=Blue]next [/color][color=Purple]j

           
                                    [/color][color=Green]'for demo purpose this is simply looped continously 
           
           [/color][color=Blue]readadc b.2 [/color][color=Black], [/color][color=Purple]j                [/color][color=Green]'get some data for testing
           [/color][color=Purple]j [/color][color=DarkCyan]= [/color][color=Purple]j [/color][color=DarkCyan]* [/color][color=Navy]100 [/color][color=DarkCyan]/ [/color][color=Navy]255                          [/color][color=Green]'scale it a bit
           [/color][color=Purple]j [/color][color=DarkCyan]= [/color][color=Purple]j [/color][color=DarkCyan]max [/color][color=Navy]100                  [/color][color=Green]'make sure full scale is not exceeded (overflow messes up stuff)
                 
      [/color][color=Blue]bintoascii [/color][color=Purple]j[/color][color=Black], [/color][color=Purple]character1[/color][color=Black],[/color][color=Purple]character2[/color][color=Black],[/color][color=Purple]character3 [/color][color=Black]: [/color][color=Blue]IF [/color][color=Purple]character1 [/color][color=DarkCyan]= [/color][color=Red]"0" [/color][color=Blue]THEN [/color][color=Black]: [/color][color=Purple]character1 [/color][color=DarkCyan]= [/color][color=Red]" " [/color][color=Black]: [/color][color=Blue]ENDIF     [/color][color=Green]'break down input number so it can be displayed
           
      [/color][color=Blue]let [/color][color=Purple]LCD1 [/color][color=DarkCyan]= [/color][color=Navy]148     
           [/color][color=Blue]gosub [/color][color=Black]wrins
      [/color][color=Blue]for [/color][color=Purple]loopcounter [/color][color=DarkCyan]= [/color][color=Navy]0 [/color][color=Blue]to [/color][color=Navy]4
            [/color][color=Blue]lookup [/color][color=Purple]loopcounter[/color][color=Black],[/color][color=Blue]([/color][color=Purple]character1[/color][color=Black],[/color][color=Purple]character2[/color][color=Black],[/color][color=Purple]character3[/color][color=Black],[/color][color=Red]" %"[/color][color=Blue])[/color][color=Black],[/color][color=Purple]LCD1
            [/color][color=Blue]gosub [/color][color=Black]wrchr
           [/color][color=Blue]next [/color][color=Purple]loopcounter   
                 
                 
             [/color][color=Blue]debug
            [/color][color=Purple]loopcounter [/color][color=DarkCyan]= [/color][color=Purple]j [/color][color=DarkCyan]/ [/color][color=Navy]5           [/color][color=Green]'number of whole blocks to print
            [/color][color=Purple]segs [/color][color=DarkCyan]= [/color][color=Purple]j [/color][color=DarkCyan]// [/color][color=Navy]5                 [/color][color=Green]'remainder gives segments in last block
            [/color][color=Purple]j [/color][color=DarkCyan]= [/color][color=Purple]loopcounter               [/color][color=Green]'reuse j for counter
            
            [/color][color=Purple]LCD1 [/color][color=DarkCyan]= [/color][color=Navy]212              [/color][color=Green]'move to begining of first line
            [/color][color=Blue]gosub [/color][color=Black]wrins
            
           [/color][color=Blue]do until [/color][color=Purple]j [/color][color=DarkCyan]= [/color][color=Navy]0                 [/color][color=Green]'test first, then print blocks if needed
           
            [/color][color=Purple]LCD1 [/color][color=DarkCyan]= [/color][color=Navy]255              [/color][color=Green]'255 prints a solid block of 5x8
            [/color][color=Blue]gosub [/color][color=Black]wrchr
            
            [/color][color=Blue]dec [/color][color=Purple]j
            
           [/color][color=Blue]loop
           
            if [/color][color=Purple]segs [/color][color=DarkCyan]> [/color][color=Navy]0 [/color][color=Blue]then        [/color][color=Green]'print partial block if needed
                  [/color][color=Purple]LCD1 [/color][color=DarkCyan]= [/color][color=Purple]segs             
                  [/color][color=Blue]gosub [/color][color=Black]wrchr
            [/color][color=Blue]endif
            
            [/color][color=Purple]j [/color][color=DarkCyan]= [/color][color=Navy]21 [/color][color=DarkCyan]- [/color][color=Purple]loopcounter      [/color][color=Green]'j is counter again, limiting number of characters to clear
            
           [/color][color=Blue]do until [/color][color=Purple]j [/color][color=DarkCyan]= [/color][color=Navy]0                 [/color][color=Green]'test first, then clear remaining spaces
           
            [/color][color=Purple]LCD1 [/color][color=DarkCyan]= [/color][color=Navy]0                [/color][color=Green]'prints a blank space
            [/color][color=Blue]gosub [/color][color=Black]wrchr
            
            [/color][color=Blue]dec [/color][color=Purple]j
            
           [/color][color=Blue]loop[/color]
I put the eeprom data at the top of the program.
Code:
                 [color=Blue]EEPROM [/color][color=Navy]0[/color][color=Black], [/color][color=Blue]([/color][color=Navy]0[/color][color=Black],[/color][color=Navy]0[/color][color=Black],[/color][color=Navy]0[/color][color=Black],[/color][color=Navy]0[/color][color=Black],[/color][color=Navy]0[/color][color=Black],[/color][color=Navy]0[/color][color=Black],[/color][color=Navy]0[/color][color=Black],[/color][color=Navy]0[/color][color=Black],[/color][color=Navy]16[/color][color=Black],[/color][color=Navy]16[/color][color=Black],[/color][color=Navy]16[/color][color=Black],[/color][color=Navy]16[/color][color=Black],[/color][color=Navy]16[/color][color=Black],[/color][color=Navy]16[/color][color=Black],[/color][color=Navy]16[/color][color=Black],[/color][color=Navy]16[/color][color=Black],[/color][color=Navy]24[/color][color=Black],[/color][color=Navy]24[/color][color=Black],[/color][color=Navy]24[/color][color=Black],[/color][color=Navy]24[/color][color=Black],[/color][color=Navy]24[/color][color=Black],[/color][color=Navy]24[/color][color=Black],[/color][color=Navy]24[/color][color=Black],[/color][color=Navy]24[/color][color=Black],[/color][color=Navy]28[/color][color=Black],[/color][color=Navy]28[/color][color=Black],[/color][color=Navy]28[/color][color=Black],[/color][color=Navy]28[/color][color=Black],[/color][color=Navy]28[/color][color=Black],[/color][color=Navy]28[/color][color=Black],[/color][color=Navy]28[/color][color=Black],[/color][color=Navy]28[/color][color=Black],[/color][color=Navy]30[/color][color=Black],[/color][color=Navy]30[/color][color=Black],[/color][color=Navy]30[/color][color=Black],[/color][color=Navy]30[/color][color=Black],[/color][color=Navy]30[/color][color=Black],[/color][color=Navy]30[/color][color=Black],[/color][color=Navy]30[/color][color=Black],[/color][color=Navy]30[/color][color=Black],[/color][color=Navy]31[/color][color=Black],[/color][color=Navy]31[/color][color=Black],[/color][color=Navy]31[/color][color=Black],[/color][color=Navy]31[/color][color=Black],[/color][color=Navy]31[/color][color=Black],[/color][color=Navy]31[/color][color=Black],[/color][color=Navy]31[/color][color=Black],[/color][color=Navy]31[/color][color=Blue])[/color]
I believe i should be getting some partially filled blocks but i'm not, is this the part of the code that moves the eeprom data (segs) to the LCD memory?
the LCD has the capability to store data? or is it picaxe?

Code:
                    [color=Purple]LCD1 [/color][color=DarkCyan]= [/color][color=Navy]64                    [/color][color=Green]'move to user memory slot 0
           [/color][color=Blue]gosub [/color][color=Black]wrins
           
           [/color][color=Blue]for [/color][color=Purple]j [/color][color=DarkCyan]= [/color][color=Navy]0 [/color][color=Blue]to [/color][color=Navy]63                [/color][color=Green]'write the data to LCD user memory
           [/color][color=Blue]read [/color][color=Purple]j[/color][color=Black], [/color][color=Purple]LCD1
           [/color][color=Blue]gosub [/color][color=Black]wrchr              
           [/color][color=Blue]next [/color][color=Purple]j[/color]
 

Rick100

Senior Member
Hello ac21,

After looking at the code a lot closer, I found some things that may be causing you problems. It didn't have proper scaling for the bargraph input value. It also called the LCD initialize routine twice, once after defining the custom characters. I breadboarded the circuit with an 18M2 and a 4X20 display. One display I tried had missing pixels in the custom characters. After I removed the second initialization, the problem went away. Instead of trying to add scaling to the original bargraph routine, I just replaced it with a routine hippy posted in this thread.

http://www.picaxeforum.co.uk/showthread.php?19908-axe133-bargraph&p=188443&viewfull=1#post188443

I also deleted some pauses I didn't think were necessary and added pauses after the clear screen and home cursor commands. You can set the number of characters you want for the bargraph with the CHARS constant. I tested it with 8,10,and 20 characters.

I put the eeprom data at the top of the program.
It doesn't matter where you put the eeprom statement. The data will end up in the pic internal eeprom memory.

I believe i should be getting some partially filled blocks but i'm not, is this the part of the code that moves the eeprom data (segs) to the LCD memory?
the LCD has the capability to store data? or is it picaxe?
The problem with no partial blocks was probably the scaling problem. The for next loop reads data from the pics eeprom and stores it in the LCD character generator ram(CGRAM).

Code:
'bargraph program
'started with code in this thread
'http://www.picaxeforum.co.uk/showthread.php?18541-LCD-bargraph-analog-simulation
'removed 2nd lcd initialization, it was causing missing pixels with custom characters
'removed several pauses that I don't think were necessary
'added pauses after clear screen and home cursor commands
'original program didn't have proper scaling so
'I swapped out bargraph drawing routine for hippy's code in this thread
'http://www.picaxeforum.co.uk/showthread.php?19908-axe133-bargraph&p=188443&viewfull=1#post188443
'
'* Pin Assignments  **************************************

	'LCD pin  6 = SE = c.6 = pin 15 MPU
	'LCD pin  4 = RS = c.7 = pin 16 MPU

	'LCD pin 11 = D4 = b.4 = pin 10 MPU
	'LCD pin 12 = D5 = b.5 = pin 11 MPU
	'LCD pin 13 = D6 = b.6 = pin 12 MPU
	'LCD pin 14 = D7 = b.7 = pin 13 MPU
	'touch input c.0	Used for a source of variable input
	
'* Symbols ************************************************
#picaxe 18M2

Symbol CHARS = 20			' 20 character display

symbol LcdSE = c.6		'strobe data into display
symbol LcdRS = c.7		'set low for instruction, high for character entry
	
symbol LcdByte = b0		'data sent to LCD routines
symbol j = b1				'scratch byte

Symbol pixelsOn  = b2
Symbol charsOn   = b3
Symbol charsToDo = b7
Symbol valueToGraph = b8	'0 - 255
	
symbol huns = b4			'hundreds digit in bintoascii
symbol tens = b5			'tens digit in bintoascii
symbol ones = b6			'ones digit in bintoascii

	
					
'* Main Routine *******************************************

	EEPROM 0, (0,0,0,0,0,0,0,0,16,16,16,16,16,16,16,16,24,24,24,24,24,24,24,24,28,28,28,28,28,28,28,28,30,30,30,30,30,30,30,30,31,31,31,31,31,31,31,31)
	
	'This list of data creates five user defined characters that are called to make partially filled blocks
	'0=no lines, 1=one line, 2=two lines, 3=three lines, 4=four lines
	
	dirsb = %11110000		'portB high nibble is LCD D7-D4
	dirsc = %11000000		'c.6 c.7 are outputs
	
			
	gosub LCD_Init				'get lcd ready
	setfreq m16					'run at a higher clockspeed after lcd init
	
	LcdByte = 64				'data will go to LCD custom character CGRAM
	gosub LCD_WrIns
	
	for j = 0 to 63			'write the data to LCD custom character CGRAM
		read j, LcdByte
		gosub LCD_WrChr				
	next j

	valueToGraph = 0
	do								'for demo purpose this is simply looped continously 
		
		inc valueToGraph				'0 - 255
		'valueToGraph = 3
		
		lcdbyte = 128				'move to first line, first position of DDRAM
		gosub lcd_wrins
		
	
		gosub drawGraph
		
		lcdbyte = 192					'move to second line, first position
		gosub lcd_wrins
		
		bintoascii valueToGraph, huns, tens, ones	'break down input number so it can be displayed
		
		lcdbyte = huns					'display tens
		gosub lcd_wrchr
		
		lcdbyte = tens					'display tens
		gosub lcd_wrchr
		
		lcdbyte = ones					'display ones
		gosub lcd_wrchr
			
	loop
	
	end

'drawGraph draws a bargraph the length of the constant CHARS
'the graph starts at the current cursor location
'call with valueToGraph from 0 to 255
'routine is based on code hippy posted on forum
drawGraph:
	'pixelsOn = CHARS * 5 - 1 * valueToGraph / 255 + 1	'1 pixel will be printed when 0
	pixelsOn = CHARS * 5 * valueToGraph / 255		'no pixel will be printed when 0
 	charsOn = pixelsOn / 5
 	pixelsOn = pixelsOn // 5
  	charsToDo = CHARS - charsOn
 	Do While charsOn > 0
    	lcdbyte = 255			'255 prints a solid block of 5x8
		gosub lcd_wrchr
		charsOn = charsOn - 1
  	Loop
 	If pixelsOn <> 0 Then
		lcdbyte = pixelsOn			
		gosub lcd_wrchr
		charsToDo = charsToDo - 1
 	End If
 	Do While charsToDo > 0  
 		lcdbyte = 0				'prints a blank space
		gosub lcd_wrchr
    	charsToDo = charsToDo - 1
 	Loop
	return	'doDraph


'* Initialise LCD *****************************************

LCD_Init:	
	low LcdRS
	low LcdSE

	'wait for LCD to stabilise (>40ms after Vcc > 2.7V)
	pause 100

	'send 00110000 three times to initialise LCD by instruction
	outpinsb = %00110000
	pulsout LcdSE,1
	pause 5				'wait at least 4.1 milliseconds
	pulsout LcdSE,1
	pause 1
	pulsout LcdSE,1
	pause 1
	
	outpinsb = %00100000	'set to 4 bit mode
	pulsout LcdSE,1
	
	LcdByte = %00101000 'set interface
	gosub LCD_WrIns
	
	LcdByte = %00001100 'enable display, no cursor
	gosub LCD_WrIns
	
	LcdByte = %00000001 'clear and home cursor
	gosub LCD_WrIns
	
	LcdByte = %00000110 'set cursor direction: movement
	gosub LCD_WrIns
	
	return
	
	
'* Display Character On LCD *******************************

LCD_WrChr:

	high LcdRS	'set RS high (write data)
	
	outpinsb = LcdByte and %11110000
	pulsout LcdSE,1
	
	outpinsb = LcdByte * 16
	pulsout LcdSE,1
	
	return


'* Send Instruction to LCD ********************************

LCD_WrIns:

	low LcdRS	'set RS low (write instruction)
		
	outpinsb = LcdByte and %11110000
	pulsout LcdSE,1
	
	outpinsb = LcdByte * 16
	pulsout LcdSE,1
	
	return
	
	
'* Clear LCD **********************************************

LCD_Clear:

	LcdByte = 1
	gosub LCD_WrIns
	pause 8			'wait at least 1.5 milliseconds after home or clear
	return
	
	
'* Home Cursor  *******************************************

LCD_Home:

	LcdByte = 128
	gosub LCD_WrIns
	pause 8 			'wait at least 1.5 milliseconds after home or clear
	return


'* Move To Line 1 *****************************************

LCD_Line1:

	LcdByte = 128
	gosub LCD_WrIns

	return


'* Move To Line 2 *****************************************

LCD_Line2:

	LcdByte = 192
	gosub LCD_WrIns

	return
	
'* Move To Line 3 *****************************************

LCD_Line3:

	LcdByte = 148
	gosub LCD_WrIns

	return


'* Move To Line 4 *****************************************

LCD_Line4:

	LcdByte = 212
	gosub LCD_WrIns

	return
Good luck,
Rick
 

ac21

Member
When j comes back for bintoascii its not in a range 0-100%, its set up to display correctly but still not seeing any segments from eeprom maybe due to 0-255 scale?
Code:
[color=Black]genon:


           
                 LCD1 [/color][color=DarkCyan]= [/color][color=Navy]64                [/color][color=Green]'move to user memory slot 0
           [/color][color=Blue]gosub [/color][color=Black]wrins
           
           [/color][color=Blue]for [/color][color=Black]j [/color][color=DarkCyan]= [/color][color=Navy]0 [/color][color=Blue]to [/color][color=Navy]63                [/color][color=Green]'write the data to LCD user memory
           [/color][color=Blue]read [/color][color=Black]j, LCD1
           [/color][color=Blue]gosub [/color][color=Black]wrchr              
           [/color][color=Blue]next [/color][color=Black]j
      
             
               [/color]
[color=Blue]do 

            
            gosub [/color][color=Black]level    

      [/color]
[color=Blue]loop until [/color][color=Purple]pinc.6 [/color][color=DarkCyan]= [/color][color=Navy]1[/color]
[color=Green];================================                      
      [/color][color=Blue]goto [/color][color=Black]genoff
      [/color]
[color=Green];----------------------------------------------------------------------------------------------------------------------- [/color]
[color=Black]level:

      [/color][color=Blue]readadc b.2 [/color][color=Black], j               [/color][color=Green];0-255
      
              
              [/color][color=Blue]let [/color][color=Black]LCD1 [/color][color=DarkCyan]= [/color][color=Navy]212     
           [/color][color=Blue]gosub [/color][color=Black]wrins
           [/color][color=Blue]gosub [/color][color=Black]drawgraph
        
      [/color][color=Blue]bintoascii [/color][color=Black]j, character1,character2,character3 : [/color][color=Blue]IF [/color][color=Black]character1 [/color][color=DarkCyan]= [/color][color=Red]"0" [/color][color=Blue]THEN [/color][color=Black]: character1 [/color][color=DarkCyan]= [/color][color=Red]" " [/color][color=Black]: [/color][color=Blue]ENDIF     [/color][color=Green]'break down input number so it can be displayed
           
      [/color][color=Blue]let [/color][color=Black]LCD1 [/color][color=DarkCyan]= [/color][color=Navy]163     
           [/color][color=Blue]gosub [/color][color=Black]wrins
      [/color][color=Blue]for [/color][color=Black]loopcounter [/color][color=DarkCyan]= [/color][color=Navy]0 [/color][color=Blue]to [/color][color=Navy]4
            [/color][color=Blue]lookup [/color][color=Black]loopcounter,[/color][color=Blue]([/color][color=Black]character1,character2,character3,[/color][color=Red]" %"[/color][color=Blue])[/color][color=Black],LCD1
            [/color][color=Blue]gosub [/color][color=Black]wrchr
           [/color][color=Blue]next [/color][color=Black]loopcounter   
            [/color][color=Blue]return     
                 
             debug[/color]
[color=Black]drawGraph:
segs [/color][color=DarkCyan]= [/color][color=Navy]20 [/color][color=DarkCyan]* [/color][color=Navy]5 [/color][color=DarkCyan]* [/color][color=Black]j [/color][color=DarkCyan]/ [/color][color=Navy]255 
      [/color][color=Purple]b14 [/color][color=DarkCyan]= [/color][color=Black]segs [/color][color=DarkCyan]/ [/color][color=Navy]5
      [/color][color=Black]segs [/color][color=DarkCyan]= [/color][color=Black]segs [/color][color=DarkCyan]// [/color][color=Navy]5
      [/color][color=Purple]b15 [/color][color=DarkCyan]= [/color][color=Navy]20 [/color][color=DarkCyan]- [/color][color=Purple]b14
      [/color][color=Blue]Do While [/color][color=Purple]b14 [/color][color=DarkCyan]> [/color][color=Navy]0
      [/color][color=Black]LCD1 [/color][color=DarkCyan]= [/color][color=Navy]255              [/color][color=Green]'255 prints a solid block of 5x8
            [/color][color=Blue]gosub [/color][color=Black]WrChr
            [/color][color=Purple]b14 [/color][color=DarkCyan]= [/color][color=Purple]b14 [/color][color=DarkCyan]- [/color][color=Navy]1
      [/color][color=Blue]Loop
      If [/color][color=Black]segs [/color][color=DarkCyan]<> [/color][color=Navy]0 [/color][color=Blue]Then
            [/color][color=Black]LCD1 [/color][color=DarkCyan]= [/color][color=Black]segs             
            [/color][color=Blue]gosub [/color][color=Black]WrChr
            [/color][color=Purple]b15 [/color][color=DarkCyan]= [/color][color=Purple]b15 [/color][color=DarkCyan]- [/color][color=Navy]1
      [/color][color=Blue]End If
      Do While [/color][color=Purple]b15 [/color][color=DarkCyan]> [/color][color=Navy]0  
            [/color][color=Black]LCD1 [/color][color=DarkCyan]= [/color][color=Navy]0                [/color][color=Green]'prints a blank space
            [/color][color=Blue]gosub [/color][color=Black]WrChr
      [/color][color=Purple]b15 [/color][color=DarkCyan]= [/color][color=Purple]b15 [/color][color=DarkCyan]- [/color][color=Navy]1
      [/color][color=Blue]Loop

      
      return[/color]
 

Rick100

Senior Member
Hello ac21,

If you post the entire program I can try it while it's set up on my breadboard tomorrow.

Rick
 

Rick100

Senior Member
Hello ac21,

I just took a quick look at your code. You have a #no_data directive at the start of your program. This will prevent the eeprom in the Picaxe from being programmed. So the custom character data for the lcd is not in the Picaxe. Try removing that and see if your program works.

Good luck,
Rick
 

ac21

Member
Hey Rick100 I removed the #no_data but it started reading some odd characters elsewhere in the display.. but now the original code works.:D Thanks
 

locky42

New Member
AXE133 in 4 bit OLED use

I have converted the AXE133 code to run the OLED display in 4 bit nibble mode.
This frees up digital I/O bits b0,b1,b2 and b3 in the basic AXE133 software.
But, as I have done, its not that difficult to use the AXE133 for OLED/LCD message display based on digital input.

Hopefully the attachment contains the more fundamental changes to the original kit.
 

Attachments

locky42

New Member
AXE133 as GPS display

I have managed to take the serial output from a GlobalSat 406A GPS into an AXE133 serial to LCD display.
Others may find better ways to do it, BUT I have got it to display GPS time and date as well as the Lat, long position.
I have then used free bits on the C port to select what to display on the LCD.
The main problem was getting enough variables to hold the GPS 'Sentence' so it uses repeated @bptrinc. Along with markers as to
where various parts have been stored and can be extracted for processing to the LCD display.

The code could do with some tidying up but 'It works' and is attached.
 

Attachments

hippy

Ex-Staff (retired)
Welcome to the PICAXE Forum, locky42.

Excellent work and it may even be worth posting / linking to your programs in the Finished Forum sections so they are easier to find for others.
 
Top