you could save it to the codespace and play around the following
http://www.pbpgroup.com/modules/wfse...p?articleid=10
or, use an external EEPROM.
you could save it to the codespace and play around the following
http://www.pbpgroup.com/modules/wfse...p?articleid=10
or, use an external EEPROM.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Hi all
Thanks for the reply.
Just now on the lab I have try to display the word in the LCD but NOT SUCCESS.
Below is the code I follow all the connection on the PBP manual using PIC16F84A. LCD is bought from the www.cct.com.my.
‘ Set LCD Data port
DEFINE LCD_DREG PORTA
‘ Set starting Data bit (0 or 4) if 4-bit bus
DEFINE LCD_DBIT 0
‘ Set LCD Register Select port
DEFINE LCD_RSREG PORTA
‘ Set LCD Register Select bit
DEFINE LCD_RSBIT 4
‘ Set LCD Enable port
DEFINE LCD_EREG PORTB
‘ Set LCD Enable bit
DEFINE LCD_EBIT 3
‘ Set LCD bus size (4 or 8 bits)
DEFINE LCD_BITS 4
‘ Set number of lines on LCD
DEFINE LCD_LINES 2
‘ Set command delay time in us
DEFINE LCD_COMMANDUS 2000
‘ Set data delay time in us
Pause 100 ' Wait for LCD to startup
LCDOut $fe, 1 ' Clear LCD screen
LCDOut "Hello" ' Display Hello
End
Please advice and thanks
Hi,
Double check all connections. Do you have the pullup resistor on RA4?
/Henrik Olsson.
AND never finsih your program with a single END... use a endless loop or PBP STOP.
Code:LCDOUT $FE,1,"Your stuff" Loop: Goto Loop
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Hi all,
Thanks for the reply.
Regarding the LCD everyting look fine in my circuit. After power on the, the LCD come 16 small black square on the screen but it does not display "Hello".
Regarding the website that u given to me i'm not very understand. Do you have the simple one and is in the pure PicBasic Pro language. Besides in the website I noticed one things which we can add 2 or more interrupt at the same time..But I go thru this I not really understand.....Thanks
Below is the statement that provide by the mister_e:-
****************too bad PIC16F84a don't have 2 timers... *********
************************************************** ******
I'm planned to use the PIC16F876A there got timer 0 ,1 and 2.
(1) Is that possible using 2 interrupt in a single program.??
(i) One interrupt (tmr0) is for the clock pulse to send to the stepper motor driver
(ii) One interrpt(tmr1) is for the 1 second elapsed.
If the above possible...Does it mean that in the program I need to have two
ON INTERRUPT code..
Please guide me thru this..... Thanks you all very very much........
Last edited by DragonBall_6; - 5th December 2006 at 10:43.
Hi,
Basicly you can have as many interrupts sources as the PIC has (TMR0, TMR1, USART, RB0, RBChange, CMP, ADC, whatever.....). When the program interrupts and starts executing the ISR (InterruptServiceRoutine) you need to check what caused the interrupt and act uppon it accordingly.
My approach to this would be to use an external 32.768kHz xtal, set the TMR of your choise up to generate an interrupt at 100Hz, then in the ISR count those ticks. When you have 100 ticks you have a second. When you have 216 ticks, toggle your step pin.
This is completely untested and just something to show you one approach. Also, I suggest you'll have a look at Darrel Taylors Instant Interrupts, search the forum, it makes interrupts a breeze but MAY be overkill in this application.Code:Ticks var byte '1/100th seconds StepTicks Var Byte '1/100th seconds, used for step pulse timing Seconds var Byte 'Seconds Minutes Var Byte 'Minutes Hours var Byte 'Hours Days var Byte 'Days, perhaps change this to a Word. Goto Main 'Jump over ISR. DISABLE ISR: 'Reload timer with correct value here, and restart it. Ticks = Ticks + 1 If Ticks = 100 then Ticks = 0 Seconds = Seconds + 1 If Seconds = 60 then Seconds = 0 Minutes = Minutes + 1 If Minutes = 60 then Minutes = 0 Hours = Hours + 1 If Hours = 24 Then Hours = 0 Days = Days + 1 Endif Endif Endif Endif StepTicks = StepTicks + 1 If StepTicks = 216 then '2.16s, time to toggle the step pin. StepTicks = 0 Toggle StepPin Endif RESUME ENABLE Main: '--------------------------------------------- 'Your main code here....... 'remember, NO time consuming commands, like Pause, sleep, nap etc. '---------------------------------------------- Goto Main
About that LCD, if your connections ARE fine and matches your DEFINES then the only thing I can think of is a longer pause at the beginning OR you could try to increase the command and data delay with:
/Henrik Olsson.Code:DEFINE LCD_COMMANDUS 2000 '<-----Increase this... DEFINE LCD_DATAUS 50 '<----and this.
Last edited by HenrikOlsson; - 5th December 2006 at 07:42. Reason: Moved ISR to beginning.
Bookmarks