here is the video of what the $59,$00 command does
here is the video of what the $59,$00 command does
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.
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
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
thanks for your help,
i will check it out.
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
if you have any suggestion please let me know.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
thanks a lot for your help.
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
Dave
Always wear safety glasses while programming.
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?
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
Remove
device pic16F628,
Dave
Always wear safety glasses while programming.
Seems you edited while I was posting.
now your answer is in the error message.
read through till you come the the ADD part
Dave
Always wear safety glasses while programming.
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
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 * '* : * '**************************************************************** @ __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
Last edited by astanapane; - 11th June 2011 at 18:13.
No problem.I dont want to disturb you more
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
Dave
Always wear safety glasses while programming.
i have fixed a lot of problems by adding your suggestions.
now i only get the followingCode:'**************************************************************** '* 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
error [118] overwriting previous address contents [2007]
Gettin there....
Take a look at this
http://www.picbasic.co.uk/forum/show...=6775#post6775
When the configs are set in code space the *.inc file needs the config lines commented.
Dave
Always wear safety glasses while programming.
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?
thank you very much for your time and for your help.
i fixed it.!!!!!
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 )
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.
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.
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.
Last edited by aratti; - 27th November 2011 at 16:07.
All progress began with an idea
i just tried it. It doesnt help.
What is that ,$0D,$0A doing?
thanks for your reply!!!
$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.
All progress began with an idea
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.
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.
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,
use identifier WAIT(6) in your SERIN2 or HSERIN command.
Ioannis
thanks Ioannis
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.
There are 10 kinds of people. Those that know binary and those that do not.
Bookmarks