- It is currently Fri Jan 22, 2021 6:39 pm • All times are UTC - 8 hours [ DST ]
[SOLVED]Audio codec shield with Arduino Due
Re: Audio codec shield with Arduino Due
the codecshield needs to be operated in slave mode, so it should work fine with the SPI on that account. note that your SS pin is always high, and only goes low during data transfer. if you look at the datasheet for the wm8731, this is the opposite of what you want. you might be better of using a different pin than the ss pin, and just generate your own ss signal in the interrupt.
- guest
- Site Admin
- Posts: 449
- Joined: Thu May 20, 2010 11:58 pm
Re: Audio codec shield with Arduino Due
The codec shield is the slave? But then what about the clock signal on pin T1 (on the atmega328 like arduinos).I think T1 is receiving the clock input from the codec shield. When I disconnected the pin it is not working.I think PIN T1 goes with the timer and accepts input from the WM8731 for clock. Please check the schematic and function of T1 pin in your code. You are using Timer 1 in your code and magically this implied that you were using the T1 pin and hardwiring it to clkout on the codec shield. I exactly did not understand the function of T1 pin.Could you explain more?
It is clear that the T1 pin is for external clock input timer interrupt. The data sheet of WM8731 says that if WM8731 is master it will send the clock signal.So one more doubt is is this clock signal on CLKOUT is what they are referring to or is it SCK clock for SPI?
It is clear that the T1 pin is for external clock input timer interrupt. The data sheet of WM8731 says that if WM8731 is master it will send the clock signal.So one more doubt is is this clock signal on CLKOUT is what they are referring to or is it SCK clock for SPI?
- youthreewire
- Posts: 117
- Joined: Tue Jun 09, 2015 8:06 pm
Re: Audio codec shield with Arduino Due
there are 3 clock signals on the codecshield:
1. I2C clock
2. SPI clock
3. codec master clock
the microcontroller T1 recieves the codec master clock, which should then fire an interrupt to drive the SPI. so SPI on the codec is in slave mode, whereas the codec master clock is in master mode.
1. I2C clock
2. SPI clock
3. codec master clock
the microcontroller T1 recieves the codec master clock, which should then fire an interrupt to drive the SPI. so SPI on the codec is in slave mode, whereas the codec master clock is in master mode.
- guest
- Site Admin
- Posts: 449
- Joined: Thu May 20, 2010 11:58 pm
Re: Audio codec shield with Arduino Due
What is the value of CLKOUT. So is it absolutely necessary to get the timer interrupt from CLKOUT? And what is the frequency of master clock.I went through the data sheet but could not find it.
- youthreewire
- Posts: 117
- Joined: Tue Jun 09, 2015 8:06 pm
Re: Audio codec shield with Arduino Due
I found some information about the Due timers here:
Here they mention about connecting an external clock but TCLK0 but also mentioned about I/O Lines TIOA0 ,TIOB0. i am confused here.
Here they mention about connecting an external clock but TCLK0 but also mentioned about I/O Lines TIOA0 ,TIOB0. i am confused here.
- youthreewire
- Posts: 117
- Joined: Tue Jun 09, 2015 8:06 pm
Re: Audio codec shield with Arduino Due
that code does not allow for external clocks as one of its options. i found this arduino forum link that might be of some help:
http://forum.arduino.cc/index.php?topic=311872.0
it doesnt look like there is a standard library for doing this yet. the due is quite new, and there isnt a lot of support for it yet.
http://forum.arduino.cc/index.php?topic=311872.0
it doesnt look like there is a standard library for doing this yet. the due is quite new, and there isnt a lot of support for it yet.
- guest
- Site Admin
- Posts: 449
- Joined: Thu May 20, 2010 11:58 pm
Re: Audio codec shield with Arduino Due
I tried the sketch in the thread but I get no update in the print statement. Everything reads zero. The sketch does not detect the CLKOUT signal on pin30.
I even ran this code here:
But external IRQs still read 0.
The CLKOUT signal is a 11Mhz signal. But in both the example codes above the input signal is either a 0.5Hz signal or a 3 hz signal on pin30.
I even ran this code here:
But external IRQs still read 0.
The CLKOUT signal is a 11Mhz signal. But in both the example codes above the input signal is either a 0.5Hz signal or a 3 hz signal on pin30.
Last edited by youthreewire on Mon Jun 22, 2015 2:01 am, edited 1 time in total.
- youthreewire
- Posts: 117
- Joined: Tue Jun 09, 2015 8:06 pm
Re: Audio codec shield with Arduino Due
did you follow this instruction in the original thread:
Remove TC_CMR_BURST_XC2 from TC2UsingExternalClock.ino
this was the same problem the other thread mentions as well
Remove TC_CMR_BURST_XC2 from TC2UsingExternalClock.ino
this was the same problem the other thread mentions as well
- guest
- Site Admin
- Posts: 449
- Joined: Thu May 20, 2010 11:58 pm
Re: Audio codec shield with Arduino Due
Yes I did remove that. The CLKOUT signal is a 11Mhz signal. But in both the example codes above the input signal is either a 0.5Hz signal or a 3 hz signal on pin30. I also gave it a signal from pin13 (LED) blinking every second but still I get 0.
I wonder how your library worked for the atmega328 based arduinos. Because once we set interrupts on the external clock of 11Mhz hardly any time might be left for the main loop to run.I was still able to send data over serial port from the main loop using your library.
I wonder how your library worked for the atmega328 based arduinos. Because once we set interrupts on the external clock of 11Mhz hardly any time might be left for the main loop to run.I was still able to send data over serial port from the main loop using your library.
- youthreewire
- Posts: 117
- Joined: Tue Jun 09, 2015 8:06 pm
Who is online
Users browsing this forum: No registered users and 1 guest