The Mini AV Test Box

Questions and Comments on All Projects
ThePyroElectro
PyroElectro Admin
Posts: 1181
Joined: Mon Nov 12, 2007 9:24 pm
Location: Earth
Contact:

The Mini AV Test Box

Postby ThePyroElectro » Thu Mar 17, 2011 2:35 pm

The Mini AV Test Box Project Write-up

The Mini AV Test Box is a self countained VGA/3.5mm Audio output device for testing to see if speakers or monitors are working in a quick and easy way. The VGA signal output is simply 3 blocks of Red, Green and Blue. The audio output is a single tone that can be changed with a trimpot/knob.



Questions & Comments?

user032
Newbie Pyro
Posts: 14
Joined: Sat Jun 18, 2011 1:55 am

question regarding av test box programming

Postby user032 » Sat Jun 18, 2011 2:31 am

Hi my name is mark. I had a question about the programming of the chip for the av test box. I was mainly concerned with building the "vga video" part of this project.
I purchased PIC16F83 from mouser

mouser part #: 579-PIC16F83-04/P

I believe this is the one in the schematic. The parts list says PIC16F84 though, wrong PIC maybe?

My question:
Do we HAVE to use MPLAB IDE to program the chip (your guide for programming PICS uses this) or is another programming method ok?
Reason being is that I was unable to get one of the recommended programmers and found another one called NOPPP.

1st one if you google "noppp"


Which claimed to work with about 4 of the 16F series PICS. I used it in conjunction with "david tait's FPP" software. Instruction used here.

2nd one if you google "david tait fpp"

I left the timing in the "FPP setup" portion as is. I'm thinking this is where I could have messed up...
I ended up compiling the tester .asm file into a .hex file (MPLAB IDE), then I programmed the .hex onto the chip "succesfully" (david tait's FPP).

I went to test my box but it wasn't outputing any signal. I pretty confident in everything else (buttons, vga conn, wires, power, etc).
If I could get some help troubleshooting that would be much appreciated.

Thank you

ThePyroElectro
PyroElectro Admin
Posts: 1181
Joined: Mon Nov 12, 2007 9:24 pm
Location: Earth
Contact:

Postby ThePyroElectro » Sat Jun 18, 2011 3:18 am

Hey User032 (mark),

The PIC 16F84A (info or buy) was used for this project. 16F83 will not be compatible as its max frequency is 10 MHz and this project used a 20 MHz clock, which is the max frequency for 16F84A.

MPLAB is the official programming tool made by the manufacturer (microchip) of PICs. They have a large support network for this tool and many upgrades for the IDE. I would suggest using this tool to write firmware, compile firmware and program PICs with.

I would suggest getting a PICkit programmer. Again, this programmer is built and supported by the manufacturer of PICs.

I'm not familiar with Noppp or david tait fpp, but a very common thing people forget is to properly set the configuration bits on PICs. The programming code will be there, but the PIC won't be configured to run it properly.

I would suggest first writing a simple program to flash an LED, and make sure that your method for compiling to hex code, programming and setting the hex code works. Then, try to put the project code in and see what happens.

user032
Newbie Pyro
Posts: 14
Joined: Sat Jun 18, 2011 1:55 am

av test box

Postby user032 » Sat Jun 18, 2011 3:48 pm

Really quick response, thank you

So I need to get the PIC16F84, I'll put that down on the shopping list. I would like to get more familiar with these PICS, as my experience is next to none.

Is there any low cost PIC programmer you can recommend for this project? I have a proto-board and would like experiment a bit as you suggested, before going out and buying a proper/manufactured programmer.

I was able to find two that looked ok:

1st one if you google "multi pic programmer"

1st one if you google "ujdm"

Software they use: ic-prog and bonny gijzen.

Are these programmers worthwhile?

ThePyroElectro
PyroElectro Admin
Posts: 1181
Joined: Mon Nov 12, 2007 9:24 pm
Location: Earth
Contact:

Postby ThePyroElectro » Sun Jun 19, 2011 10:03 pm

Hi user032 (mark),

My opinion is: I would not recommend any 3rd party low cost programmer on the simple fact that they offer no support for when things go wrong.

Getting a proper microchip programmer like I suggested before is not much more expensive than building your own and there are many, many people who use them so many debug questions will already be answered on the internet. Similarly, with official programmers you don't have to use any 3rd party programming tools like ic-prog which are not updated regularly like mplab is.

So in my humble opinion those programmers on not worthwhile when for $50 more you can get the official one.

user032
Newbie Pyro
Posts: 14
Joined: Sat Jun 18, 2011 1:55 am

av test box

Postby user032 » Mon Jun 20, 2011 2:08 pm

You make a good point there. I looked at the full list of supported devices and it is a pretty good list. :D

I took a closer look at the bundled board with the starter kit. It seems to support up to 20pin chips, and is a demo board.

The boards basically offer a connection to the six pins (ICD I believe) on the programmer correct? So it is not entirely necessary.

Would it be possible to buy the programmer seperate. Here

found programmer alone for $34.99 on mouser

and use a proto-board as the connection from chip to programmer?

Main reason is to save some money and allow for bigger chips (I have been wanting to try a project with PIC18F2550).

ThePyroElectro
PyroElectro Admin
Posts: 1181
Joined: Mon Nov 12, 2007 9:24 pm
Location: Earth
Contact:

Postby ThePyroElectro » Mon Jun 20, 2011 4:07 pm

Hi user032 (mark),

The demo-board is nice to have to test code (this can be helpful for debugging code on other PICs), but it is not necessary.

The programming port is 6 pins, please see this page for more info:
http://www.pyroelectro.com/tutorials/pic_breadboard/programming.html

The white cable is a common ISP (In-circuit Serial Programming) cable. The pinout and connections are all explained in the website above. In fact, you might want to read the whole PIC Prototyping tutorial, because it explains how the 6 pin header works and connects to PICs to program them.

If you are trying to save money, go for the stand-alone programmer + ISP cable and make the connections like the tutorial shows to your 18 series PIC on protoboard. If everything is connected properly it will work. If you can, do put out some extra money for programmer + demo board + ISP cable, it will help you during debug process, which will save you time.

user032
Newbie Pyro
Posts: 14
Joined: Sat Jun 18, 2011 1:55 am

av test box

Postby user032 » Mon Jun 20, 2011 6:12 pm

That's exactly what I was looking for! The ISP part of a couple of circuits I've seen had me confused a bit.

And just to make sure this ISP setup will work on the project at hand right?
Maybe just slower because it is serial and not direct to some demo board?

ThePyroElectro
PyroElectro Admin
Posts: 1181
Joined: Mon Nov 12, 2007 9:24 pm
Location: Earth
Contact:

Postby ThePyroElectro » Mon Jun 20, 2011 6:35 pm

ISP style programming ports are common across almost all PIC microcontrollers. Yes it will work with this project because it's what I used to program the PIC in this project.

Speed will not change because the demo board will use the exact same pins and programming connections.

user032
Newbie Pyro
Posts: 14
Joined: Sat Jun 18, 2011 1:55 am

av test box

Postby user032 » Mon Jun 20, 2011 11:11 pm

I just received 4 PIC16F84A from a friend, so all I need is the programmer and ISP cable (and diode, caps for ISP circuit).

Thank you so much for your help ThePyroElectro! I'll place an order on mouser for the required stuff. In the mean time I'll read up on the whole programming process more in depth.

user032
Newbie Pyro
Posts: 14
Joined: Sat Jun 18, 2011 1:55 am

av test box

Postby user032 » Sun Jun 26, 2011 4:44 am

Hi again Pyroelectro, today I received my programmer in the mail. :D

I was able to install the software without problems but the MPLAB IDE software wouldn't allow my Pickit2 to connect to PIC16F84A. It says that it is unsupported as a programmer for this chip. I tried the other included software (pickit2 programmer v2.50) and this one does accept the chip. Am I missing something or is it just some setting?

Also I tried the pickit2 programmer software just to see if it would work (didn't see any options for config bits). Was asking for a .hex so I compiled in MPLAB IDE, programmed according to

Pin 1 to pin 4 of ucontroller
Pin 2 to pin 14 of controller
pin 3 to pin 5 of controller
pin 4 to pin 13 of controller
pin 5 to pin 12 of controller

outside of circuit
then put back in circuit but no luck.

EDIT: I realize your video on programming PIC used C18 compiler suite for "new project specs" This is not necessary because we have a .asm and not a .c file right?

ThePyroElectro
PyroElectro Admin
Posts: 1181
Joined: Mon Nov 12, 2007 9:24 pm
Location: Earth
Contact:

Postby ThePyroElectro » Mon Jun 27, 2011 5:06 pm

Hi User032,

16F84A is supported by Pickit2: Pickit2 Supported Devices List

You only need mplab, and since you are using assembly (MPASM) you do not need to install the C18 libraries. You just use MPLAB for the whole process from writing code, to assembling the hex, to programming the chip.

That text might be a little confusing, but I have the same connections for programming the chip in the schematic: http://www.pyroelectro.com/projects/audio_video_tester/schematic.html

Please notice that:
[1] Pin 1 to pin 4 of ucontroller needs to be pulled to +5v with a 10kohm pullup resistor
[2] You need to either supply power via the programmer in mplab OR you need to supply power to the circuit, when connecting to mplab.

Regardless of whether you are using Assembly, C or Basic, you do need to create a new 'project' in mplab for your project. You will select MPASM instead of C18 since the programming is all Assembly.

::EDIT::

As I look through the supported device list, the programmer is capable of programming the device, but MPLAB doesn't support it.

I found this solution
PICkit2 software does support the PIC16F84A. To program the chip you should just run a PICkit2V2.exe application in addition to the main MPLAB IDE program. To do that you should first deselect PICkit2 debugger and programmer support from the MPLAB Debugger->Select Tool and Programmer->Select Programmer menus (set the tools to MPLAB SIM and NONE resp.).

After deselecting the PICkit2 in MPLAB you can connect your PICkit2 to a USB port and run the PICkit2V2.exe application. When the application has detected your PICkit2 you may connect it to your PIC16F84A ICSP pins and select Check Communication in the PICkit2 application menu under Tools. Your PIC16F84A should now be detected and ready for being programmed.


In the microchip forums: http://www.microchip.com/forums/tm.aspx?m=370658

user032
Newbie Pyro
Posts: 14
Joined: Sat Jun 18, 2011 1:55 am

av test box

Postby user032 » Mon Jun 27, 2011 10:15 pm

Ok so I connected the ICSP part of the circuit. Went to set settings in MPLAB IDE then I launched the Pickit2 program. It gave me an error about the VPP voltage.

"pickit 2 vpp voltage level error"

check connections and parts.


I double checked for shorts and other problems. It looked good, tried it again but same error. The troubleshooter told me that VPP for this family was 12v (not sure how it came to that conclusion, couldn't even recognize the PIC).

I tried using the circuits power supply and without. Made sure I had 6pin header
PIN1-------------->ucontroller PIN4
--------------->ucontroller PIN14 via 10k resistor

Is it just not reaching the proper VPP voltage?

ThePyroElectro
PyroElectro Admin
Posts: 1181
Joined: Mon Nov 12, 2007 9:24 pm
Location: Earth
Contact:

Postby ThePyroElectro » Mon Jun 27, 2011 10:54 pm

16F84A uses +5v power (Range:4.5v->5.5v). If you have any doubt that your VPP is not +5v, use a digital multimeter and check the voltage.

The Pickit2 has an arrow pointing to pin1 of the ICSP connector. If you wire everything up like I did in the schematic for the project, the programmer software will recognize and be able to program the 16F84A.

Image

user032
Newbie Pyro
Posts: 14
Joined: Sat Jun 18, 2011 1:55 am

av test box

Postby user032 » Tue Jun 28, 2011 1:42 am

I checked out the reading on VPP and it was about 7.6-7.7 which is not close to 12v and over 5v. Some tests for continuity revealed that my programmers PIN1 and PIN2 were shorted. Guess I didn't do a good job of checking earlier. :oops:

I am now able to program it as before (out of circuit). I think I am really close to getting this working. I think it's just the config bits now. Looking through them though I only have 4.

They are

Oscillator Selection Bits
Watchdog Timer
Power-up Timer Enable bit
Code Protection bit

Each with multiple options for "settings"
It seems like there is a lack of config bits (The programming PICs vid had much more)? Programming with Pickit2 (due to lack of support in MPLAB), just to stay current.


Return to “Projects”

Who is online

Users browsing this forum: No registered users and 2 guests