PDA

View Full Version : Displaying Videos and Images on 4Dsystems uOLED Serially



RFEFX
- 14th December 2010, 08:49
I have to start by saying that those guys at 4Dsystems really know what they are doing. they have made it very easy to display video, images, and even animated gifs on their Displays.

- For my setup ill be using the µOLED-128-G1(SGC) (http://www.4dsystems.com.au/prod.php?id=78)
Note: the (SGC) indicates that this is a serial display and has the 4Dsystems Pmmc firmware loaded.
- My Controller board consists of a PIC16F877A , 5 Button dedicated RF interface (Key Fob), including Ports B,C,E brought out to the board edge.
- Also in this setup is the Parallax RFID reader (serial). Radio shack has these on sale for $5. i have a few :)

Ok. Lets start with Graphics Composer (http://www.4dsystems.com.au/downloads/Graphics_Composer/Ver2.XX/GraphicsComposer.zip). Once you download your free copy of Graphics Composer Software, you must read the Graphics Composer manual. Unfortunately there are no links to the manual it is zipped with the software. It fully details how to get images onto your Micro SD card (uSD). There are 2 ways to get your images/videos to your uSD card. plugged directly into you computer as a Drive (recommended). or serially through the Display (which is very very slow).

I chose to plug it into my computer. Very important to NOT "Quick Format" as it needs to write to the boot sector. when you get all your files loaded via the Device>Load it will give you a TXT icon that you can click on. This TXT file (Below) is the most important part. it basically just hands you the code that you just need to copy and paste into Pic Basic (Pro).



===========================
SERIAL-PLATFORM OUTPUT FILE
===========================

---------------------------------------------------------------------------------------
File "Danger_Laser_Operating.gif"
Sector Address 0x001000
Width = 128 Height = 128 Bits = 16 (Location and size may be adjusted depending on image size
and Size Mode selected)

Display Image from Memory Card (Serial Command):
Syntax:
@, I, x, y, width, height, colourMode, SectorAdd(hi), SectorAdd(mid), SectorAdd(lo)
Data:
0x40, 0x49, 0x00, 0x12, 0x7F, 0x5B, 0x10, 0x00, 0x10, 0x00


You will need to change all the "0x" to "$" in order for PBP recognize the values. This example only shows one file. the text file would grow depending on how many items you put on your micro SD Card.

below is an example of PBP Code with the Data given from the TXT File above. This Code basically Turns on a laser and tells the display to show the file "Danger_Laser_Operating.gif" at Sector Address 0x001000.




DEFINE OSC 20

'***************************** RF COMMUNICATION ********************

ADCON1=7
CMCON=7
TRISA.0 = 1 ' These lines of code setup my RF Button Link
TRISA.1 = 1
TRISA.2 = 1
TRISA.3 = 1
TRISA.4 = 1

Symbol Centerbtn = PORTA.0
symbol UP = PORTA.1
symbol Right = PORTA.2
Symbol Down = PORTA.3
symbol Left = PORTA.4

'************************************************* *****************
X var byte

'************************************************* *****************
Symbol PWRLED = PORTB.2
symbol Laser = PORTD.7 'Port D Output is Driven by a ULN2803 8 Channel Transistor Array
symbol LCD = PORTC.0

pause 1000

serout2 LCD,84,[$55] ' uOLED Initialize
low laser
high pwrled

'************************************************* *****************

Reset:
gosub cls

Main:
If centerbtn = 1 then activate_Laser 'press center button to go to activate Laser Loop
goto Main

'****************** LASER Routine *************************


Activate_Laser:
if centerbtn = 1 then activate_laser ' Release button to activate
serout2 LCD,84,[$40, $49, $00, $12, $7F, $5B, $10, $00, $10, $00] 'The code given to us from Graphics Composer
high laser

Laser_On:
if centerbtn = 1 then Deactivate 'Press Center button to go to Deactivate loop
goto laser_on

Deactivate:
if center = 1 then Deactivate 'Release to Deactivate Laser
low laser
gosub cls
goto main

'****************** CLEAR SCREEN ************************************

CLS:
for x = 0 to 2
serout2 lcd,84,[$45]
next
return


Here is the Video of the working code above.


http://www.youtube.com/watch?v=M718Eueix0o



You will notice that these videos also Implement my RFEFX Logo which is called in a separate routine

Here are some other code / video examples:



define OSC 20


'********************** RFID Tag Data *****************************


Tag1 DATA "0415146D53" '0415146D53 ' 2 cards registered...
Tag2 DATA "30700D48A5" '30700D48A5

LastTag CON 2
tagNum VAR byte ' from EEPROM table
idx VAR Byte ' tag byte index
char VAR Byte ' character from table
buf var byte(10)
X var byte

'************************************************* *****************
Symbol PWRLED = PORTB.2
symbol LCD = PORTC.0
Symbol rfidin = PORTB.4
Symbol RFID = PORTB.5
pause 1000

serout2 LCD,84,[$55] ' uOLED Initialize
high RFID
high pwrled 'Software controlled Power LED (if this LED is not on at load check your code)

'************************************************* *****************

Reset:
gosub cls
pause 100
logo:
gosub Logo_png

Main:
low rfid
serin2 rfidin,396,1000,Logo,[WAIT(10),str BUF\10] '2 Sec Timeout for Logo refresh
high RFID

'**************** RFID Check Tag Routine *****************

Check_List:
FOR tagNum = 1 TO lasttag
FOR idx = 0 TO 9
READ (((tagNum - 1) * 10) + idx), char 'The Tricky Order of Operation
IF (char <> buf(idx)) THEN Bad_Char
NEXT
GOTO Tag_found
Bad_Char:
NEXT

Bad_tag:
serout2 LCD,84,[$40, $56, $00, $00, $80, $80, $10, $21, $00, $D4, $01, $54, $2E]
PAUSE 8000 ' Delay the duration of the length of the File on the uSD card, in this case 8 sec.
GOTO reset

Tag_Found:
serout2 LCD,84,[$40, $56, $00, $00, $80, $80, $10, $21, $00, $D4, $01, $1F, $2E]
pause 8000 ' Delay the duration of the length of the File on the uSD card, in this case 8 sec.
GOTO reset




'************************* LOGO Routine ********************************

Logo_png:
serout2 lcd,84,[$40, $49, $00, $30, $7F, $1F, $10, $01, $8A, $EE]
return

'************************** Clear the LCD ****************************

CLS:
for x = 0 to 2
serout2 lcd,84,[$45]
next
return




http://www.youtube.com/watch?v=0tagVOV9EE8




DEFINE OSC 20

'***************************** RF COMMUNICATION ********************

ADCON1=7
CMCON=7
TRISA.0 = 1 ' These lines of code setup my RF Button Link
TRISA.1 = 1
TRISA.2 = 1
TRISA.3 = 1
TRISA.4 = 1

Symbol Center = PORTA.0
symbol UP = PORTA.1
symbol Right = PORTA.2
Symbol Down = PORTA.3
symbol Left = PORTA.4

'************************************************* ******

Symbol PWRLED = PORTB.2
symbol LCD = PORTC.0
pause 1000

serout2 LCD,84,[$55] ' uOLED Initialize
high pwrled 'Software controlled Power LED (if this LED is not on at load check your code)

'************************************************* *************
Reset:
GOSUB CLS
PAUSE 100
Logo:
GOSUB Logo_png

Main:
If Left = 1 then Minions ' Press Key Fob left button to start play loop
goto Main


'********************** Play Video Routine ********************

Minions:
if left = 1 then Minions ' Release left button to Play Video
serout2 lcd,84,[$40, $56, $00, $00, $80, $80, $10, $21, $04, $3C, $00, $10, $2E] 'Graphics Composer Data
pause 38000 'Pause the duration of the loaded file (38 Sec)
goto reset

'************************* LOGO Routine ********************************


Logo_png:
serout2 lcd,84,[$40, $49, $00, $30, $7F, $1F, $10, $01, $8A, $EE] 'Graphics Composer Data
return

'************************** Clear the LCD ****************************

CLS:
for x = 0 to 2
serout2 lcd,84,[$45]
next
return



http://www.youtube.com/watch?v=7F6y4jirzGU

Ioannis
- 14th December 2010, 12:55
Great post!

I was going to promote it as article, but got second!

Thanks a lot. Now only if we could add sound...

Ioannis

gadelhas
- 14th December 2010, 15:54
Thank you for this post RFEFX!

RFEFX
- 14th December 2010, 18:17
Now only if we could add sound...



Thats funny you should Mention that.... because im already working on it.

I've Already ordered the 4Dsystems SOMO (http://www.4dsystems.com.au/prod.php?id=73)

I will post a Project when i get it.

Cheers!

Ioannis
- 15th December 2010, 12:12
Yes, I have seen the SOMO, I just meant to have the sound from the Video.

OK, I know I ask too much...

Ioannis

rmteo
- 15th December 2010, 17:01
I picked up a µLCD-144(GFX) display yesterday. The reason I got this instead of the µOLED-128-G1(SGC) is that it was available locally for US$32. The main differences is that it is a backlit TFT LCD (instead of OLED) and it can be used standalone or with an MCU. You only need an RS232 (or USB to RS232 bridge) connection to program it. It comes with The 4D-Workshop3 IDE which provides an integrated software development environment for GOLDELOX-GFX2 processor and associated display modules. The IDE combines the Editor, Compiler, Linker and DownLoader to develop complete 4DGL application code. All user application code is developed within the Workshop3 IDE.
4998
Here are 2 demos that I did with the abovementioned development package. The first is a short clip of a PBS documentary. The video file is stored in the attached micro SD card. The actual code to display the video the LCD takes just 2 lines. The second demo is a simple analog clock.

http://www.youtube.com/watch?v=8R-W5kYjHEc

RFEFX
- 15th December 2010, 19:45
rmteo,
Thank you for posting your project.

The only difference i see between your display and any of the µOLED-XXX-G1 series is the price and the TFT LCD. All 4Dsystems displays are capable of being standalone.. in my article above i stated that i had the "Pmmc Firmware Loaded." with a quick firmware change to the 4DGL firmware the µOLED-128-G1 becomes a standalone module as it has the GOLDELOX processor.

This article was just a PIC based serial approach to the display.

Cheers !

rmteo
- 16th December 2010, 01:44
Just picked up one of these 3.2in. 4DGL-Platform LCD-TFT Modules (with Touch Screen) for $79. It is 4DGL with a PICASSO processor. Are you sure you can just change/swap back-and-forth between PMMC and 4DGL firmware on these displays?
http://www.4dsystems.com.au/prodimg/1277796738.jpg
They make much better videos than I do, so here is theirs.

http://www.youtube.com/watch?v=vWKWQcfNd3Y&feature=player_embedded

rmteo
- 16th December 2010, 03:42
I found the answer to my question here GOLDELOX-SGC (http://www.4dsystems.com.au/prod.php?id=71) - applies to both GOLDELOX AND PICASSO processors.


NOTE: The architecture of the base GOLDELOX device is such that it can be reconfigured either as the GOLDELOX-SGC or the GOLDELOX-GFX2. This chip-level configuration is easily achieved by re-programming the chip with the appropriate PmmC file.

* GOLDELOX-SGC : for Serial Platform (slave graphics controller)

* GOLDELOX-GFX2: for 4DGL Platform (stand alone host graphics controller)

astanapane
- 11th May 2011, 08:52
Hello,

i'm also interesting on the 3.2in. 4DGL-Platform LCD-TFT, and the RFID code.

First of all i would like to order one of the 3.2in 4DGL. Is it easy to program?

Does the screen comes with a usb adapter for programming?

on the following page i see and serial displays.

http://www.4dsystems.com.au/products.php

which is the ones can be easier controlled?

Dear Mr. RFEFX if you complete the code with sound we would like to see also an example.

thanks.

astanapane
- 11th May 2011, 14:32
sorry for my questions in here.

I would like to ask you about the GFX and SGC.

as from here,

SGC PmmC:
By loading the SGC (Slave Graphics Controller) PmmC, the module is 'ready to go' by simply connecting it to the serial port of your favourite micro-controller, and sending serial commands to it.
The Serial Command Set for GOLDELOX can be found here:
GOLDELOX-SGC-COMMANDS-SIS-rev3


GFX PmmC:
By loading the GFX (Stand-Alone Graphics Controller) PmmC, the module is then like a microprocessor which you program, using the 4DGL language (very similar to C), to control the internal graphics and external interfaces.
The 4DGL language command set and functions for GOLDELOX can be found here:
GOLDELOX-GFX2-4DGL-Internal-Functions-rev2

I understand that if i get the GFX then i need to right a program in 4D language which i dont wont.

If i get the SGC, then i only need to control my PIC with inly serial out port.

so if i understand, i can get the loaded pictures or Videos from the SD that is located in the LCD and display it.

yes yes i know i do ask a lot of questions, but sorry i'm not really a programmer. I just want to use simple functions and code in order to call the files from the SD card, using the picbasic and display it to the LCD.

thanks.


after all i also found that
http://www.sparkfun.com/products/10090

this is with GFX but the processor is GOLDELOX. According to that http://www.4dsystems.com.au/prod.php?id=71 can be modified it to SGC?

rmteo
- 11th May 2011, 16:25
You are right that with SGC, you control the display with a serial port (PIC, PC or any other serial source). To get a complete list of SGC commands, download the 116-page manual here http://www.4dsystems.com.au/downloads/Semiconductors/PICASO-SGC/Docs/PICASO-SGC-COMMANDS-SIS-rev6.pdf

Note that no matter which version you get (SGC or GFX), you can switch from one mode to the other by changing the PmmC file. At any time, you can reload the PICASO chip with either PmmC which allows you to explore the differences between the two configurations.

For example, to display a video stored on the SD card, you send a series of bytes to the display as in the example below.

astanapane
- 11th May 2011, 17:36
that is perfect.

I will place an order for a small ulcd first 1.44" and then i will try a bigger one.

thanks a lot.

rmteo
- 11th May 2011, 17:45
The main difference between the large and small displays, besides size, are

1. No touch screen.
2. Less memory.
3. Subset of commands.

I have used both, and they work well. The reference manual for the small display is here http://www.4dsystems.com.au/downloads/Semiconductors/GOLDELOX-SGC/Docs/GOLDELOX-SGC-COMMANDS-SIS-rev4.pdf

astanapane
- 11th May 2011, 17:58
i see i ok for programming but when i get it i might need some help.

thanks for your help.

i will place the order for the small 1,44 tomorrow

astanapane
- 12th May 2011, 09:22
Hello,

i see that the pins for controlling serialy the 1,5' Oled Display http://www.sparkfun.com/products/8537 is the VCC, TX, RX, GND, RESET

So do i need to use a microcontroller with TX, RX pins? The RX is needed?

On the codes that Mr. RFEFX posted, i think he used only the TX on the controller.

on the next line


serin2 rfidin,396,1000,Logo,[WAIT(10),str BUF\10]

he used the serin for RFID only, the logo command in there goes to serout line


serout2 lcd,84,[$40, $49, $00, $30, $7F, $1F, $10, $01, $8A, $EE]

please could you tell me if i'm wrong. If yes then what do i need the RX for?

thanks.

rmteo
- 12th May 2011, 16:11
Is RX needed? That is why I pointed you to the reference manual for both displays.

You can get by without using RX but I would highly recommend that you use it. Take a look at post #12 - you will see that the display returns an ACK if the command is successful, NAK if unsuccessful. This can make your application run more effectively.

astanapane
- 12th May 2011, 17:26
rmteo, thanks once more for your help.

That's why i ask you, now i see the response from the RX.

I have some SD cards here, and i would like to format them in windows 7 64bit.

I read some forum and manuals but i didnt see the format of erasing the microsd.

I did the following configuration.

Capacity : 1,83Gb
file system: FAT (default)
Alocation unit size: default
Format option: -

the only thing i found is the following migh also be interesting for you.

http://www.picaxeforum.co.uk/showthread.php?t=13971

rmteo
- 12th May 2011, 17:41
Those parameters are correct for a 2GB card under Win7. Note that both displays use micro-SD cards - not SD.

Make sure you download the Graphics-Composer Software Tool: This is a free software tool for Windows. This software tool is an aid to composing a slide show of images/animations/movie-clips (multi-media objects) which can then be downloaded into the memory card that is supported by the GOLDELOX-GFX2. The multimedia objects can then be called within the user application 4DGL program.

astanapane
- 12th May 2011, 19:12
hmmm it didnt work

i will post the problem in a bit.

I did format the usd. Then i opened the graphic composer tool.

and i did the following configuration.

on the device load option --> serial command platform and the drive is the letter G of the sd

when i try to load now to the sd i get an error.

astanapane
- 12th May 2011, 21:01
some others have the same issue as me

http://4d.websitetoolbox.com/post?id=2625580

i dont know if it has to do with windows 7.

rmteo
- 12th May 2011, 23:26
This is a 4D issue and you should see if it can be resolved over at the 4D forums. I use a 4GB SDHC uSD card and it works for me under 64-bit Win7.

astanapane
- 13th May 2011, 08:31
Sorry for getting out of the topic here. I think though that has to do with the configuration of the Oleds from 4d so it would be helpful for everyone.

What happend to me is, when i format it, it doesnt like to write the graphic composer on the uSD.

I took the uSD out of the computer port and then i placed it back. Windows asked me to format the card. I just pressed cancel.

Then i opened the program again and i tried to send a picture. It was ok then and it seems that the file sent to the card.

But i cannot see what is happening to the card since is not formatted.

I will try to buy an other uSD and i will also try a windows XP computer and let you all know.

thanks for your help.

astanapane
- 14th May 2011, 10:20
Hi all again,

i download from the 4D systems the new graphic composer 3.

This is how it looks like.See attached picture (graphic comp3)

then we click on add on the left bottom and we import a picture. (see attached pic1)

then we click on save and we create the name of our fiel, then we click on built see attach, and we create a file cgs. After that a new window opens and we have some options.

I used the uSD_RAW FAT because i didnt know what else to use.

I havent received yet the 4D1,5 OLED but i'm trying to see how the uSD work.

after this configuration i cannot see the uSD file in windows, because it is as RAW FAT save.

If you use the tools from 4D that you can make partitions on the uSD then you will be able to use both RAW and normal windows fat system.

I cannot go further since i'm still waiting for the display.

When i get them i will keep you all updated.

The above configuration is for the SCG mode displays.

astanapane
- 27th May 2011, 08:47
hello all again,

just came back from Saudi, and just got my precious small 1,5' oLED and the 1,44' uLCD.

Now i would like to play with them since is the first time i get this kind of component.

First of all i would like to talk again about the uSD and the files stored in there.

I have 2GB uSD and i have formated in format 16. Then i open the RMPET tool from 4D systems and i manage to use 50% for uSD RAW.

Then the program asked to remove the uSD and place back again. After this process windows asking to format again the 50% of the uSD.

I did that and now i can only see the 50% of the uSD.

My question is:

Do i need to store the pictures on the uSD before i send the to the uSD RAW partition space with the GRAPHIC COMPOSER.

To be more clear my question is, if i should manually first copy and paste the files in the visible 50% partition space, and then i open the graphic comsposer and via the program to send the pictures with uSD RAW.

By the way, i have plugged the uLCD via serial usb converter to my laptop and with the FAT controller i played a little bit with pictures and fonts.

very nice display.

Thanks for any help in advance.

astanapane
- 28th May 2011, 10:32
Hi i'm stack in a bit on the connections and programming my microcontroller.

as from the schematic of 4D systems the display must be connected with the 5V,GND,RX,TX,RESET.

I will not use the TX from the oLED to RX to microcontroller, but do i need the RESET also? on your programs did you use the reset pin and connected to microcontroller?

astanapane
- 28th May 2011, 19:30
i manage to fix it.

it is very easy.

My problem is some commands i cannot make it work.

i try to right a string serialy like the following but i cant.

I know somewhere i make a mistake could you help please?

serout2 portb.2,84,[$53,$00,$00,$01,$00,$00,"Hello",$00]

I think that there is somewhere a big mistake.

Regards

I fixed it with the command start with $73 for string TEXT. It is very easy to do.

thanks!!!

Ioannis
- 30th May 2011, 12:04
Satisfied with the LCD in general?

Ioannis

astanapane
- 31st May 2011, 06:49
Hi Ioannis,

i manage to display pictures and text.

i used the SCG mode becase i found it easier to control.

To be honest 4d systems save me from a microcontroller such as the PIC18F4550.

Now i use the pic16f88.

i will post my code here the folloing days.

regards

astanapane
- 1st June 2011, 10:51
as from the display,

it is small but very nice. You can use it in small projects and text is visible.

For my project i need the 3,2 inch display. I know it is expensive but i have to use the touch also.

regards,

astanapane
- 1st June 2011, 21:58
you can see here my video.


http://www.youtube.com/watch?v=jjE62O5NY6s&feature=related

i will post the code later on. It is based on the code you provided with a small changes.

Regards,

astanapane
- 2nd June 2011, 10:03
i have noticed that when i power the system with only one 5 volt regulator, it gets very hot.

The regulator is about 1Amp. Is it possible to get so hot?

I think that the pic16f88 the Display and the RFID - 12 does not get more that 700 mA.

As from the datasheet of the Dipslay, the minimum is 500 mA. Is that means that the backround is black color?

There is also an option to program the display for low power and sleep mode.

Ioannis
- 2nd June 2011, 11:54
What is the input voltage to the 5V regulator?

Suppose it is 12V. Then 12-5=7 volts drop on the regulator.

With a 0,7A current this gives a 0,7 x 7= 4,9 Watts of heat on the regulator. Too much! That is why it gets hot.

Here is a very good link to calculate heat sinks. Read it all as it has very good points.

http://sound.westhost.com/heatsinks.htm

To quickly end with your problem, put the regulator on a large aluminium heatsink,say 4x4x2 cm or lower input voltage to 8 volts.

Ioannis

astanapane
- 2nd June 2011, 14:09
Hi Ioannis,

i will try to drop the input voltage to see what will happend.

You are right, the input voltage at the moment is 12V. Which means that we have drop of 7V.

The current though from the display is too high. I dont understand why for this kind of small lcd.

I will also try a heatsink.

thanks a lot.

rmteo
- 2nd June 2011, 19:43
For my project i need the 3,2 inch display. I know it is expensive but i have to use the touch also.

I have one of the 3.2 inch displays that I no longer need. Let me know if you are interested.

astanapane
- 2nd June 2011, 21:43
yes i am.

please pm me for the price please :D

astanapane
- 3rd June 2011, 13:22
apart from that (High heat on the voltage regulator), is there anyone that manage to use the display off command?

when i used the command, i managed to power off the dipslay. But i couldnt powered up again. It seems it doesnt work.

As from my measurements, the current of the circuits is 1,3 A. This is too much.

Only the display gets about 0,7A to 0,8A when you use all the pixels in white color. (very bad).

That's why it is needed to use the power off comands.

Regards,

Ioannis
- 3rd June 2011, 14:16
Maybe there is a sleep command?

Power off means that it may not communicate again, as it is ... off!

Ioannis

astanapane
- 3rd June 2011, 15:29
hi Ioannis,

there is a sleep command but i think it does not turn the display backlight off.

I will try it and keep you updated.

Regards,

astanapane
- 3rd June 2011, 16:54
what i have noticed is:

when you use the sleep mode ($5A) it turns off only display like a clear lcd command.

when you use the display off command $59 it completes shut down the display.

i managed to turn on the diplsay again. I'm happy but still the program has a lot of bugs, because i dont know if this procedure is safe for the display.

what i mean:

first i initialize the display by the command $55 which is also the autobound.
this has to be paused for approximatelly 200ms or more. I have put it on 1000 ms.

Then after all i use commands to display pictures.

The first picture is the logo.

In order to shut down the display, i use the $59,$00 inside the gotosub logo, and then i turn off the display.

Then when i use a tag to RFID reader, inside the tag_found command i use the command $59,01 to turn on the display.

i will upload a video so you understand what i do. Do not panic for my bugs.....i know there are a lot but have in mind that i'm not a programmer and i dont know how to use the interrupt command at all.

thanks for understanding.

astanapane
- 3rd June 2011, 17:38
here is the video of what the $59,$00 command does


http://www.youtube.com/watch?v=VDo_sK6Dekw

astanapane
- 3rd June 2011, 21:37
based on the above video i would like a little bit of help?

as you see the first picture (the blue "star", actually it is a symbol,but anyway), it dissapear from the screen and then the screen goes off.

I would like to do something but i dont really know how to use inrerrupt.

I want to display this symbol every 5 seconds, and when the tag pass from the reader, to display the picture that corresponds to the tag.

I think this can be done using interrupt but i have never used it and i have read some programs, but cannot understant.

do you have any simple example using an led flashing and a button that interrupts the process?

thanks for any help.

Archangel
- 4th June 2011, 11:42
Interrupts get fast and easy using Darrel's Instant Interrupts, no setting up registers, no latency of PBP interrupts. Which interrupt do you want to use? Look at the data sheet to see what is available for your chip and check out Darrel's webpage:
http://darreltaylor.com/DT_INTS-14/intro.html

astanapane
- 4th June 2011, 12:06
thanks for your help,

i will check it out.

astanapane
- 11th June 2011, 17:17
i've been trying to use the interrupt commands but i get a lot of errors. I used both files

INCLUDE "DT_INTS-14.bas" ' Base Interrupt System
INCLUDE "ReEnterPBP.bas" ' Include if using PBP interrupts

First error i get is that micro assembler does not support 16F628a, and it is asking to use the MPASM for compiling.

then if i use the MPASM i get again a lot of error like the attached pic.

i dont understand why it says that cannot filnd the pic16f628a.

here is also my code



'************************************************* ***************
'* Name : TAG NUMBER.BAS *
'* Author : LEONARDO BILALIS *
'* Notice : Copyright (c) 2011 [LEONARDOS BILALIS] *
'* : All Rights Reserved *
'* Date : 11/6/2011 *
'* Version : 1.0 *
'* Notes : this program allows you to see the *
'* : Number of the RFID tag *
'* : *
'************************************************* ***************
@ DEVICE PIC16F628a
Include "MODEDEFS.BAS"
INCLUDE "DT_INTS-14.bas" ' Base Interrupt System
INCLUDE "ReEnterPBP.bas" ' Include if using PBP interrupts
CMCON = 7
;-----------------------------------------------------------------
LED VAR PORTB.3

ASM
INT_LIST macro ; IntSource, Label, Type, ResetFlag?
INT_Handler TMR1_INT, _ToggleLED1, PBP, yes
endm
INT_CREATE ; Creates the interrupt processor
ENDASM

T1CON = $31 ; Prescaler = 8, TMR1ON
@ INT_ENABLE TMR1_INT ; enable Timer 1 interrupts
;-----------------------------------------------------------------

DEFINE OSC 8 'Set oscillator in MHz
DEFINE LCD_DREG PORTB 'define port to LCD
DEFINE LCD_DBIT 4 'RB4 RB5 RB6 RB7 to D4 D5 D6 D7 display
DEFINE LCD_RSREG PORTA 'RS on porta
DEFINE LCD_RSBIT 0 'RS on porta.0
DEFINE LCD_EREG PORTA 'Enable on porta
DEFINE LCD_EBIT 1 'Enable porta.1
DEFINE LCD_BITS 4 '
DEFINE LCD_LINES 2 'lines 2
PAUSE 200 ' Stop 200ms
;----------------------------------
LCDOUT $FE,1 ' power lcd
Lcdout $FE,1,4
lcdout $FE, 1," Copyright 2011"
lcdout $FE, $C0,"Leonardo Bilalis"
;----------------------------------

pause 1000
low led
pause 500
high led
pause 500
low led
pause 500
high led
pause 500

' -----[ Variables ]-------------------------------------------------------

buf VAR byte [10]' RFID bytes buffer
tagNum VAR Byte ' from EEPROM table
idx VAR Byte ' tag byte index
char VAR Byte ' character from table

Main:
pause 500
lcdout $FE,1," Please use your"
lcdout $FE, $C0,"Personal RFIDTAG"
pause 500
SERIN2 portb.1, 84, [WAIT($02),Str buf\10]
pause 1000
LCDout $fe,1, "TAG ID:"
lcdout $fe,$C0, "NO: ", str buf\10
pause 5000
goto main

'---[TMR1 - interrupt handler]--------------------------------------------------
ToggleLED1:
TOGGLE LED
@ INT_RETURN

if you have any suggestion please let me know.

thanks a lot for your help.

mackrackit
- 11th June 2011, 17:26
You must use MPASM with DT's interrupts.
Then you will need to use MPASM type configs
http://www.picbasic.co.uk/forum/showthread.php?t=543

astanapane
- 11th June 2011, 17:52
thank you very much for you answer,

i have used the MPASM and the following line

device pic16F628, @ __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_ON & _MCLRE_OFF & _BODEN_ON & _LVP_OFF & _CP_ALL & _DATA_CP_ON

but i'm getting the same errors, could you help please?

astanapane
- 11th June 2011, 17:59
i used the following config

@ __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_ON & _MCLRE_OFF & _BODEN_ON & _LVP_OFF & _CP_ALL & _DATA_CP_ON
@device pic16F628a

and now i get the following errors

mackrackit
- 11th June 2011, 18:01
Remove

device pic16F628,

mackrackit
- 11th June 2011, 18:04
Seems you edited while I was posting.
now your answer is in the error message.
read through till you come the the ADD part

astanapane
- 11th June 2011, 18:09
hi Dave again,

now i get the following errors.

I dont want to disturb you more.

I'm really sad to not understand what are these errors and why it does not work.

regards


'************************************************* ***************
'* Name : TAG NUMBER.BAS *
'* Author : LEONARDO BILALIS *
'* Notice : Copyright (c) 2011 [LEONARDOS BILALIS] *
'* : All Rights Reserved *
'* Date : 11/6/2011 *
'* Version : 1.0 *
'* Notes : this program allows you to see the *
'* : Number of the RFID tag *
'* : *
'************************************************* ***************
@ __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_ON & _MCLRE_OFF & _BODEN_ON & _LVP_OFF & _CP_ALL & _DATA_CP_ON

Include "MODEDEFS.BAS"
INCLUDE "DT_INTS-14.bas" ' Base Interrupt System
INCLUDE "ReEnterPBP.bas" ' Include if using PBP interrupts
CMCON = 7
;-----------------------------------------------------------------
LED VAR PORTB.3

ASM
INT_LIST macro ; IntSource, Label, Type, ResetFlag?
INT_Handler TMR1_INT, _ToggleLED1, PBP, yes
endm
INT_CREATE ; Creates the interrupt processor
ENDASM

T1CON = $31 ; Prescaler = 8, TMR1ON
@ INT_ENABLE TMR1_INT ; enable Timer 1 interrupts
;-----------------------------------------------------------------

DEFINE OSC 8 'Set oscillator in MHz
DEFINE LCD_DREG PORTB 'define port to LCD
DEFINE LCD_DBIT 4 'RB4 RB5 RB6 RB7 to D4 D5 D6 D7 display
DEFINE LCD_RSREG PORTA 'RS on porta
DEFINE LCD_RSBIT 0 'RS on porta.0
DEFINE LCD_EREG PORTA 'Enable on porta
DEFINE LCD_EBIT 1 'Enable porta.1
DEFINE LCD_BITS 4 '
DEFINE LCD_LINES 2 'lines 2
PAUSE 200 ' Stop 200ms
;----------------------------------
LCDOUT $FE,1 ' power lcd
Lcdout $FE,1,4
lcdout $FE, 1," Copyright 2011"
lcdout $FE, $C0,"Leonardo Bilalis"
;----------------------------------

' -----[ Variables ]-------------------------------------------------------

buf VAR byte [10]' RFID bytes buffer
tagNum VAR Byte ' from EEPROM table
idx VAR Byte ' tag byte index
char VAR Byte ' character from table

Main:
pause 500
lcdout $FE,1," Please use your"
lcdout $FE, $C0,"Personal RFIDTAG"
pause 500
SERIN2 portb.1, 84, [WAIT($02),Str buf\10]
pause 1000
LCDout $fe,1, "TAG ID:"
lcdout $fe,$C0, "NO: ", str buf\10
pause 5000
goto main

'---[TMR1 - interrupt handler]--------------------------------------------------
ToggleLED1:
TOGGLE led
@ INT_RETURN

mackrackit
- 11th June 2011, 18:32
I dont want to disturb you more
No problem.

Try changing the config line to
@ __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_ON & _MCLRE_OFF & _LVP_OFF & _CP_OFF
and make sure the *.inc file is commented.
Then add
wsave VAR BYTE $70 SYSTEM
in your VAR section

astanapane
- 11th June 2011, 18:40
i have fixed a lot of problems by adding your suggestions.



'************************************************* ***************
'* Name : TAG NUMBER.BAS *
'* Author : LEONARDO BILALIS *
'* Notice : Copyright (c) 2011 [LEONARDOS BILALIS] *
'* : All Rights Reserved *
'* Date : 11/6/2011 *
'* Version : 1.0 *
'* Notes : this program allows you to see the *
'* : Number of the RFID tag *
'* : *
'************************************************* ***************
@ __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_ON & _MCLRE_OFF & _LVP_OFF & _CP_OFF
wsave VAR BYTE $20 SYSTEM ' location for W if in bank0
;wsave VAR BYTE $70 SYSTEM ' alternate save location for W
' if using $70, comment wsave1-3

' --- IF any of these three lines cause an error ?? ------------------------
' Comment them out to fix the problem ----
' -- Which variables are needed, depends on the Chip you are using --
wsave1 VAR BYTE $A0 SYSTEM ' location for W if in bank1
wsave2 VAR BYTE $120 SYSTEM ' location for W if in bank2
;wsave3 VAR BYTE $1A0 SYSTEM ' location for W if in bank3
Include "MODEDEFS.BAS"
INCLUDE "DT_INTS-14.bas" ' Base Interrupt System
INCLUDE "ReEnterPBP.bas" ' Include if using PBP interrupts
CMCON = 7
;-----------------------------------------------------------------
LED VAR PORTB.3

ASM
INT_LIST macro ; IntSource, Label, Type, ResetFlag?
INT_Handler TMR1_INT, _ToggleLED1, PBP, yes
endm
INT_CREATE ; Creates the interrupt processor
ENDASM

T1CON = $31 ; Prescaler = 8, TMR1ON
@ INT_ENABLE TMR1_INT ; enable Timer 1 interrupts
;-----------------------------------------------------------------

DEFINE OSC 4 'Set oscillator in MHz
DEFINE LCD_DREG PORTB 'define port to LCD
DEFINE LCD_DBIT 4 'RB4 RB5 RB6 RB7 to D4 D5 D6 D7 display
DEFINE LCD_RSREG PORTA 'RS on porta
DEFINE LCD_RSBIT 0 'RS on porta.0
DEFINE LCD_EREG PORTA 'Enable on porta
DEFINE LCD_EBIT 1 'Enable porta.1
DEFINE LCD_BITS 4 '
DEFINE LCD_LINES 2 'lines 2
PAUSE 200 ' Stop 200ms
;----------------------------------
LCDOUT $FE,1 ' power lcd
Lcdout $FE,1,4
lcdout $FE, 1," Copyright 2011"
lcdout $FE, $C0,"Leonardo Bilalis"
;----------------------------------

' -----[ Variables ]-------------------------------------------------------

buf VAR byte [10]' RFID bytes buffer
tagNum VAR Byte ' from EEPROM table
idx VAR Byte ' tag byte index
char VAR Byte ' character from table

Main:
pause 500
lcdout $FE,1," Please use your"
lcdout $FE, $C0,"Personal RFIDTAG"
pause 500
SERIN2 portb.1, 84, [WAIT($02),Str buf\10]
pause 1000
LCDout $fe,1, "TAG ID:"
lcdout $fe,$C0, "NO: ", str buf\10
pause 5000
goto main

'---[TMR1 - interrupt handler]--------------------------------------------------
ToggleLED1:
TOGGLE led
@ INT_RETURN

now i only get the following

error [118] overwriting previous address contents [2007]

mackrackit
- 11th June 2011, 19:01
Gettin there....
Take a look at this
http://www.picbasic.co.uk/forum/showthread.php?t=543&p=6775#post6775
When the configs are set in code space the *.inc file needs the config lines commented.

astanapane
- 11th June 2011, 19:27
i feel that if i make any change in the inc file under the original device 16f628a i will make a mess.

when i open the inc file of the 16f628a i cannot save it because access is denied. Is that has to do with my permissions as admin?

astanapane
- 11th June 2011, 19:35
thank you very much for your time and for your help.

i fixed it.!!!!!

astanapane
- 20th November 2011, 19:12
after a long time i would like to add some features on the code i'm currently trying to fix.

I got an 3.2" ulcd PT from 4DSystems.

I would like to create a program that i could control an iconic 4x3 keyboard serially from the display.

For example i would like to add 4x3 buttons and ones i touch them, to get a feedback on the display.

I have tried to create a very simple program as the start, by creating: Draw Text Button - 62hex, no luck!!!

the command as from the Manual has the following configuration :

cmd, state, x(msb:lsb), y(msb:lsb), buttonColour(msb:lsb), font, stringColour(msb:lsb),
width, height, “string”, terminator


the problem is that i dont know what to use at x and y as the width and height!

After that i need to create a touch commands i guess! I have a lot of work.

It is very confusing and there is no example at all a their site or manuals.

I will be able to check the code again on Friday because i'm at a business trip (again :chargrined: )

astanapane
- 25th November 2011, 14:03
Hello all,

i manage to create a displayed only button on the screen.

My next step is to make the displayed button as an active.

shown as down pressed : $62 $00 $00 $28 $00 $14 $FF $FF $00 $00 $00 $02 $02 $31 $00

shown as up not pressed: $62 $01 $00 $28 $00 $14 $FF $FF $00 $00 $00 $02 $02 $31 $00



Is there anyone made any button active on this screens? If so could you please help me to create one?

thanks a lot.

astanapane
- 27th November 2011, 12:21
hi all,

now i really want your help,

i'm trying to display 2 or 3 line text at the same time on the uLCD 32 PT.

i use the following command, but the second line does not show up on the screen.

If i place a PAUSE in between of 100 then both lines displayed but with a PAUSE 100 delay.

serout2 lcd,84,[$73,$04,$03,$13,$ff,$ff,"Leonardo Bilalis",$00]
serout2 lcd,84,[$73,$05,$07,$13,$ff,$00,"Copyright 2011",$00]

is there any command can help me to display both lines at the same time?

thanks for your help.

aratti
- 27th November 2011, 16:01
Have you tried with carriege return + line feed ? Add 13,10 to the first serout2 command.

serout2 lcd,84,[$73,$04,$03,$13,$ff,$ff,"Leonardo Bilalis",$00,$0D,$0A]


Cheers

Al.

astanapane
- 27th November 2011, 16:26
i just tried it. It doesnt help.

What is that ,$0D,$0A doing?

thanks for your reply!!!

aratti
- 27th November 2011, 19:51
$0D = carriege return. It just move to the first column
$0A = new line. It moves to the line below.

Very likely your display works with pixel coordinate so these commands are useless.

Try reducing the delay to Find the minimum necessary for having the display working.

Cheers

Al.

astanapane
- 28th November 2011, 10:54
I did that and works, but it looks like it has a delay for displaying the lines.

I wonder if there is any other available modification on the code in order to display both.

thanks for your kind help.

astanapane
- 28th November 2011, 15:02
ok it does not matter this a lot, i can stand with that. Now i need to create some active touch buttons on the screen. Once i manage to do it, i will let you know.

thanks.

astanapane
- 16th December 2011, 08:56
ok lets go back to my previous question first and then i move on to the touch buttons.

first of all i have been in touch with the guys from 4D system. I have asked them how is it possible to display two line at the same time.

They told me that the display has a TX output that send to the microcontroller a signal of ACK $06.


So the microcontroller needs to wait first for the ACK and then to check the second command and display both at the same time.

Is there any example here in the forum that can guide me how to wait for the ACK of an exernal device?

I guess that has to do with serial in and serial out ports.

So what i have to do is that one i send the comand to the display, i need to wait on the RX on microcontroller the right $06. If it read that it is right then i move on the next command.

could you please help me a bit?

thanks,

Ioannis
- 16th December 2011, 09:43
use identifier WAIT(6) in your SERIN2 or HSERIN command.

Ioannis

astanapane
- 16th December 2011, 15:25
thanks Ioannis

RFEFX
- 2nd February 2012, 21:52
If your referring to the uLCD-32PT. i recommend not use the display as a serial terminal. it has a very nice processor on board that will handle all of your touch commands. With the addition of the 4D-VISI putting graphs and buttons on the display is just simple click and drag. Of course we are talking 4DGL language, however once you have the display process the touch commands you can spit that out to serial so your pic micro can take over.. I will post my project if 4D systems ever get their freaking carrier boards in stock.