View previous topic :: View next topic |
Author |
Message |
Robert7x
Joined: 18 Mar 2006 Posts: 22 Location: Hungary, Budapest
|
Posted: Fri Apr 29, 2011 6:00 pm Post subject: Bascom 2.0.5.0 LCD error? |
|
|
The code cannot work:
Code: | Config Lcdpin = Pin , Db4 = Porta.4 , Db5 = Porta.5 , Db6 = Porta.6 , Db7 = Porta.7 , E = Portc.7 , Rs = Portc.6
Config Lcd = 16 * 2
Initlcd
Cls
Lcd "1. 2. "
End |
Complie, and the result is:
via Bascom 2.0.5.0: 1.2.
via Bascom 2.0.3.0: 1. 2.
If I change 1. to 1; -> everything is OK. The problem is a dot.
Any advice? _________________ http://wwwr.tavir.hu - AVR hungarian site (Arduino & Bascom tutorials and examples) |
|
Back to top |
|
|
athomeelectronics
Joined: 13 Jun 2007 Posts: 60
|
Posted: Sat Apr 30, 2011 2:57 pm Post subject: |
|
|
Doh! I've seen similar problems with 2.0.5.0!
If I print "This. And that." to serial port, the space after dot disappears. I thought it was just my eyes, but the case is, space is not printed at all.
This is indeed a bug. I haven't had a time to find out is this a bug in print/lcd statement, or is Bascom losing data inside constant when a code is compiled. |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Sat Apr 30, 2011 10:15 pm Post subject: |
|
|
this is indeed a bug which i introduced when i rewrote some code.
i will make a fix for this asap.
the problem is with all constant strings that use a dot. they are wrong stored/converted. _________________ Mark |
|
Back to top |
|
|
Munktell
Joined: 07 Aug 2008 Posts: 8
|
Posted: Wed May 11, 2011 11:48 am Post subject: |
|
|
This bug is very serious for us as we are going to send a customer 40 mcu's today or tomorrow. When do you thing an updated bascom will be released or quick fix in library? |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Wed May 11, 2011 11:51 am Post subject: |
|
|
if you have an SLA you can write to support to get a fix, otherwise you need to wait till the end of the week(end). _________________ Mark |
|
Back to top |
|
|
Munktell
Joined: 07 Aug 2008 Posts: 8
|
Posted: Wed May 11, 2011 1:30 pm Post subject: |
|
|
We didn't have the support, but bought it and 5 min later the fix was in the SLA archive. Extreamly good support, thank you! |
|
Back to top |
|
|
ivangel
Joined: 20 Sep 2010 Posts: 41 Location: Poland
|
Posted: Wed May 25, 2011 12:12 pm Post subject: |
|
|
whether this bug has been resolved? If so, where to download the update? |
|
Back to top |
|
|
manekinen
Joined: 21 Oct 2007 Posts: 34
|
Posted: Wed May 25, 2011 8:11 pm Post subject: |
|
|
I started to getting strange bugs if i used the "." char. Wasted some time and not found any bugs in code, so, this is a 2.0.5.0 problem...
At least, good to know! I have to read the forum most often
Please fix this _________________ µProg – tiny, fast, portable AVR programmer with SD - bascom powered |
|
Back to top |
|
|
jene
Joined: 03 Aug 2008 Posts: 13
|
Posted: Thu May 26, 2011 5:29 am Post subject: |
|
|
Hi,
when will the fix be available ?
Thanks and BR |
|
Back to top |
|
|
reinhars
Joined: 29 Nov 2009 Posts: 114
|
Posted: Fri May 27, 2011 5:27 am Post subject: |
|
|
If space doesn't matter that could be used:
Code: |
Sub Lcdtext(byval S As String , Xoffset As Byte , Yoffset As Byte , Fontset As Byte , Inverse As Byte , Rotation As Byte , Fontsize As Byte)
Local Tempstring As String * 1 , Temp As Byte 'Dim local the variables
Local H As Byte , Pixels As Byte , Count As Byte , Carcount As Byte , Lus As Byte
Local Row As Byte , Byteseach As Byte , Blocksize As Byte , Dummy As Byte
Local Colums As Byte , Columcount As Byte , Rowcount As Byte , Stringsize As Byte
Local Xpos As Byte , Ypos As Byte , Pixel As Byte , Pixelcount As Byte
If Inverse > 1 Then Inverse = 0 'Inverse can't be greater then 1
If Rotation > 3 Then Rotation = 0 'There are only 4 rotation's
Stringsize = Len(s) - 1 'Size of the text string -1 because we must start with 0
For Carcount = 0 To Stringsize 'Loop for the numbers of caracters that must be displayed
If Fontset = 1 Then Restore Font8x8 'Add or remove here fontset's that you need or not,
If Fontset = 2 Then Restore Font8x12 'this is the name that you gave to the font, NOT the filename
' If Fontset = 3 Then Restore Font6x8 'If you dont know the name, open the font file in wordpad, and there it is,
' If Fontset = 4 Then Restore Font5x5 'right on top.
Temp = Carcount + 1 'Cut the text string in seperate caracters
Tempstring = Mid(s , Temp , 1)
Read Row : Read Byteseach : Read Blocksize : Read Dummy 'Read the first 4 bytes from the font file
Temp = Asc(tempstring) - 32 'Font files start with caracter 32
For Lus = 1 To Temp 'Do dummie read to point to the correct line in the fontfile
For Count = 1 To Blocksize
Read Pixels
Next Count
Next Lus
Colums = Blocksize / Row 'Calculate the numbers of colums
Row = Row * 8 'Row is always 8 pixels high = 1 byte, so working with row in steps of 8.
Row = Row - 1 'Want to start with row=0 instead of 1
Colums = Colums - 1 'Same for the colums
Select Case Rotation
Case 0 '0 degrees rotation
For Rowcount = 0 To Row Step 8 'Loop for numbers of rows
H = Rowcount + Yoffset
For Columcount = 0 To Colums 'Loop for numbers of Colums
Read Pixels : If Inverse = 1 Then Toggle Pixels 'Read the byte from the file and if inverse = true then invert de byte
Xpos = Columcount 'Do some calculation to get the caracter on the correct Xposition
Temp = Carcount * Byteseach
Xpos = Xpos + Temp
Xpos = Xpos + Xoffset
For Pixelcount = 0 To 7 'Loop for 8 pixels to be set or not
Ypos = H + Pixelcount 'Each pixel on his own spot
Pixel = Pixels.0 'Set the pixel (or not)
Pset Xpos , Ypos , Pixel 'Finaly we can set the pixel
Shift Pixels , Right 'Shift the byte 1 bit to the right so the next pixel comes availible
Bytearray(1) = Rowcount + Pixelcount
Incr Bytearray(1)
If Bytearray(1) > Fontsize Then Exit For
Next Pixel
Next Columcount
Next Rowcount
Case 1 '90 degrees rotation
For Rowcount = Row To 0 Step -8 'Loop is now counting down
H = Rowcount + Xoffset
H = H - 15 'Correction to set Xpos on Xoffset with rotation
For Columcount = 0 To Colums
Read Pixels : If Inverse = 1 Then Toggle Pixels
Xpos = Columcount
Temp = Carcount * Byteseach
Xpos = Xpos + Temp
Xpos = Xpos + Yoffset 'We want that Xoffset is still Xoffset, so we need here the change from x to y
For Pixelcount = 7 To 0 Step -1
Ypos = H + Pixelcount
Pixel = Pixels.0
Pset Ypos , Xpos , Pixel
Shift Pixels , Right
Next Pixel
Next Columcount
Next Rowcount
Case 2 '180 degrees rotation
For Rowcount = Row To 0 Step -8
H = Rowcount + Yoffset
H = H - 7 'Correction to set Xpos on Xoffset with rotation
For Columcount = Colums To 0 Step -1
Read Pixels : If Inverse = 1 Then Toggle Pixels
Xpos = Columcount
Temp = Carcount * Byteseach
Xpos = Xpos - Temp
Xpos = Xpos - 8 'Correction to set Xpos on Xoffset with rotation
Xpos = Xpos + Xoffset
For Pixelcount = 7 To 0 Step -1
Ypos = H + Pixelcount
Pixel = Pixels.0
Pset Xpos , Ypos , Pixel
Shift Pixels , Right
Next Pixel
Next Columcount
Next Rowcount
Case 3 '270 degrees rotation
For Rowcount = 0 To Row Step 8
H = Rowcount + Xoffset
For Columcount = Colums To 0 Step -1
Read Pixels : If Inverse = 1 Then Toggle Pixels
Xpos = Columcount
Temp = Carcount * Byteseach
Xpos = Xpos - Temp
Xpos = Xpos - 8 'Correction to set Xpos on Xoffset with rotation
Xpos = Xpos + Yoffset
For Pixelcount = 0 To 7
Ypos = H + Pixelcount
Pixel = Pixels.0
Pset Ypos , Xpos , Pixel
Shift Pixels , Right
Next Pixel
Next Columcount
Next Rowcount
End Select
Next Carcount
End Sub 'End of this amazing subroutine
$include "font/Font8x8.font" 'Includes here your font files
$include "font/Font8x12.font" 'If you don't need the files in your program, don't include them,
'$include "font/Font6x8.font" 'these are flash memory eaters.
'$include "font/Font5x5.font"
|
Edit: After posting this i saw that you use char-lcd - the code is for graphic lcd... |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|
|