I remind that code...You remove my name on the top header
Well why not simply use HSERIN in the USARTInterrupt section?
I remind that code...You remove my name on the top header
Well why not simply use HSERIN in the USARTInterrupt section?
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Your quite correct Steve, it was your code which i found at http://www.picbasic.co.uk/forum/show...6F877+%4020MHZ
I didn't remove any of your signatures from the top header as they weren't on the code i found as above. All credits recognised though ;-).
Would you be kind enough to give an example of what you mean using the HSERIN command.
As in the interrupt code you are disabling the serial port first. Are you saying remove these lines, and then treat it with just the HSERIN command.
I am new to serial comms and often learn better from a quick example (if you could oblidge).
Many thanks,
Steve
Yup that's what i think... just an idea.
So you already figured something like
Just read the HSERIN section. You may also use STR modifier too. Dpending what kind of data format you'll use.Code:Disable USARTInterrupt: HSERIN [Data1, Data2,....] ' ' Data processing or not here ' Resume Enable
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Excellent help, thanks.
I have now managed to get variables sent from VB to PIC.
The code now looks like this:
However, i can only send over single numerals, ie 0-9. But in the timing functions for Hrs, Mins and Sec it could be upto 59. How do i get the PIC to reconise the double figures. If i try to send them the PIC just hangs.Code:Start: ' Main program loop that make the user happy to ' see a LED flashing to mean that something is ' running ' Hserout [hours, minutes, seconds] toggle userled for delay = 1 to 5000 ' use a loop delay to ensure pauseus 5 ' getting interrupt as fast as next ' possible goto start disable interrupt USARTInterrupt: ' Here's the interrupt routine who will make the user HSERIN [hours, minutes, seconds] Write 5, hours Write 6, minutes Write 7, seconds resume ' get out of here enable interrupt
The write command is to just store the variables in EEPROM for later use.
Thanks for your help,
Steve
Suppose the actual time is 1:33:56
Send it as 013356
actual time is 1:02:01
send it as 010201
THEN you use the DEC2 modifier
HSERIN [DEC2 hour, DEC2 Minute, DEC2 Second]
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Yup, that worked very well. I'm trying to figure out the methods of sending and receiveing data on 2 languages, PIC and VB.
I managed to get the combining of the timings and it now it reads and outputs very well. Thank you Steve.
I've been reading about qualifiers, but can only see the WAIT command, where as i'm using an interupt, this isn't really what i want.
I want to look for a command sent from VB to signal what routine to jump too. For example in the interupt if the word TIMINGS is received then it reads and stores the subsequent timing variables. But if the word FLAGS is received then it stores the flag variables etc etc.
In VB i would output something like
Is this possible?Code:MSComm1.Output = "Time" & Format(Hours, "00") & Format(Minutes, "00") & Format(Seconds, "00") & Format(SuSeconds, "00")
As at the moment it will just deal with the 8 numbers it receives, i want it to be more choosy depending what VB sends accross.
Many thanks,
Steve
for the HSERIN modifier refer to SERIN2
about VB, here's a quote from VB6 Black book pdf
![]()
Last edited by mister_e; - 16th March 2006 at 15:02.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks