Which chip do i use?


Closed Thread
Results 1 to 40 of 78

Hybrid View

  1. #1
    Join Date
    Mar 2006
    Location
    China
    Posts
    266


    Did you find this post helpful? Yes | No

    Default Hmmm

    Hi,

    I hope you have downloaded the pdf datasheet for the 16F882. There you can see that this PIC belongs to a family of PICs starting with the 882 and ending with the 887. There is a table showing the memory size and partnumber/number of pins for these pics.

    INT0 is the only external interupt source for the 882-887 family and the rest of PORTB has interupt on change support. This means that you can set up the INT0 pin to generate an interupt when this pin goes either high or low (set in SW).
    The rest of PORTB has interupt on change mening it will generate an interupt if any of these pins (that has this function activated) changes state. And then you have to figure out which pin did what and why...

    There is a big table for this too under CPU special features.... interupts :-)

    The microchip webpage has the price for the 882 at USD 1.20 and the 887 USD 1.84. This can be the best spent 64 cents in your entire life :-). Or you can choose a 884 (still basically the same chip for USD 1.64) since this is a 40-pin package and then keeping the options for plugging in a 18F when you run out of speed and program memory)

    Probably you have forgotten a few pins in your idea that you will "remember" later and making a design using a 28-pin device and planning to use more or less all pins is hmmmmm not that smart :-) (unless you really know what you are doing like Melanie and her friends).
    Maybe a LCD... some more buttons..... smoke detection..... automatic fire extinguishing.... you get the idea.... things tend to grow with time and some projects newer really finish.


    But if I were you I would:

    Download the datasheet for the 16F882 (same datasheet as for 883 884 886 887)
    Check if they are supported by PBP (if not memorize which are for later use)
    Not choose a 28 pin PIC since it will kill the future plans and leave no room for misstakes
    Choose a 40-pin PIC (884 or 887 if we only look at this family) unless price and pcb size is really important)


    The 884 is 20 cents cheaper then the 887 but you only get half as much program memory.

    Of course these prices might be different from what you pay in the stores but it will at least give us a chance to compare apples and bananas.

    In the end it all comes down to what can be found in your local hardware store or what can be salvaged from previous projects.

    A start is always a good start!



    /me
    Last edited by Jumper; - 26th November 2007 at 14:52.

  2. #2
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697


    Did you find this post helpful? Yes | No

    Default

    Hmm. Ill start off with interrupts. IVe been reading this incredibly long thread and i think im starting to understand how it works but i do have a question about it. In one of the posts he says "And, all of this is happening behind the scenes of your normal PBP program." Does that mean for me that i can have serin wait for data (with no timeout) *AND* still have the PWM stuff running at the same time? (Meaning i only need 1 interrupt pin)

    I understand how the other interrupt pins work now. Bit annoying but maybe i dont need them anyway.

    I do always look at the datasheets for chips but i dont completely understand them.

    If i have forgotten any pins then its bad anyway. I can do breadboard testing but once i make this thing it has to work first time. Space is an issue. Im trying to cram so much into such a small box.

    How do i tell if it supports PBP?

  3. #3
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697


    Did you find this post helpful? Yes | No

    Default

    Right. Ive just connected a PIC up and checked that its working. Now im trying out the hello world example. Ive pasted the code in from that page exactly but i get 3 errors when i try to compile

    ERROR: Variable wsave3 position request 416 beyond RAM_END 79.
    ERROR: Variable wsave2 position request 288 beyond RAM_END 79.
    ERROR: Variable wsave1 position request 160 beyond RAM_END 79.

    I dont understand what they mean or how to fix them. Im testing on a PIC16F84A. I have set the chip correctly in PBP this time :P and ive downloaded the 14 bit version of the interrupt code (for 12F-16F)

  4. #4
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697


    Did you find this post helpful? Yes | No

    Default

    Ive just loaded the bas file up and theres some comments saying i can comment out the lines that are causing a problem. Ive done that and now theres another error.

    Error PBPIC14.LIB 1141 : [255] undefined symbol 'int_entry'

  5. #5
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697


    Did you find this post helpful? Yes | No

    Default

    Aha! Ive just read a whole thread of people having digs at each other but in the end i found out that its because i havnt got MPASM turned on. Ive enabled it and got the program to compile. It did give me 2 warnings though.

    Warning[211] c:\picbas~1\pwmtes~1.asm 227 : Extraneous arguments on the line.
    Warning[211] c:\picbas~1\pwmtes~1.asm 227 : Expected (ENDIF)

    I assume that 211 is the error code and 227 is the line. If that is correct then this error is on line 169 of the origional "DT_INTS-14" file. The line says "End If". I think this is because .bas files open with VB and for some reason it added the space in. The origional file doesnt have the space. So, ive copied the origional file back out of the zip, commented out those 3 lines again and now its giving me another error

    Error[113] c:\picbasic\pbppic14.lib 1141 : Symbol not previously defined (INT_ENTRY)

    Ive tried deleting all the files generated for DT_INTS-14 (like the asm file etc). Ive hit compile again and yet another error.

    Error[113] c:\picbas~1\pwmtes~1.asm 115 :Symbol not previously defined (PIR1)

    Now im stuck. Does anyone have any suggestions?

  6. #6
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Maybe you should try and learn regular interrupts before going for the big guns Darrel gave us.

    You said that you do not understand interrupts. Search the forum for Olympic Timer or real time clock. Paul B has a good example too. Once you work through these you should have a good understanding of the behind the PBP and using an interrupt pin is not much different.
    The above mentioned threads:
    http://www.picbasic.co.uk/forum/show...=olympic+timer

    http://www.picbasic.co.uk/forum/showthread.php?t=2129
    Dave
    Always wear safety glasses while programming.

  7. #7
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697


    Did you find this post helpful? Yes | No

    Default

    Ok. Ill have a read through them. I thought the thing Darrel made was to make interrupts easier.

    Can someone give me a bit of info on the pins used please. I can read those threads tomoz but i need to get the PCB designed ASAP. Do i need the zero-crossing diodes going to RB0/INT and the serial input go to just another normal I/O pin?

    Is there a chip suited to this circuit? I see what Jumper was saying about having a 40 pin chip but space is tight and i wont need to expand on this project. If i have missed anything then ill find it when im designing the PCB.

    If the worst happens and i cant learn interrupts fast enough then i can still use the circuit without PWM but the hardware has to be right. I can reprogram the chip but i cant remake the PCB

Similar Threads

  1. Trouble with PIC16F88 (chip hangs up)
    By nobner in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 20th January 2009, 10:23
  2. Camera with PIC chip
    By The Master in forum Off Topic
    Replies: 5
    Last Post: - 1st July 2008, 15:28
  3. More info on L4620 liquid sensor chip
    By Nicmus in forum Documentation
    Replies: 4
    Last Post: - 2nd June 2008, 00:03
  4. TV Display Chip
    By zadok in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 17th April 2008, 23:17
  5. chip selection aid
    By PICMAN in forum General
    Replies: 4
    Last Post: - 21st February 2005, 19:33

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts