BasicMicroUK - Forums

www.basicmicro.co.uk
It is currently Tue Oct 23, 2018 1:04 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Wish list, commands and stuff.
PostPosted: Sat Dec 11, 2010 4:30 am 
Offline
Master
User avatar

Joined: Tue Jul 07, 2009 5:06 pm
Posts: 120
Location: Wisconsin USA
#1 is the easiest and least important, allow the High/Low command to do multiple pins at once.
IE
HIGH p1,p4,p11,p21

#2, timed HIGH/LOW that works in the background,
THIGH pin, delay in ms

TLOW p5, 4000 ;sets p5 low after 4 seconds
THIGH p10, 5 ;sets p10 high after 5ms
TLOW p0, 600000 ; sets P0 low after 1 hour, regardless of what the program is doing.

The reasoning is so you can have a pin set high or low, even if your code is in the middle of something else.
This way it'll go low after the specified amount of time, without having to use pause, or try to figure out exactly where in your code to add the lows. This would be good for security, as you don't need to stop monitoring sensors in order to have a timer.
I'm sure there are plenty of other things where such a timer would be nice.
I assume it can be done in the background, where every loop adds 1 point to a counter, and once it hits the desired amount, it causes an interrupt. Though there may be an alternative to this that i haven't tried or found yet, i don't know, i'm still learning as i go.

#3. automatic 3x3, 3x4 and 4x4 keypad.
just select the rows and column pins, and the digits and the IDE/Atom do the rest.

Keypad workspace, [col\row\output,col\row\output] ;and so on


for example

Code:
___C1 C2 C3
R1[1][2][3]
R2[4][5][6]
R3[7][8][9]


Code:
value var byte

main
keypad value, [col1\row1\1,col2\row2\2..............col3\row3\9]
seriout s_out,i9600,[value,13]
pause 500
goto main


Programming keypads is a real pain in the butt as i recently found out, something that should be simple, takes many lines of code, and depending on your programming style, may not be very efficient, mine certainty isn't very efficient.

Edit:
Still want some way of setting the MCU and com port inside the bas file, especially now since i'm working with 4 different atoms., the nano 18, nano 28x, pro 28 and pro 40. I've been goofing up more and more now that i'm using a wider range of atoms.

_________________
Image
Basic Micro Blog
Universal Robot Controller


Top
 Profile  
 
 Post subject: Re: Wish list, commands and stuff.
PostPosted: Sat Dec 11, 2010 6:08 pm 
Offline
Master

Joined: Tue Nov 21, 2006 5:34 pm
Posts: 662
Hi Fallentine,

I think some of these ideas are interesting.
1) It would be interesting to see if this would give any improvements in speed or code size... There are ways to set multiple pins high or low today by using the system variables: Dirx (need to set the pins to output) and variable Numbers like INL0. But this requires you do do some bit masking and the like: For example if you wish to turn pins (1, 4, 11, 21) to high:
Code:
mask = %1000000000100000010010
; Set all of the appropriate pins to output
; if Nano or atom
DIRE = DIRE & !mask
; if Pro
DIRE = DIRE | mask

; Set the pins to high
INL0 = INL0 | mask


#2 I think what you really want is some form of scheduler. Where you say at timeX I would like to call this function...

#3 I think this looks like a good candidate to put in library sample code. It would need more information with it on how to wire it up and the like...

#4<or edit> Yep this can definitely come in handy as I am often working on multiple boards...

Kurt


Top
 Profile  
 
 Post subject: Re: Wish list, commands and stuff.
PostPosted: Sat Dec 11, 2010 8:07 pm 
Offline
Master
User avatar

Joined: Tue Jul 07, 2009 5:06 pm
Posts: 120
Location: Wisconsin USA
On #3, i actually meant to add a note about how to wire it up, but BM is really good about adding wiring examples in the manual, so that would have been a given. Go team BMicro.
Keypads are cheap, just not easy to use for beginners.

Ya, before i wanted #4 as a convenience.
But, for example, my Pros use Com1, my older 4 pin nano boards use com3, the new 3 pin nano boards use com7. Also building for a specific processor too. So you aren't building a nano program in Pro mode, simply because you recently programed your pros.
Though this is all just me repeating myself.

_________________
Image
Basic Micro Blog
Universal Robot Controller


Top
 Profile  
 
 Post subject: Re: Wish list, commands and stuff.
PostPosted: Mon Dec 13, 2010 7:20 pm 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 7:00 pm
Posts: 1316
Location: Temecula, CA
#4 is still in my todo list.

#1 can be done but the method Kurt showed is much more code efficient. Doing multiplt random pins with a command like high/low(would probably be mhigh/mlow) internally would generate individual tokens for each pin number. to be processed. Were using the pin variables is a single shot.

#2 sounds interesting. It would use an interrupt unless you limit it to just the ftio pins. Those pins you can already set them to a state and have them set back to the old state after some specified amount of time(upto a limit based on the timer multiple).

#3 Is already in the wish list. It's one of those I'll do it as soon as I have some free time ones. I think a library function will probably be the way to go with it, like Kurt mentioned.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

phpBB SEO