12f675 and midi!


Closed Thread
Results 1 to 19 of 19

Hybrid View

  1. #1
    Alaskanphoenix's Avatar
    Alaskanphoenix Guest

    Default 12f675 and midi!

    Hi!
    I would configure a 12f675 to send midi messages, i know it is possible with the serout2 command, but the rate of midi is 31250 so i must use an external 20mhz crystal and bypass the internal clock.....How?

    Thanks in advance

  2. #2
    Join Date
    Jan 2005
    Posts
    72


    Did you find this post helpful? Yes | No

    Default

    hi

    cool project!

    i did the same with an 16f876a once, here the most important settings :

    Code:
    DEFINE        OSC           20            ' oscillator speed
    define        HSER_TXSTA    20h           ' enable transmit register
    define        HSER_BAUD     31250         ' midi baud rate
    
    hserout [$90,$45,$40] ' send a midi comand. noteon ch 1. middle A. middle velocity
    this commands and defines are the same on a 12f675

    eventually it would be possible to work with the debug command on the 12f675 and you could use the internal oscillator. must be tried. the debug command is the most fastest of the serial commands.
    take a look at the pbp manual for setup the right debug settings.

    I used this hardware setup

    cheers
    i know it's only microcontrolling, but i like it!

  3. #3
    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?

  4. #4
    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.

  5. #5
    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

  6. #6
    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!

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