*************************************** PmmC Revision R3.0 26th June 2012 *************************************** 1] COM1 doesnt work with the buffered service, was sending rubbish - fixed. 2] Sending a \n character first after selecting a uSD font was resetting processor - fixed 3] There is now a seperate PmmC for the 4.3" LCD non touch module - uLCD-43P-GFX-R30.PmmC 4] Due to integer rounding, baud rates are not exact, actual baud rates are defined here for reference MIDI 9 31,250.00 ( 0.00%) BAUD_110 0 110.00 ( 0.00%) BAUD_300 1 300.00 ( 0.00%) BAUD_600 2 599.94 (-0.01%) BAUD_1200 3 1,199.87 (-0.01%) BAUD_2400 4 2,399.74 (-0.01%) BAUD_4800 5 4,799.49 (-0.01%) BAUD_9600 6 9,598.98 (-0.01%) BAUD_14400 7 14,423.08 (+0.16%) BAUD_19200 8 19,263.70 (+0.33%) BAUD_31250 9 31,250.00 ( 0.00%) BAUD_38400 10 38,527.40 (+0.33%) BAUD_56000 11 56,250.00 (+0.45%) BAUD_57600 12 57,397.96 (-0.35%) BAUD_115200 13 117,187.50 (+1.73%) BAUD_128000 14 127,840.91 (-0.12%) BAUD_256000 15 255,681.82 (-0.12%) BAUD_300000 16 312,500.00 (+4.17%) BAUD_375000 17 351,562.50 (-6.25%) BAUD_500000 18 468,750.00 (-6.25%) BAUD_600000 19 562,500.00 (-6.25%) Note: "PicasoGFX2_Functions.fnc" file must be placed in the workshop "..\4D Labs\4D Workshop 3 IDE\INCLUDE" folder Note: “The downloaded (4DGL Workshop3 IDE) setup application will create the required 4DGL-Workshop3 folders and install all the required files. Note that in-line with current Microsoft philosophy all samples and demos are located in the ‘All Users\Shared Documents\4D Labs’ folder (XP) or ‘Users\Public\Documents\4D Labs’ folder (Vista and Windows 7)." *************************************** PmmC Revision R2.9 05th June 2012 *************************************** NB!!!!!!! "PicasoGFX2_Functions.fnc" file must be placed in the workshop "..\4D Labs\4D Workshop 3 IDE\INCLUDE" folder Note: “The downloaded (4DGL Workshop3 IDE) setup application will create the required 4DGL-Workshop3 folders and install all the required files. Note that in-line with current Microsoft philosophy all samples and demos are located in the ‘All Users\Shared Documents\4D Labs’ folder (XP) or ‘Users\Public\Documents\4D Labs’ folder (Vista and Windows 7)." ====================================== PmmC changes ====================================== ============================================================================================ ============================================================================================ changes/fixes in 2.9 1] com_TXbuffer and com1_TXbuffer functions have been modified and take an extra parameter. Refer to example COMx_Burst_Test1.4dg for explanation of use. func com_TXbuffer("buf", "bufsize", "pin"), 0; // sets the buffer location for buffered transmission // Syntax: com_TXbuffer("buf", "bufsize", "pin"); // Usage : com_TXbuffer(mybuf, 1024, IO1_PIN); // set the TX buffer, usin IO1_PIN for turnaround // Usage : com_TXbuffer(0, 0); // revert to non buffered service // Notes : initialize a serial buffer for the COM0 output. // : The program must declare a var array as a circular buffer. // : When a TX buffer is declared for comms, the transmission // : of characters becomes non blocking. The only time // : blocking will occur is if the buffer has insufficient space // : to accept the next character, in which case the function // : will wait for buffer space to become available. If the // : TX buffer is no longer required, just set the buffer pointer // : to zero, the size in this case doesnt matter and is ignored. // : The function can resize or reallocated to another buffer at // : any time. The buffer is flushed before any changes are made. // : "pin" designates an IO pin to control a bi-directional // : control device for half duplex mode. "pin" will go HI at the // : start of a transmission, and will return low after the final // : byte is transmitted. If not required, just set "pin" to zero. 2] Image control will now show error box for out of range video frames. Also, if frame is set to -1, just a rectangle will be drawn in background colour to blank an image. (see test program ImageControlFrameOverrun.4dg) 3] FAT16 uSD cards can now be formatted with 64k clusters. 4] Clipping issues now fixed, some large images were not being clipped properly. 5] All I/O pins are now configured as inputs, prevously they were configured as outputs / LO 6] txt_Attributes(n) was not working, now fixed. 7] DIVISION by zero and MODULUS of zero were resetting, now fixed, illegal operations returns zero. 8] str_Printf was not advancing source pointer properl, fixed, refer to test program Str_PrintfCheck.4dg 9] Transparent image mode has test program and explanation of use, refer to test program transparentTest.4dg 10] ucmp16 was not working correctly, fixed, refer to test program ucmp32.4dg 11] Memory for font storage is now dynamically allocated, allowing very large user defined characters to be used. Previously, the allocation was only fixed 64 bytes, limting character size to a 512 pixel array which limited character size to approx 22 pixels square. The tradeoff for this is that you cannot allocate the entire amount of memory returned by mem_Heap(), so allow 32 bytes for the internal fonts, adjusting this amount accordingly if you have custom larger fonts. ============================================================================================ ============================================================================================ ************************************** PmmC Revision R2.8 27th Jan 2012 ************************************** 1] Fixed 4.3" CT touch problems, now common PmmC for both versions 2] See C:\Users\user\Dropbox\4D Projects\4D Products\PICASO-GFX2\PmmC 2.7 Buglist\FIXED-I2C_Putn_Bug I2C_PutN is fixed, it was stopping when 0x00 encountered in strings. 3] See C:\Users\user\Dropbox\4D Projects\4D Products\PICASO-GFX2\PmmC 2.7 Buglist\FIXED-str_Printf_Bug str_Printf is fixed, was incorrectly calculating number following %. This also applied to %0ns 4] serout_1 was not checking pending flag FIXED 20120127 http://4d.websitetoolbox.com/post/printadd?id=5686973 maybe he's the first to use it 5] str_Printf was falsely adjusting string pointer on control string containing string chars eg: str_Printf(&p,"%s"); would add an extra 3 to the string pointer. FIXED 20120128 6] str_Cat and str_CatN return pointer to incremented source. It should return a pointer to the destination, the doc is correct. FIXED 20120128 7] Restriction on number of pixels in a character are now removed. Pixel array buffer now dynamically allocates what is requred, whereas before it used a fixed buffer limiting matrix to 800 pixels (buffer was 100 bytes) 8] Added function to return unsigned carry. This replaces the solution of:- C := (A[0]<0)^(B[0]>=0) ^ (!OVF()); // 34usec with a faster function call CY(); // 5usec http://4d.websitetoolbox.com/post/overflow-register-5671096 //================================================================ func CY(), 1; // Syntax: CY(); // Usage : myvar := 0xFFF8 + 9; // result = 1 // : print(myvar," "CY(),"\n"); // carry = 1 // Notes : This function returns the carry status of an // unsigned overflow from any 16 or 32bit additions or sutractions. //================================================================ 9] Added new func for non aligned byte copy as there was no support other than a 'roll your own' loop which was rather slow ==================================================================== func str_ByteMove("src", "dest", "count"), 1; // func str_ByteMove("src", "dest", "count"), 1; // Syntax : str_ByteMove(src, dest, bytecount); // Input : STR *source points to byte aligned source. // : STR *dest points to byte aligned destination. // : VAR count number of bytes to transfer. // Usage : nextpos := str_ByteMove(s, d, 100); // Notes : copy bytes from "src" to "dest", stopping only // : when "count" is exhausted. // : No terminator is appended, it is purely a // : byte copy, and any zeroes encountered will // : also be copied. // Returns : returns a pointer to the end of the destination // : (which is "dest" + "count") //================================================================= 10] Added new functions for string copy as there was no support other than 'roll your own' loops which were rather slow //================================================================= func str_Copy("dest", "src"), 1; // Syntax : str_Copy(dest, src); // Input : STR *dest points to byte aligned destination. // : STR *source points to byte aligned source. // Usage : nextplace := str_Copy(d, s); // Notes : copy a string from "src" to "dest", stopping only // : when the end of source string "src" is encountered // : (0x00 terminator). // : The terminator is always appended, even if "src" is // : an empty string. // Returns : returns a pointer to the 0x00 string terminator at // : end of "dest" (which is "dest" + str_Length(src); ) //================================================================ //================================================================ func str_CopyN("dest", "src", "count"), 1; // Syntax : str_CopyN(dest, src, bytecount); // Input : STR *dest points to byte aligned destination. // : STR *source points to byte aligned source. // : VAR count max number of chars to copy. // Usage : nextplace := str_CopyN(d, s, 100); // Notes : copy a string from "src" to "dest", stopping only // : when "count" is exhausted, or end of source // : string "str" is encountered (0x00 string terminator). // : The terminator is always appended, even if // : "count" is zero, or "src" is a null string. // Returns : returns a pointer to the 0x00 string terminator // : (which is "dest" + whatever was copied) //================================================================ 11] Added unsigned 16 x 16 multiply with 32bit result //================================================================ func umul_1616("&res32", "val1", "val2"), 1; // Syntax : umul_1616(&res32, varA, varB); // Input : DWORD *result points to 32bit result register. // : VAR val1 16bit register or constant // : VAR val2 16bit register or constant // Usage : var res32[2]; // : umul_1616(&res32, myvar, 50000); // Notes : performs an unsigned multiply of 2 x 16bit values // : placing the 32bit result in a 2 word array. // Returns : the pointer to the 32bit result. // : carry and overflow are not affected. //================================================================ 12] Added 32 bit addition function //================================================================ func uadd_3232("&res32", "&val1", "&val2"), 1; // Syntax : uadd_3232(&res32, &varA, &varB); // Input : DWORD *res32 points to optional result (or zero for compare) // : DWORD *val1 points to 32bit augend // : DWORD *val2 points to 32bit addend // Usage : var res32[2]; // : res := uadd_3232(res32, val1, val2); // Notes : performs an unsigned addition of 2 x 32bit values // : placing the 32bit result in a 2 word array. // Returns : returns 1 on 32bit unsigned overflow (carry). // ; carry flag is also set on 32bit unsigned overflow // ; and can be read with the CY() function. //================================================================ 12] Added 32 bit unsigned subtraction function //================================================================ func usub_3232("&res32", "&val1", "&val2"), 1; // Syntax : usub_3232(&res32, &varA, &varB); // Input : DWORD *res32 points to optional result (or zero for compare) // : DWORD *val1 points to first 32bit minuend // : DWORD *val2 points to 32bit subtrahend // Usage : var res32[2]; // : res := usub_3232(res32, val1, val2); // Notes : performs an unsigned subtraction of 2 x 32bit values // : placing the 32bit result in a 2 word array. // Returns : returns 1 on 32bit unsigned overflow (borrow). // ; carry flag is also set on 32bit unsigned underflow // ; and can be read with the CY() function. //================================================================ 13] Added 32 bit unsigned compare function //================================================================ func ucmp_3232("&val1", "&val2"), 1; // Syntax : ucmp_3232(&varA, &varB); // Input : DWORD *val1 points to 32bit minuend // : DWORD *val2 points to 32bit sutrahend // Usage : res := ucmp_3232(val1, val2); // Notes : performs an unsigned comparison of 2 x 32bit values. // : The result of the subtraction is returned. // Returns : 0 if equal // : 1 if val1 > val2 // : -1 if val1 < val2 // : This function does not affect the carry flag. //================================================================ 14] Displays using SSD1963 driver IC (uLCD43xx and uVGAII) now supports gfx_ColourChange which was not supported on previous PmmC's, Full screen colour change in less than 80msec. Note that the READ_PAGE is the source, and WRITE_PAGE is the destination for the colour change operation. 15] Displays using SSD1963 driver IC (uLCD43xx and uVGAII) have an improved gfx_ScreenCopyPaste(..) function that will now copy a full page to another page in less than 70msec. 16] Incorrect memory size constants in PicasoGFX2_Functions.fnc __MAXPROG 15360 // user program space __MAXMEM 14336 // user memory bytes have been changed to correct values of:- __MAXPROG 14400 // user program space __MAXMEM 14400 // user memory bytes ============================================================================================ ============================================================================================ *************************************** PmmC Revision R2.7 13th Dec 2011 *************************************** 1] media_WriteByte was missing - this was common to all r26 modules - fixed 2] Sleep NQR on wakeup - this was common to all r26 modules, uSD card was not being re-enable - fixed 3] Transparent images not implemented on uVGA or either 4.3" - fixed