Search found 17 matches
- 18 Jan 2013 08:23
- Forum: mikroC General
- Topic: PIC16F1937 delay_ms() delaying too long
- Replies: 1
- Views: 1567
PIC16F1937 delay_ms() delaying too long
As title says, I'm working with a PIC16f1937 and the delay_ms() function is delaying too long. If I set delay_ms(10), it will delay for what seems like half a second. I'm using the internal oscillator "INTOSC oscillator: I/O function on clkin pin" at an oscillator frequency of 32.000 MHz. Does anyon...
- 21 Dec 2012 13:17
- Forum: mikroC PRO for PIC General
- Topic: How to generate interrupt at 1Hz using 8Mhz clock and timer?
- Replies: 2
- Views: 1514
Re: How to generate interrupt at 1Hz using 8Mhz clock and ti
I googled around some more, and found a way to get precise a 1Hz if anyone is interested:
http://www.romanblack.com/one_sec.htm
http://www.romanblack.com/one_sec.htm
- 20 Dec 2012 09:58
- Forum: mikroC PRO for PIC General
- Topic: How to generate interrupt at 1Hz using 8Mhz clock and timer?
- Replies: 2
- Views: 1514
How to generate interrupt at 1Hz using 8Mhz clock and timer?
Hi all, I'm looking for a way to trigger an interrupt precisely every 1 second (1Hz). Is this possible using a PIC16f887, its internal 8MHz clock, and timers? I have tried to research ways to generate 1Hz from timers, but I haven't been able to get a straightforward solution. Can you help me out or ...
- 22 Jun 2012 19:58
- Forum: mikroC PRO for PIC General
- Topic: Working with Arrays, "IRP bit" and "Not enough RAM" errors
- Replies: 5
- Views: 3211
Re: Working with Arrays, "IRP bit" and "Not enough RAM" erro
Sorry, forgot to mention: I'm using a PIC16F887. @jani I see, that makes sense why I'm getting the IRP bit warning. So is there any way I can have a single array/struct across multiple memory banks? I'm still unsure why I'm getting the "Not enough RAM" error seeing as I was only at 34% RAM consumpti...
- 22 Jun 2012 09:58
- Forum: mikroC PRO for PIC General
- Topic: Working with Arrays, "IRP bit" and "Not enough RAM" errors
- Replies: 5
- Views: 3211
Working with Arrays, "IRP bit" and "Not enough RAM" errors
I have 3 cases of code: one which compiles fine, one which gives the "IRP bit must be manually set" warning, and one which gives the "Not enough RAM" error. Each piece of code has a subtle difference from the others, but produces different errors. I am creating a matrix of characters, but at a certa...
- 18 Jun 2012 23:30
- Forum: mikroC PRO for PIC General
- Topic: Developing API for LED matrix with arbitrary pin mapping
- Replies: 4
- Views: 1560
Re: Developing API for LED matrix with arbitrary pin mapping
Thanks for the tips. I think I have a pretty good design, I have done some research and analysis. The 18 column pins can supply enough current, and the 7 row pins toggle BJTs that sink the current from the columns. Code-wise, I wrote simple routines to turn on each light and/or all the lights in mul...
- 18 Jun 2012 22:33
- Forum: mikroC PRO for PIC General
- Topic: Developing API for LED matrix with arbitrary pin mapping
- Replies: 4
- Views: 1560
Developing API for LED matrix with arbitrary pin mapping
I made an LED matrix of size 18x7 controlled by a pic16f887. Columns are positive, rows are negative and pin mappings are as follows: 18 rows in this order: PORTB7-0, PORTD7-4, PORTC7-4, PORTD3-2 7 columns in this order: PORTA0-5, PORTE0 This was the most convenient set up since I did it on on a per...
- 18 Jun 2012 00:54
- Forum: mikroC PRO for PIC General
- Topic: Can you store port bits in an array? (for for looping)
- Replies: 1
- Views: 1213
Can you store port bits in an array? (for for looping)
I know this question has been asked many times in different ways, but there really is no straightforward answer that provides a solution (at least for what I want to do). I want to be able to store port bits/pins in an array like so: sbit arr[3] = {PORTA.B1, PORTB.B2, PORTC.B3}; but when I try to do...
- 19 May 2012 10:07
- Forum: mikroC PRO for PIC General
- Topic: Controlling a 18x7 LED Matrix using PIC16f887
- Replies: 9
- Views: 3337
Re: Controlling a 18x7 LED Matrix using PIC16f887
Fixed it, I'll post the solution if anyone else has this problem. The problem was with how I initialized the pins: void initMain() { ANSEL = ANSELH = 0; // All I/O pins are configured as digital C1ON_bit = C2ON_bit = 0; // Disable comparators TRISA = TRISB = TRISC = TRISD = TRISE = 0; // All ports p...
- 19 May 2012 10:05
- Forum: mikroC PRO for PIC General
- Topic: What is the object type of a bit?
- Replies: 3
- Views: 1158
Re: What is the object type of a bit?
I have tried searching, but I could not get a clear answer and/or find anything the same as what my question is.
- 19 May 2012 05:59
- Forum: mikroC PRO for PIC General
- Topic: What is the object type of a bit?
- Replies: 3
- Views: 1158
What is the object type of a bit?
I'm programming in C on a pic16f887 and I want more versatility with pins such as being able to put them into an array, passing them as arguments to functions...etc. So I was wondering what "type" a bit such as PORTB.F1 is? How would I store bits into an array? Would this work?: const char pinArr[3]...
- 09 May 2012 03:12
- Forum: mikroC PRO for PIC General
- Topic: Controlling a 18x7 LED Matrix using PIC16f887
- Replies: 9
- Views: 3337
Re: Controlling a 18x7 LED Matrix using PIC16f887
Can any one offer any more explanation?
I have tried and tried and double checked my code. Double checked the hardware, no problem there.
I probed pins RA3, RB3, and RD3 and there is simply no voltage there so the problem is with the pic/software.
I have tried and tried and double checked my code. Double checked the hardware, no problem there.
I probed pins RA3, RB3, and RD3 and there is simply no voltage there so the problem is with the pic/software.
- 06 May 2012 19:52
- Forum: mikroC PRO for PIC General
- Topic: Controlling a 18x7 LED Matrix using PIC16f887
- Replies: 9
- Views: 3337
Re: Controlling a 18x7 LED Matrix using PIC16f887
Why is that?
The data sheet says RA3 RB3 and RD3 are bidirectional pins?
The data sheet says RA3 RB3 and RD3 are bidirectional pins?
- 04 May 2012 23:48
- Forum: mikroC PRO for PIC General
- Topic: Controlling a 18x7 LED Matrix using PIC16f887
- Replies: 9
- Views: 3337
Re: Controlling a 18x7 LED Matrix using PIC16f887
Not sure what you mean by that. In the datasheet, RA3 RB3 RD3 are shown as bidirectional pins: https://lh4.googleusercontent.com/-sELB0wxijoE/T6Rali1JhwI/AAAAAAAAAaE/GhJdGQJdiZ4/s720/pic.png I'm pretty sure the initialization of those pins to output is correct, I've tried using two different control...
- 03 May 2012 23:15
- Forum: mikroC PRO for PIC General
- Topic: Controlling a 18x7 LED Matrix using PIC16f887
- Replies: 9
- Views: 3337
Re: Controlling a 18x7 LED Matrix using PIC16f887
The pins can be set as outputs and can sink/source the current I have designed them for. The circuitry is very simple so there should be no interference to the pins. I ran another test code and found that pins RA3, RB3, and RD3 are not turning on. Coincidence that its bit 3 on each port? Here is the...