pic24 beginner


Closed Thread
Results 1 to 24 of 24

Thread: pic24 beginner

Hybrid View

  1. #1
    Join Date
    Aug 2009
    Posts
    63


    Did you find this post helpful? Yes | No

    Default

    mack

    I just realised whilst browsing the forums that it didnt support 16bit. but thats ok i have changed my idea on how to complete what i want, so i only need a chip that provides 10bit ADC.

    Ill explain my whole project! basically im working for a wind turbine company, and currently the power from the turbine goes to an analogue rectifier and then into a converter which goes off to the mains. Unfortuantely this has caused alot of noise due to some problems, and also means we can't collect data too easily or send error signals etc. so im using a microprocessor that is programmed to do what i want. First ill explain what i want and then il explain how i think i will do it

    i want to measure the frequency of 3 analogue signals and get the average from them, and then using that i can create a time constant for each average, which will determine the pulse width modulation of the digital signal output. additionally i want to be able to measure the DC voltage after its been modulated, so that it can switch the generator off if the voltage gets to a certain point (since this will cause damage to the resistor inbetween the + and - and then will cause further damage etc)


    First of all i've decided that I am going to run the 3 analogue signals (3 phases from the turbine) through a schmitt trigger (unless there is a schmitt trigger already integrated into a specific pic). Using the now digital signal i can easily measure the drops using an interrupt? with the information from the drops i can measure the frequency? and then using the frequencies from all 3 signals i can get an average (f1+f2+f3)/3 and i can use that to set the time constant for the pulse width modulator.

    im sorry if some of that was completely impossible, but i havnt worked with programming or electronics at all before.

    thanks

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


    Did you find this post helpful? Yes | No

    Default

    Interesting project.
    I would look at the 18F4550 for this and clock it at 48Mhz.

    Also a coulpe of threads that may help
    http://www.picbasic.co.uk/forum/showthread.php?t=3251
    http://www.picbasic.co.uk/forum/showthread.php?t=11571

    What do you have in mind for a programmer? The PICKIT2 from microchip is nice...and cheap.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Aug 2009
    Posts
    63


    Did you find this post helpful? Yes | No

    Default

    well thats the problem i wasnt too sure on how this works since its my first time, so would i program everything on (in this case) pickit2, and then then how would i compile it? or does that program include that? would that mean not having to purchase picbasic or picbasic pro? just need a run through on the whole process

    thanks, sorry again was the mindless questions, just can't seem to find this ridiculously simple stuff other places

    edit: sorry i think i confused myself massively when i wrote that, so it doesnt make much sense, would it be ok for someone to give me a quick run through on how i would do this, e.g. create program on what, upload program to pic how, etc
    Last edited by robertpeach; - 11th August 2009 at 17:01.

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


    Did you find this post helpful? Yes | No

    Default

    PicBasic compiles the basic code into assembly language.
    If you are using an 18F chip MPASM then converts the assembly into HEX.
    This is all done automatically when you compile your basic code. MPASM is free, it is part of MPLAB. When you purchase PBP a compatibe version of MPASM come with it.

    Now you need a way to "squirt" the hex into the PIC. That is where the PicKit2 comes into play. There are other programmers out there. If you do not go with the PicKit2 MeLabs has some good ones. Beware of the clones though. Nothing but trouble. The last I flecked the PicKit2 war around $50 US.

    So it boils down to needind PBP and a PicKit2 and a bread board or two and you should be good go.
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Aug 2009
    Posts
    63


    Did you find this post helpful? Yes | No

    Default

    ok thank you! you wouldnt believe how much thats helped!

    also just wondering for what ive described to you, is it important to buy the picbasic pro, or is the picbasic sufficient enough for my needs? or are there other programs i could use that would do the same thing at a lesser price?

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


    Did you find this post helpful? Yes | No

    Default

    To be honest, PB Pro is all I have ever used from MeLabs.

    Other programs... Folks around here seem to like PBP
    a few years ago before I purchased PBP I tried the demos from some of the others. And here I am. I think most would agree that PBP is the most stable one out there and the support from MeLabs if needed is great.

    Once you purchase PBP upgrades are only $25.
    Dave
    Always wear safety glasses while programming.

  7. #7
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    I will 2nd what Dave says. PBP is the only way to go. 90% of everyone that's ever
    purchased PBC from us over the years has returned within around 30 days to upgrade
    to PBP. It's the best out there.

    For your particular application, have a look at the 18F2431. The motion feedback module
    has a capture option specifically for frequency measurements, and makes it incredibly
    simple. It automatically captures the 16-bit timer5 value on every rising-edge.

    It also has 10-bit A/D with up to 200K samples-per-second, with simultaneous 2-channel
    sampling.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Similar Threads

  1. Replies: 17
    Last Post: - 12th April 2014, 03:17
  2. Replies: 0
    Last Post: - 29th August 2008, 06:54
  3. Beginner at PB
    By alphahr in forum Off Topic
    Replies: 1
    Last Post: - 21st April 2008, 18:43
  4. Beginner trying to use arrays
    By captain in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 3rd November 2007, 08:20
  5. Pic ID Error please help (beginner)
    By ninja in forum General
    Replies: 4
    Last Post: - 11th August 2005, 18:54

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