• AVR Freaks

Hot!dsPIC33 Audio Communication Demo

Author
sgregory1984
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2019/08/12 07:41:19
  • Location: 0
  • Status: offline
2019/08/13 01:36:37 (permalink)
0

dsPIC33 Audio Communication Demo

Good morning,
Now, I will caveat this post with the fact that I'm a complete novice when it comes to Microchip products and I'm also very green when it comes to electronics generally... however, "theoretically" I'm trying to do something simple. 
 
The end game for me is I would like to communicate audio between two explorer 16/32 boards with the dsPIC33FJ256GP710A PIM modules installed. The first step is to utilise the demo code available which utilises the Audio pictail daughterboard with the WM8510G codec onboard to compress the audio and communicate via UART with the second board. The first issue I had is the fact that the demo code is designed for use with the explorer 16 board, not the 16/32, which comes with a serial to usb adapter chip which i could not get to work in a host/device mode. I overcame this by connecting the UART tx to the UART rx directly on the second board, which then gave me board synchronisation(LED3 switches to LED4 indicating the boards are receiving dummy frames). However, I cannot seem to get audio to transmit between the two.... and frankly a little lost as to how to debug this.
 
This may not be enough information to go on, but please bear with me as I'm a complete novice in this space!
#1

7 Replies Related Threads

    du00000001
    Just Some Member
    • Total Posts : 3064
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: dsPIC33 Audio Communication Demo 2019/08/14 12:45:22 (permalink)
    0
    Debug?
    Start with transmitting defined bytes from board 1 to board 2. Once you got this working, you can continue with reading the WM8510 and transmitting the audio codes to the 2nd board. ...

    PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
    #2
    sgregory1984
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2019/08/12 07:41:19
    • Location: 0
    • Status: offline
    Re: dsPIC33 Audio Communication Demo 2019/08/15 01:43:42 (permalink)
    0
    Altering the demo code at this stage might be a bit of a stretch for me since I've not yet learnt embedded C LoL: LoL however... The first part of the demo code transmits an "A" character across the link from board 2 to board 1, LED 4 illuminates if successfully received on board 1, board 1 then does the same in reverse - therefore in terms of known characters traversing the link, I'd say that's covered.
     
    Slight update on this too, to isolate issues with the codec, I loaded the Audio PICtail demo code which allows you to process the analog line feed, process it and send it back out of the headphone socket and this works without fault. Additionally having recompiled the demo code and programmed the device, once a sync has occurred, if I attach a DB9 connector to the TX out of board 1, I can see it transmitting "something", although clearly this is encoded and reading it straight off the serial is going to give me gibberish.
     
    Once again, apologies for the novice approach/questions - I'm very much still learning!
    #3
    sgregory1984
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2019/08/12 07:41:19
    • Location: 0
    • Status: offline
    Re: dsPIC33 Audio Communication Demo 2019/08/15 01:44:56 (permalink)
    0
    As an aside, what I want to do ultimately is use a daughter card with the TCP/IP stack and serial-over-ethernet functionality to send data via UDP.
    #4
    du00000001
    Just Some Member
    • Total Posts : 3064
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: dsPIC33 Audio Communication Demo 2019/08/15 01:58:02 (permalink)
    0
    C is C - "Embedded C" is just the use of C on an embedded system. Hope you are not too novice in C.
     
    The further steps / basic concept:
    1. Take the audio demo and duplicate it.
    2. Make sure the UART data rate is high enough.
    3. For the transmitter, "cut" the signal chain open somewhere in the processing stages and add the UART TX part. (You may even let this demo output the audio. This would give you a reference signal.)
    4. For the receiver, cut away the "analog line feed" and replace the data with the data received from the UART.
    Re TCP/IP / UDP: good luck with that.

    PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
    #5
    sgregory1984
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2019/08/12 07:41:19
    • Location: 0
    • Status: offline
    Re: dsPIC33 Audio Communication Demo 2019/08/20 08:54:09 (permalink)
    0
    OK so a little progress on this..
     
    With the help of a scope I have been poking at the WM8510 chip as I had a suspicion that the i2c control and DCI were not functioning correctly between it and the dsPIC. Sticking a probe on the SCLK line into the WM8510 confirms this - there is no clock at all. Looking at the pin outs from the dsPIC I beleive this is supposed to come out of pin 58 and should be clocking ~100KHz, but I'm seeing nothing and I'm not sure on how this is configured on the dsPIC. One other thing to note though is that the i2c configuration sequence expects that the clock line stays high, then the data line drops low to signify start of transmission - I do see the SDIN line drop low, but nothing more.
    #6
    du00000001
    Just Some Member
    • Total Posts : 3064
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: dsPIC33 Audio Communication Demo 2019/08/20 09:46:11 (permalink)
    0
    sgregory1984
    ..., I loaded the Audio PICtail demo code which allows you to process the analog line feed, process it and send it back out of the headphone socket and this works without fault.

    sgregory1984
    ...- there is no clock at all.
    ..., but I'm seeing nothing ...
    ...  see the SDIN line drop low, but nothing more.

     
    Hä? What are you currently doing ?
    Didn't you start with copying the audio demo to the 2nd board? (Expectancy: should perform just like the 1st board.)
    Not sure whether the issue is the software or your measurement "skills"  sad

    PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
    #7
    sgregory1984
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2019/08/12 07:41:19
    • Location: 0
    • Status: offline
    Re: dsPIC33 Audio Communication Demo 2019/08/20 11:20:40 (permalink)
    0
    The audio pic demo code I need to re check as I noticed some jumpers were out of place. Will check and report back tomorrow.

    Please don't be rude regarding my "skills"... Everyone has to start somewhere in life.
    #8
    Jump to:
    © 2019 APG vNext Commercial Version 4.5