Can someone help me get hpwm working on 18f24k22


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2009
    Posts
    33

    Default Can someone help me get hpwm working on 18f24k22

    Hello.
    I am trying to get 3 hpwm outputs on a pic18f24k22. The problem is that it requires reading the data sheet. I can read it but for the life of me I don't understand much of it. Perhaps someone could explain which settings I need for one ccp and then maybe I can work the rest out. I think it is time I learned how to read data sheets but it is so overwhelming and my brain has started to dribble.

    Thanks

  2. #2
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,588


    Did you find this post helpful? Yes | No

    Default Re: Can someone help me get hpwm working on 18f24k22

    Bruce has some code in this thread:
    http://www.picbasic.co.uk/forum/showthread.php?t=7095

    Robert


    EDIT: I tried to find better examples using search for HPWM CONFIG sorted by descending date, found this one:
    http://www.picbasic.co.uk/forum/showthread.php?t=15829
    Last edited by Demon; - 21st March 2012 at 14:13.

  3. #3
    Join Date
    Jul 2009
    Posts
    33


    Did you find this post helpful? Yes | No

    Default Re: Can someone help me get hpwm working on 18f24k22

    Actually, my usual stumbling about blindly programming I thought I would try this and it works. I thought I had to set things up first and I don't understand why I don't but hey. It work so I suppose I should be happy. I kinda wanted to be forced to learn how to read data sheets but now I don't have to for this project at least.
    OSCCON = %1110000
    TRISC = %00000000
    TRISB = %00000000
    DEFINE OSC 16
    bright var byte


    mainloop:

    for bright = 254 to 0 step -1
    hpwm 1,bright,1000
    hpwm 2,bright,1000
    hpwm 3,bright,1000
    pause 5
    next
    goto mainloop

  4. #4
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,588


    Did you find this post helpful? Yes | No

    Default Re: Can someone help me get hpwm working on 18f24k22

    My guess is that you fell on a PIC that had default settings exactly the way you needed it. I wouldn't bet on that happening a lot.

    I know, the 18F have so many features, so many settings. It's a good thing several post sample code.

    Also, I stopped using LIVE SEARCH and now use ADVANCED SEARCH. There were times when stuff didn't show up in live search, and advanced search can sort by descending date. That helps in getting the latest posts up front.

    Robert
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

Members who have read this thread : 2

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