you are getting closer. the scope shots show the problem - the SS pin is toggled too early. you are correct that the SS should be the LRC and the SCK the BCK in the WM8731 datasheet pictures. try to replicate what i did for the maple, and then check the scope again and see what happens. basically, do the following:
set SS high
transfer first data packet on SPI
set SS low
- It is currently Thu Jan 26, 2023 7:31 pm • All times are UTC - 8 hours [ DST ]
[SOLVED]Audio codec shield with Arduino Due
Re: Audio codec shield with Arduino Due
First data packet means a byte or a bit. Because I am thinking that it is first bit, I already tried to make it low after the first byte but I did not get any data.
- youthreewire
- Posts: 117
- Joined: Tue Jun 09, 2015 8:06 pm
Re: Audio codec shield with Arduino Due
Last edited by youthreewire on Sat Aug 01, 2015 3:34 am, edited 1 time in total.
- youthreewire
- Posts: 117
- Joined: Tue Jun 09, 2015 8:06 pm
Re: Audio codec shield with Arduino Due
I am getting this graph.As you can see the yellow peak now overlaps with the green peak.Not at the cycle of the rising edge but just at the falling edge. Is this graph right or should I change something more?
"lout" reads as 0 and "lin" reads a constant 917504 .What shall I do now?
- IMG_20150801_151815.jpg (197.55 KiB) Viewed 21953 times
"lout" reads as 0 and "lin" reads a constant 917504 .What shall I do now?
- youthreewire
- Posts: 117
- Joined: Tue Jun 09, 2015 8:06 pm
Re: Audio codec shield with Arduino Due
I tried now again and I get these values (it is either of these 3 or 4 values).
- serial values.jpg (42.5 KiB) Viewed 21953 times
- youthreewire
- Posts: 117
- Joined: Tue Jun 09, 2015 8:06 pm
Re: Audio codec shield with Arduino Due
I am getting some thing on the "lin" and "rin" but it is always a number starting with 91000 and I think it might be because these integer variables in Due are 32 bit but the values read from the codec are 16 bit. Could you please give your opinion on this.
- lin and rin.jpg (70.41 KiB) Viewed 21953 times
- youthreewire
- Posts: 117
- Joined: Tue Jun 09, 2015 8:06 pm
Re: Audio codec shield with Arduino Due
When I am making noise before the mic these values are changing but I now have to see if they can be set to 16 bit. I did lout=lin and rout=rin but I do not get an echo back. Now I have declared these integers as short int which means 16 bit but the ISR gets stuck if I used short int. I do not know how to get an echo now. Could you test my code if you have a Due?
- youthreewire
- Posts: 117
- Joined: Tue Jun 09, 2015 8:06 pm
Re: Audio codec shield with Arduino Due
WIERD thing, When I connect the oscilloscope probes to tap the SCK and SS pin I get the mic values responding to sound and additionally if I change the sensitivity (by pressing a button) on the probe I also get an echo back on one of the speakers of the headphone.Now when I remove the probes I just constant values 917504. What could be the problem?
- youthreewire
- Posts: 117
- Joined: Tue Jun 09, 2015 8:06 pm
Re: Audio codec shield with Arduino Due
that oscilloscope shot looks good.
so, if i understand correctly, it works when the scope is connected, but not elsewise? if so, first - congratulations on getting it working, but second, it must be ringing on the lines messing things up. put a 10pF capacitor where you had the scope probe and see if it makes it work.
so, if i understand correctly, it works when the scope is connected, but not elsewise? if so, first - congratulations on getting it working, but second, it must be ringing on the lines messing things up. put a 10pF capacitor where you had the scope probe and see if it makes it work.
- guest
- Site Admin
- Posts: 449
- Joined: Thu May 20, 2010 11:58 pm
Who is online
Users browsing this forum: No registered users and 1 guest