A header wizard


Results 1 to 40 of 230

Thread: A header wizard

Threaded View

  1. #25
    Join Date
    Feb 2010
    Location
    USA, New England
    Posts
    164


    Did you find this post helpful? Yes | No

    Default

    Hello All,

    First, just to make it clear, the fact I was fried the last time I posted had nothing to do with this project! I do not feel unappreciated or overwhelmed. You folks are all just swell! My day job, on the other hand....8^)

    So I had a few hours tonight and started in on the ADC stuff. I decided to start with the 16F877 (which used to be my "go to" microcontroller). I then started implementing the next nearest type of ADC I could find, which is represented by the 16C433. Those two appear to be making the right data, but the application is picking up way more other PICs than are actually handled in the same manner.

    I can think of at least three ways of writing the configuration bits in PBP. First, the terse way is to write everything in a single line for each register, e.g.
    Code:
    ADCON0 = %10101010
    The second is to do it a bit at a time, still referencing the registers, e.g.
    Code:
    ADCON0.7 = 1
    ADCON0.6 = 0
    etc.
    The third (and most verbose) way is to alias the register bits and set them by name, e.g.
    Code:
    ADCS1   var ADCON0.7
    ADCS0   var ADCON0.6
    
    ADCS1 = 1
    ADCS0 = 0
    There are probably other ways, too, but I've tried implementing the first and third methods. In the verbose mode I also tried to add helpful comments. There are two screenshots attached showing the results of both ways.

    Best Regards,
    Paul
    Attached Images Attached Images   

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