why? It shouldn't be. Like 12, 45, 123, 4323 etc, 00 it's only a number, it's zero, what's the difference when it is written 0x00 or 00 or 00000 or 0000000 etc.
Hello friends. Look please at the following pictures. When I pass a 00 as parameter in i2csend as plain decimal number i have a compiler error. When i pass it as a hex 0x00 all is ok.
Hello friends. Look please at the following pictures. When I pass a parameter in i2csend as plain decimal number i have a compiler error. When i pass it as a hex all is ok.
Interesting. Thanks a lot
And from me all well setup. Although I had to uninstall the old one
Yesterday tried this with a 12f675. It works! no need for pullups, just turn off the chip's option_reg.7 ! ;Chip Settings #chip 12F675,4 #option explicit dim p_w as byte ' Define I2C settings #define I2C_MODE master #define I2C_DATA GPIO.4 #define I2C_CLOCK GPIO.5 #define I2C_DISABLE_INTERRUPTS ON #define I2C_BIT_DELAY 20 us #define I2C_CLOCK_DELAY 30 us **OPTIONREG.7 = 0** Do Forever for p_w = 0 to 255 repeat 100 I2CStart I2CSend p_w i2cstop wait 10 ms end repeat next Loop
Any support (libraries or code) for SX1278 Lora programming? Simple code please, as to make it transmit or receive mode in full power and how to reflect a pin ON or OFF from transmitter to receiver
Any libraries or code for SX1278 Lora programming? Simple code please, as to make it transmit or receive mode in full power and how to reflect a pin ON or OFF from transmitter to receiver
well rowdy (if you are still there) there is a simple method to try. Assume for the 12F675, a trimmer on each pins AN0 and AN1 as voltage dividers and the code bellow gives you good comparator results about the difference of the two inputs. Just pick an_diff and treat it as you wish in your code. You can check this even with a simulator, put one oscilloscope channel on an output pin and give it pulses of an_diff milliseconds width (figure it on my attachment). P.S. Trying readad(AN0, AN1) does not...
well rowdy (if you are still there) there is a simple method to try. Assume for the 12F675, a trimmer on each pins AN0 and AN1 as voltage dividers and the code bellow gives you good comparator results about the difference of the two inputs. Just pick an_diff and treat it as you wish in your code. You can check this even with a simulator, put one oscilloscope channel on an output pin and give it pulses of an_diff milliseconds width (figure it on my attachment). P.S. Trying readad(AN0, AN1) does not...
Yes very nice warning. Thank you for your offer, I appreciate it.
Anobium the 3rd case is more likely to my opinion with the exception to add the word "maybe" in the warning. eg : "Internal clock source maybe does not support specific frequency" or more specific "Warning: Internal clock source maybe support specific frequency for simulation primitives but not in real chip".
Here I wish to show with the 1st attach image an issue with 1 and 4 MHz configuration which is changing the wpu4 and wpu5 behavior following with solution in 2nd attach image. Don't know if this is elsewere in forum solved, but took 3 days to me to solve so I desided to post it to help others.
Here I wish to show with the 1st attach image an issue with 1 and 4 MHz configuration which is changing the wpu4 and wpu5 behavior following with solution in 2nd attach image
Yes sure it is usefull when writing a variable wrong accidentaly, without this option compiler assumes the wrong variable as byte and continue using it without warning. In small programs someone can easy observe what is going wrong but in bigger ones things go hard when this happens.
Yes sure it is usefull when writing a variable wrong accidentaly, without this option compiler assumes the wrong variable as byte and is using it without warning.
Oups sorry Anobium, just forget to remove the #defines, its ok now it works, thank you. But anyway why is this necessary, that shouldn't be. And specially to only one var, the SERVO_STEP. Why not for the others?
Oups sorry Anobium, just forget to remove the #defines, its ok now it works, thank you. But anyway why is this necessary, that shouldn't be.
After compile new errors after using the described solution Errors have been found: xxx.gcb (29): Error: Array/Function INT has not been declared xxx.gcb (31): Error: Array/Function INT has not been declared xxx.gcb (33): Error: Array/Function INT has not been declared xxx.gcb (35): Error: Array/Function INT has not been declared xxx.gcb (37): Error: Array/Function INT has not been declared xxx.gcb (39): Error: Array/Function INT has not been declared The message has been logged to the file Erro...
New errors after using the described solution Errors have been found: xxx.gcb (29): Error: Array/Function INT has not been declared xxx.gcb (31): Error: Array/Function INT has not been declared xxx.gcb (33): Error: Array/Function INT has not been declared xxx.gcb (35): Error: Array/Function INT has not been declared xxx.gcb (37): Error: Array/Function INT has not been declared xxx.gcb (39): Error: Array/Function INT has not been declared The message has been logged to the file Errors.txt.
oups! attachments dont upload...one more try
From this code (please remove the "-" signs before defines, I put them because without them text becomes weird) ;Chip Settings -#chip 16F887,20 'Pin mappings for LCD -#define LCD_IO 4 -#define LCD_NO_RW -#define LCD_RW PORTB.1 -#define LCD_RS PORTB.0 -#define LCD_Enable PORTB.2 -#define LCD_Data_Port PORTD -#define LCD_DB4 PORTD.4 -#define LCD_DB5 PORTD.5 -#define LCD_DB6 PORTD.6 -#define LCD_DB7 PORTD.7 -#define ARC 70 'επιθυμητό τόξο κίνησης -#define SERVO_L_LIMIT 650 'δεξί όριο κίνησης (ms) -#define...
nothing hard in my code Anobium. Just a general variable declaration at the start and then the code. Dim xcenter, ycenter......etc etc as word etc etc Until now I had no issues declaring general vars and then use them inside of subs. Its a programming rule they are known elsewhere in the code. Why I should declare them again when use in subs?
nothing hard in my code Anobium. Just a general variable declaration at the start and then the code. Dim xcenter, ycenter......etc etc as word etc etc Until now I had no issues declaring general vars and then use them inside of subs. Its a programming rule they are know elsewhere in the code. Why I should declare them again when use in subs?
yes sure, in bla bla session of my post it is supposed that these vars are declared as words. But anyway from now on it is known that line must be out of any sub or function
when going to code this (which is running ok) bla bla bla do until beamfactorL > beamfactorR beamLR (beamfactorL, 0) line xcenter, ycenter, cx, cy, ST7735WHITE beamLR (beamfactorL - 1, stepms) line xcenter, ycenter, cx, cy, ST7735BLACK beamfactorL++ loop bla bla into following simple sub, chip stops interrupt calling and glcd goes crazy... *bla bla bla do until beamfactorL > beamfactorR abeam loop sub abeam beamLR (beamfactorL, 0) line xcenter, ycenter, cx, cy, ST7735WHITE beamLR (beamfactorL - 1,...
Well, as for the sim issue, one solution I found is going in the settings of the chip and set the frequency by hand. Ok a little tricky but it works.
Ok XTAL issue solved, NO NEED FOR CAPACITORS. When I put them back chip goes down to 4MHz. The position on the breadboard seems not critical (to me anyway). Now remains the other issue, that with the sim and the ext rc osc...thank you Mr Roper. And yes you have right, GCB sets by itself the configuration, no need for derivatives. What a lovely language.
Ok XTAL issue solved, NO NEED FOR CAPACITORS. When I put them back chip goes down to 4MHz. The position on the breadboard seems not critical (to me anyway). Now remains the other issue, that with the sim and the ext rc osc...thank you Mr Roper. And yes you have right, GCB sets allone the configuration, no need for derivatives. What a lovely language.
Ok XTAL issue solved, NO NEED FOR CAPACITORS. When I put them back chip goes down to 4MHz. The position on the breadboard seems not critical (to me anyway). Now remains the other issue, that with the sim and the ext rc osc...thank you Mr Roper. And yes you have right, GCB sets allone the configuration, no need for derivatives. What a lovely lang.
Ok XTAL issue solved, NO NEED FOR CAPACITORS. When I put them back chip goes down to 4MHz. The position on the breadboard seems not critical (to me anyway). Now remains the other issue, that with the sim and the ext rc osc...thank you Mr Roper. And yes you have right, GCB sets allone the configuration, no need for derivatives
Ok XTAL issue solved, NO NEED FOR CAPACITORS. When I put them back chip goes down to 4MHz. The position on the breadboard seems not critical (to me anyway). Now remains the other issue, that with the sim and the ext rc osc...thank you Mr Roper
back to reality...but with something different now. In attached foto you see my ext connection of a crystal oscillator. A 20MHz crystal, two capacitors of 47p....bla bla...at pins 13-14...Nothing simple like that. But the 16f887 don't seems to run that fast. It seems to go at 4MHz internal osc. And the code (the # symbol is gone at copy - paste don't know why, it is there in the code) chip 16f887,20 config OSC=HS bla bla bla.....
back to reality...but with something different now. In attached foto you see my ext connection of a crystal oscillator. A 20MHz crystal, two capacitors of 47p....bla bla...at pins 13-14...Nothing simple like that. But the 16f887 don't seems to run that fast. It seems to go at 4MHz internal osc. And the code chip 16f887,20 config OSC=HS bla bla bla.....
No in real I dont tried yet. Only in sim
no option of external oscillator is working Tried any
hmm...I have no serious code until now...just only experimenting. Anyway if I have any news I will share....
hmm...I have no serious code until now...I was only experiment. Anyway if I have any news I will share....
hmm...no serious code ...I was only experiment. Anyway if I have any news I will share....
This simple code supposed to give on portb.0 variable pulse width, depending on the position of the potensiometer in the attached circuit diagram connected as stated in page 65 of the chip manual. ;Chip Settings chip 16F887,20 config OSC=EXTRCIO ;Variables Dim count As word dir portb.0 out do forever for count = 1 to 200 next set portb.0 on for count = 1 to 200 next set portb.0 off loop well....instead, as you can see in attached image, the pulse width is steady about 25ms in every position of the...
This simple code supposed to give on portb.0 variable pulse width, depending on the position of the potensiometer in the attached circuit diagram connected as stated in page 65 of the chip manual. ;Chip Settings chip 16F887,20 config OSC=EXTRCIO ;Variables Dim count As word dir portb.0 out do forever for count = 1 to 200 next set portb.0 on for count = 1 to 200 next set portb.0 off loop well....instead, as you can see in attached image, the pulse width is steady about 25ms in every position of the...
8MHz, the internal osc
ok I tested it on my adafruit with a 16f887 pic and it worked. But why is its drawing so slow? is that normal?
no error for the first (0.5) but for the second (0.05) it stops compile with the message "Error: Invalid PWM Frequency value"
And finally, is there any solution to have 50Hz with CCP1? for 500Hz I found that this worked! define PWM_Freq 0.5 but not this define PWM_Freq 0.05 for 50Hz
yes it worked but it would be more comfort to me if its possible to make it directly from GCG
Trying to load the demonstration I get this error message
Hi mmotte 1. The dash is only for the forum. If I don't write the dash I'm geting...
Hi mmotte 1. The dash is only for the forum. If I don't write the dash I'm geting...
Hi mmotte 1. The dash is only for the forum. If I don't write the dash I'm geting...
Hi mmotte 1. The dash is only for the forum. If I don't write the dash I'm geting...
In the following code the output pin GLOW_LED should have some pulses outgoing but...
In the following code the output pin GLOW_LED should have some pulses outgoing but...
A ok I understood. So I adapted the value of my variable to have the proper pulse...
A ok I understood. So I adapted the value of my variable to have the proper pulse...
A ok I understood. So I adapted the value of my variable to have the proper pulse...
A ok understood. So I adapted the value of my variable to have the proper pulse timing....
In the following code all is going well except of three things. a. After compile...
In the following code all is going well except of three things. a. After compile...
In the following code all is going well instead of three things. a. After compile...
:) ok sorry Hughs
Well gentlemen once again and after lots of mails, anobium proved how trustworthy...
Ok got the message. Will check it tomorrow. Thanks for attention Anobium
yes
......and here the new asm and hex files
Ok tryed with the correction of the initialisation. Now EEPROM is not full of strings...
What do you mean Anobium? I tryed the code you suggested before but had the same...
What do you mean Anobium? I tryed the code you suggested before but had the same...
What do you mean Anobium? I tryed the code you suggested before but had the same...
Ok I tryed but not worked. And additionaly I am now with a EEPROM full of unterminated...
I will try and be back...but....can be different the streepromaddr++ from streepromaddr...
I will try and be back...but....can be different the streepromaddr++ from streepromaddr...
Kent have you any solution to this? https://sourceforge.net/p/gcbasic/discussion...
Yeah guys thats great!!! Just implemented the Kents IOC3 solution and now I jump...
Yeah guys thats great!!! Just implemented the Kents IOC3 solution and now I jump...
Thank you guys. Kent the pin has no buttons but it is driven with pulses and thus...
Thank you guys. Kent the pin has no buttons but it is driven with pulses and thus...
After proper port and variable inits, I use this code where it is supposed that if...