Search found 75 matches

by AllenM
14 Jan 2018 17:13
Forum: mikroC PRO for PIC General
Topic: One Wire and DS18B20 Revisited
Replies: 4
Views: 1771

Re: One Wire and DS18B20 Revisited

I tested this by freezing the sensor on real hardware. The signs work out correctly.
by AllenM
08 Jan 2018 06:08
Forum: mikroC PRO for PIC General
Topic: One Wire and DS18B20 Revisited
Replies: 4
Views: 1771

One Wire and DS18B20 Revisited

For the last two weeks we have been having sub zero temperatures (-15 degrees F today) and I noticed that my DS18B20 units were not reporting the temperature correctly. This is the working code I came up with after discovering some caveats mentioned below: // ====================================== /...
by AllenM
04 Oct 2017 19:16
Forum: mikroC PRO for PIC General
Topic: Bug in recent versions
Replies: 9
Views: 3624

Re: Bug in recent versions

This is an old post but I want to publish the remedy. The problem was not with the compiler but rather when the compiler was installed it apparently changed some of the project settings. The problem was that the 4x pll was disabled. It was enabled in earlier versions but this version shows it disabl...
by AllenM
01 Dec 2016 03:59
Forum: mikroC PRO for PIC General
Topic: Bug in recent versions
Replies: 9
Views: 3624

Re: Bug in recent versions

No. I don't have any 18F45K22 units on hand. In the past I have used them interchangeably as long as the code and data fit.
by AllenM
30 Nov 2016 04:23
Forum: mikroC PRO for PIC General
Topic: Bug in recent versions
Replies: 9
Views: 3624

Re: Bug in recent versions

I have attached photos of my dev board. However, this project has been in use monitoring greenhouses and other structures for several years. I have also posted code on LibStock pertaining to the use of DS18b20 devices. I have been using them successfully for some time now. http://libstock.mikroe.com...
by AllenM
28 Nov 2016 22:27
Forum: mikroC PRO for PIC General
Topic: Bug in recent versions
Replies: 9
Views: 3624

Re: Bug in recent versions

My hardware is an EasyPIC v7.

I made no hardware changes when testing the different compiler versions.
The DS18b20 jumper is set to RE2 and there is a pull up on RE2 (using the on board switch).
PIC18F46K22
by AllenM
27 Nov 2016 22:16
Forum: mikroC PRO for PIC General
Topic: Bug in recent versions
Replies: 9
Views: 3624

Bug in recent versions

I have noticed that if I compile projects using the one wire library for the ds18b20 not all compiler versions function in Windows 10. v6.4.0 works fine, v6.6.1 and v6.6.3 do not. The later versions report exactly the same temperature when the ds18b20 is not even present. I have not noticed any prob...
by AllenM
17 May 2015 20:54
Forum: mikroC PRO for PIC General
Topic: keypad 4x4
Replies: 13
Views: 4916

Re: keypad 4x4

I'm sorry this is so late. For the benefit of future readers. I set row=4 to break out of the for loop.
by AllenM
11 Apr 2015 17:32
Forum: mikroC PRO for PIC General
Topic: 1-wire
Replies: 10
Views: 5311

Re: 1-wire

You could put a service socket on your device so when you need to replace a device you could just plug it in there and use code like this below to read the ID and copy it to the appropriate storage location. http://www.libstock.com/projects/view/1022/ds18b20-retrieving-the-unique-64-bit-serial-code-...
by AllenM
11 Apr 2015 17:18
Forum: mikroC PRO for PIC General
Topic: How to round a float?
Replies: 3
Views: 2102

Re: How to round a float?

Note also for whole numbers, if you convert float to int it does not round off. I merely truncates the decimal values. Adding .5 before truncating resolves this issue.
by AllenM
11 Apr 2015 16:22
Forum: mikroC PRO for PIC General
Topic: keypad 4x4
Replies: 13
Views: 4916

Re: keypad 4x4

The logic of reading a matrix keyboard is really pretty simple. When a key is pressed the row and column are shorted together. In my example I used pull down resistors to hold the columns to a low level. Then, one at a time, I bring each row up. If a key is pressed the corresponding column will also...
by AllenM
21 Dec 2014 04:13
Forum: mikroC PRO for PIC General
Topic: Silly IF/ELSE problem.
Replies: 18
Views: 7471

Re: Silly IF/ELSE problem.

I had a similar problem some time ago. It had nothing to do with the LCD. I failed to declare string arrays large enough. If I recall correctly, I changed some variables from byte to integer and forgot to increase the array size when converting them to strings for display on the LCD. Some of the dat...
by AllenM
21 Dec 2014 04:02
Forum: mikroC PRO for PIC General
Topic: Problem with Soft_SPI
Replies: 7
Views: 2922

Re: Problem with Soft_SPI

If I send: 12 34 56 78 9A (HEX) all the 5 bytes are into the array . If I send 12 34 00 78 9A (HEX) only 12 34 are into the array. If you are simply examining these as strings, remember that zero is the string terminator. Your second example only sees the first two bytes because they are followed b...
by AllenM
21 Dec 2014 03:25
Forum: mikroC PRO for PIC General
Topic: keypad 4x4
Replies: 13
Views: 4916

Re: keypad 4x4

HyperUniverse, Writing your own keyscan routine is pretty easy and you can use any polarity you wish. Here is some code I use to open my garage door with a 4x4 or 4x3 keypad: /* Keypad connections: B4: Col 0 A0: Row 0 B5: Col 1 A1: Row 1 B6: Col 2 A2: Row 2 B7: Col 3 A3: Row 3 EasyPIC7 Turn on pull ...
by AllenM
05 Dec 2014 04:13
Forum: mikroC PRO for PIC General
Topic: PIC based 32-channel rf remote control codes in mikroC PRO
Replies: 2
Views: 2207

Re: PIC based 32-channel rf remote control codes in mikroC P

How to do this depends on which PIC you want to use and which radio.

You might want to consider the nRF24L01+ for the radio:
http://www.libstock.com/projects/view/9 ... -libraries

Go to advanced search