Hi Richard,
Which device are you targeting?
/Henrik.
Hi Richard,
Which device are you targeting?
/Henrik.
Exactly, that's what I meant by "but then it's too late". The assembler doesn't do its stuff until PBP is finished doing it stuff so whatever you do in and with the assembler is unkown to the compiler....but a #define thats made here seems unreadable to the pbp compiler
and I don't really want to do the whole routine in asm
any pic18 was what I'm aiming at , hoping to get a default compile that would use mssp1 if it exists/shiftout if no mssp exits and mssp2 if user sets a define to do so.Which device are you targeting?
dare I say idiot proof , but I don't think I can do it , at this point users will need some knowledge of the pic hardware chosen for their application and will need to modify the code accordingly.
Hi Richard,
I tried the following very simple programI compiled it for a couple of 18F devices, all with 2 MSSP modules. Some of them (like the 18F24J11, 18F44J50 and 18F46K22) worked fine while others didn't and gave a Bad Expression error on the CMD=SSPBUF. My conclusion is that Microchip isn't consistent in aliasing SSPBUF to SSP1BUF thru all their device header files :-(Code:CMD VAR BYTE CMD = SSPBUF CMD = SSP1BUF CMD = SSP2BUF
I don't know a way of doing it automatically - that's not to say it can't be done though!
I'd probably use SSPBUF in the code and add a comment saying that if the compiler complains then add SSPBUF VAR SSP1BUF to the code. That's certainly not idiot proof but you do know that's an impossible thing to achieve ;-)
/Henrik.
henrik
I think your right and what you suggest may be as good as it gets
add SSPBUF VAR SSP1BUF on Expression error
WILL call this version 1.0 , the python code now converts the pixels to suit (saves the pic18 from all that work)
the usercommand file has a more meaningful name but I forgot to update the demo's include to the new name
change glcd_chr include to INCLUDE "TFT_SPI.pbpmod" ;glcdc
Last edited by richard; - 3rd July 2015 at 10:38.
Richard,
Great amount of work on this library.
I have to hand it to you, a lot of coding you worked out there.
For my own edification, I have a question for you.
In "TFT_SPI.PBPMOD" you have your setxy 8-element byte array for y0, y1, x0 & x1 declared.
This I understand.
You do this to support Word variables for x0 & x1 and space for y0 and y1 to be used as Word variables in the future,
but used as byte variables today. This I assume as the TFT display's y axis in less than 255.
One thing I notice though is that you have the following ASM address mapping for the individual x&y elements.
Then you have the following PBP variable declarations.Code:ASM y0 = _setxy +1 y1 = _setxy +3 x0 = _setxy +4 x1 = _setxy +6 ENDASM
Understood at this point.Code:x0 var WORD EXT x1 var WORD EXT y0 var byte EXT y1 var byte EXT
x vars are Words and y vars are Bytes.
But here is my question, I thought I noticed you use a lot of manual (CHK?RP/movlw/movwf) manipulation within the USERCOMMANDS for
the y0 & y1 variables instead of using PBP standard macros for MOVE?xx.
Could you not change the ASM address mapping for the y0 & y1 elements to use Little Endian style, instead of Big Endian, and then use the
standard PBP macros (MOVE?BB, MOVE?CB, MOVE?WB)?
Wouldn't that simplify the ASM in the USERCOMMAND macros?
Doesn't the PBP standard MOVE?xx macros take care of the BankSel testing/switching and movement of the High and Low bytes for you?
I may be off base, but was just curious.Code:ASM y0 = _setxy +0 y1 = _setxy +2 x0 = _setxy +4 x1 = _setxy +6 ENDASM
I didn't read through the entire "TFT_SPI.PBPMOD", to see if there was another reason you have y0 & y1 defined in ASM as Big Endian.
Regards,
TABSoft
good catch tabsoft , I missed that when I changed the setxy method and never finished "cleaning up" . the two hardware includes have been fixed also (same error)
y0,y1 are now words and usercommand macros are more consistent
version 1.1 for these files (already)
I download python 2.7.10 version for windows and when I run it I get some errors.
When I open script FLASH.py and pres F5 button run module I got this message:
Python 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>>
Traceback (most recent call last):
File "C:\Python27\flash.py.TXT", line 6, in <module>
import serial
ImportError: No module named serial
>>>
Because I'm not a good programmer there is a few things that are not clear to me.
Where I can download the Arduino utft ImageConverter 565.exe.I found only a online converter on Rinky-Dink Electronics web page.
What is the purpose of this file "flash.py.TXT" and where I must copied this file.
When I get a image file from ImageConverter565 how I can send this file to external Flash memory w25q32.
to find the image converter just google arduino utft librarywhere can I get ImageConverter565
I got mine from here
http://www.rinkydinkelectronics.com/library.php?id=51
download the utft.zip ,its in the utft/tools folder
flash.py.TXT needs to be renamed to flash.pyWhat is the purpose of this file "flash.py.TXT" and where I must copied this file.
its a python 2.7 script . you will need to install python 2.7 on to your pc
to be able to run it
there are some python apps that mat need to be installed too see above (os,time,Tkinter,serial,glob) most come preinstalledCode:#flash.py extract import os import time from Tkinter import * import serial import glob ser=serial.Serial("com27",38400) ser.flush() ser.timeout=.005
the code also wants a serial port (or it will crash and burn) mine uses com27 you can edit file to suit your setup , whatever port you supply needs to exist and be available for python to use
this code can either make a pbp.bas include image file or transfer the image directly to external Flash memory via the serial port when used with my flash add in
Bookmarks