Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Bootloaders

Status
Not open for further replies.

Zacman

New Member
So who has experience with these things. I have spent the past 3 days trying to get any of my pics to talk to the computer and have had 0 luck. I can load led blinking programs and they work fine but I am having so much trouble, I can't tell if its my max232, wiring, or any of these bootloaders. I would like to test the set up with a basic serial out program but I end up finding code for other chips that I then have to modify and then am unsure if thats causing the problem. Anyone have some simple code for a 16f876a with a 4mhz crystal that would send a character out on the serial port, at least that way I could be sure that isn't the problem. I wish I had a 20mhz crystal right now since thats what most examples run on but they are usually for the 877a anyways.

I would really like to start working with the 18f252 since that is far superior but if I can't get anything to go to the serial port I am reluctant. I would love to get the bootloaders working so I could build the chip into a circuit and reprogram it without the programmer and without possibly damaging other components.
 
Zacman said:
So who has experience with these things. I have spent the past 3 days trying to get any of my pics to talk to the computer and have had 0 luck. I can load led blinking programs and they work fine but I am having so much trouble, I can't tell if its my max232, wiring, or any of these bootloaders. I would like to test the set up with a basic serial out program but I end up finding code for other chips that I then have to modify and then am unsure if thats causing the problem. Anyone have some simple code for a 16f876a with a 4mhz crystal that would send a character out on the serial port, at least that way I could be sure that isn't the problem. I wish I had a 20mhz crystal right now since thats what most examples run on but they are usually for the 877a anyways.

The 876 and 877 are basically the same chip, just that the 877 has more pins and ports. Any code which doesn't use the extra I/O will work without change (even the HEX file will, you don't even need to reassemble).

I have RS232 examples in my tutorials which you may find helpful, the software RS232 examples use a software UART at 4MHz, and again the code will work just the same on an 876 (but may need very slight changes). The hardware examples use an 876/877 but with a 20MHz crystal, but it's simple to change to 4MHz (only a change to a register setting, which I give).

I would really like to start working with the 18f252 since that is far superior but if I can't get anything to go to the serial port I am reluctant. I would love to get the bootloaders working so I could build the chip into a circuit and reprogram it without the programmer and without possibly damaging other components.

I've used bootloader code on the 876 and 877, it works extremely well.

Bear in mind, although the 18F252 is superior, it's also more complicated and includes more instructions - most PIC code and examples on the net use 14 bit core PIC's, like the 876 and 877. If you have a need for the extra power of the 18 series, you don't have much choice - but the 876 is an extremely powerful chip and can easily perform most tasks.
 
Thanks for the code on your site. I hvae been through your tutorials a while back but I didn't realize you had this code there. I will definitely go through that and see what I can do. I just didn't want to do too much adaptation of the code until I know I can at least send something back and forth with the computer, then I will go crazy and start making something useful. Thanks for the comments.
 
I have been going through your tutorials, good stuff. I am still having problems sending stuff to the computer though. I have gotten 2 superscript n's to show up so far but thats it, I think thats more of an accident fiddling with the wires.

I was able to load a led blinking program and test that, chip works. I am using a max233a since that one doesn't require any external capacitors, I tried a 232 and a 205 as well, same result. I can't get anything to show up. I notice that the program was listed for the 876 and not thte 876a, I changed that in the asm file but would anything else be different. This is driving me absolutely crazy.

If you didn't mind checking out the datasheet on the max233a and letting me know if my wiring is correct that would be helpful. I have rc6 connected to pin1, rc7 connected to pin3, and then on the serial cable going to the computer I have the wire that sends to the computer on pin 18. I know I have the correct wire since I wired my gps through it and it worked in hyperterminal so I know which wire is which. I also have the appropriate grounds connected and vdd to the max233. As well they list some interchip connections like 17 and 12, 11 and 15 and 10 and 16. I have those connected. I also have a 4mhz oscillator and a 22pf capacitor connected to ground with each pin of the oscillator. I have a 10k resistor from mclr to vdd. Thats really all I can think of, I have the leds and stuff still connected from when I tested that program but those use RA0 and RA1.

If you have any idea it would be great, I could also take a picture if you wanted. I really just need to know this part works since this is the most useful part of the pics. If I can't get this working I might as well give up on this stuff.
 
Why don't you do a few loopback tests to see if the thing is wired up correctly.

1. First remove both the PIC and the MAX233A IC's.
2. Jumper pin18 and pin4 of the MAX233A socket. I assume the TX pin of the PC serial port is also connected to the PIC board as well.
3. Run hyper terminal and send a few characters to the serial port and see if it's echoed back.
4. If step 3 is OK, put back the MAX233A and now jumper RC6 and RC7 of the PIC socket.
5. Repeat step 3 to check if the RS232 driver is working and wired correctly to the PIC.
 
Thanks, thats exactly the kind of suggestion I was looking for, I wanted to know if you could test the max chips but I wasn't sure how. Well I ran a bunch of tests on the 233a and the 205 and I got nothing. I have thoroughly checked my serial cable though not on transmit besides checking continuity between the end and the db9 connector.

On the 233a I did some checking of the pins and here is what I was getting, on the v+ pins +10V, on the v- pins, -10V, on the computers tx -10V, .5V on the computer's receive, and +6 and -6 on C2+ / - respectively. This leads me to belive that the chip is good. Also I tried several baud rates though I did not change any of the data bit, stop bits, or parity since those should not matter in loopback.

I don't understand how I could be so wrong with just this one part. Unfortunately I didn't bring any of the max232's back to school with me so I can't try those at the moment.

I am going to take a break for today and try again tomorrow or something. It is so simple thats whats killing me and so many people are able to get everything going. I did have the same problems when I first started with the blinking leds though, the first steps are always the hardest I guess.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top