News:

Let's find out together what makes a PIC Tick!

Main Menu

1602 LCD INCLUDE

Started by Colin G3YHV, Feb 04, 2021, 05:42 PM

Previous topic - Next topic

Colin G3YHV

Hello all - Great to see the new forum up and running so well !
Does anybody have a copy of the include file  "I2CPrintCommand.inc"
Its for running 1602 lcd with the little driver board on the back  to
display via i2c bus. It needs to work with the latest version of the compiler.
Colin G3YHV

keytapper

I have the hardware one. But it will be easy to substitute the HbusOut for the equivalent BusOut.

BTW use 7zip to open the archive.
Ignorance comes with a cost

rick.curl

I have uploaded the files you're looking for. I did not write these.  Credit goes to George Towler, Barak Dar, and Harm van de Ven.
Since these were written in 2018, you'll need to do a few minor tweaks to make them work with the latest compiler.

-Rick

Colin G3YHV

Thanks Rich and Keytapper ( I assume keytapper is also a ham ?)
Unfortunately I dont know how to adapt the include files for the new compiler.
This is the problem....
Regards Colin

Bob (G8GFA)

Try and PM towlerg (George) as it was he that created the original code.

Bob

Bob (G8GFA)

OK, I think I have a solution.  In the include file there is a label called @Print. Find this and change it to @__Print_. Note the 2 underscores at the beginning of the label.

Colin G3YHV

Ok thanks Bob, I will give it a try tomorrow.
Recovering from root canal filing and wallpapering the stairs.
I need a beer and a telly watch to recover fully...
Colin G3YHV

keytapper

Quote from: Colin G3YHV on Feb 05, 2021, 03:02 PM( I assume keytapper is also a ham ?)
I was playing some  time on CB for a very low wattage. But absolutely never registered.

Regarding my file is the same as Rick posted, I downloaded it from the former forum. I just modifiy a little to allow to change the PCF8475 address. By that construct it will be easy to use the SPI and interface with a 74xx595. It's a matter simply to replace the Hbus* command with the similar (h)sh* one after the synchronous configuration.
Ignorance comes with a cost

Colin G3YHV

Hi Bob and Keytapper.
I did the change to the include file and it works fine again now.
I noticed warnings about Hbusout command will not be supported.
Why is this  -  what replaces it ?
Colin

top204

#9
QuoteWhy is this - what replaces it?

The newer PIC microcontrollers are starting to use very, over, complex peripherals for SPI and I2C, and each family has a slightly different method of working! So the logistics of creating different code for every single new device that is released means that I simply cannot maintain compatability on my own.

Also, now that the Proton8 compiler has procedures, most, built-in, peripheral commands are now not needed as much because libraries can be written for specific devices, that perform the same task and the code can be viewed and changed for differring devices by users of the compiler when required, and shared with other users.

keytapper

Yeah, just ignore the warning, like myself, whether using midrange family MCU. But as Mr. Les suggest we may improve the code by translating into a procedure, probably we'll need to take care of the configuration bits according certain $define statements.
Ignorance comes with a cost

Colin G3YHV

Thanks Les and Keytapper for the answer. That makes sense.
Its shame Microchip does not have any sense !
I tend to stick to chips I know- used the 18f1320 for years
Now I mainly use the 18f26k22 for my projects.
Colin

charliecoutas

Like you Colin, I love the 18F26K22 and use it for most projects. I have just about got used to its quirks.

Charlie

Dompie

Yes totally agree, I use the 18F26K22 for everything and if it really has to be smaller I will go for 12F1840 and all other chips that I used in the past have been replaced by now (only the 16F628A I replaced by the 16F1826/27 otherwise I had to replace the pcb).

Johan

OG

If a little bigger of 16F1827 is required, I would recommend 16F1579 instead of 16F628A. (for small jobs that won't require a K22)
However, it is not pin to pin.

Colin G3YHV

Hi Johan - I bought a bunch of 12f1840's From Farnell. Not had need to try them yet.
Colin

joesaliba

I am also replacing the 12F675 to the 12F1840.

Edwin

Quote from: Bob (G8GFA) on Feb 05, 2021, 05:01 PMOK, I think I have a solution.  In the include file there is a label called @Print. Find this and change it to @__Print_. Note the 2 underscores at the beginning of the label.

Hello Did you get it compiled with the new version 4.0.1.7 i tried but no succes

keytapper

#18
I tried to compile for a 16F819, but it gets
QuoteError at Line [51]      In file [X:\Carico_16F819-A\I2CPRINTHARDCOMMAND.INC]    *** Device not suitable for the Hbusin or Hbusout commands because no SSPCON2 register available! ***
Error at Line [103]    In file [X:\Carico_16F819-A\I2CPRINTHARDCOMMAND.INC]    *** Device not suitable for the Hbusin or Hbusout commands because no SSPCON2 register available! ***
But the relevant bits SSPM0~3 are in SSPCON at the SFR 0x14. Any option to hijack the compiler and work with SSPCON instead?
I got to know that the 16F819 works only as slave mode.

My friend should accept the softI2C :P  :-\
Ignorance comes with a cost

HAL

Hi Rick

It looks like the zipped file has two copies of the same I2CPrintHardCommand.inc both the print hard and print soft files seem to contain an inc file Named: I2CPrintHardCommand.inc.  When you have a chance, maybe you can take a look and see if your copy is the same as mine... 

Thanks and best regards,  Hal