BasicMicro - Forums

www.basicmicro.com
It is currently Mon May 21, 2012 8:00 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: HSER timeout, if-then command, etc
PostPosted: Sat Sep 11, 2010 2:24 am 
Offline
Citizen

Joined: Thu Aug 19, 2010 9:34 pm
Posts: 17
What is the HSER timeout measured in? Miliseconds, microseconds, or some imaginary value?

I started with "2" and now I'm up to "5000" to catch 9-byte string on hserin at 9600bps.

Now the string pops-up in HyperTerminal fast, so "5000" is not 5000ms (5 seconds). It has to be something else than miliseconds. So little info on this micro, you may as well start programming in assembly and do it yourself.

The software serial port doesn't seem to be interrupt driven or use some buffering, which I really needed. I'll have to use two micros with only the hardware serial port on each. OK, no big deal, the price of two is close to the 40-pin micro with 2 serial ports.

There are also some missing features in the basic interpreter. The IF-THEN can go to a label, but I was not able to use it in any other way.

for x=0 to 15
IF a(x)>9 THEN a(x)=0 ;this doesn't work
next


Top
 Profile  
 
 Post subject: Re: HSER timeout, if-then command, etc
PostPosted: Sat Sep 11, 2010 8:11 am 
Offline
Master
User avatar

Joined: Tue Jul 07, 2009 9:06 am
Posts: 120
Location: Wisconsin USA
0.5 microseconds. So try setting the wait period to something like 1000000 = 500 milliseconds.
Or longer if it's all about waiting for the command.
5 seconds = 10,000,000 for the hser wait.


200,000 microseconds = 100 milliseconds.
I was a bit overwhelmed when they changed it from milliseconds to microseconds, because of the big numbers, but i got used to it.

So.. take the milliseconds you want, multiply by 2, and add 3 zeros.
500 milliseconds
= 1,000,000 microseconds.

There are also two types of pause commands
pause 500 ;500 milliseconds
pauseus 500,000 ; 250 milliseconds.


As for your if/then/else command problem, i'm not exactly sure what you mean so i may not be able to help, i'm not exactly a great programmer myself.

_________________
Image
Basic Micro Blog
Universal Robot Controller


Top
 Profile  
 
 Post subject: Re: HSER timeout, if-then command, etc
PostPosted: Sat Sep 11, 2010 11:17 am 
Offline
Citizen

Joined: Thu Aug 19, 2010 9:34 pm
Posts: 17
Thanks. God, I struggle with this thing. There is no easy way to find all the info. I'm very thankfull that you reply to my desperation.

Anyway, my project is progressing. I just have to get used to things like "AND" is "&" for one thing and not for another thing, etc. That took time to figure out. I was getting wrong sum masking parity bits thinking there is bug in the firmware.

The bad part is that I won't remember anything I learned few months down the road since I don't do any programming. The next time I use this micro will be as hard as the fist time. I hope by then there will be manual available and hopefully some code examples in ONE PLACE (one folder) on this website.

Thanks again for your help.


Top
 Profile  
 
 Post subject: Re: HSER timeout, if-then command, etc
PostPosted: Sat Sep 11, 2010 4:11 pm 
Offline
Master
User avatar

Joined: Tue Jul 07, 2009 9:06 am
Posts: 120
Location: Wisconsin USA
beginner wrote:
The bad part is that I won't remember anything I learned few months down the road since I don't do any programming.


Well, you can always buy one for yourself, grab a few cheap servos from www.hobbypartz.com and make a contraption.
Theres a big world when it comes to programming,
You already have your foot in the door. It won't be easy, and it will be time consuming, but you might feel pretty good at the end of your project.

_________________
Image
Basic Micro Blog
Universal Robot Controller


Top
 Profile  
 
 Post subject: Re: HSER timeout, if-then command, etc
PostPosted: Sat Sep 11, 2010 4:25 pm 
Offline
Master

Joined: Sun Aug 17, 2008 5:26 pm
Posts: 798
Location: CA bay Area
beginner wrote:
The bad part is that I won't remember anything I learned few months down the road since I don't do any programming. The next time I use this micro will be as hard as the fist time.

Comment your code in real detail. First lesson offered to newbies. I comment the livin' bejeezus out of my app notes on the forums for just that reason. Even *I* have to be reminded what I was doing after the fact! :mrgreen:

_________________
kenjj
http://blog.basicmicro.com/
http://kjennejohn.wordpress.com/


Top
 Profile  
 
 Post subject: Re: HSER timeout, if-then command, etc
PostPosted: Sat Sep 11, 2010 4:48 pm 
Offline
Citizen

Joined: Thu Aug 19, 2010 9:34 pm
Posts: 17
I do comment each line of code and above most labels. Even if you don't read the code, the comments alone would give you enough info what does the program do.

For testing this project I dusted of 15 years old DOS laptop where I had card reader test program I wrote 15 years ago in assembly as .COM DOS program. I had to invert the CLOCK / DATA lines in software. The program was commented so well, it took me 10 minutes to do that without even reading any DOS assembler manual.


Top
 Profile  
 
 Post subject: Re: HSER timeout, if-then command, etc
PostPosted: Wed Sep 15, 2010 8:48 am 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 11:00 am
Posts: 903
Location: Temecula, CA
The new manual, which you can get in the manual forum, has the most up to date timings for all commands. We changed the timeouts on hserial commands and a few other commands back to milliseconds a while ago.

From now on always consult the new manual first. We will not be making anymore major changes in the manual as far as syntax goes(there are still a few sections that have to be finished though). If you find a bug that shows a command not working like the manual says it should we will fix the command in the compiler. The manual will be the gold standard from now on when it comes to how a command should work.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: HSER timeout, if-then command, etc
PostPosted: Fri Sep 17, 2010 6:57 am 
Offline
Master
User avatar

Joined: Tue Jul 07, 2009 9:06 am
Posts: 120
Location: Wisconsin USA
Acidtech wrote:
The new manual, which you can get in the manual forum, has the most up to date timings for all commands. We changed the timeouts on hserial commands and a few other commands back to milliseconds a while ago.

From now on always consult the new manual first. We will not be making anymore major changes in the manual as far as syntax goes(there are still a few sections that have to be finished though). If you find a bug that shows a command not working like the manual says it should we will fix the command in the compiler. The manual will be the gold standard from now on when it comes to how a command should work.


What version of the studio did you change the hserial timeouts back to milliseconds?
I've been using -0.5microseconds still, and didn't notice any changes.
And this was with the 1.0.0.35 version.

As long as you guys mark these changes in the release notes, i should be fine, or make a 1 time popup in the studio that has a list of changes.
(and an option to show the list again.)

_________________
Image
Basic Micro Blog
Universal Robot Controller


Top
 Profile  
 
 Post subject: Re: HSER timeout, if-then command, etc
PostPosted: Fri Sep 17, 2010 9:33 am 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 11:00 am
Posts: 903
Location: Temecula, CA
We are now basing everything off the new manual. If the new manual says some then that is what the compiler should do. If you find something the manual says but the compiler doesn't work that way let me know. It will be fixed to match what the manual says. We've been too long ina "development" cycle and are now trying to lock everything down.

However since that section of the manual is not written yet I have to look at the compiler. It seems I was wrong and you were right. :) It is in .5us. I must have been thinking of something else. Oops. :)

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

phpBB SEO