Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/06/09 16:49
Read: times


 
#166808 - Additional info about the board AT89S52 and ISP
Responding to: ???'s previous message
Per Westermark said:
No, he did not intend you to connect the button and the LED to UART pins.
Having a button on an otherwise unused processor pin, and a LED on another pin allows you to write helper code.
You may for example have your program toggle the LED whenever it receives a UART interrupt, or receives a character.
And you may teach your program to start a transmission every time you press the button.
Such debugging tricks can help a lot when trying to find a hardware or software problem.
You say you have seen a signal on the oscilloscope. Did it have the expected voltage levels, and the expected timing? Would you be able to manually decode a received character from the oscilloscope image?
The scope test is something you have to do in both directions. Both to make sure that both sides tries to send (and hence receive) with the same baudrate, and to make sure that the transmitters on both sides will translate the signal correctly to the receiver on the other side.
In the end, you must always try to split your problems into two smaller problems and then continue to split them further into even smaller problems until you have reached a level where you can prove - or disprove - the function of such a subdivision. Instead of starting with full-system debugging, you try one signal at a time, and verify levels and timing. See your system as an onion. Fix the layers from the inside and out. You can't see a rotten core, but it will spoil everything...


Per is leading to the right direction.

The AT89S52 microcontroller besides Port2 (P2) has another three ports P0, P1 and P3.
Excluding P3.0(RXD), P3.1(TXD), P1.5(MOSI), P1.6(MISO) and P1.7(SCK) you have another
3x8=24 -5=19 pins free for any option. At any two of these pins try to connect a Button
and a Led to another.
I suggest to connect the Button to P3.2(INT0) so you may interrupt the running program
of cource you have to setup the INT0_ISR,
and the Led to P3.7 to show any flash on, off at situations helpfull like Per said

If you remove the microcontroller from the socket while programming then this is not
the ISP (In System Progmamming) method. The ISP concept is to programm the microcontroller
on board on the running circuit using these line MOSI, MISO, SCK and RST. You have to make
an ISP header on the target board and by that you use the ISP method. One of the typical ISP
programmers is from ATMEL AT89SIP and costs about 25$. Don't try to make it, buy it.
If you have to
a. remove the microcontroller from the board,
b.connect it to an other programmer,
c.write/verify the flash,
d.disconnect from the programmer and to
e.connect to the target board,
then after a few runs the pins will be ruined and random problems will appear.

About serial communications
Have done this before ? to connect a PC sending/receiving data to a board with '51 like AT89S52 ?
The setup of serial communications at the microcontroller side have to do be done according
to the applications' specifications.
Are you using the Serial Interrupt or the polling method of the RI/TI ?
What is the speed of transiming/receiving data ?
Is the hardware about serial comms on the microcontroller setup with
the right values and procedures ?
How do you use the data received at the microcontroller side ?

If you present formatted and documented pieces of your code it would be easy to find the missing part.

Remeber to try to solve one issue at a time.

K.L.Angelis


List of 137 messages in thread
TopicAuthorDate
debugging AT89S52            01/01/70 00:00      
   where?            01/01/70 00:00      
   FAQs            01/01/70 00:00      
   Image uploaded and other corrections made            01/01/70 00:00      
      You MUST use a max232 or equivalent            01/01/70 00:00      
         MAx232 connections            01/01/70 00:00      
            if you have connected the PC RS232 directly            01/01/70 00:00      
            ambiguous?            01/01/70 00:00      
         Not necessarily!            01/01/70 00:00      
   Image of MAx232 connection for reference            01/01/70 00:00      
      89S52 - PC -> MAX232 conenctions            01/01/70 00:00      
         max 232 connection            01/01/70 00:00      
            To test MAX232            01/01/70 00:00      
               Testing a Com port using hyperterminal            01/01/70 00:00      
                  PC Loop-back            01/01/70 00:00      
                     Connections of COm port            01/01/70 00:00      
                        So what about direct on the COM port            01/01/70 00:00      
                        Check the PC's driver            01/01/70 00:00      
                           Testing an RS232 driver            01/01/70 00:00      
                              results of rs232 testing            01/01/70 00:00      
                                 Hyperterminal            01/01/70 00:00      
                                    data not displayed in echo mode in hyperterminal            01/01/70 00:00      
                                       Why do you call it hypoterminal?            01/01/70 00:00      
            I got confused regarding the value of capacitors            01/01/70 00:00      
   MAx driver and hypertermianl problem solved but...            01/01/70 00:00      
      can somebosy please reply?            01/01/70 00:00      
         Try a step by step aproach            01/01/70 00:00      
            Reg Step by step approach            01/01/70 00:00      
               How are you programming the flash memory of AT89S52            01/01/70 00:00      
                  clarifications            01/01/70 00:00      
                     Not to UART            01/01/70 00:00      
                        Additional info about the board AT89S52 and ISP            01/01/70 00:00      
                           Many issues solved but one            01/01/70 00:00      
                              How?            01/01/70 00:00      
                                 diode...connection            01/01/70 00:00      
                                    Explain with graph or text            01/01/70 00:00      
                                       clarification            01/01/70 00:00      
                                          Study the AT89S52 datasheets            01/01/70 00:00      
                                          Please read the answers you get            01/01/70 00:00      
                                             It works now!!!!            01/01/70 00:00      
                                                What series resistor?            01/01/70 00:00      
                                                   Connection of diode            01/01/70 00:00      
                                                      Please clarify            01/01/70 00:00      
                                                      the problem is NOT the 2.7V            01/01/70 00:00      
                                                         clarifications            01/01/70 00:00      
                                                            Google Ohms law            01/01/70 00:00      
                                                               Report            01/01/70 00:00      
                                                                  Measure pin voltage when held low, not hgh            01/01/70 00:00      
                                                                     trouble again            01/01/70 00:00      
                                                                        details...            01/01/70 00:00      
                                                                           Troll?            01/01/70 00:00      
                                                                              clarification            01/01/70 00:00      
                                                                                 I am not an electrical engineer I am a mechanical engineer            01/01/70 00:00      
                                                                           Do not accept everything as is, Revise your schematic            01/01/70 00:00      
                                                                              who cares?            01/01/70 00:00      
                                                                                 Short-circuit            01/01/70 00:00      
                                                                                    OOPS, anyhow            01/01/70 00:00      
                                                                              circuit revised but ....            01/01/70 00:00      
                                                                                 have changed to new buffers ..            01/01/70 00:00      
                                                                                 Post the revised schematic to check            01/01/70 00:00      
                                                                                    schematic            01/01/70 00:00      
                                                                                       there are "LED resistors" whwre are the LEDs and            01/01/70 00:00      
                                                                                          you are in deep waters            01/01/70 00:00      
                                                                                          what's the error?            01/01/70 00:00      
                                                                                       It is hopeless, but anyhow            01/01/70 00:00      
                                                                                          Vf for diode            01/01/70 00:00      
                                                                                             Too deep waters indeed, describe everything            01/01/70 00:00      
                                                                                             then how do you propose they will both work when in patralle            01/01/70 00:00      
                                                                                                Haven't you seen that he has series resistors with each LED?            01/01/70 00:00      
                                                                                                   update            01/01/70 00:00      
                                                                                                      Resistor value            01/01/70 00:00      
                                                                                                         update.-2            01/01/70 00:00      
                                                                                                            free-wheel diode            01/01/70 00:00      
                                                                                                               details of relay            01/01/70 00:00      
                                                                                                                  details of relay-2            01/01/70 00:00      
                                                                                                                     free-wheel diode always reversed            01/01/70 00:00      
                                                                                                                  No simple diode but a zener in series!            01/01/70 00:00      
                                                                                                                     zener and IN4148 already in series?            01/01/70 00:00      
                                                                                                                        clarification            01/01/70 00:00      
                                                                                                                        The datasheet is a bit confusing...            01/01/70 00:00      
                                                                                                                           no space to connect            01/01/70 00:00      
                                                                                                                              Solder it on the solder side!            01/01/70 00:00      
                                                                                                                                 Thanks..but            01/01/70 00:00      
                                                                                                                              Did you made a PCB ?            01/01/70 00:00      
                                                                                                                                 YEs true            01/01/70 00:00      
                                                                                                                                    Regarding zener and In4148            01/01/70 00:00      
                                                                                                                                       update on relay testing            01/01/70 00:00      
                                                                                                                                          testing relay using multimeter            01/01/70 00:00      
                                                                                                                                    NO, NO, NO            01/01/70 00:00      
                                                                                                                                 as opposed to            01/01/70 00:00      
                                                                                                   what about the coil across the LEDs?            01/01/70 00:00      
                                                                                                      full picture of relay            01/01/70 00:00      
                                                                                                         use preview            01/01/70 00:00      
                                                                                                            true            01/01/70 00:00      
                                                                                                      Heaven, Erik, ...            01/01/70 00:00      
                                                                                                         it works but for relay orientation            01/01/70 00:00      
                                                                                                            Look at this, too            01/01/70 00:00      
                                                                                                               latest posts            01/01/70 00:00      
                                                                                                                  Don't be so quick to experiment            01/01/70 00:00      
                                                                                                                     clarifications            01/01/70 00:00      
                                                                                                                        make simple tests like this            01/01/70 00:00      
                                                                                                                           reg the test circuit..            01/01/70 00:00      
                                                                                                                              circuit details            01/01/70 00:00      
                                                                                                                                 Still experimenting            01/01/70 00:00      
                                                                                                                              Already covered in this thread - more than once            01/01/70 00:00      
                                                                                                                                 but how did the above circuit work?            01/01/70 00:00      
                                                                                                                                    Experiments can work, even if incorrect            01/01/70 00:00      
                                                                                                                                       there is no zener diode            01/01/70 00:00      
                                                                                                                                          Don't ignore the datasheet.            01/01/70 00:00      
                                                                                                                                             thanks            01/01/70 00:00      
                                                                                                                                          Forget the sales engineer!            01/01/70 00:00      
                                                                                                                                             Minimum turn-on voltage            01/01/70 00:00      
                                                                                                                                    it HAPPENS to            01/01/70 00:00      
                                                                                                                                       ther is no other way now            01/01/70 00:00      
                                                                                                                                          where there is a will, there is a way            01/01/70 00:00      
                                                                                                                                             is this what you are suggesting?            01/01/70 00:00      
                                                                                                                                             Relay            01/01/70 00:00      
                                                                                                                                                Finally reached the shore            01/01/70 00:00      
                                                                                                                                                   Project completed ?            01/01/70 00:00      
                                                                                                                                                      yes completed            01/01/70 00:00      
                                                                                                                                                         Good luck!            01/01/70 00:00      
                                                                                                                                                            Reagrding other relays            01/01/70 00:00      
                                                                                                                                                               Scan through catalogs            01/01/70 00:00      
                                                                                                                                                               you do not need to buy there, but            01/01/70 00:00      
                                                                                                                                                                  form factor            01/01/70 00:00      
                                                                                                                                                                     The datasheets normally have the answer            01/01/70 00:00      
                                                                                                                                                                        files            01/01/70 00:00      
                                                                                                                                                                           Not so many files            01/01/70 00:00      
                                                                                                                                                                              Regarding LEd            01/01/70 00:00      
                                                                                                                                                                                 _always_ current-limited supply!            01/01/70 00:00      
                                                                                                                                                                                 Only if it contains a current limiting resistor!            01/01/70 00:00      
                                                                                                                                                                                    thanks and file updates            01/01/70 00:00      
                                                                                                                                                                                       You can enormously save user space...            01/01/70 00:00      
                                                                                                                                                                                          Hard now            01/01/70 00:00      
                                                                                                                                                                                             Correct!            01/01/70 00:00      
                                                                                                                        never do that            01/01/70 00:00      
                                                                                                         Kai, you must be able to see invisible ink            01/01/70 00:00      

Back to Subject List