Search found 111 matches

by w7ami
15 Mar 2018 23:06
Forum: mikroC PRO for PIC General
Topic: I2C Issue with PIC18F4550
Replies: 7
Views: 2330

Re: I2C Issue with PIC18F4550

Sparky, I checked and double checked all the wiring and the clock settings, etc. and couldn't find any mistakes. So I tried a 20 MHz oscillator without any change in what I was seeing. The delay_ms command seemed to be working correctly. I could program it to give me a 10 uS pulse on the heartbeat p...
by w7ami
15 Mar 2018 00:37
Forum: mikroC PRO for PIC General
Topic: I2C Issue with PIC18F4550
Replies: 7
Views: 2330

Re: I2C Issue with PIC18F4550

Sparky, Thanks for jumping in. OK, I put the code back in to set up the SDA and SCL lines. I also set the analog inputs to digital. // I2C Pins sbit SCL at LATB1_bit; sbit SCL_dir at TRISB1_bit; sbit SDA at LATB0_bit; sbit SDA_dir at TRISB0_bit; void main() { PCFG0_bit = 1; // turn off analog inputs...
by w7ami
14 Mar 2018 23:30
Forum: mikroC PRO for PIC General
Topic: I2C Issue with PIC18F4550
Replies: 7
Views: 2330

Re: I2C Issue with PIC18F4550

Yes, I have 4K7 pull up resistors on each line.

Terry
by w7ami
14 Mar 2018 22:20
Forum: mikroC PRO for PIC General
Topic: I2C Issue with PIC18F4550
Replies: 7
Views: 2330

I2C Issue with PIC18F4550

I'm trying without luck to get an 18F4550 to connect to another device via the hardware I2C port. The program freezes whenever I add the line I2C1_Start; to the program. I have looked at the SDA and SCL lines with a logic analyzer and I'm not seeing what I expected. I see the SDA line go low followe...
by w7ami
16 Jun 2015 00:16
Forum: mikroC PRO for PIC General
Topic: USB HID descriptor modifying
Replies: 6
Views: 3722

Re: USB HID descriptor modifying

The number of bytes that you specify here... const char HID_INPUT_REPORT_BYTES = 64; const char HID_OUTPUT_REPORT_BYTES = 64; Must match the number of bytes that you really are sending as defined in your descriptor table. const struct { char report[USB_HID_RPT_SIZE]; }hid_rpt_desc = { { 0x05, 0x01, ...
by w7ami
08 Jun 2015 23:24
Forum: mikroC PRO for PIC General
Topic: Coding "Blond" mment
Replies: 3
Views: 1679

Re: Coding "Blond" mment

If you paste your code inside the code tags it makes it keeps the indentation and makes it much easier to read. Click on the Code box(next to the Quote box) at the top of the reply screen and then paste your code in between the Code and /Code tags. while (1) { // endless loop if (RA0_bit) { // butto...
by w7ami
30 Jan 2015 23:38
Forum: mikroC PRO for PIC General
Topic: Issues with If statement
Replies: 6
Views: 2798

Re: Issues with If statement

OK, I have figured out part of what is happening. flag_xmt = 0; flag_xmt_p = 0; if(flag_xmt==1||flag_xmt_p==1) { // Start transmit sequence heartbeat_cntr = 0; // clear counter beacon_cntr6 = 0; // clear counter LED1 = 1; // turn on transmit LED xmt = 1; } I missed the fact that flag_xmt_p could be ...
by w7ami
27 Jan 2015 04:10
Forum: mikroC PRO for PIC General
Topic: Issues with If statement
Replies: 6
Views: 2798

Re: Issues with If statement

Android, Thanks for the tips. I appreciate the pointers. if(rmc_valid==1 & gga_valid==1) { // if both GPS sentences report good data turn on LED2 This was a mistake that I didn't catch before. I always confuse & and &&. I am updating my code to reflect your pointers. ...all do the same thing, but th...
by w7ami
25 Jan 2015 21:20
Forum: mikroC PRO for PIC General
Topic: Issues with If statement
Replies: 6
Views: 2798

Re: Issues with If statement

Android and Spary1039 Thanks for the ideas, they were very much appreciated. Unfortunately neither one cleared up the strange issue that I am seeing. Timer 3 is interrupting around 70,000 times per second in order to produce a 32 step sine wave of 2200Hz. Some times the program will run for minutes ...
by w7ami
25 Jan 2015 00:19
Forum: mikroC PRO for PIC General
Topic: Issues with If statement
Replies: 6
Views: 2798

Issues with If statement

I am having the strangest problem with a program I am working on and wondering if anyone else has seen something like this. I am using MikroC version 6.5.0 with a PIC18F4550. The reference oscillator frequency is 12MHz and that is multiplied up to 48 MHz. The program runs on a custom PCB. The issue ...
by w7ami
25 Aug 2014 19:40
Forum: mikroC PRO for PIC General
Topic: PIC not working after adding one insignificant line of code
Replies: 4
Views: 2062

Re: PIC not working after adding one insignificant line of c

Don't forget that the EEPROM on the PIC has a limited number of erase/write cycles. If you write to the memory once a second the EEPROM will be worn out in a little over 1 day.
100,000 Erase/write cycle data EEPROM memory, typical
by w7ami
15 Jul 2014 03:31
Forum: mikroC PRO for PIC General
Topic: T6963C_INVERT Returns an error
Replies: 3
Views: 1627

Re: T6963C_INVERT Returns an error

The _T6936c.h file I was using was an older copy and didn't have the line referring to INVERT. I sustituted the file with the newest version of _T6936c.h and the problem is solved. /* * color masks */ #define T6963C_WHITE 0b1000 #define T6963C_BLACK 0 #define T6963C_INVERT 2 Terry
by w7ami
14 Jul 2014 17:37
Forum: mikroC PRO for PIC General
Topic: T6963C_INVERT Returns an error
Replies: 3
Views: 1627

Re: T6963C_INVERT Returns an error

Marina, Thank you for the reply. In the Help File INVERT is listed as an option for T6963C_circle_fill. I did notice that INVERT was not included in the color masks in the .h file. Terry Prototype void T6963C_circle_fill(int x, int y, long r, unsigned char pcolor); Returns Nothing. Description Draws...
by w7ami
14 Jul 2014 01:05
Forum: mikroC PRO for PIC General
Topic: T6963C_INVERT Returns an error
Replies: 3
Views: 1627

T6963C_INVERT Returns an error

I am using the SmartGLCD panel and want to draw a filled circle but have it invert the existing color. The command T6963C_circle_fill(120, 64, 110, T6963C_INVERT); returns an error when I try to use it. Both T6963C_WHITE and T6963C_BLACK work correctly. "191 324 Undeclared identifier 'T6963C_INVERT'...

Go to advanced search