BV4613 and picaxe
January 20, 2014 10:22AM
Hi, I bought a 192x64 LCD fitted with a BV4613 about 3 years ago but have only just got around to trying it.

In Serial mode I have it powered up but can't seem to get past the "waiting for CR" message. I am using a picaxe 20M2 (but have most other current ones) and have tried hserout and serout commands. I have tried CR, "CR", 13, #13, "13", 0x0d and $0d but can't get a reaction from the display. I tried T9600 for the baud amongst others.

In i2c mode I cant get past the "i2c mode ready" message. I have the 4k7 resistors to 5v on both sda and scl. I have tried the codes shown in the manual for clear screen and move cursor but with no success.

Does anyone have some snippets of picaxe basic that will initialise the display and print some text at a certain location and also a graphic function? It doesn't matter whether it is serial or i2c.

Once I have it working I can change one bit at a time to see what happens, but at the moment I don't know what, and how many things I am doing wrong.

Thanks

Stig
Re: BV4613 and picaxe
January 20, 2014 11:56AM
I cant help you with the picaxe code but the display in serial mode needs a single byte 13 (0x0d) to establish the Baud rate, when it receives this another message will appear.

Some common issues:
1) TX and RX on the wrong pins, TX should go to RX and RX to TX
2) Baud rate should be selected from a list in the data sheet, if in doubt use 9600
3) The controller is sending LF before CR

Would you like me to send you another controller? It does mean removing the previous one which can be tricky although the previous one can be destroyed thus preserving the display. If so send a private message to let me know who you are.
Re: BV4613 and picaxe
January 21, 2014 08:29PM
Hi Jim, thanks for the reply.

I have spent today trying again in both modes but without any success. I have asked a question on the Picaxe forum, as I was able to get some help there before with my 4513. That turned out to be just a syntax issue and I am expecting this to be the case again.

If I can get some 'known good' code, I should be able to figure it all out from there. If it turns out to be the controller I will PM you my address.

Thanks

Stig
Re: BV4613 and picaxe
January 22, 2014 04:00PM
Hi, all sorted now thanks.

Have it working in both i2c and serial mode. One of the main problems turned out to be a faulty ribbon cable between the controller and my picaxe. Also the picaxe has 2 serial modes, serout and hserout. I was concentrating most of my efforts on serout but was unable to get that working. Hserout is faster but restricted to 2 particular output pins, so not as flexible. I can make these pins available for my project, so all is well.
Re: BV4613 and picaxe
January 23, 2014 10:05AM
Thanks for posting the solution, it will help others with Picaxe
Re: BV4613 and picaxe
January 23, 2014 10:17AM
Sample code (Picaxe 20M2 serial)

Main:
Pause 1000

Hsersetup B9600_4,%00
Hserout 0,(CR)                            'establish comms
Pause 500                                 'viewing time
      
Hserout 0,($1b,$5b,$32,$4a)               'CLS  
Pause 500                                 'viewing time
      
Hserout 0,($1b,$28,$33)                   'big font (size 3)
Pause 500                                 'viewing time
      
Hserout 0,("Send message")                'text
Pause 500                                 'viewing time
      
Hserout 0,(CR)                            'carriage return
Pause 500                                 'viewing time
      
'can use hex or ascii code
Hserout 0,( 27 ,91 ,50 ,59 ,50, 72)       'move cursor   
Pause 500                                 'viewing time
      
Hserout 0,($1b,$5b,$49)                   'invert colours
Pause 500                                 'viewing time
      
Hserout 0,("Message delivered!")          'blue on white text
Pause 500                                 'viewing time
      
Hserout 0,($1b,$5b,$49)                   'un-invert colours (same code)
Pause 500                                 'viewing time
      
'Draw rectangle  (esc   {  x1  x1   ,  y1  y1   ,  x2  x2  x2   ,  y2  y2   R)
'at coordinates  (esc   {   0   7   ,   2   2   ,   1   7   0   ,   5   5   R)
Hserout 0,       ($1b,$7b,$30,$37,$2c,$32,$32,$2c,$31,$37,$30,$2c,$35,$35,$52)
Pause 1000                                'viewing time

'Draw filled rectangle slightly smaller            change last character to F
'with ascii code (esc   {   1   0   ,   2   5   ,   1   6   8   ,   5   3   F) 
Hserout 0,       ( 27,123, 49, 48, 44, 50, 53, 44, 49, 54, 55, 44, 53, 51, 70)
Pause 500                                 'viewing time



Edited 1 time(s). Last edit at 01/23/2014 10:26AM by StigOfTheDump.
Re: BV4613 and picaxe
January 23, 2014 10:20AM
Sample code (Picaxe 20M2 i2c)

pause 1000
Main:

  Hi2csetup i2cmaster,0x64,i2cslow,i2cbyte
pause 1000

HI2cOut ("Before CLS")
pause 1000

'Clear screen
 HI2cOut ($1b) ; esc
 HI2cOut ($5b) [noparse]; [[/noparse]
 HI2cOut ($32) ; 2
 HI2cOut ($4a) ; J
Pause 1000

HI2cOut ($1b,$5b,$3f,$32,$35,$49)   'Hide cursor
pause 20

HI2cOut ("After CLS")
pause 1000

'Move cursor
'HI2cOut ($1b,$5b,$32,$3b,$31,$35,$48) can use hex or ascii code
 HI2cOut ( 27 ,91 ,50 ,59 ,49, 53,72)     
pause 1000

 HI2cOut ("After move 2-15")
pause 1000

 HI2cOut (CR)
pause 1000

b1=$2a
 HI2cOut ("b1 is an asterisk ",b1)  ;Write value of variable b1
pause 1000

'Draw rectangle
'Coords  (esc   {   3   2   ,   3   6   ,   1   1   1   ,   4   5   R)
'HI2cOut ($1b,$7b,$33,$32,$2c,$33,$36,$2c,$31,$31,$31,$2c,$34,$35,$46)
 HI2cOut ( 27,123, 51, 50, 44, 51, 54, 44, 49, 49, 49, 44, 52, 53, 82)
Pause 1000

'Draw filled rectangle
 HI2cOut ( 27,123, 51, 53, 44, 51, 57, 44, 49, 48, 56, 44, 52, 51, 70)
pause 1000

 HI2cOut (CR)
pause 20

  HI2cOut ($1b,$5b,$49)             'invert colours
pause 20

 HI2cOut (" thats all folks!! ")
Pause 20

  HI2cOut ($1b,$5b,$49)             'un-invert colours
pause 20
Sorry, only registered users may post in this forum.

Click here to login