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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Konstantinos L. Angelis
07/06/09 11:49
Read: 646 times
Lamia
Greece


 
#166808 - Additional info about the board AT89S52 and ISP
Responding to: Per Westermark'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      Sivanand Somasundaram      06/24/09 09:52      
   where?      Erik Malund      06/24/09 15:08      
   FAQs      Jan Waclawek      06/24/09 15:19      
   Image uploaded and other corrections made      Sivanand Somasundaram      06/24/09 22:27      
      You MUST use a max232 or equivalent      David Prentice      06/25/09 01:19      
         MAx232 connections      Sivanand Somasundaram      06/25/09 05:37      
            if you have connected the PC RS232 directly      Erik Malund      06/25/09 06:15      
            ambiguous?      Andy Neil      06/25/09 07:02      
         Not necessarily!      Richard Erlacher      06/27/09 17:32      
   Image of MAx232 connection for reference      Sivanand Somasundaram      06/25/09 05:40      
      89S52 - PC -> MAX232 conenctions      Shoaib Ali      06/25/09 06:49      
         max 232 connection      Sivanand Somasundaram      06/30/09 06:10      
            To test MAX232      Shoaib Ali      06/30/09 17:21      
               Testing a Com port using hyperterminal      Sivanand Somasundaram      07/01/09 01:44      
                  PC Loop-back      Andy Neil      07/01/09 02:13      
                     Connections of COm port      Sivanand Somasundaram      07/01/09 04:16      
                        So what about direct on the COM port      Andy Neil      07/01/09 08:11      
                        Check the PC's driver      Hal Albach      07/01/09 10:21      
                           Testing an RS232 driver      Andy Neil      07/01/09 13:13      
                              results of rs232 testing      Sivanand Somasundaram      07/02/09 02:17      
                                 Hyperterminal      Sivanand Somasundaram      07/02/09 05:43      
                                    data not displayed in echo mode in hyperterminal      Andy Neil      07/02/09 06:08      
                                       Why do you call it hypoterminal?      Richard Erlacher      07/06/09 08:29      
            I got confused regarding the value of capacitors      Andy Neil      06/30/09 18:48      
   MAx driver and hypertermianl problem solved but...      Sivanand Somasundaram      07/03/09 04:55      
      can somebosy please reply?      Sivanand Somasundaram      07/05/09 05:52      
         Try a step by step aproach      KONSTANTINOS L. ANGELIS      07/05/09 14:53      
            Reg Step by step approach      Sivanand Somasundaram      07/05/09 23:08      
               How are you programming the flash memory of AT89S52      KONSTANTINOS L. ANGELIS      07/06/09 02:51      
                  clarifications      Sivanand Somasundaram      07/06/09 03:31      
                     Not to UART      Per Westermark      07/06/09 03:51      
                        Additional info about the board AT89S52 and ISP      KONSTANTINOS L. ANGELIS      07/06/09 11:49      
                           Many issues solved but one      Sivanand Somasundaram      07/07/09 00:58      
                              How?      Per Westermark      07/07/09 02:26      
                                 diode...connection      Sivanand Somasundaram      07/07/09 02:56      
                                    Explain with graph or text      Per Westermark      07/07/09 03:02      
                                       clarification      Sivanand Somasundaram      07/07/09 03:25      
                                          Study the AT89S52 datasheets      KONSTANTINOS L. ANGELIS      07/07/09 03:59      
                                          Please read the answers you get      Per Westermark      07/07/09 04:04      
                                             It works now!!!!      Sivanand Somasundaram      07/07/09 04:20      
                                                What series resistor?      Per Westermark      07/07/09 04:50      
                                                   Connection of diode      Sivanand Somasundaram      07/07/09 05:33      
                                                      Please clarify      Per Westermark      07/07/09 05:46      
                                                      the problem is NOT the 2.7V      Erik Malund      07/07/09 06:27      
                                                         clarifications      Sivanand Somasundaram      07/07/09 09:11      
                                                            Google Ohms law        Per Westermark      07/07/09 09:55      
                                                               Report      Sivanand Somasundaram      07/07/09 22:00      
                                                                  Measure pin voltage when held low, not hgh      Per Westermark      07/08/09 02:12      
                                                                     trouble again      Sivanand Somasundaram      07/08/09 05:25      
                                                                        details...      Sivanand Somasundaram      07/08/09 05:34      
                                                                           Troll?      Per Westermark      07/08/09 06:19      
                                                                              clarification      Sivanand Somasundaram      07/08/09 07:37      
                                                                                 I am not an electrical engineer I am a mechanical engineer      Andy Neil      07/08/09 09:14      
                                                                           Do not accept everything as is, Revise your schematic      KONSTANTINOS L. ANGELIS      07/08/09 06:39      
                                                                              who cares?      Erik Malund      07/08/09 07:40      
                                                                                 Short-circuit      Per Westermark      07/08/09 07:54      
                                                                                    OOPS, anyhow      Erik Malund      07/08/09 08:16      
                                                                              circuit revised but ....      Sivanand Somasundaram      07/12/09 22:27      
                                                                                 have changed to new buffers ..      Sivanand Somasundaram      07/12/09 23:49      
                                                                                 Post the revised schematic to check      KONSTANTINOS L. ANGELIS      07/13/09 02:22      
                                                                                    schematic      Sivanand Somasundaram      07/13/09 03:09      
                                                                                       there are "LED resistors" whwre are the LEDs and      Erik Malund      07/13/09 06:28      
                                                                                          you are in deep waters      Andy Neil      07/13/09 08:01      
                                                                                          what's the error?      Sivanand Somasundaram      07/13/09 09:20      
                                                                                       It is hopeless, but anyhow      Erik Malund      07/13/09 09:38      
                                                                                          Vf for diode      Sivanand Somasundaram      07/13/09 10:32      
                                                                                             Too deep waters indeed, describe everything      KONSTANTINOS L. ANGELIS      07/13/09 10:54      
                                                                                             then how do you propose they will both work when in patralle      Erik Malund      07/13/09 16:50      
                                                                                                Haven't you seen that he has series resistors with each LED?      Kai Klaas      07/13/09 19:08      
                                                                                                   update      Sivanand Somasundaram      07/13/09 21:25      
                                                                                                      Resistor value      Sivanand Somasundaram      07/13/09 23:10      
                                                                                                         update.-2      Sivanand Somasundaram      07/14/09 04:22      
                                                                                                            free-wheel diode      Per Westermark      07/14/09 04:25      
                                                                                                               details of relay      Sivanand Somasundaram      07/14/09 04:33      
                                                                                                                  details of relay-2      Sivanand Somasundaram      07/14/09 04:37      
                                                                                                                     free-wheel diode always reversed      Per Westermark      07/14/09 05:41      
                                                                                                                  No simple diode but a zener in series!      Kai Klaas      07/14/09 08:32      
                                                                                                                     zener and IN4148 already in series?      Sivanand Somasundaram      07/14/09 09:52      
                                                                                                                        clarification      Sivanand Somasundaram      07/14/09 09:58      
                                                                                                                        The datasheet is a bit confusing...      Kai Klaas      07/14/09 10:02      
                                                                                                                           no space to connect      Sivanand Somasundaram      07/14/09 10:12      
                                                                                                                              Solder it on the solder side!      Kai Klaas      07/14/09 10:26      
                                                                                                                                 Thanks..but      Sivanand Somasundaram      07/14/09 21:49      
                                                                                                                              Did you made a PCB ?      KONSTANTINOS L. ANGELIS      07/14/09 15:05      
                                                                                                                                 YEs true      Sivanand Somasundaram      07/14/09 21:28      
                                                                                                                                    Regarding zener and In4148      Sivanand Somasundaram      07/14/09 22:18      
                                                                                                                                       update on relay testing      Sivanand Somasundaram      07/15/09 01:12      
                                                                                                                                          testing relay using multimeter      Sivanand Somasundaram      07/15/09 01:25      
                                                                                                                                    NO, NO, NO      Erik Malund      07/15/09 06:56      
                                                                                                                                 as opposed to      Erik Malund      07/15/09 06:47      
                                                                                                   what about the coil across the LEDs?      Erik Malund      07/14/09 05:03      
                                                                                                      full picture of relay      Sivanand Somasundaram      07/14/09 05:11      
                                                                                                         use preview      Erik Malund      07/14/09 05:24      
                                                                                                            true      Sivanand Somasundaram      07/14/09 07:52      
                                                                                                      Heaven, Erik, ...      Kai Klaas      07/14/09 08:41      
                                                                                                         it works but for relay orientation      Sivanand Somasundaram      07/14/09 09:02      
                                                                                                            Look at this, too      Kai Klaas      07/14/09 09:03      
                                                                                                               latest posts      Sivanand Somasundaram      07/15/09 01:29      
                                                                                                                  Don't be so quick to experiment        Per Westermark      07/15/09 03:11      
                                                                                                                     clarifications      Sivanand Somasundaram      07/15/09 04:02      
                                                                                                                        make simple tests like this      KONSTANTINOS L. ANGELIS      07/15/09 04:44      
                                                                                                                           reg the test circuit..      Sivanand Somasundaram      07/15/09 04:58      
                                                                                                                              circuit details      Sivanand Somasundaram      07/15/09 05:20      
                                                                                                                                 Still experimenting      Per Westermark      07/15/09 05:30      
                                                                                                                              Already covered in this thread - more than once      Per Westermark      07/15/09 05:21      
                                                                                                                                 but how did the above circuit work?      Sivanand Somasundaram      07/15/09 05:27      
                                                                                                                                    Experiments can work, even if incorrect      Per Westermark      07/15/09 05:48      
                                                                                                                                       there is no zener diode      Sivanand Somasundaram      07/15/09 07:21      
                                                                                                                                          Don't ignore the datasheet.      Per Westermark      07/15/09 07:42      
                                                                                                                                             thanks      Sivanand Somasundaram      07/15/09 09:02      
                                                                                                                                          Forget the sales engineer!      Kai Klaas      07/15/09 08:01      
                                                                                                                                             Minimum turn-on voltage      Kai Klaas      07/15/09 08:38      
                                                                                                                                    it HAPPENS to      Erik Malund      07/15/09 07:11      
                                                                                                                                       ther is no other way now      Sivanand Somasundaram      07/15/09 07:17      
                                                                                                                                          where there is a will, there is a way      Erik Malund      07/15/09 08:31      
                                                                                                                                             is this what you are suggesting?      Sivanand Somasundaram      07/15/09 09:25      
                                                                                                                                             Relay      Steve M. Taylor      07/15/09 15:35      
                                                                                                                                                Finally reached the shore      Sivanand Somasundaram      07/16/09 05:15      
                                                                                                                                                   Project completed ?      KONSTANTINOS L. ANGELIS      07/16/09 05:23      
                                                                                                                                                      yes completed      Sivanand Somasundaram      07/16/09 06:51      
                                                                                                                                                         Good luck!      Kai Klaas      07/16/09 07:38      
                                                                                                                                                            Reagrding other relays      Sivanand Somasundaram      07/16/09 21:03      
                                                                                                                                                               Scan through catalogs      Per Westermark      07/17/09 01:05      
                                                                                                                                                               you do not need to buy there, but      Erik Malund      07/17/09 06:44      
                                                                                                                                                                  form factor      Sivanand Somasundaram      07/20/09 03:45      
                                                                                                                                                                     The datasheets normally have the answer      Per Westermark      07/20/09 03:56      
                                                                                                                                                                        files      Sivanand Somasundaram      07/20/09 04:23      
                                                                                                                                                                           Not so many files      Per Westermark      07/20/09 05:37      
                                                                                                                                                                              Regarding LEd      Sivanand Somasundaram      07/23/09 08:13      
                                                                                                                                                                                 _always_ current-limited supply!      Per Westermark      07/23/09 08:50      
                                                                                                                                                                                 Only if it contains a current limiting resistor!      Kai Klaas      07/23/09 08:50      
                                                                                                                                                                                    thanks and file updates      Sivanand Somasundaram      07/23/09 21:23      
                                                                                                                                                                                       You can enormously save user space...      Kai Klaas      07/24/09 08:30      
                                                                                                                                                                                          Hard now      Per Westermark      07/24/09 08:36      
                                                                                                                                                                                             Correct!      Kai Klaas      07/24/09 09:12      
                                                                                                                        never do that      Erik Malund      07/15/09 07:07      
                                                                                                         Kai, you must be able to see invisible ink      Erik Malund      07/15/09 07:03      

Back to Subject List