Jump to content


Photo

Using Harware And Software Uart For Pic


4 replies to this topic

#1 kf00115

kf00115

    Newbrie

  • EstablishedMember
  • 7 posts

Posted 01 November 2012 - 09:52 AM

Using SourceBoosterC or SourceBoosterC++ can i define and use all pins as pins of uart software or i have to use only pins of hardware uart ?

#2 JorgeF

JorgeF

    Super Enthusiast

  • EstablishedMember
  • PipPipPip
  • 273 posts
  • Gender:Male
  • Location:ES @ Europe, third rock from the Sun

Posted 02 November 2012 - 10:35 AM

Hi

I think that answer has a generic question that aplies to all compilers.
If you are using the (E)USART hardware, you are restricted to the hardware defined pins, don't forget that some PICs have function steering on I/O pins.

If you are bit-banging communications (software implemented protocol) you can use any generic digital I/O pins.


Best regards
Jorge

#3 kf00115

kf00115

    Newbrie

  • EstablishedMember
  • 7 posts

Posted 02 November 2012 - 07:00 PM

It'is ok.But i asked i can use Hardware USART and SOFTWARE USART togheter.
In my old project i used hardware usart to read GPS ( EM406A ) with dedicaded PINS, then i use 2° usart, software, to read BarCodeReader (other casual pins) and 3° software usart to communicate with SIM908. (other casual pins). Paul

#4 kf00115

kf00115

    Newbrie

  • EstablishedMember
  • 7 posts

Posted 04 November 2012 - 11:07 AM

For example in my old project i used a compiler whit 2 instrucion:

SEROUT pin,baudrate, text

SERIN pin,baudrate ,text

if i select pin of harware uart it work wirh hardware uart

if i select every all pin i have 1,2,3,4... software uart

Can i doo the same with sourceboostC ?

Thanks Paul

#5 JorgeF

JorgeF

    Super Enthusiast

  • EstablishedMember
  • PipPipPip
  • 273 posts
  • Gender:Male
  • Location:ES @ Europe, third rock from the Sun

Posted 05 November 2012 - 12:34 PM

Hi

Yes, it can be done.

As I never used them, I'm not sure if the available lib functions are suitable for it, I mean the same functions for both hardware and software USART.
In a worst case scenario, you might be able to use the lib functions for one type of USART and write your own for the other type.

BTW: Besides looking in the available libs, don't forget to look at the "example code" page at the Sourceboost site, you might find some contributed code and links that can be useful


Best regards
Jorge

Edited by JorgeF, 05 November 2012 - 12:42 PM.




Reply to this topic



  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users