Home
Prox / RFID
Verichips
Ladder Logic
[interfacing] †
Tube Joints
Key Code From Photo
SolveSpace (3d CAD)
SketchFlat (2d CAD)
Photographs
Miscellany
Resume / Consulting
Contact Me

LDmicro Forum - Can anyone share HI-TECH 9.8 please?

(you are viewing a thread; or go back to list of threads)

Can anyone share HI-TECH 9.8 please? (by Angelo)
Can anyone share HI-TECH 9.8 please?
Thu Jul 23 2020, 12:27:22
(no subject) (by paulino)
Mon Jul 27 2020, 06:56:33
(no subject) (by José)
You can now download it from my github:

https://github.com/joegil95/LdMicro32
Mon Jul 27 2020, 14:17:50
HI-TECH download doubt. (by Angelo)
To Paulino:

According to the link you send me I downloaded "UniversalToolsuite-1.37" which is a very old version of HI-TECH.
Does it work?


To Jose:

According to the link you send me I downloaded "Compiler-HTC-Pic16_9.82 "
I tried to install it but it asks me for a Licence.
Don't you have a free version of HI-TECH 9.82 that you can share?

I would appreciate a lot!
Mon Jul 27 2020, 22:23:33
(no subject) (by José)
If I remember well, you must choose free version when installing ; it's less optimized but it works fine...
Thu Jul 30 2020, 08:14:24
Thanks for the Help. (by Angelo)
Thank you so much José. I will try the HI-TECH 9.82 lite version.


Merci beaucoup José. Je vais essayer la version HI-TECH 9.82 lite.
Thu Jul 30 2020, 20:25:14
(no subject) (by Angelo)
Hi José:
Attached I sent you some screens to show you the errors I get by LDmicro when trying to read and write a serial memory.

I hope you can help me to read and write an I2C memory using LDmicro.

On pictures I show you the changes you recommend.
Best regards
Angelo.

P.D.
I program using pic basic pro. The way to program serial memories is as follows:
'Declare variables
SCL VAR PORTC.3
SDA VAR PORTC.4
Addr var word
CONT CON %10100000
.
.
.
READ:
Addr =1
I2CREAD SDA,SCL,CONT,Addr, [var1,var2,var3,var4]
.
.
.
WRITE:
Addr =1
I2CWRITE SDA,SCL,CONT,Addr, [var1,var2,var3,var4]
Mon Aug 3 2020, 13:42:24, download attachment i2c_pictures.docx
(no subject) (by José)

Hi Angelo

1) The message "Invalid I2C name in ladder" is typical of the bug existing in verson 5.4.0.4 ; it's due to the fact that Ihor, the main developper, has renamed the I2c bus from I2C to I2C1, but changes has not been done everywhere in source code and it can't work at all...

So, if you want to have your program working with I2C, must downgrade to a previous version or use my build as previouly said...

2) I2C address is determined by your memory module : look at your datasheet(between 1 and 127). And I2C registers too, according to what you wanna do with it. Your values are ugly...

3) With PIC16F887 40 pins your SCL should be 18 (RC3) and SDA 23 (RC4) ; I don't know how you can have other values as defautlt ones are OK for me. You must lok at it AFTER selecting mcu.

Heres's what I can say.
José
Mon Aug 3 2020, 14:26:26
(no subject) (by Angelo)


I will try with Ldmicro 5.3.1.0 version.

I really appreciate your help José.
Wed Aug 5 2020, 14:19:59
I2C serial memory. (by Angelo)
Hi José:

Attached I send you some problems about trying to use the I2C function.

I just want to write and read a serial I2C memory.

I hope you (or anyone on the forum) can help me.

Thank you very much in advance.
Sat Aug 8 2020, 19:24:44, download attachment i2c_read_write_memory.docx
Workaround for the message "Invalid I2C name in ladder" in v5.4.0.4 (by Flenser)
José,

The bug in verson 5.4.0.4 where you get the message "Invalid I2C name in ladder" only occurs when you insert an I2C Read or I2C Write instruction with no MCU selected.

If you select an MCU before you insert an I2C instruction then you do not get message "Invalid I2C name in ladder".
Sun Aug 9 2020, 00:42:50
(no subject) (by José)
To Angelo:

I've had a look at your doc ; your program seems to be much better.

Have you got some files in HTC\lib and HTC\obj ?

If no hex file is generated, it's probably due to some compiling errors when launching flashMCU.bat
Can you post the output of this script so that I can have an idea of the problem ; and post your ld file too.

José
Wed Aug 12 2020, 03:51:34
(no subject) (by Angelo)
Hi José:

HTC\lib
is totally empty.

HTC\obj
has a file named i2c_read_writte_memory_1.pre

I attached to this post.

greetings!!!
Wed Aug 12 2020, 14:28:10, download attachment i2c_read_writte_memory_1.pre
(no subject) (by José)

OK !

If you don't have anything in HTC\lib, it can't work at all.
Libraries are normally copied here by flashMCU.bat from their original place which is the "LIBRARIES_FOR" directory in ldmicro.exe folder => There's a config pb.

"Pre" files are of no use for me. You must post your flashMCU.bat (rename it as flashMCU.txt) and its ouput at screen when running (screen captures).

José
Thu Aug 13 2020, 03:56:26
flashMcu_screenshots (by Angelo)
Firstly I send you the screenshots and in a second post I send you the flashMcu file as a Text file.
Fri Aug 14 2020, 15:31:35, download attachment flashMcu_screenshots.docx
(no subject) (by Angelo)
Firstly I send you the screenshots and in a second post I send you the flashMcu file as a Text file.
Fri Aug 14 2020, 15:32:34, download attachment flashMcu.docx
(no subject) (by José)
OK !

I can see a first config error in flashMcu.bat at the line
"if not exist HTC\lib\UsrLib.c copy %LIB_PATH%\*.* HTC\lib"
which becomes in your environment:
"if not exist HTC\lib\UsrLib.c copy C:\Users\Usuario\Desktop\SW_5.3.1.0 - copia\ldmicro\LIBRARIES_FOR\PIC16\*.* HTC\lib"

Windows can't access the location specified in your LIB_PATH
and can't copy the libraries ; that's why your "HTC\lib" folder remains empty. LIb_PATH is derived from EXE_PATH where the pb may lie.

1) First of all, you should remove all spaces in your folder names because it can easily create such problems : rename "SW_5.3.1.0 - copia" into "SW_5.3.1.0-copia" without spaces.

2) Verify that the whole path is good from C:\Users ... to ... PIC16 and that .c and .h libraries are present in it.

3) Retry compiling and look if some files appear in HTC\lib ?

4) there must be no subsequent error as I can see in your output (for instance "can't open include file Usrlib.h")

You're not so far from having it working !
If some other pbs persist, post new screen captures...
Fri Aug 14 2020, 16:37:59
.hex file not running. (by Angelo)
Hi José:

Thanks for the recommendation. Now the software created the .hex file.

I downloaded the i2c_read_writte_memory_1.hex file into the PIC16F887 but nothing happens.

I decided to create a new file, just to test.

When I compiled this file (Test_program) just using Ldmicro, it worked O.K. when downloaded into the PIC.

When I compiled this file (Test_program) using HI-TECH and flashMcu method, I realized that nothing happens when downloaded into the PIC. I mean the program is not running.
Mon Aug 17 2020, 13:09:51, download attachment Test_program.jpg
(no subject) (by José)

Well... that's strange... I don't understand...

Are you sure your .hex is uploaded ?
Outputs of flashMCU.bat are required to have an idea.

Can you post this ld file and output files generated by ldmicro (Test_program.c, Test_program.h, ladder.h) ?

I'll have a look and if need be test with a PIC16F877 or in simulation.
Mon Aug 17 2020, 15:09:46
(no subject) (by Angelo)
Simulation works well.

Attached I will send you the files you ask for.
Tue Aug 18 2020, 13:19:53, download attachment Test_program.c
(no subject) (by Angelo)
Simulation works well.

Attached I will send you the files you ask for.
Tue Aug 18 2020, 13:20:55, download attachment Test_program.h
(no subject) (by Angelo)
Simulation works well.

Attached I will send you the files you ask for.
Tue Aug 18 2020, 13:21:57, download attachment ladder.h
(no subject) (by Angelo)
Simulation works well.

Attached I will send you the files you ask for.
Tue Aug 18 2020, 13:23:19, download attachment Test_program.ld
(no subject) (by José)
Hi Angelo

I have recompiled your Test_program.ld file and files generated with 5.3.1.0 seem to be the same as yours.

Then I have lauched FlashMCU.bat and it has generated an hex file. Here's my output during flashMCU in a zip file. Is yours similar ? I just have an error at the end because my Pickit3 was not connected ; I don't have PIC16F887, only 16F877(A).

Are you sure that your hex file is uploaded to the PIC ???
Please show me your own ouput.

José
Tue Aug 18 2020, 16:34:12, download attachment Test_program.zip
(no subject) (by Angelo)
I just bought a PIC16F877, just to test. So I tried the HI-TECH and flashMcu method, but something even stranger happened, after compiling no .hex file was created.

Compiling with the HI-TECH and flashMcu method using the PIC16F887 option the .hex is created but nothing happens into the PIC.

Attached I send you the information you requested me.

By the way, I tried compiling with Pics (16F877 and 16f887) just Ldmicro and everything was running O.K.

P.D.- Several years ago I programed with Pic Basic Pro and sometimes extrange things like this happened from one version of PBP to another so maybe some bugs are still hidden.
Wed Aug 19 2020, 20:10:54, download attachment Test_program.zip
(no subject) (by José)

OK Angelo, we'll try to understand !

1) In your output for 16F877, no hex file is generated because of an error (877_3.jpg) "can't find 0x2 words for psect..."
I don't understand what it means but it's not important for the time being.

2) Your output for 16F887 is ok, you have the "Memory summary".
But the program is not uploaded to the target because you get the message "Device not found" from PK3CMD.
It works when you upload it manually because on the one hand you select PIC16F887 (manual) and on the other one you select PIC16F887A (flashMCU). There are very little diffrences between them but you must select the right target ; and beware that 887A can run at 20 MHz while 887 only at 4 MHz.

It may explain some of your problems...
Which one have you got ? 887 I believe. If so you must edit your FlashMCU.bat and remove 'A' after -P%4 in PK3CMD.exe command line. And you musn't run at frequencies higher than 4 MHz...

Let me know if it solves the issue ?
Thu Aug 20 2020, 03:52:39
(no subject) (by Angelo)
O.K. You are right. I have an 887 version.

I will buy an 887A because I would like to run the PIC at 20 Mhz.

I appreciate your help!
Thu Aug 20 2020, 19:17:50
(no subject) (by José)

OK.

In the mean time, you may try your 887 at 4 MHz with your test_program just to know if it works fine or if the pb is somewhere else ?

Hope I'll have some time this week-end to test on my 877(A).

BR.
Fri Aug 21 2020, 15:01:20
(no subject) (by José)
Hi Angelo

I have made some tests with a PIC16F877A under version 5.3.1.0.

I think there are several problems in your ld file:
- Your frequency may be too high for a 877 not A => test at 4 MHz
- Your pull-ups are all enabled in config panel => disable all pull-ups by setting 0 instead of 0xFF in ldmicro config panel
- Your config bits seem to be wrong ; I personaly use 0x3F72
in config panel
- You can't use RB3, RB6 and RB7 with a PicKit3 programmer because these pins are used to program the target
- My buttons work in reverse logic (1 by default and 0 when pushed) and maybe yours too ?

The attached program, derived from yours, works fine with my PIC16F877A at 4 Mhz with Pickit3 on a Waveshare PIC board, using compile for HTC + FlashMcu.
Please adapt and test it with your PIC16F887 and own board.
Leds on RB1, RB2 and LB4 must light cyclically.

Let me know...
José
Sat Aug 22 2020, 07:43:03, download attachment Test_program_877_JG.ld
(no subject) (by José)
Here's another program, similar to yours, which works fine on PIC16F877A using Compile for HTC + FlashMCU (version 5.3.1.0).

I have changed:
- pin assignment (according to my board) ; we can in fact use RB3, 6 and 7 but it's better to use other pins if possible.
- pull-ups => 0
- config bits => 0x3F72
- buttons logic (according to my board)

Try to adapt it to your 887(A) ?

Beware that config bits are (strangely) very different on 877 and 887 family !!! There's one word on 877 and two words on 887.
Your value 0x060023E2 seems to be correct...
Sun Aug 23 2020, 04:14:45, download attachment Test_program_877_JGv2.ld
(no subject) (by Angelo)
Thank you very much José, tomorrow I will buy the PIC16F887A, if not available I will buy a 4 Mhz oscillator.

I will let you know how things are doing.

Nice weekend
Sun Aug 23 2020, 15:01:12
PIC16F887"A"??? There is not such microcontroller (by DanielH)
Hi!
I'm not reading completely this thread, but...
what kind of beast PIC16F887A is?

I cann't found this microcontroller in Microchipe site.
I suspect that Angelo have been confused about Microchip codes...

There is only PIC16F887, an upgrade and replacement of the old PIC16F877A (EOL).
This "new" microcontroller has different config words, in fact 2 config words in 887 versus 1 config word in 877(A), as José has stated.

---

BTW (perhaps a new thread?)

I habitually use PIC16F887, is the first microcontroller I've choosed for my OSIMPLC, Open Hardware + Free Software PLC for educative purposes, see https://osimplc.com

Of course, PIC16F887 onto OSIMPLC can be programmed using LDmicro, and the machine code can be downloaded into PIC16F887 flash memory using an USB-TTL adapter, thanks to Tiny PIC bootloader firmware preinstalled in the microcontroller and TinyBootloaderLin software under GNU/Linux https://github.com/lcgamboa/tinybldlin, or Tiny Multi Bootloder+ software under MS Windows http://tinypicbootload.sourceforge.net/ .

The second (optional) microcontroller for OSIMPLC will be ATmega1284P 44TQFP, its adapter module is in beta stage.
I'm programming this microcontroller with a LDmicro new alpha version that Ihor sent me, and downloading the machine code with the USB-TTL adapter and One Way Loader firmware and software for GNU/Linux and MS Windows http://jtxp.org/tech/onewayloader_en.htm

Best regards,
DanielH
Sun Aug 23 2020, 21:15:50
(no subject) (by José)

Hi Daniel

You're right, there's no 887A, only 887 ; the difference is only relevant for 877 and 877A. I have both, but I don't use 887 at all...

Normally, Ldmicro ought to work in ASM or C mode with all these targets, provided that the hardware and software configuration are good !
Mon Aug 24 2020, 03:10:23
(no subject) (by Angelo)
Thanks Daniel;
Hi José:
When working with Ldmicro alone IT IS POSSIBLE to configure PORTB.6 and PORTB.7 as inputs.

When working with HI-TECH and flashMcu method IT IS NOT POSSIBLE to configure PORTB.6 and PORTB.7 as inputs.

I tried the very first Test_program. That is PIC16F887 at 20 Mhz and works O.K. but never using portb.6 and portb.7 as inputs. I did not change the configuration bits neither the pull-up resistors configuration i.e. I used the default configuration.

I really do not like using portb.6 and portb.7 as outputs because when downloading the .hex by the Pickit3 they always get activated. If a motor is connected to one of them it could be dangerous.

Coming back to the original program (i2c_read_writte_memory_1) I still have trouble because it is not writing and reading the serial memory. I will continue checking out the memory configuration.

Thank you very much.

BTW, would you be so kind enough to send me more information about the configuration bits in the configuration panel.
Tue Aug 25 2020, 17:26:31
(no subject) (by José)
OK ; I'll have a look at RB6-7 as inputs. Do you activate pull-ups on your inputs ?

Can you remind me of your I2C memory module reference ? So that I can download the datasheet.
Wed Aug 26 2020, 07:56:17
(no subject) (by José)
PS:

"Configuration bits" are explained in the datasheet of the µC.
(chap 14.1 in my datasheet of 16F887).

To get a value, you must set each bit as 0 or 1 according to what you wanna do, and then encode it in hexadecimal (Reg 1 = low word, Reg 2 = high word)
Wed Aug 26 2020, 08:02:09
(no subject) (by Angelo)

model AT24C32A and also
model 24LC16B
Wed Aug 26 2020, 16:17:00
(no subject) (by José)
To Angelo:

I have studied your datasheets.

You can't use AT24C32A with existing I2C library for ldmicro because it uses 16 bit memory adresses, which is not supported as is.

But you should be able to use 24LC16B because it uses only 8 bit memory addresses.

Concerning 24LC16B:

- WP pin must be to Gnd
- A0, A1, A2 are not used

- I2C address is from 0x50 to 0x58 in hexadecimal according to the memory block you wanna use ; test 0x50 for the time being

- Write sequence is StartW(I2C_address) + Write(Mem_address) + Write(Value) which will become in ldmicro an instruction
I2C_Write with ;
address= I2C_Adress = 0x50 (for instance)
register= Mem_Address = 0 (to test first byte in memory)
value= Value to store at this address = 0x25 (for instance)

- Read sequence is StartW(I2C_address) + Write(Mem_address) + RestartR(I2CAddress) + Read(Value) which will become in ldmicro an instruction
I2C_Read with ;
address= I2C_Adress = 0x50 (same as above)
register= Mem_Address = 0 (same as above)
receive variable= variable to store the value (should give the same value as above)

Try it and let me know ?
Tue Sep 1 2020, 05:20:12
(no subject) (by Angelo)
Hi José:

Now it’s working, I am using a PIC16F877 at 20 Mhz.

Unfortunately the maximum value on any register must be 255.

Thank you very much for your help.
Greetings!!!

P.D.- ¿Aren’t you planning in the near future to allow the software to configure PORTB.6 and PORTB.7 as inputs?
Tue Sep 1 2020, 21:15:36
(no subject) (by José)

Ok Angelo !

I'm glad to see that it I2C works for you.

I'll try to take time to have a look at RB6-7...

Best regards
Wed Sep 2 2020, 03:13:30
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):