pwm 18f2431


Closed Thread
Results 1 to 21 of 21

Thread: pwm 18f2431

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    I think you are correct that not many have used this chip. I was hopping Bruce Or Darrel would reply to this. When I get a chance I will look at the data sheet.

    DTs instant interrupts works well for what I have used it for so when the motion module is undrstood they should work well for that too.

    Sorry I can not be more help at this time.
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    Aug 2009
    Posts
    63


    Did you find this post helpful? Yes | No

    Default

    thanks mack

    yeah i was looking at instant interupts aswell...

    my coding is quite abysmal at this time, but the general idea is what im heading for at the moment till my coding is up to scratch (hopefully picbasic pro will actually arrive today :P including a manual that might actually help!)

    CAP1M3:CAP1M0 = 0101 'capture channel 1 is measuring period
    CAP1REN 'capture timer5 is reset after each measurment is made
    CAP2M3:CAP2M0 = 0101 'capture channel 2 is measuring period
    CAP2REN 'capture timer5 is reset after each measurement is made
    CAP3M3:CAP3M0 = 0101 'capture channel 3 is measuring period
    CAP3REN 'capture timer5 is reset after each measurement is made
    (i realise its asm)

    this is just the starting for actually capturing the result. this measures directly to a buffer for each channel without the need to save it with any coding. CAP1BUF, CAP2BUF and CAP3BUF. would it be possible to have this running in the background? and not actually create an interupt to get to it? since it is already saved automatically in a buffer. cant i just during my program just "read" from the specific buffer and not actually entangle myself with the measurement processes that are going on at the CAP's.

    thanks

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


    Did you find this post helpful? Yes | No

    Default

    You do not need interrupts. You should be able to read it just as you would an ADC or other hardware things. The interrupt option is just that with hardware that might be helpful.

    I will try to get a chance to read through the data sheet later. I have some of these chips on order now. So maybe in a week or so I will be asking you questions.
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Aug 2009
    Posts
    63


    Did you find this post helpful? Yes | No

    Default

    ok thanks mack

    unfortunately i still dont understand much about these interupts and how they can help me, but ill keep searching around and looking at example codes.

    haha ill be as much help as possible but dont expect much!

  5. #5
    Join Date
    Aug 2009
    Posts
    63


    Did you find this post helpful? Yes | No

    Default

    sorry again to post here, but since i dont actually have the program yet to play with since it hasnt arrived, i cant actually trial and error anything im doing... or any basic language im picking up.

    one thing i am interested in is just reading values that would be saved at a certain filename. ive looked up the filenames in the datasheets etc..

    to use my specific data value would i have to convert it to var? and then use it in my calculation algorithm.

    READ F69H, w0.BYTE.o 'cap1 value written to word0 byte 0
    READ F67H, W0.BYTE.1 'cap2 value written to word0 byte 1
    READ F65H, W0.BYTE.2 'cap3 value written to word0 byte 2

    is this an incorrect way of accessing my data? im sorry i cant actually test it myself as of yet...

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


    Did you find this post helpful? Yes | No

    Default

    You have lost me.
    Where is the file being saved? Are you meaning save the data to eeprom?

    This page has several samples.
    http://www.melabs.com/resources/samples.htm
    Dave
    Always wear safety glasses while programming.

  7. #7
    Join Date
    Aug 2009
    Posts
    63


    Did you find this post helpful? Yes | No

    Default

    sorry im quite bad at explaining, but ill try my best. ill check that site out as well thanks

    basically its being saved in the thing called SRAM, if im correct. which is similar to normal ram but its for special functions. Basically its just implemented as static ram. with an address of F69H for CAP1BUFH, which is the place where "capture 1 register highbyte", the place where the measurement (period in my case) has been stored temporarily, till it is overwritten by the next measurement.

Similar Threads

  1. Half-bridge PWM with a 16F684 ?
    By Byte_Butcher in forum General
    Replies: 7
    Last Post: - 17th January 2010, 22:18
  2. Variable PWM PIC18F2431
    By trr1985 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 12th June 2009, 06:03
  3. PWM setting PIC16F887
    By Gevo in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 12th June 2008, 07:24
  4. using all pins of pwm in pic 18f2431
    By jorgequesada in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 4th May 2007, 21:43
  5. Tidying Up PWM Routine
    By Tissy in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 21st February 2005, 00:26

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