PIC18F1320 HPWM on 2 pins


Closed Thread
Results 1 to 22 of 22

Hybrid View

  1. #1
    Join Date
    Jan 2008
    Location
    Selm, Germany
    Posts
    116


    Did you find this post helpful? Yes | No

    Default Re: PIC18F1320 HPWM on 2 pins

    Hello Richard,

    to be shure I ordered PBP3 Gold and Microcode studio 5.0 today. Will see if that helps. One question: What Computer do I need for that software?

    Regards

    Mugel

  2. #2
    Join Date
    Oct 2009
    Posts
    583


    Did you find this post helpful? Yes | No

    Default Re: PIC18F1320 HPWM on 2 pins

    Hi,

    I copied the code in post #16 into microcode studio version 4.0.0.0, selecting 16F88 in the drop down menu and clicked on compile and it compiled using PBP 2.60c with MPSAM 5.06 with no errors

    The only change I had to make was change LOOP to MAIN for the main program loop

    Code:
    '************************************************* ***************
    '* Name : AnalogDEBUG *
    '* Author : [Davidpower] *
    '* [select VIEW...EDITOR OPTIONS] *
    '* : All Rights Reserved *
    '* Date : 05.12.2017 *
    '* Version : 1.0 *
    '* Notes : 16F88 no LCD *
    '* : Portb.7 analog IN 0-5V *
    '************************************************* ***************
    
    
    Include "modedefs.bas"
    
    Define OSC 4
    Define ADC_BITS 4 ' Set number of bits in result
    Define ADC_CLOCK 3 ' Set clock source (3=rc)
    Define ADC_SAMPLEUS 50 ' Set sampling time in uSec
    DEFINE DEBUG_REG PORTB
    DEFINE DEBUG_BIT 2
    DEFINE DEBUG_BAUD 9600
    DEFINE DEBUG_Mode 0
    DEFINE DEBUG_PACING 1000
    
    
    
    CMCON = 7 ' Disable analog comparator
    ANSEL = %01000000 ' set AN6 (RB7) as analog, others to digital
    ADCON1.7 = 1 '
    
    GLCDBM VAR WORD
    
    
    PAUSE 1000 ' lcd settle time
    DEBUG 10,13
    
    main:
    ADCIN 6,GLCDBM ' Read channel 6 (RB7)
    
    DEBUG "*.*",DEC5 GLCDBM,13,10
    
    
    Goto main
    Mugel if you could use the code tags to insert code it makes the post easier to read ( use [ code ] insert your code here [ / code ] - remove the spaces between square brackets and code)

    Not sure if the code works as it should, but thought I would see if it compiled on an version 2.60 with an old copy of MPSAM...

Similar Threads

  1. PIC18F1320 Config Help
    By iw2fvo in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 8th June 2013, 06:31
  2. Timer 3 config for HPWM using remappable pins
    By jimbostlawrence in forum General
    Replies: 1
    Last Post: - 5th December 2012, 14:26
  3. PIC - 8 Pins - 6 Output Pins ?
    By DanPBP in forum Off Topic
    Replies: 0
    Last Post: - 22nd October 2007, 00:23
  4. Setting up 5 HPWM pins on 18F4680
    By tcbcats in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 2nd August 2006, 05:54
  5. Compiling error with PIC18F1320
    By mazlan in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 26th November 2004, 01:01

Members who have read this thread : 1

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