Page 1 of 1

Choosing a Microcontroller

Posted: Sat Jan 18, 2003 10:35 pm
by ele1200
Hey guys,<p>Can you please suggest a pic (preferably) or a microcontroller that can loosly do the following.<p>Have about 325 bits of information sent serially to it. The unit must ignore the first 310 bits, record the next eight and ignore the last 7 bits. The eight recorded bits must be compared to a list of eight bits and if a match is found, have one of its pins go low. <p>The pic or micro. must also be able to record and store the lists (from a user input keypad) to be compared to the serial data inputted.<p>What PIC am i best off starting on? Any samples of code? Is this lots of work??<p>Thanks :confused:

Re: Choosing a Microcontroller

Posted: Sun Jan 19, 2003 5:07 am
by bodgy
Probably start with the 18F252 or 452.<p>Do you really mean bits or do you mean bytes?<p>Actually the 16F series have enough space for 40 bytes 16F876/877. However the 18F series is better to code.<p>You'd need to be a little more specific as far as what you are doing with the code,as to how difficult this may or may not be. <p>Does the incoming data need to fill a circular buffer, is the serial data synchronous or asynchronous, IC2 etc?<p>The 8 bit check is this a CRC algorithm or is a plain match. How will the PIC know that valid data is being sent to it - in other words does it just wait for a start bit or is there a header code.<p>colin

Re: Choosing a Microcontroller

Posted: Sun Jan 19, 2003 7:34 am
by ele1200
Ok....the data is 8 eight binary bits, so i suppose 1 byte?<p>The first 300 bits that are to be ignored are the same all the time. Could this allow the PIC to get ready? <p>What is a circular buffer?

Re: Choosing a Microcontroller

Posted: Sun Jan 19, 2003 7:57 pm
by ele1200
Also, how would you code an ignore function? Is there an ignore function for all families of pics or just the higher memory ones?<p>For instance, does the 16f84 have an ignore function?

Re: Choosing a Microcontroller

Posted: Mon Jan 20, 2003 1:27 pm
by hlreed
That would be nice. You would have to say ignore something, so you have to make a test anyhow. Test for the first number you are going to use, or count them until you get to the first number.

Re: Choosing a Microcontroller

Posted: Mon Jan 20, 2003 3:10 pm
by josmith
There is no actual ignore functon. YOU would have to read the data and ignore it in your program by simply doing nothing with it. you could count the number of unused reads until you get to the data you want to process.<p>I am a big fan of the Basic Stamp for starting out because it is so simple to program and use.

Re: Choosing a Microcontroller

Posted: Mon Jan 20, 2003 7:49 pm
by bodgy
A circular buffer is one where the incoming data basically goes round in a circle. Used where data may come in bursts and fast and allows all the data to be read before performing whatever action needs to be taken.<p>As has already been said an ignore fuction(really useful) would have to be coded in.<p>I would be tempted to use a circular buffer in this case as it could make processing a little easier. <p>All you do is set up a loop to read in the amount of bytes and then hold onto the last but 7.<p>Are you able to say what the ignored bits look like. For example are the last 7 bits all zeroes?<p>Colin

Re: Choosing a Microcontroller

Posted: Tue Jan 21, 2003 7:18 am
by ele1200
Colin,<p>The bits are <p>300 1's and 0's
200 1's
data (10 bits)
7 1's and 0's this is data as well but i dont need it