LoRa 3 click header error

General discussion on mikroC PRO for PIC32.
Post Reply
Author
Message
Hexoplon
Posts: 5
Joined: 12 Sep 2019 10:38

LoRa 3 click header error

#1 Post by Hexoplon » 20 Mar 2020 13:52

Hi,

compiler: mikroC Pro for PIC32 4.0.0
Board: mikromedia for PIC32 - with mikrobus shield
MCU: PIC32MX460F512L

I'm trying to configure the LoRa 3 click based on the provided example from the libstock package. I have an SDR, and I am able to see that it transmits three pulses upon initialization (so I know the module works), but when it tries to write to the eeprom to enable master mode it returns a 255 error code, which the documentation says is a header error. Could someone please help me explain what that means, and what could be the problem? I am using the exact example code, but with a usb uart3 click in slot 2 to enable logging over uart

Thank you! :)

Hexoplon
Posts: 5
Joined: 12 Sep 2019 10:38

Re: LoRa 3 click header error

#2 Post by Hexoplon » 20 Mar 2020 19:26

I have the exact same issue when using a mikromedia for STM with the same setup (mikroC pro form ARM though)

Hexoplon
Posts: 5
Joined: 12 Sep 2019 10:38

Re: LoRa 3 click header error

#3 Post by Hexoplon » 22 Mar 2020 14:14

Okay, so turns out that the mikroBUS shield has the RX and TX pins wired to the same pins. Since the source code for the LoRa 3 click is not public, I have to assume the LoRa 4 source code that is on github is similar, as the cips are from the same manufacturer. After a command is sent to the chip it sends a response, always starting with 0xAA. The drivers read function reads the first byte it gets and checks if it matches the frame header, and fails if it does not. So when the tx pins on the USB UART click and the LoRa click are shared, the function recieves noise from the USB UART, and it will therefore fail.

I connected the clicks to a breadboard and wired up the pins to the mikromedia for PIC32 board, but with the tx pin of the usb uart disconnected, and it works just fine!

The question then is, is it possible to disable the uart tx pin of a mikrobus socket, to allow for using the LoRa 3 click alongside other clicks?

User avatar
stefan.filipovic
mikroElektronika team
Posts: 1135
Joined: 18 Dec 2018 10:30

Re: LoRa 3 click header error

#4 Post by stefan.filipovic » 23 Mar 2020 12:02

Hi,

Unfortunately, you cannot disable the UART TX pin of a mikroBUS socket while it's used on another socket. All you can do is to physically remove the connection between USB UART click and TX pin (G4.5).

Kind regards,
Stefan Filipović

Hexoplon
Posts: 5
Joined: 12 Sep 2019 10:38

Re: LoRa 3 click header error

#5 Post by Hexoplon » 23 Mar 2020 14:19

Would it be possible to get the source code for the LoRa 3 click driver? This would allow me to improve on some of the functionality (like the blocking calls), without having to recreate the entire code

User avatar
stefan.filipovic
mikroElektronika team
Posts: 1135
Joined: 18 Dec 2018 10:30

Re: LoRa 3 click header error

#6 Post by stefan.filipovic » 23 Mar 2020 14:29

Hi,

Please check your mailbox.

Kind regards,
Stefan Filipović

Post Reply

Return to “mikroC PRO for PIC32 General”