[PIC]: 18F47K42

classic Classic list List threaded Threaded
5 messages Options
Jim
Reply | Threaded
Open this post in threaded view
|

[PIC]: 18F47K42

Jim
 
 All,

 I am trying to get the EUSART1 on a
 PIC18F47K42 in a 40 pin dip package
 to operate.

 This part has the Peripheral Pin Select.
 functionality that allows you to remap
 some peripheral input and outputs to more
 convenient package pins for easier pcb
 routing.
 
 I have chosen to make USART1 input on
 Pin C7 and output on pin C6.

 I am using Mikro C for PIC and have used the.
 USART library to do the USART setup, and am
 using the EasyPIC 7 dev board for programming
 and code development.

 I have set the baud rate to 19200, set USART1
 to be active, enabled the USART, transmit and
 receive on, etc.
 
 I either get nothing from the USART or
 gibberish.

 I have been through the code a dozen times
 have tried various combinations of options
 etc.

 Does anyone have any experience or ideas
 about why might this be happening?
 Or suggestions of what to try?

 Using Microchip C or MAPLB X with the Code
 Configurator Ap is not possible.

 I want to be able to use this processor
 without having to rely on Mplab X with code
 configurator.

 Any insight or suggestions would be greatly
 appreciated.

 Thanks and Regards,

Jim


--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
Reply | Threaded
Open this post in threaded view
|

Re: [PIC]: 18F47K42

Harold Hallikainen-3
If SOMETHING happens when you send a character to the UAST, I suspect it's
working, but the bit rate or bits per character is wrong (especially the
bit rate). Also, some chips allow you to invert the transmit data which
will also, of course, mess things up. Can you look at the pin on a logic
analyzer or scope? That way you can see what's going on.

Good luck!

Harold


>
>  All,
>
>  I am trying to get the EUSART1 on a
>  PIC18F47K42 in a 40 pin dip package
>  to operate.
>
>  This part has the Peripheral Pin Select.
>  functionality that allows you to remap
>  some peripheral input and outputs to more
>  convenient package pins for easier pcb
>  routing.
>
>  I have chosen to make USART1 input on
>  Pin C7 and output on pin C6.
>
>  I am using Mikro C for PIC and have used the.
>  USART library to do the USART setup, and am
>  using the EasyPIC 7 dev board for programming
>  and code development.
>
>  I have set the baud rate to 19200, set USART1
>  to be active, enabled the USART, transmit and
>  receive on, etc.
>
>  I either get nothing from the USART or
>  gibberish.
>
>  I have been through the code a dozen times
>  have tried various combinations of options
>  etc.
>
>  Does anyone have any experience or ideas
>  about why might this be happening?
>  Or suggestions of what to try?
>
>  Using Microchip C or MAPLB X with the Code
>  Configurator Ap is not possible.
>
>  I want to be able to use this processor
>  without having to rely on Mplab X with code
>  configurator.
>
>  Any insight or suggestions would be greatly
>  appreciated.
>
>  Thanks and Regards,
>
> Jim
>
>
> --
> http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
> View/change your membership options at
> http://mailman.mit.edu/mailman/listinfo/piclist
>


--
FCC Rules Updated Daily at http://www.hallikainen.com
Not sent from an iPhone.
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
Reply | Threaded
Open this post in threaded view
|

Re: [PIC]: 18F47K42

Roger Morrell
 I had a similar problem - different PIC, different compiler.  On that I looked in the part errataPIC18(L)F27/47/57K42 Family Silicon Errata and Data Sheet Clarification
Document DS80000773C-page 6 for yours it says
4. Module: Universal AsynchronousReceiver Transmitter (UART) 
4.1 Baud Rate Generator Speed SelectThe Baud Rate Generator Speed Select feature(BRGS bit in the UxCON0 register) in DALImode is not functional. The Baud RateGenerator always operates at normal speedwith 16 baud clocks per bit in DALI mode. 
Work aroundNone. 
Affected Silicon Revisions   .... this may be the problem ????????
4.2 Stop Bit Interrupt Flag 
Stop Bit interrupt flag functionality is notavailable in the CERIF bit in revision A1. Work aroundUse Timer2 with HLT and connect the UART RXport to the timer Reset trigger. Set the time-outperiod to the desired Stop bit time (for DALImode, this is equivalent to two Stop bits at 1200baud = 1.66 ms). When the Stop bit is received,the timer times out notifying end of data.Affected Silicon Revisions 
4.3 Auto-BaudWhen the UART is configured as follows, 


Roger

    On Tuesday, July 21, 2020, 08:39:08 PM PDT, Harold Hallikainen <[hidden email]> wrote:  
 
 If SOMETHING happens when you send a character to the UAST, I suspect it's
working, but the bit rate or bits per character is wrong (especially the
bit rate). Also, some chips allow you to invert the transmit data which
will also, of course, mess things up. Can you look at the pin on a logic
analyzer or scope? That way you can see what's going on.

Good luck!

Harold


>
>  All,
>
>  I am trying to get the EUSART1 on a
>  PIC18F47K42 in a 40 pin dip package
>  to operate.
>
>  This part has the Peripheral Pin Select.
>  functionality that allows you to remap
>  some peripheral input and outputs to more
>  convenient package pins for easier pcb
>  routing.
>
>  I have chosen to make USART1 input on
>  Pin C7 and output on pin C6.
>
>  I am using Mikro C for PIC and have used the.
>  USART library to do the USART setup, and am
>  using the EasyPIC 7 dev board for programming
>  and code development.
>
>  I have set the baud rate to 19200, set USART1
>  to be active, enabled the USART, transmit and
>  receive on, etc.
>
>  I either get nothing from the USART or
>  gibberish.
>
>  I have been through the code a dozen times
>  have tried various combinations of options
>  etc.
>
>  Does anyone have any experience or ideas
>  about why might this be happening?
>  Or suggestions of what to try?
>
>  Using Microchip C or MAPLB X with the Code
>  Configurator Ap is not possible.
>
>  I want to be able to use this processor
>  without having to rely on Mplab X with code
>  configurator.
>
>  Any insight or suggestions would be greatly
>  appreciated.
>
>  Thanks and Regards,
>
> Jim
>
>
> --
> http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
> View/change your membership options at
> http://mailman.mit.edu/mailman/listinfo/piclist
>


--
FCC Rules Updated Daily at http://www.hallikainen.com
Not sent from an iPhone.
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
 
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
Reply | Threaded
Open this post in threaded view
|

Re: [PIC]: 18F47K42

Harold Hallikainen-3
Also, as I recall, some the BRGH bit did not work on some chips. That may
have been fixed in later revisions. As always, it's good to look at the
errata!

Harold

>  I had a similar problem - different PIC, different compiler.  On that I
> looked in the part errataPIC18(L)F27/47/57K42 Family Silicon Errata and
> Data Sheet Clarification
> Document DS80000773C-page 6 for yours it says
> 4. Module: Universal AsynchronousReceiver Transmitter (UART) 
> 4.1 Baud Rate Generator Speed SelectThe Baud Rate Generator Speed Select
> feature(BRGS bit in the UxCON0 register) in DALImode is not functional.
> The Baud RateGenerator always operates at normal speedwith 16 baud clocks
> per bit in DALI mode. 
> Work aroundNone. 
> Affected Silicon Revisions   .... this may be the problem ????????
> 4.2 Stop Bit Interrupt Flag 
> Stop Bit interrupt flag functionality is notavailable in the CERIF bit in
> revision A1. Work aroundUse Timer2 with HLT and connect the UART RXport
> to the timer Reset trigger. Set the time-outperiod to the desired Stop bit
> time (for DALImode, this is equivalent to two Stop bits at 1200baud = 1.66
> ms). When the Stop bit is received,the timer times out notifying end of
> data.Affected Silicon Revisions 
> 4.3 Auto-BaudWhen the UART is configured as follows, 
>
>
> Roger
>
>     On Tuesday, July 21, 2020, 08:39:08 PM PDT, Harold Hallikainen
> <[hidden email]> wrote:
>
>  If SOMETHING happens when you send a character to the UAST, I suspect
> it's
> working, but the bit rate or bits per character is wrong (especially the
> bit rate). Also, some chips allow you to invert the transmit data which
> will also, of course, mess things up. Can you look at the pin on a logic
> analyzer or scope? That way you can see what's going on.
>
> Good luck!
>
> Harold
>
>
>>
>>  All,
>>
>>  I am trying to get the EUSART1 on a
>>  PIC18F47K42 in a 40 pin dip package
>>  to operate.
>>
>>  This part has the Peripheral Pin Select.
>>  functionality that allows you to remap
>>  some peripheral input and outputs to more
>>  convenient package pins for easier pcb
>>  routing.
>>
>>  I have chosen to make USART1 input on
>>  Pin C7 and output on pin C6.
>>
>>  I am using Mikro C for PIC and have used the.
>>  USART library to do the USART setup, and am
>>  using the EasyPIC 7 dev board for programming
>>  and code development.
>>
>>  I have set the baud rate to 19200, set USART1
>>  to be active, enabled the USART, transmit and
>>  receive on, etc.
>>
>>  I either get nothing from the USART or
>>  gibberish.
>>
>>  I have been through the code a dozen times
>>  have tried various combinations of options
>>  etc.
>>
>>  Does anyone have any experience or ideas
>>  about why might this be happening?
>>  Or suggestions of what to try?
>>
>>  Using Microchip C or MAPLB X with the Code
>>  Configurator Ap is not possible.
>>
>>  I want to be able to use this processor
>>  without having to rely on Mplab X with code
>>  configurator.
>>
>>  Any insight or suggestions would be greatly
>>  appreciated.
>>
>>  Thanks and Regards,
>>
>> Jim
>>
>>
>> --
>> http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
>> View/change your membership options at
>> http://mailman.mit.edu/mailman/listinfo/piclist
>>
>
>
> --
> FCC Rules Updated Daily at http://www.hallikainen.com
> Not sent from an iPhone.
> --
> http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
> View/change your membership options at
> http://mailman.mit.edu/mailman/listinfo/piclist
>
> --
> http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
> View/change your membership options at
> http://mailman.mit.edu/mailman/listinfo/piclist
>


--
FCC Rules Updated Daily at http://www.hallikainen.com
Not sent from an iPhone.
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
Jim
Reply | Threaded
Open this post in threaded view
|

RE: [PIC]: 18F47K42

Jim
In reply to this post by Jim

FYI, I looked at the errata before I posted the question.  I forgot to
include it with the list of things i did when i posted the question.
I will look at it again and I'll check the in and out with a scope again
too.



Regards,

Jim

> -------- Original Message --------
> Subject: Re: [PIC]: 18F47K42
> From: "Harold Hallikainen" <[hidden email]>
> Date: Wed, July 22, 2020 11:52 am
> To: "Microcontroller discussion list - Public." <[hidden email]>
>
>
> Also, as I recall, some the BRGH bit did not work on some chips. That may
> have been fixed in later revisions. As always, it's good to look at the
> errata!
>
> Harold
>
> >  I had a similar problem - different PIC, different compiler.  On that I
> > looked in the part errataPIC18(L)F27/47/57K42 Family Silicon Errata and
> > Data Sheet Clarification
> > Document DS80000773C-page 6 for yours it says
> > 4. Module: Universal AsynchronousReceiver Transmitter (UART) 
> > 4.1 Baud Rate Generator Speed SelectThe Baud Rate Generator Speed Select
> > feature(BRGS bit in the UxCON0 register) in DALImode is not functional.
> > The Baud RateGenerator always operates at normal speedwith 16 baud clocks
> > per bit in DALI mode. 
> > Work aroundNone. 
> > Affected Silicon Revisions   .... this may be the problem ????????
> > 4.2 Stop Bit Interrupt Flag 
> > Stop Bit interrupt flag functionality is notavailable in the CERIF bit in
> > revision A1. Work aroundUse Timer2 with HLT and connect the UART RXport
> > to the timer Reset trigger. Set the time-outperiod to the desired Stop bit
> > time (for DALImode, this is equivalent to two Stop bits at 1200baud = 1.66
> > ms). When the Stop bit is received,the timer times out notifying end of
> > data.Affected Silicon Revisions 
> > 4.3 Auto-BaudWhen the UART is configured as follows, 
> >
> >
> > Roger
> >
> >     On Tuesday, July 21, 2020, 08:39:08 PM PDT, Harold Hallikainen
> > <[hidden email]> wrote:
> >
> >  If SOMETHING happens when you send a character to the UAST, I suspect
> > it's
> > working, but the bit rate or bits per character is wrong (especially the
> > bit rate). Also, some chips allow you to invert the transmit data which
> > will also, of course, mess things up. Can you look at the pin on a logic
> > analyzer or scope? That way you can see what's going on.
> >
> > Good luck!
> >
> > Harold
> >
> >
> >>
> >>  All,
> >>
> >>  I am trying to get the EUSART1 on a
> >>  PIC18F47K42 in a 40 pin dip package
> >>  to operate.
> >>
> >>  This part has the Peripheral Pin Select.
> >>  functionality that allows you to remap
> >>  some peripheral input and outputs to more
> >>  convenient package pins for easier pcb
> >>  routing.
> >>
> >>  I have chosen to make USART1 input on
> >>  Pin C7 and output on pin C6.
> >>
> >>  I am using Mikro C for PIC and have used the.
> >>  USART library to do the USART setup, and am
> >>  using the EasyPIC 7 dev board for programming
> >>  and code development.
> >>
> >>  I have set the baud rate to 19200, set USART1
> >>  to be active, enabled the USART, transmit and
> >>  receive on, etc.
> >>
> >>  I either get nothing from the USART or
> >>  gibberish.
> >>
> >>  I have been through the code a dozen times
> >>  have tried various combinations of options
> >>  etc.
> >>
> >>  Does anyone have any experience or ideas
> >>  about why might this be happening?
> >>  Or suggestions of what to try?
> >>
> >>  Using Microchip C or MAPLB X with the Code
> >>  Configurator Ap is not possible.
> >>
> >>  I want to be able to use this processor
> >>  without having to rely on Mplab X with code
> >>  configurator.
> >>
> >>  Any insight or suggestions would be greatly
> >>  appreciated.
> >>
> >>  Thanks and Regards,
> >>
> >> Jim
> >>
> >>
> >> --
> >> http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
> >> View/change your membership options at
> >> http://mailman.mit.edu/mailman/listinfo/piclist
> >>
> >
> >
> > --
> > FCC Rules Updated Daily at http://www.hallikainen.com
> > Not sent from an iPhone.
> > --
> > http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
> > View/change your membership options at
> > http://mailman.mit.edu/mailman/listinfo/piclist
> >
> > --
> > http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
> > View/change your membership options at
> > http://mailman.mit.edu/mailman/listinfo/piclist
> >
>
>
> --
> FCC Rules Updated Daily at http://www.hallikainen.com
> Not sent from an iPhone.
> --
> http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
> View/change your membership options at
> http://mailman.mit.edu/mailman/listinfo/piclist

--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist