Sign in

username:

password:



Not a member?

Search piclist



Search tips

Subscribe to piclist



piclist by Keywords

12F675 | 16F628 | 16F84 | 16f877 | 16F877A | 16F88 | 18F458 | ADC | AVR | Bootloader | CAN | CCS | CRC | EAGLE | EEPROM | ICD | ICSP | IDE | JDM | LED | Macros | Microchip | MPLAB | PCB-CAD | PIC10F | Pic12f675 | PIC16F84 | PIC16F84A | PIC16F877 | PIC18 | PIC18F452 | PicBasic | PICC | PICSTART | PWM | RS-485 | RS232 | SMT | SPI | UART | USART | USB | Wireless | Wisp628 | Xilinx

Discussion Groups

Discussion Groups | Piclist | Impossible to send a character through UART

A discussion group for the PICMicro microcontroller. Also called the Microchip PIC, this list is dedicated to the use and abuse of this fine, simple, microcontroller. Close to topic posts are welcome, ie. general electronics.

Impossible to send a character through UART - Alain Paschoud - Oct 20 3:52:00 2003


Hi all,

I just bought a PIC16C63A. I compiled a program which now runs on it (I
toggle a pin of B-port and can see it). I just followed the example to
initialize the UART communication and want to send a byte... But
unfortunately, no byte is sent. The output voltage on PIN 17 (TX) is always
0.

The simulator (MPLAB SIM) allows to see what happens on ports, but I can't
see if a character is sent on serial line or not.

My program is very simple, it should simply send continuously the same
character. I attached it to this e-mail. Can someone tell me if I'm doing
something wrong ?

Thank you for any suggestions help or comments.

Best regards.

Alain Paschoud


Attachment (not stored)
send_char.asm
Type: application/octet-stream




(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )

Re: Impossible to send a character through UART - Chad Russel - Oct 20 21:16:00 2003

Looks like it will fly to me.

Once the UART is set up correctly, reading it is just a matter of
reading the register when the receive flag is true.

I like your PWM method. I, being a real-time freak, would just add a
clock to sync everything.

Chad

--- Alain Paschoud <> wrote:
> Hi all,
>
> I just bought a PIC16C63A. I compiled a program which now runs on it
> (I
> toggle a pin of B-port and can see it). I just followed the example
> to
> initialize the UART communication and want to send a byte... But
> unfortunately, no byte is sent. The output voltage on PIN 17 (TX) is
> always
> 0.
>
> The simulator (MPLAB SIM) allows to see what happens on ports, but I
> can't
> see if a character is sent on serial line or not.
>
> My program is very simple, it should simply send continuously the
> same
> character. I attached it to this e-mail. Can someone tell me if I'm
> doing
> something wrong ?
>
> Thank you for any suggestions help or comments.
>
> Best regards.
>
> Alain Paschoud > ATTACHMENT part 2 application/octet-stream name=send_char.asm
__________________________________






(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )

Re: Impossible to send a character through UART - Chad Russel - Oct 20 21:19:00 2003

Arrrrrrgh. Wrong message. :-( Sorry, sorry, sorry, this reply goes to
Mark. I have printed out your program Alain, and may have a chance to
look at it tonight.

Chad

--- Chad Russel <> wrote:
> Looks like it will fly to me.
>
> Once the UART is set up correctly, reading it is just a matter of
> reading the register when the receive flag is true.
>
> I like your PWM method. I, being a real-time freak, would just add a
> clock to sync everything.
>
> Chad
>
> --- Alain Paschoud <> wrote:
> > Hi all,
> >
> > I just bought a PIC16C63A. I compiled a program which now runs on
> it
> > (I
> > toggle a pin of B-port and can see it). I just followed the example
> > to
> > initialize the UART communication and want to send a byte... But
> > unfortunately, no byte is sent. The output voltage on PIN 17 (TX)
> is
> > always
> > 0.
> >
> > The simulator (MPLAB SIM) allows to see what happens on ports, but
> I
> > can't
> > see if a character is sent on serial line or not.
> >
> > My program is very simple, it should simply send continuously the
> > same
> > character. I attached it to this e-mail. Can someone tell me if I'm
> > doing
> > something wrong ?
> >
> > Thank you for any suggestions help or comments.
> >
> > Best regards.
> >
> > Alain Paschoud
> >
>
> > ATTACHMENT part 2 application/octet-stream name=send_char.asm >
> __________________________________
__________________________________





(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )

Re: Impossible to send a character through UART - Chad Russel - Oct 20 22:20:00 2003

Alain,

Initialization is wrong I believe:

MOVLW 0x20 ; not 0x40
MOVWF TXSTA

Port C is never set for output.
While in bank 1 of main:

MOVLW 0x0e
MOVWF TRISC

replace loop2 with:

loop2
movlw '55'h
btfss TXSTA, 1 ; checks to see if xmit buffer is empty
goto loop2
movwf TXREG ; load with new send character
goto loop

These are just a few problems I have found. If you still do not get it
working, get back to me.

Chad

--- Alain Paschoud <> wrote:
> Hi all,
>
> I just bought a PIC16C63A. I compiled a program which now runs on it
> (I
> toggle a pin of B-port and can see it). I just followed the example
> to
> initialize the UART communication and want to send a byte... But
> unfortunately, no byte is sent. The output voltage on PIN 17 (TX) is
> always
> 0.
>
> The simulator (MPLAB SIM) allows to see what happens on ports, but I
> can't
> see if a character is sent on serial line or not.
>
> My program is very simple, it should simply send continuously the
> same
> character. I attached it to this e-mail. Can someone tell me if I'm
> doing
> something wrong ?
>
> Thank you for any suggestions help or comments.
>
> Best regards.
>
> Alain Paschoud __________________________________





(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )