??? 06/13/08 09:38 Read: times |
#155819 - I'm getting insane! pls help! |
Guys, I am in absolute despair at the moment. I have been trying to debug my custom built AT89C51AC2 mainboard for my final year project (which I must submit in a few days altogether with a looong write-up, which I haven't even started yet). I have stripped down the board to the bare minimum components (the 89c51, MAX232CPE with 4 1UF capcitors as the datasheet tells, 18.432Mhz crystal with 22pF ceramic capacitors from each of its leads (2, obviously) to ground, a serial connector...you get the idea). I'm simply trying to connect to the bloody micocontroler serial port to burn some code on its built-in Flash (I'm not using external memory) through pc, but most of the times connection proves unsucessful. I'm using Atmel's FLIP to try dump the code to the 89c51. I have carried out the following debugging procedure in these 5 days:
-remeoved any shorts/open circuit I had on the board (should have removed them all -checked that MAX32CPE is working correctly by removing the 89c51 from the board, then shorting pins 11 and 12 of the MAX232CPE. I used some terminal software (Realterm) to send ASCII 'Hello' to serial and got echoed back 'Hello'. Therefore MAX232CPE is working well -Checked the voltage levels being sent from the MAX232 to the RXD (receive) pin of the AT89c51ac2 (pin 12). Voltage levels seem correct (+5V to 0V), -Hence Max232 is working correctly, therefore proceeded to debug the 89c51 by doing the following: -Checked the oscillator/crystal is working well by ensuring that a frequency of 18.932MHZ is being produced by using an oscilloscope to check that the ALE pin frequency is 1/6th the crystal frequency i.e. 18.432MHz/6 = 3.07MHZ. Result: Test Passed as I had exactly 3.07Mhz (5Vp-p) square wave. -Checked that EA is shorted to supply. I have +5V so, yeah its ok (I'm only interested in burning code on the built in 89c51 flash) -Checked that the PSEN is +5V and then when I press a switch on board, it goes to ground (0V). Test passed too/ -Finally cheked the RST Pin. I have connected a 10uF capacitor to supply and a 10K resistor to ground and connected the RST pin in between those two (For start up reset), also have shorted a normally open switch between the RST pin and to supply (for manual reset). When I press the RST switch i get +5V on the 89c51 RST pin and when i release it, it gkoes to ground. So, therefore Test passed too. -Checked that when I press te reset button all of the ports are +5V, test passed too (altough p0 pins are floating, but oh well, i didn't pul them up, i only need them as an input. Test passed too. So my question is, what the heck am I doing wrong?! Please help me as soon as possible, I'm in BIG TROUBLE if i dont make this project work! Thanks in advance for any help! Kai Busuttil (The guy that did a 4 year course to obtain a diploma in industrial electronics but can wave bye-bye to his qualification if he doesn't make the above work---hey that's me!) |