Needing help to start project please

shanepitt

New Member
At the moment when you start a program it steps threw in order , IE......it completes one step then once that and any sub routines it might have are finished it then steps to the following line under the main program and so on, I cant get it to monitor all the inputs on the chip simultaneously and act on each input separately. Has to go in order the only way at the moment I can see around this is to have a smaller chip for each input I want to monitor, having several smaller chips needing more hardware and PCB space, is not ideal, I want to be able to achieve this on one chip.
The current chip I have is the 18M2.

Can anyone help please , this sort of will stem to my big project.

regards
shane
 

Attachments

Jamster

Senior Member
I would re post in the active forum, far more people look at that.

How quickly do you need to read the information?

If you only need to read digital inputs simultaniously at certain points in your code consider reading up on the 'portB' variable.

If you need to constantly poll the inputs (or you need more than just on or off), then set up a parralell prosessing task that just loops round reading the states of the pins: Ie for an analogue reading:
Code:
start0:
 do
  'main loop content here
 loop
start1:
 do
  readadc B.1,b1
  readadc B.2,b2
  readadc B.3,b3
  readadc B.4,b4
 loop
There may be other chips that will do the job of the second task, but I don't know of any. Also note that serin (etc) will halt all tasks, read up on Parralell tasks.

Jamster
 

shanepitt

New Member
wow great thanks for the prompt reply have just started doing the whole picaxe thing myself, have gone threw the manuals but there isint nearly enough in there to read and understand, sounds like it might be a forum toyle. thanks again

regards
shane
 

westaust55

Moderator
agree that it will be far better to post in the Active forum area than in Blogs (which are more intended to report project progress than ask general questions). when posting it would be good to include your program code as developed so far and a clear description of what you are trying to achieve. in the meantime, have you looked at the SETINT command and use with the NOT parameter.
 
Top