Activity for Clint Koehn

  • Clint Koehn Clint Koehn posted a comment on discussion Open Discussion

    LCD_DB6 and LCD_DB7 are duplicated, and there is no LCD_DB4 or LCD_DB5. #DEFINE **LCD_DB7** PORTB.5 #DEFINE LCD_DB6 PORTB.4 #DEFINE **LCD_DB7** PORTB.3 #DEFINE LCD_DB6 PORTB.2 Later, Clint

  • Clint Koehn Clint Koehn posted a comment on discussion Open Discussion

    This is incorrect in the help file: Example: #DEFINE LCD_IO 4 #DEFINE LCD_SPEED OPTIMAL #DEFINE LCD_DB7 PORTB.5 #DEFINE LCD_DB6 PORTB.4 #DEFINE LCD_DB7 PORTB.3 #DEFINE LCD_DB6 PORTB.2 #DEFINE LCD_RW PORTA.3 'Must be defined for RW Mode #DEFINE LCD_RS PORTA,2 #DEFINE LCD_ENABLE PORTA.1 It should be more like: Example: #DEFINE LCD_IO 4 #DEFINE LCD_SPEED OPTIMAL #DEFINE LCD_DB7 PORTB.5 #DEFINE LCD_DB6 PORTB.4 #DEFINE LCD_DB5 PORTB.3 #DEFINE LCD_DB4 PORTB.2 #DEFINE LCD_RW PORTA.3 'Must be defined for...

  • Clint Koehn Clint Koehn posted a comment on discussion Compiler Problems

    The following program will compile and progam properly under GCBASIC but not GCStudio. #chip 18F14K22 #define USART_BAUD_RATE 9600 #define USART_TX_BLOCKING Do HSerSend “A” Wait 100 ms Loop Later, Clint

  • Clint Koehn Clint Koehn posted a comment on discussion User Submitted Projects, Demos & Guides

    This probably isn't the right place to explain this but... gcb does sin and cos by lookup tables. Integer math isn't really that hard. You do have to know what the min and max of the number you expect to end up with, and then you can make it fit in a long variable with a decimal point assumed. (e.i. 1235234 = 123.5234) 4 decimal points assumed. Say for instance you need to divide x by 1.32, you would first ([long]x * 10000) / 132. Your answer would have an assumed 2 decimal places. 90/1.32 = (90...

  • Clint Koehn Clint Koehn posted a comment on discussion User Submitted Projects, Demos & Guides

    I'm using this for retrieving a single precision value from a sensor. I really need to rename my variables, they aren't named right. The fractional name should be mantissa and the mantissa should be exponent. :( I too am a little new at the float/single/double precision game. I'm too use to integer math on these microcontrollers I program with gcbasic. It has worked well for me. Later, Clint

  • Clint Koehn Clint Koehn posted a comment on discussion User Submitted Projects, Demos & Guides

    I will be glad to look at it. I did make a mistake that I have corrected. I divided by 0xFFFF and it should have been 0x10000. Later, Clint

  • Clint Koehn Clint Koehn modified a comment on discussion User Submitted Projects, Demos & Guides

    I needed to convert a single precision number to a integer value. This is what I came up with. You lose a little precision but that happens anyway when dealing with integer math. sub SingleToLong(sgn as Byte, fnx as long, prec as byte) '----------------------------------------------------- ' sgn - the sign is returned in this variable ' fnx - single precision in, long variable out ' prec - number of digits of precision (e.i. 3 = 1000) '----------------------------------------------------- dim fractional...

  • Clint Koehn Clint Koehn posted a comment on discussion User Submitted Projects, Demos & Guides

    I needed to convert a single precision number to a integer value. This is what I came up with. You lose a little precision but that happens anyway when dealing with integer math. sub SingleToLong(sgn as Byte, fnx as long, prec as byte) '----------------------------------------------------- ' sgn - the sign is returned in this variable ' fnx - single precision in, long variable out ' prec - number of digits of precision (e.i. 3 = 1000) '----------------------------------------------------- dim fractional...

  • Clint Koehn Clint Koehn posted a comment on discussion Compiler Problems

    I will see if I can recreate my problem today. I will have to reinstall the new update and reprogram my chip and see what happens. If it acts the same I will send you the zip file. On Tue, May 21, 2019, 6:00 AM Anobium evanvennn@users.sourceforge.net wrote: Which long variable to specific? I have loaded into mplab simulatot - the interrupt is firing. So, puzzled. Can you please do the following? Uploaded the project into a number of zip. Each zip is specific to each version. Add the source code and...

  • Clint Koehn Clint Koehn posted a comment on discussion Compiler Problems

    I have not resolved this. What I noticed was that the timer0 never fired and that the type casting of long variables didn't return correct values. On Mon, May 20, 2019, 9:11 PM Anobium evanvennn@users.sourceforge.net wrote: Ok. Which vars were impacted? As you explaining this is the past sense. Have you resolved this? 18F14K22 Long type casting and TIMER0 https://sourceforge.net/p/gcbasic/discussion/596084/thread/9c1d367477/?limit=250#5bb6 Sent from sourceforge.net because you indicated interest...

  • Clint Koehn Clint Koehn posted a comment on discussion Compiler Problems

    There was no error message, it just didn't work. The timer never fired and the subs that had long type casting returned wrong values. On Mon, May 20, 2019, 3:54 PM Anobium evanvennn@users.sourceforge.net wrote: No issues here with 0.98.05 2019-04-20,as below: Compiler Version (YYYY-MM-DD): 0.98.05 2019-04-20 (Windows 32 bit) Program Memory: 2096/8192 words (25.59%) RAM: 170/512 bytes (33.2%) Chip: 18F14K22 So, exactly what was the error message? 18F14K22 Long type casting and TIMER0 https://sourceforge.net/p/gcbasic/discussion/596084/thread/9c1d367477/?limit=250#b6bc...

  • Clint Koehn Clint Koehn posted a comment on discussion Compiler Problems

    It compiles without error on both, but on the latest one it gives erroneous readings. On Mon, May 20, 2019 at 9:08 AM Anobium evanvennn@users.sourceforge.net wrote: Clint - sorry, I cannot follow. Can you post a complete program that shows the issue? 18F14K22 Long type casting and TIMER0 https://sourceforge.net/p/gcbasic/discussion/596084/thread/9c1d367477/?limit=250#ed75 Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/gcbasic/discussion/596084/ To unsubscribe...

  • Clint Koehn Clint Koehn posted a comment on discussion Compiler Problems

    sub GetBatt(readin as word) readin = 0 for cnt = 1 to 5 'take 5 readings 150 ms apart readin = readin + READAD10(BattSensor) 'place in variable wait 150 ms next readin = readin / 5 readin=[long]readin*981/1000 'average readings over 750 ms approx. end sub The one I really noticed it on was this one. It could be fine tuned a little though. You input a positive integer temperature and it returns air saturation at that temperature: sub DoAtTemp(readin as word) readin=readin*100 readin=3653+[long]readin...

  • Clint Koehn Clint Koehn posted a comment on discussion Compiler Problems

    That was only an example. I re installed the prior version and everything compiled and worked properly with no changes to my code. So it has to be something in the new install. I'll try to get you a sample tomorrow sometime. On Sun, May 19, 2019, 9:14 PM Anobium evanvennn@users.sourceforge.net wrote: Hi Clint. No functional changes in that are of the compiler. So, got any code that shows the issue? Or, in this a syntax error? try dropping the var*. 18F14K22 Long type casting and TIMER0 https://sourceforge.net/p/gcbasic/discussion/596084/thread/9c1d367477/?limit=250#5669/1b07...

  • Clint Koehn Clint Koehn posted a comment on discussion Compiler Problems

    Long type casting (e.i. [long] var * const) and timer0 didn't seem to work with this latest download on the 18f14k22. Later, Clint

  • Clint Koehn Clint Koehn posted a comment on discussion Open Discussion

    stan, Your -1 error was the result of not having your vdd connected. You need the MCLR, VDD, VSS, DATA, CLOCK lines connected. It works like a charm. I much prefer CGBASIC over Arduino for both ease of programming and speed. The newer chips require that you purchase the Pickit 2+ from Evan. Later, Clint

  • Clint Koehn Clint Koehn posted a comment on discussion Help

    Timer0 is NOT affected by the RTCC. I must not have had something set up right before. Later, Clint

  • Clint Koehn Clint Koehn modified a comment on discussion Help

    I am running this off of a breadboard and I think I may need a better setup. My on/off power switch appears to have a bounce and it locks the processor up when I turn the switch on (at least I think that is what is happening). It'll start when I turn it back off then on but then it doesn't read right after that. The setup and program posted above is the closest I've come to making this work. Later, Clint

  • Clint Koehn Clint Koehn posted a comment on discussion Help

    I am running this off of a breadboard and I think I may need a better seteup. My on/off power switch appears to have a bounce and it lock the processor up when I turn the switch on (at least I think that is what is happening). It'll start when I turn it back off then on but then it doesn't read right after that. The setup and program posted above is the closest I've come to making this work. Later, Clint

  • Clint Koehn Clint Koehn posted a comment on discussion Help

    OK... here is the latest 12:52:10 - turned off the power 15:59:12 - turned the power back on FAILED should have read 19:22:40 Looks like it worked for a little over 3 hrs. I'm using 3 AAA batteries and the voltage is still at 4v. I'm going to reset the time and see what happens overnignt. Later, Clint

  • Clint Koehn Clint Koehn posted a comment on discussion Help

    I cannot seem to use Timer0 with the RTCC. I will try to set it up again a little later to be sure. Yes, it seems to keep time. The thing that supprised me was that the program counter was also saved, and restarted at the point where the power was turned off. It did not go through my init routine. I didn't see that in the data sheet at all. Later, Clint

  • Clint Koehn Clint Koehn modified a comment on discussion Help

    So far I'm up to: 09:39:04 - stopped 10:50:55 - restarted 10:51:45 - stopped 12:51:45 - restarted Later, Clint

  • Clint Koehn Clint Koehn posted a comment on discussion Help

    So far I'm up to: 09:39:04 - stopped 10:50:55 - restarted Later, Clint

  • Clint Koehn Clint Koehn posted a comment on discussion Help

    OK.. This sort of works with the MicrochipRTCC.h file included. I had to extend some time durations in it. I'll explain what I mean by sort of. I start it, set the time, and let it run a little. Turned off the power for 30 sec. Turned the power back on. It by-passed my startup routine and started counting time again. The clock was right! It worked! But... it looks like it also stores the program pointer and it picks up where the power was removed from. I can live with that. So I shut it off before...

  • Clint Koehn Clint Koehn modified a comment on discussion Help

    I did the same thing he did, only when I plugged my power back in, my time was like it was when I unplugged it. So what did he do different? How are his settngs? How can I duplicate what he did?

  • Clint Koehn Clint Koehn modified a comment on discussion Help

    II did the same thing he did, only when I plugged my power back in, my timet was like it was when I unplugged it. So what did he do different? How are his settngs? How can I duplicate what he did?

  • Clint Koehn Clint Koehn posted a comment on discussion Help

    I did the same thing he did, only when I plugged my power back in, my timet was like it was when I unplugged it. So what did he do different? How are his settngs? How can I duplicate what he did?

  • Clint Koehn Clint Koehn posted a comment on discussion Help

    I just looked at the video but it doesn't really show what he did, or did I miss something. It would be nice to have some written down instructions to follow.

  • Clint Koehn Clint Koehn posted a comment on discussion Programmers and Chip Files Problems

    Thank you very much Evan.

  • Clint Koehn Clint Koehn posted a comment on discussion Programmers and Chip Files Problems

    Doesn't look like I'm going to get to it today. Probably not this week even. Got too busy.

  • Clint Koehn Clint Koehn posted a comment on discussion Programmers and Chip Files Problems

    Here are the 16F18445 and 16F18446 from the data sheet

  • Clint Koehn Clint Koehn posted a comment on discussion Programmers and Chip Files Problems

    The only thing different between those chips is: prog flash mem words prog flash Kb Data SRAM 16F18445 8192 14 1024 16F18446 16384 28 2048 That is at least all I could see.

  • Clint Koehn Clint Koehn posted a comment on discussion Programmers and Chip Files Problems

    I know what you mean, but sometimes it seems my logic and other peoples logic is different. I might try to copy the 16F18446.dat file and rename it 16F18445.dat and see if it works.

  • Clint Koehn Clint Koehn posted a comment on discussion Programmers and Chip Files Problems

    OK, finally got back. They do not have the .inc files, BUT..... The PIC xml files say that they are cloned from other chips, I'll list them. 16F18424 is cloned from 16F18426 16F18425 is cloned from 16F18426 16F18444 is cloned from 16F18445 16F18445 is cloned from 16F18446 16F18455 is cloned from 16F18456 16F18456 is cloned from 16F18446 Does that make any sense to you? Are they just duplicating the chip data and changing the name?

  • Clint Koehn Clint Koehn posted a comment on discussion Programmers and Chip Files Problems

    My internet is the slowest you can have and still call it DSL I think. I have time so I started the download, looks like a little over 2hrs. 731MBs. I'm using the internet, so that slows it down too. I'll see if I can get you those files. the one I'm downloading is the 5.00.

  • Clint Koehn Clint Koehn posted a comment on discussion Programmers and Chip Files Problems

    I don't know if this is the right place to post this, but I need the dat file for this chip. It has 12 bit adc in a 20 pin package plus other good stuff. Later, Clint

  • Clint Koehn Clint Koehn posted a comment on discussion Help

    One more thing to add. On my chip it looks like when you have a battery hooked up (mine is 3 AA which is 4.5v) and disconnect power, it back feeds to the power lines which read around 1.9v. My Timer keeps running blinking my LED though it is very faint. Unplug the battery and everything goes dead.

  • Clint Koehn Clint Koehn posted a comment on discussion Compiler Problems

    The #startup simply did not work. It locked my chip up. The RTCSYNC did not work. It locked my chip up. When I removed both of those the RTC worked as far as being able to retrieve and set the time and keep time. All running off of the SOSC. Of course, the VBAT hasn't kept the clock running when the power is removed. It looks like it doesn't matter if VBATEN is ON or OFF. It still saves the time just before power is lost. It is frusterating.

  • Clint Koehn Clint Koehn posted a comment on discussion Compiler Problems

    Still musn't have everything right. The battery kept the time the power was turned off, but did not keep SOSC working. Need to do some more reading I guess. Later, Clint

  • Clint Koehn Clint Koehn modified a comment on discussion Compiler Problems

    The MicroChipRTCC.h had numerous errors in it, al least for my PIC16F19176 chip I'm using. 1 - Does not work with #starup. I had to remark that out and place "rtcc_Initialize" right before my main loop otherwise it would lock up the chip. 2 - There were also some RTCEN before RTCWREN. RTCWREN must be before RTCEN. Fixed 3 - The "wait unit RTCSYNC = 0" would also just lock the chip up. i had to replace that with a 200us delay then it worked. I set up a "rtcc_TimeDelay" define that can be changed before...

  • Clint Koehn Clint Koehn posted a comment on discussion Compiler Problems

    The MicroChipRTCC.h had numerous errors in it, al least for my PIC16F19176 chip I'm using. 1 - Does not work with #starup. I had to remark that out and place "rtcc_Initialize" right before my main loop otherwise it would lock up the chip. 2 - There were also some RTCEN before RTCWREN. RTCWREN must be before RTCEN. Fixed 3 - The "wait unit RTCSYNC = 0" would also just lock the chip up. i had to replace that with a 200us delay then it worked. I set up a "rtcc_TimeDelay" define that can be changed before...

  • Clint Koehn Clint Koehn posted a comment on discussion User Submitted Projects & Guides

    Thanks for the kind words Chris. I have a chip that has 2 hardware serial ports but I needed a third one. One radio went to the computer, one was for a sensor board I made and I needed a third one for a 4D display. Later, Clint

  • Clint Koehn Clint Koehn modified a comment on discussion User Submitted Projects & Guides

    You can use a hardware interrupt to act as a hardware serial receive. Hook your TX from your device to a hardware interrupt. Set the edge detect to falling. Set that port/pin to SoftSerial RX. Set any other pin to SoftSerial TX. This is with my new micro controller so it will probably need modying for your device, but I have used it on an older model that had hardware interrupts and it worked. #chip 16f19176, 32 #include <SoftSerial.h> '======= Simulate hardware rx ==============================...

  • Clint Koehn Clint Koehn posted a comment on discussion User Submitted Projects & Guides

    You can use a hardware interrupt to act as a hardware serial receive. Hook your TX from your device to a hardware interrupt. Set the edge detect to falling. Set that port/pin to SoftSerial RX. Set any other pin to SoftSerial TX. This is with my new micro controller so it will probably need modying for your device, but I have used it on an older model that had hardware interrupts and it worked. #chip 16f19176, 32 #include <SoftSerial.h> '======= Simulate hardware rx ==============================...

  • Clint Koehn Clint Koehn posted a comment on discussion Open Discussion

    Thank you very much. Later, Clint

  • Clint Koehn Clint Koehn posted a comment on discussion Open Discussion

    I somehow had a bad installation. I cleared everything out and re-installed and the below works. It gives around a 1.04s interrupt. Is there a program or something that will calculate interrupt values? #chip 16f19176, 32 '====== timer fires approx every second ============ #define TMR0_16bit InitTimer0 Osc, PRE0_64 + TMR0_HFINTOSC , POST0_8 on Interrupt Timer0Overflow call SecCount StartTimer 0 Later, Clint

  • Clint Koehn Clint Koehn modified a comment on discussion Open Discussion

    I've been working all afternoon trying to get the TIMER0 Interrupt to work on the PIC16F19176. I don't care if it is in 8 or 16 bit mode. It is a new chip and I can cycle 8 LED's so I know the chip is running, but the interrupt won't fire. I have tried all kind of things. #chip 16f19176, 16 '====== timer fires approx every second ============ InitTimer0 Osc, PRE0_16384, POST0_12 On Interrupt Timer0Overflow Call SecCount StartTimer 0 dir PORTD out #define LED PORTB.5 dir LED out set LED off PORTD...

  • Clint Koehn Clint Koehn posted a comment on discussion Open Discussion

    I've been working all afternoon trying to get the TIMER0 Interrupt to work on the PIC16F19176. I don't care if it is in 8 or 16 bit mode. It is a new chip and I can cycle 8 LED's so I know the chip is running, but the interrupt won't fire. I have tried all kind of things. #chip 16f19176, 16 '====== timer fires approx every second ============ dim timer_delay, tmr_cnt as Word tmr_cnt = 0 InitTimer0 Osc, PRE0_16384, POST0_12 On Interrupt Timer0Overflow Call SecCount StartTimer 0 dir PORTD out #define...

  • Clint Koehn Clint Koehn posted a comment on discussion Programmers and Chip Files Problems

    I sent you an email but I didn't see the PIC16F19176 listed in the file of supported chips. I wanted to use that 40 pin chip because I need that number of pins, memory and RTCC that it offered.

  • Clint Koehn Clint Koehn posted a comment on discussion Programmers and Chip Files Problems

    I have a Pickit 2 but I assume that I cannot use it to program the PIC16F19176, even though there is a data file in GCBASIC. Which programmer works with this chip? Later, Clint

  • Clint Koehn Clint Koehn modified a comment on discussion Contributors

    This code uses LCD Assistant for images and MikroElektronika Font Creator for fonts up to 16 pixels high.. '------------------------------------------------------------------- ' My GLCD routine ' ' saved as MyGLCD.h ' Needs GLCD.h for PSet command '------------------------------------------------------------------- Sub GLCDPrintCustom (In PrintLocX as word, In PrintLocY as word, in LCDPrintData as string, In FID as byte ) Dim GLCDPrintLoc as word GLCDPrintLen = LCDPrintData(0) If GLCDPrintLen = 0...

  • Clint Koehn Clint Koehn modified a comment on discussion Contributors

    This code uses LCD Assistant for images and MikroElektronika Font Creator for fonts up to 16 pixels high.. '------------------------------------------------------------------- ' My GLCD routine ' ' saved as MyGLCD.h ' Needs GLCD.h for PSet command '------------------------------------------------------------------- Sub GLCDPrintCustom (In PrintLocX as word, In PrintLocY as word, in LCDPrintData as string, In FID as byte ) Dim GLCDPrintLoc as word GLCDPrintLen = LCDPrintData(0) If GLCDPrintLen = 0...

  • Clint Koehn Clint Koehn posted a comment on discussion Contributors

    This code uses LCD Assistant for images and MikroElektronika Font Creator for fonts up to 16 pixels high.. '------------------------------------------------------------------- ' My GLCD routine ' ' saved as MyGLCD.h ' Needs GLCD.h for PSet command '------------------------------------------------------------------- Sub GLCDPrintCustom (In PrintLocX as word, In PrintLocY as word, in LCDPrintData as string, In FID as byte ) Dim GLCDPrintLoc as word GLCDPrintLen = LCDPrintData(0) If GLCDPrintLen = 0...

  • Clint Koehn Clint Koehn posted a comment on discussion Help

    I am doing a hardware serial recieve which is some ascii chars that I need to compare...

  • Clint Koehn Clint Koehn modified a comment on discussion Help

    How do you do that in GCBASIC? It doesn't work to do CONFIG1.13. It generates an...

  • Clint Koehn Clint Koehn posted a comment on discussion Help

    How do you do that in GCBASIC? It doesn't work to do CONFIG1.13. It generates an...

  • Clint Koehn Clint Koehn posted a comment on discussion Help

    Thanks for taking time to look at it. If I can get them to all light together (and...

  • Clint Koehn Clint Koehn posted a comment on discussion Help

    Could some tell me why this doesn't work. RB6 And RB7 do not work when set individually....

1