PIC18LF25K22

Information and discussion regarding the main Firewing development board

PIC18LF25K22

Postby geoff138 » Sat Mar 07, 2015 2:30 pm

David

I have just received a Rev2 board . The supply jumper is connected to +5V but but the board is fitted with the 18LF25K22 version which according to the data sheet is a 3.3V device ! or am I wrong ?


Another thing is that I note that the compiler uses a software I2c could you add a hardware driver version as well ?

Regards

Geoff
geoff138
 
Posts: 7
Joined: Fri Oct 18, 2013 12:53 pm

Re: PIC18LF25K22

Postby David John Barker » Sat Mar 07, 2015 4:56 pm

Yes, it should have a 25K22 installed. If you contact me off forum I can arrange getting the correct part sent to you. In the meantime, you could install the 3.3v jumper? I will leave that up to you or if you would prefer to wait for the new part.

>Another thing is that I note that the compiler uses a software I2c could you add a
> hardware driver version as well ?

The problem was maintaining Arduino pin compatibility between Firewing main board versions, hence the libraries are software based. The good news is that with the Firewing for PIC18 board, the Arduino I2C pins are mapped to hardware I2C pins on the PIC.

A4 -> PORTB.2 (SDA2)
A5 -> PORTB.1 (SCL2)

I will see if I can put together a basic hardware library over the next few days.
User avatar
David John Barker
 
Posts: 490
Joined: Thu Nov 08, 2012 12:21 pm

Re: PIC18LF25K22

Postby Timbo » Sat Mar 07, 2015 7:08 pm

When it comes to hardware i2c vers software. I'm not sure on the advantages. Its like hardware USART. Unless timing is an issue with a interrupts its not going to be any faster.

I though would appreciate a hardware i2c lib as I intend to use interrupts a lot.
Timbo
 
Posts: 93
Joined: Fri May 03, 2013 7:51 pm

Re: PIC18LF25K22

Postby geoff138 » Sat Mar 07, 2015 8:42 pm

Yes, interrupts are the reason I want to use the hardware.
The software approach may be OK most of the time but I don't have control of the external interrupt rate, which may or may not cause problems !
geoff138
 
Posts: 7
Joined: Fri Oct 18, 2013 12:53 pm

Re: PIC18LF25K22

Postby Jerry Messina » Sat Mar 07, 2015 10:01 pm

Actually, software-based I2C and interrupts shouldn't be an issue since unlike a bit-banged UART where interrupts wreak havoc on the timing, the I2C bus isn't timing sensitive.

That said, I like using the MSSP peripheral too. It lets you run the bus a lot faster and with less code. Most software-based implementations just barely reach the 100K speed, and most chips these days will run at 400K+.
Jerry Messina
 
Posts: 278
Joined: Thu Feb 14, 2013 10:16 am

Re: PIC18LF25K22

Postby David John Barker » Sun Mar 08, 2015 1:08 pm

I've attached a hardware I2C module for the Firewing for PIC18 board. You use it in pretty much the same was as the software I2C library, except initialisation. For example,

Code: Select all
I2c.Open(I2C.Baudrate.Is100KHz)

It's had limited testing but should work fine. To install, just drag and drop the zip file into the Firewing IDE. This will automatically install the module in your user library folder. At the top of your program, just use

Code: Select all
imports HI2C
Attachments
HI2C.zip
(1.79 KiB) Downloaded 743 times
User avatar
David John Barker
 
Posts: 490
Joined: Thu Nov 08, 2012 12:21 pm


Return to Main Board

Who is online

Users browsing this forum: No registered users and 1 guest

cron

x