Jump to content

Digitally controlled preamp, PGA2310, PIC18F


markiemrboo

Recommended Posts

Looking beautiful :). Did you sketch out the initial PCB schematics by yourself, or did you use a program?

 

Thankee.

 

I used Eagle for drawing the schematics. No by-hand-drawing here! It's actually pretty cool, as it has back annotation... so it won't let the PCB layout differ from the schematic :) Makes things quite a bit easier :blush:

Share this post


Link to post
Share on other sites

Well... first of all I will start off with hardware issues.

  • The PGA gets hot quickly. This could be one of two things as far as I can tell. It could be that the analog portion of the chip has no power, and it doesn't like it for some reason... or it could be something to do with the fact one of the control lines for the PIC is connected to the ICD2 programmers programming lines, and for some reason the ICD2 likes to tie these to ground when idle (also causes another issue...). So the control lines on the PGA would be trying to draw some current. There is a current limiting resistor in series with the line though, so it would be very little... I haven't tested the behavior with the ICD2 programming line disconnected yet....
  • The IR data line is on the second ICD2 programming line, so the input is therefore always pulled low by the damn programmer. I have tested this with the programming line disconnected, and the IR sensor is picking up stuff from a remote control at least...
  • I forgot to add the relay switching output when I switched to a 28 pin chip. I have used a pin I had spare (RB3) and just soldered a wire straight to it. No biggy for a personal use prototype type thing really... :)

I may be able to fix the ICD2 issue with a opamp based comparator. If I take the MCLR pin (which is ordinarily 5v and pulled to 0v to indicate a reset, but 13v to indicate programming) and use that as the input to the comparator, and have the comparator switch on a couple of transistors (?) at more than, say, 6v... this should disconnect the ICD when it's finished programming, and automatically switch them on when it wants to program. This is assuming it keeps MCLR at 13v during programming... I think it does. I could just use a manual switch of course :) If the PGA is getting hot because of the programming lines being pulled low, however, it won't really fix this. Perhaps a diode in series with that PGA line, as it's only ever an output from the microcontroller...

 

 

 

Other than that, the digital side seems to be working so far. The software, however, is proving to be a little more difficult than I anticipated.

 

The mechanical incremental rotary encoder I bought seem to be absolute s***. Well, to be fair when the chip was running at a pissy 1MHz (instructions run at 4 times below the clock... 250KHz?) it seemed OK. When I eventually realized that the default was 1MHz, not the 8MHz I expected, this all changed! Probably contact bounce, which I have tried to debounce with some simple hardware and software... but so far it's still *completely* unacceptable. I think I may find myself spending

Edited by markiemrboo

Share this post


Link to post
Share on other sites

OK. So, this week I have been messing with assembly trying to get things working. I got fairly far (see above), but started to get very very annoyed at how long things were taking. To cut a long story short, I messed with a C compiler yesterday and what took me a week to do in assembly got done in a day of C (including learning the in's and out's of it, it's not 100% standard C)!

 

Sure, the code memory usage went up a bit... but I still have 13k left and all of the basic functionality should now be done! Plenty of space for extras. Also, the rotary encoder seems to be behaving MUCH better for some reason. It's actually seeming perfectly usable now. C is so much easier for me! I find I can concentrate on the logic much more.

 

So, rather than static images I have made a short video with the webcam of it's current state. Nearer the end I demonstrate the backlight idle timer. You'll notice the power light is still on, but the LCD appears to go dead... then wakes up again when I twiddle the rotary encoder :) You can see it switching source, and the source name changing. The volume being controlled by the rotary encoder, and the fact that it is restoring the previous (saved) source and volume upon power up.

 

I haven't drilled and componenterized the source selection PCB yet, so I intend to do that tomorrow, and possibly test the whole thing out tomorrow too, to see if I get any noise on the analog side and make sure the whole separate supply thing is OK etc.

 

Awesome!

 

http://youtube.com/watch?v=unZ0ZZsgYOg

Edited by markiemrboo

Share this post


Link to post
Share on other sites

Here's the source select PCB. A couple of flaws... the pull up resistor for the output enable pin should have been before the series current limiting resistor, otherwise it was acting as a voltage divider and pulling low ended up with that pin seeing 3.6v ish, which was still a logic 1. I tacked it on the underside of the main PCB before the series resistor, where it should have really been, and it now works.

 

The other flaw.... well, since there wasn't a package for the RCA / Phono PCB mount sockets I had to draw it myself, and I got the spacing slightly wrong. I also had to 'mod' each socket slightly so they would fit side by side... and some of them are a bit wonky, but I think they will be alright once screwed to a panel, as the screw should pull them all straight... I hope!

 

Here's a couple of pics

 

2006284038183676980_rs.jpg

 

2006211872485123143_rs.jpg

Edited by markiemrboo

Share this post


Link to post
Share on other sites

ah... the good part of being a doley :lol:

 

lol yeah, jobless is kinda rubbish though :P

 

looking good... just need some fancy matching cases now eh? :)

 

Yup. I have no more excuses to delay that any further now :blush: I think I shall be testing this preamp tomorrow.... hopefully it will be all good.

Share this post


Link to post
Share on other sites

i can't wait. markie - you truely are an electrical genious :P i swear, instead of cells, you have transistors.

 

:lol: far from an electrical genius, but thanks!

 

I just straightened up the RCA socket on the far left which looked rather wonky in the picture (but not in real life for some reason!). It looks straighter in the picture now at least.

 

Hmm... what else will today bring!

 

2000361800250774327_rs.jpg

Share this post


Link to post
Share on other sites

  • 3 years later...

Not getting to see the schematics...why?

Was thinking of designing a preamp and the ideas you had were really interesting.

4 year old thread is four years old.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...