Hi Richard,
Hmmm, then why does it work perfectly on an F88?
Can you give me an example how I can change to "da" and then unpack please?
Kind regards,
Bill
Hi Richard,
Hmmm, then why does it work perfectly on an F88?
Can you give me an example how I can change to "da" and then unpack please?
Kind regards,
Bill
if you look at the lst file the compiler detects a problem for the 16f88 and still generated the wrong result
16f88 lst
16f1847Code:0934 M TheString Message[303]: Program word too large. Truncated to core size. (5265) Message[303]: Program word too large. Truncated to core size. (7469) Message[303]: Program word too large. Truncated to core size. (6375) Message[303]: Program word too large. Truncated to core size. (6C61) Message[303]: Program word too large. Truncated to core size. (7469) Message[303]: Program word too large. Truncated to core size. (6F6E) 0934 1265 3469 2375 M data "Reticulation", 0 2C61 3469 2F6E 0000
pic18 the correct resultCode:0000 M local TheString, OverStr 0971 2979 M goto OverStr 0972 M TheString 0972 1265 3469 2375 M data "Reticulation", 0 2C61 3469 2F6E 0000 0979 M OverStr
Code:02715 PrintStr 6,3,"Reticulation" ; Line 4. 0000 M local TheString, OverStr 0011FE EF08 F009 M goto OverStr 001202 M TheString 001202 6552 6974 7563 M data "Reticulation", 0 616C 6974 6E6F 0000 001210 M OverStr
maybe it was ok in older versions of complier , I doubt it though ,wrong is wrong
Last edited by richard; - 3rd May 2018 at 07:22. Reason: spelling
Warning I'm not a teacher
I think Charles should be informed about this.
Ioannis
Thanks Richard,
I'm no aficianado with asm and if needed it sort of defeats the purpose being on a PicBasicPro forum, but it is fast becoming apparent one needs to know some asm if one wants to excel with anything that extends PBP out of its comfort zone and to its boundaries. I'm almost completely ignorant on this subject despite being very willing to learn. I'd like to think those who are very knowledgeable and experienced in such matters would welcome the opportunity to pass on same and offer due guidance - call it a legacy if you will.
I don't want anyone to write my code for me but I'm flying blind under these circumstances and have no clue on such matters.
While I can make the change from data to da I don't have much idea how to perform the unpack - while I am grateful for your help, reading it is difficult to understand. If your suggestion means I have to make the changes for every @ printstr line (a learning curve all of its own) then it will be easier pulling teeth and I'd suggest the whole macro thing is a waste of time for me - easier to stick with 18F's to do the job, which don't seem to show this problem. This being the case I'd jump across to Swordfish and dispense with PBP completely but I like to use the 12F and 16F series - and don't like being forced into doing anything I don't want to!
Charles, following on from Ioannis' prompt, if you can shed some light here, please do so. Apart from Richard there is very little input seen to date. If it is all too difficult then I'll move away from these Nokia displays to something more accommodating.
Kind regards,
Bill
there is no pbp error here . the asm "data" directive in inappropriate for core 14 devicesCharles, following on from Ioannis' prompt, if you can shed some light here, please do so. Apart from Richard there is very little input seen to date. If it is all too difficult then I'll move away from these Nokia displays to something more accommodating.
what part of my description can't you not follow , there is no need for asm at all to do this.I don't want anyone to write my code for me but I'm flying blind under these circumstances and have no clue on such matters
hint
Code:packedbit var bit StringOut: Readcode Addr, Char ' Get a character would be the low byte packedbit= char.7 char=char&127 .......
Warning I'm not a teacher
Hi Richard,
Thanks for the help. I started work Friday so my time on the forum will be a lot less from now on unfortunately - but good that I have an income now after so long.
Can I ask: have you tried these changes yourself and seen the results on a Nokia 3310 lcd? I tried your suggestion per my interpretation below and it compiled/assembled without errors but the result was the same as if the changes were not made - so I'm assuming I didn't do it correctly or am still missing something.
I made the following edits after replacing data with da:
Please show me where have I blundered.Code:'for @ printstr Addr VAR WORD 'Char VAR byte ' lcdchardata[0] [WJS] as it was Char VAR word ' lcdchardata[0] [WJS] now for modification StringOut: ' Edits for 16F devices. Readcode Addr, Char ' Get a character if Char = 0 then StringDone ' Look for Null char, Stop if found packedbit = char.7 ' Store bit 7 value of low byte char.lowbyte = char.lowbyte&127 ' Bitwise And (&) the low byte with 127 Char.highbyte = (Char.highbyte <<1) ' left shift the high byte 1 digit (multiplying by 2n) if packedbit <> 0 then Char.highbyte = Char.highbyte+1 endif Gosub Lcd_GotoXY Lcd_Data = Char gosub Lcd_SendChar ' puttext Addr = Addr + 1 ' Point to next character PosX = PosX + 6 if PosX > 78 then ' If end of line, cycle to next line PosY = PosY + 1 PosX = 0 endif goto StringOut ' Continue with rest of the string '' Original ' Readcode Addr, Char ' Get a character ' if Char = 0 then StringDone ' Look for Null char, Stop if found ' Gosub Lcd_GotoXY ' Lcd_Data = Char ' gosub Lcd_SendChar ' puttext ' Addr = Addr + 1 ' Point to next character ' PosX = PosX + 6 ' if PosX > 78 then ' If end of line, cycle to next line ' PosY = PosY + 1 ' PosX = 0 ' endif ' goto StringOut ' Continue with rest of the string StringDone: return
Kind regards,
Bill
I don't have a nokia display so I can't really try any of this.
you have not shown how u modified the macro
Code:'for @ printstr Addr VAR WORD 'Char VAR byte ' lcdchardata[0] [WJS] as it was Char VAR word ' lcdchardata[0] [WJS] now for modification StringOut: ' Edits for 16F devices. Readcode Addr, Char ' Get a character if Char = 0 then StringDone ' Look for Null char, Stop if found will not work as intended since either the high byte or the low byte could be a null not necessarily both packedbit = char.7 ' Store bit 7 value of low byte char.lowbyte = char.lowbyte&127 ' Bitwise And (&) the low byte with 127 Char.highbyte = (Char.highbyte <<1) ' left shift the high byte 1 digit (multiplying by 2n) if packedbit <> 0 then Char.highbyte = Char.highbyte+1 endif Gosub Lcd_GotoXY Lcd_Data = Char gosub Lcd_SendChar ' puttext Addr = Addr + 1 ' Point to next character the address would now need to incremented by 2 and when did you send the highbyte to the screen ? PosX = PosX + 6 if PosX > 78 then ' If end of line, cycle to next line PosY = PosY + 1 PosX = 0 endif goto StringOut ' Continue with rest of the string
if codespace is a big issue then
Lcd_SendChar:
lookdown Lcd_data,_
[" !\#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~"],CharNum
Lcd_data = CharNum +32
wastes 117 words of code space for no appreciable reason
SELECT CASE lcd_data
Case 32
FC(0)=$00:FC(1)=$00:FC(2)=$00:FC(3)=$00:FC(4)=$00 ' // sp
Case 33
FC(0)=$00:FC(1)=$00:FC(2)=$2f:FC(3)=$00:FC(4)=$00 ' // !
Case 34
FC(0)=$00:FC(1)=$07:FC(2)=$00:FC(3)=$07:FC(4)=$00 ' // " (shown as \ in Lookdown table)
.......................
manages to use 1662 words of code space to store 235 words of data, it could be far more efficient
see http://www.picbasic.co.uk/forum/showthread.php?t=23758
where I use a 7x8 font that is stored as a packed 14bit array for pic16 chips , the posted code has routines to unpack the font
Warning I'm not a teacher
in the offending macro find the word "data"Can you give me an example how I can change to "da" and then unpack please?
delete the t and and one of the remaining a's in that word
to unpack
read in the low byte , store bit 7 value of low byte then bitwise and (&) the low byte with 127
then
read in the high byte left shift it left 1 digit then add 1 to result if bit7 result from low byte is not zero
Bookmarks