CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

ESP8266 Driver for PIC

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
SubhamayS



Joined: 07 Mar 2012
Posts: 34
Location: jalpaiguri, India

View user's profile Send private message

ESP8266 Driver for PIC
PostPosted: Sat Mar 09, 2019 11:29 am     Reply with quote

I have been trying to interface an ESP8266 ESP-12E WiFi module with PIC18F2550. I have searched a lot for a related resource but unable to find any. Is it possible to interface the PIC with a ESP-12E loaded with a node mcu/AT firmwire ? Of course the Tx pin of PIC need a 5v to 3.3v converter. But what I am looking for is ESP8266 driver for PIC. Can anybody help me out. Rolling Eyes
temtronic



Joined: 01 Jul 2010
Posts: 9243
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Mar 09, 2019 12:54 pm     Reply with quote

1st step. I'd suggest you usiing the low voltage( 'L' version) of that PIC . That way you can eliminate the logic level conversion devices.

2nd, use a power supply rated for at least 2 amps. Wireless devices use a LOT of power during transmit mode. WHile not long in duration, it will 'drain down' low watt PSUs.

3rd, search the forum ! There are 29 hits about the ESP8266, so odds are there is a driver(maybe mininal).

4th, Do low level testing ! Confirm you can access,change,read several registers. If there's a command for 'default configuration' try that and CONFIRM the values are correct.

Odds are if you just 'download and burn' someone else's driver/code it won't work unless it is 100% written for YOUR PIC and IDENTICAL hardware.
dluu13



Joined: 28 Sep 2018
Posts: 395
Location: Toronto, ON

View user's profile Send private message Visit poster's website

PostPosted: Sat Mar 09, 2019 1:30 pm     Reply with quote

Here's how I got my ESP8266 working:

Get yourself a USB to UART adaptor, like the SparkFun FTDI basic. Make sure it's a 3V3 version.

Then get yourself a copy of the ESP8266 AT command reference.

Use a terminal program like Realterm to try sending AT commands to the ESP8266, and take very careful notes about how the messages back and forth are formatted.

Learn the UART and string manipulation functions very well in CCS, and start sending and processing the AT commands.

Anyway, that's how I got myself started. Unfortunately, most code examples are for Arduino, which have so much stuff hidden behind abstractions it's hard to find your way around.

I should also say that I used the WiFi ESP Click board, but that should not make very much of a difference.


Last edited by dluu13 on Sat Mar 09, 2019 2:31 pm; edited 1 time in total
Ttelmah



Joined: 11 Mar 2010
Posts: 19539

View user's profile Send private message

PostPosted: Sat Mar 09, 2019 2:15 pm     Reply with quote

As a comment, ignoring the software side, it is the receive pin that most
needs handling on a connection like this.

The transmit side can simply be done with a resistor divider, but the
signal coming out of the peripheral chip will not go high enough to
be seen as a '1' on the PIC. Both the UART, and the I2C interface
require the input to go up to 0.8*Vdd, which is above the maximum
a 3.3v device can generate....

As Temtronic says, much easier to use a 3.3v PIC.

Dluu13's comments are spot on. You need to actually 'play' with the
device from a more basic environment to learn how it works, before
trying to go 'PIC'.
elcrcp



Joined: 11 Mar 2016
Posts: 62
Location: izmir / Turkey

View user's profile Send private message

PostPosted: Sat Mar 09, 2019 3:57 pm     Reply with quote

I did a few projects with esp8266 with PIC and Arduino and I should say that there are some driver files available for PIC but they are not much helpfull but you can use them as referance.
If you are using an esp8266 module, you can create your own driver easyly. Just print a few "printf("AT+..."); " commands and call them in an order. All answers for AT commands are available at AT command list. But remember, connecting to wireless or a host and sending data takes time. Sometimes 5-10 seconds needed for responses, so you need to check answer before going next line of AT command.
But if you are using a nodeMCU then you don't need to use AT commands since nodeMCU Arduino driver handles them and you can leave all automated wireless transmission job to nodeMCU but then you need to create a communication protocol between nodeMCU and PIC to ensure a known message traffic (SPI,I2C or UART, nodeMCU supports all).
_________________
There is nothing you can't do if you try
allenhuffman



Joined: 17 Jun 2019
Posts: 554
Location: Des Moines, Iowa, USA

View user's profile Send private message Visit poster's website

PostPosted: Mon Jul 15, 2019 11:26 am     Reply with quote

You could also look into alternative firmware for the ESP8266/32/etc. modules. Bo Zimmerman's "Zimodem" turns it into a Hayes-compatible modem, allowing telnet and other operations with simple "AT" commands. That can do much of the heavy lifting instead of pushing it onto the PIC.

https://github.com/bozimmerman/Zimodem
_________________
Allen C. Huffman, Sub-Etha Software (est. 1990) http://www.subethasoftware.com
Embedded C, Arduino, MSP430, ESP8266/32, BASIC Stamp and PIC24 programmer.
http://www.whywouldyouwanttodothat.com ?
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group