12f675 and midi!


Closed Thread
Results 1 to 19 of 19

Hybrid View

  1. #1
    Alaskanphoenix's Avatar
    Alaskanphoenix Guest


    Did you find this post helpful? Yes | No

    Default

    thank you mischl!

    But the hserout command "Send one or more Items to the hardware serial port" and the 12f675 hasn't one!

    I used this SerOut2 PORTB.3,12,[$B0,0,control] with a 16f84a and it's ok,but with 12f675 it doesn't work!

    Any idea?

  2. #2
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    237


    Did you find this post helpful? Yes | No

    Lightbulb

    GPIO.3 is INPUT ONLY. Use a different pin and please read the datasheet. You probably need to disable AD and comparator aswell.

  3. #3
    Alaskanphoenix's Avatar
    Alaskanphoenix Guest


    Did you find this post helpful? Yes | No

    Default

    I used gpio.2 as output to send midi messages and i must use the gpio.0 and gpio.1 as ad inputs with pots!

    I'm a beginner in pic programming,so please explain me how to configure these pins!

    Thanks a lot

  4. #4
    Join Date
    Jan 2005
    Posts
    72


    Did you find this post helpful? Yes | No

    Default

    uuups. sorry, you are right, there is no uart at the 12f675 ;-)

    look at the manual under SEROUT2 for calculating baud rate. 31250 baud needs a 20 mhz crystal.

    for analog in : some sample program with a 12F675 look at TESTX4.BAS
    i know it's only microcontrolling, but i like it!

  5. #5
    Alaskanphoenix's Avatar
    Alaskanphoenix Guest


    Did you find this post helpful? Yes | No

    Default

    I tried to use an external 20 mhz xtal with the serout2 but nothing!
    Then i used the debug command with the internal xtal and finally some message appears but wrong,probably it can't reach 31250 baud! how can i disable the internal and use the external xtal?

  6. #6
    Join Date
    Jan 2005
    Posts
    72


    Did you find this post helpful? Yes | No

    Default

    please post your code si we can take a look

    you can define the osc as usual, don't write any : @ DEVICE pic12F675, INTRC_OSC ' activates internal osc

    how looks your serout2 command?
    i know it's only microcontrolling, but i like it!

  7. #7
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    237


    Did you find this post helpful? Yes | No

    Lightbulb

    You set the use of an exernal oscillator in your programmer software, in your case you should look for HS oscillator. To make GP0 and 1 analog inputs, GP2 digital output and ADconverter 10bit, you should probably(never used the 12F675) use ....

    TRISIO = %00000011
    ANSEL = %00110011
    ADCON0 = %10000001

    ADvalue VAR WORD

    ADCIN 0,ADvalue ' Read channel 0
    ADCIN 1,ADvalue ' Read channel 1

  8. #8
    Alaskanphoenix's Avatar
    Alaskanphoenix Guest


    Did you find this post helpful? Yes | No

    Default

    I want to use gp0 and gp1 as analog inputs and gp3 as digital out to send midi messages:

    DEFINE OSC 20
    DEFINE DEBUG_BAUD 31250 ' midi baud rate
    DEFINE DEBUG_REG gpio ' Set Debug pin port
    DEFINE DEBUG_BIT 2 ' Set Debug pin bit
    DEFINE DEBUG_MODE 0

    adval var byte ' Create adval to store result
    ANSEL = %00000011 ' ----DDAA
    CMCON = 7 ' Analog comparators off

    loop: ADCIN 0, adval ' Read channel 0 to adval
    debug $b0,$00,adval
    Pause 250 ' Do it all about 10 times a second
    Goto loop ' Do it forever

    End

    how can i limit the results of analog inputs between 0-127?

    Thanks a lot

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