This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

AT89C51ED2 UART not work?

I downloaded AT89C51ED2 UART source code from ATMEL web.
when I connected from PC COM1 to AT89C51ED2 and sended a byte data, it sended a wrong byte data back.

Have some solutions about this @@?

Parents
  • I can programming with ISP in this development kit board. So, I think the crystal is fine.
    The ISP probably autobauds, so "any" crystal will be fine.

    is 11.059MHz same with 11.0592MHz

    close enough

    the code looks Ok, just for kicks try changing
    void serial_IT(void) interrupt 4
    to
    void serial_IT(void) interrupt 4 using 1

    All I can see is OK. Do you have something else that has a 232 connector on it? If so, try working out hyperterminal seetings.

    Erik

Reply
  • I can programming with ISP in this development kit board. So, I think the crystal is fine.
    The ISP probably autobauds, so "any" crystal will be fine.

    is 11.059MHz same with 11.0592MHz

    close enough

    the code looks Ok, just for kicks try changing
    void serial_IT(void) interrupt 4
    to
    void serial_IT(void) interrupt 4 using 1

    All I can see is OK. Do you have something else that has a 232 connector on it? If so, try working out hyperterminal seetings.

    Erik

Children
  • hi erik

    "void serial_IT(void) interrupt 4 using 1"
    why use this "using 1"?
    can I ask for why?

    that is nothing on the rs232 connector.

    Hyperterminal seetings....i will try it.

    and another question,
    can I use 11.0592Mhz crystal?
    because code says it is using 11.059MHz.

    Regard.
    Yu-Hung Hsiao

  • "void serial_IT(void) interrupt 4 using 1"
    why use this "using 1"?
    can I ask for why?

    It makes the compiler use another register stack for the ISR.

    and another question,
    can I use 11.0592Mhz crystal?
    because code says it is using 11.059MHz.

    who wrote the code was a bit lazy, and dis not include the last digit, the "correct" crystal is 11.0592

    Erik