Uart converts character case

General discussion on mikroBasic for dsPIC30/33 and PIC24.
Post Reply
Author
Message
kingGrey
Posts: 158
Joined: 08 Mar 2007 00:40
Location: portland, OR

Uart converts character case

#1 Post by kingGrey » 26 Sep 2008 23:24

I have noticed that when ever a lowercase character is sent to the UArtx
and then read either by Uartx_Read_char OR Uartx_Read_Text(....)
the character get converted to Uppercase ? has anyone else noticed this and if so do you happen to know why?
Thank You for your help
An expert is a man who has made all the mistakes which can be made, in a narrow field.
http://www.stevenswater.com/catalog/stevensProductdl3000.aspx?SKU=%2793750%27

anton
Posts: 807
Joined: 23 Sep 2004 09:16
Location: South-Africa
Contact:

#2 Post by anton » 29 Sep 2008 11:17

Hi kingGrey,
I have noticed that when ever a lowercase character is sent to the UArtx
and then read either by Uartx_Read_char OR Uartx_Read_Text(....)
the character get converted to Uppercase ?
Can you please tell us which chip your are using and maybe paste some demo code that you used.

I've never seen this before.

Anton
Another proud user of LV 24-33A Development System and mikroPascal PRO for dsPIC :)
PortA not working? Add CMCON := 7; PortD not working? Add ADCON1 := 6;
To paste code on the forum, please use the [b] Code [/b] button !! ;)

kingGrey
Posts: 158
Joined: 08 Mar 2007 00:40
Location: portland, OR

#3 Post by kingGrey » 29 Sep 2008 16:21

I am using dspic33FJ128GP708,

Code: Select all

if Uart2_Data_Ready() = 1 then
  
   Uartx_Read_Text(txt,delim)
   Uartx_write_Text(txt)            <---- txt is usually upper case
end if
Thank You for your help
An expert is a man who has made all the mistakes which can be made, in a narrow field.
http://www.stevenswater.com/catalog/stevensProductdl3000.aspx?SKU=%2793750%27

anton
Posts: 807
Joined: 23 Sep 2004 09:16
Location: South-Africa
Contact:

#4 Post by anton » 29 Sep 2008 18:20

Hi kingGrey,

What terminal program do you use on the PC? Are you sure it isn't the terminal?

Anton
Another proud user of LV 24-33A Development System and mikroPascal PRO for dsPIC :)
PortA not working? Add CMCON := 7; PortD not working? Add ADCON1 := 6;
To paste code on the forum, please use the [b] Code [/b] button !! ;)

kingGrey
Posts: 158
Joined: 08 Mar 2007 00:40
Location: portland, OR

#5 Post by kingGrey » 29 Sep 2008 18:59

I am using the terminal program called Real term, it just awkward that it converts to upper Case.. but I will do some more research into the matter.
Thank You for your help
An expert is a man who has made all the mistakes which can be made, in a narrow field.
http://www.stevenswater.com/catalog/stevensProductdl3000.aspx?SKU=%2793750%27

anton
Posts: 807
Joined: 23 Sep 2004 09:16
Location: South-Africa
Contact:

#6 Post by anton » 29 Sep 2008 19:07

Hi kingGrey,

What happens when you send numbers? Do you get the number back or another character?

Anton
Another proud user of LV 24-33A Development System and mikroPascal PRO for dsPIC :)
PortA not working? Add CMCON := 7; PortD not working? Add ADCON1 := 6;
To paste code on the forum, please use the [b] Code [/b] button !! ;)

kingGrey
Posts: 158
Joined: 08 Mar 2007 00:40
Location: portland, OR

#7 Post by kingGrey » 29 Sep 2008 23:44

Hi anton

when numbers are sent they do appear as numbers, but for some reason in the case for the alphabets, they choose to display as uppercase.. it could be something else that I might be doing...

thanks for your help, I appreciate it.
Thank You for your help
An expert is a man who has made all the mistakes which can be made, in a narrow field.
http://www.stevenswater.com/catalog/stevensProductdl3000.aspx?SKU=%2793750%27

anton
Posts: 807
Joined: 23 Sep 2004 09:16
Location: South-Africa
Contact:

#8 Post by anton » 30 Sep 2008 06:16

Hi kingGrey,

The reason why I asked if you get a number back when you sent a number is, take for instance 'a' with ASCII value 97. When you receive this you say you get 'A' back with ASCII value 65. There is exactly 32 difference between them or binary %00100000. This is for all the characters, telling me that bit 5 doesn't get set some times.

Please have a look at your crystal and BAUD rate again.

Anton
Another proud user of LV 24-33A Development System and mikroPascal PRO for dsPIC :)
PortA not working? Add CMCON := 7; PortD not working? Add ADCON1 := 6;
To paste code on the forum, please use the [b] Code [/b] button !! ;)

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

#9 Post by Dany » 30 Sep 2008 07:59

kingGrey wrote:when numbers are sent they do appear as numbers, but for some reason in the case for the alphabets, they choose to display as uppercase.. it could be something else that I might be doing...
Hi, this may seem perhaps a stupid question to you: what happens when you send e.g. "g" with your terminal program? Is it translated to "G" or does something else happen?
Another question: what is the behaviour when using the built in (in the compiler) "UART Terminal" program? Is the behaviour also wrong?
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

Post Reply

Return to “mikroBasic for dsPIC30/33 and PIC24 General”