Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC18F micro controller to send and receive atcommand

Status
Not open for further replies.

nayakajit87

Member level 5
Joined
Aug 13, 2018
Messages
84
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
1,065
I have PIC18F45k40. I am trying to communicate with LOra module. Can someone suggest me simple example to send At command and get response for same.


i have attached datasheet for reference.View attachment Lora device..pdf
 

You should be able to use any UART driver library or write your own. The LOra module uses 115200 Bauds serial protocol so all you have to do is hook it up to the PIC TX and RX pins then configure the USART for that speed. The RXDATA and TXDATA registers are your data from the module and to the module respectively.

Brian.
 

If you are asking that question then I suggest that you will have a very hard road ahead of you with an awful lot to learn before you are successful. I don't say this to put you off but to get you to take small steps towards your goal.
To me, it sounds like you don't have much experience with microcontrollers, and at least the PIC18F family of devices.
Start with the 'flash a LED' task as that will at least get you able to program the chip (i.e. get to know the IDE, how to set the CONFIG bits, how to program the MCU, how to set the oscillator up to the required frequency, how to use a basic peripheral such as a timer and how to use the GPIOs).
Next move on to how to use the UART module to send and receive characters with a PC (i.e. how to set the Baud rate, how to map the Tx and Rx signals to a GPIO pin using PPS).
Add to that the use of ring buffers (at least for receiving characters).
Move on to sending strings through the UART to your Lora chip but at this point I'd suggest you use the PC to see the strings that it sends back.
Next learn about how to parse character strings - this is NOT a trivial thing but if you are to understand what the Lora chip is sending back to you then it will be essential. Also think about how you will handle errors, mal-formed response strings and other communication failures that might occur.
Add in the string parsing code and interpret what the Lora chip is sending back to you.
Finally you can add all of the code over the top of that to make the Lora chip send/receive whatever data you are wanting to use.
I know this sounds a lot but each step builds on what you have done in the previous step. Also your next project will be MUCH easier as you can start at the appropriate place in the sequence and build out from there. The learning curve can be quite steep (for example, I've not mentioned learning how to debug your faulty code in any of the above steps!!!!!) but once you have the basics under your belt then it becomes much easier.
Susan
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top