[go: up one dir, main page]

Activity for kent_twt4

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    I think there is practical way to test the resolution of the AVR pwm frequency. I mentioned a previous link on how to set up some servo code. I would determine the freq. of interest, then load the registers accordingly. From that point add to the register by one and note the frequency change and so forth would inform just what resolution is possible?

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    No increased resolution for HPWM and AVRs. Byte sized variables were used to keep library overhead low so that HPWM will also work on say a tiny13A. Increasing the frequency resolution would be an interesting project.

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    Glad you got it sorted.

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    I found my Nano and it was already to go on a breadboard! So I programmed the chip per previous OP gcb program. Again I am using AVRISP MarkII programmer and GCB 0.99.01 compiler. ChipID# 0x1E950F Freq. 3974 Duty 49% I will try the AVRDude programmer next.

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    The device signature still not lining up. Have you tried to use device for AVRDude as -p m328p ?

  • kent_twt4 kent_twt4 modified a comment on discussion Open Discussion

    Copied the make hex output window from 0.99.01 from help example, no errors: 20:03:04 G+Stool started with parameter 'hex' -> processing C:\GCB@Syn\G+Stools\makeHEX.bat Source-File = C:\GCB@Syn_Programs\Forum\HPWM_Nano_m328.gcb Target-File = C:\GCB@Syn_Programs\Forum\HPWM_Nano_m328.hex Compiler Version: 0.99.01 2022-01-27 (Windows 64 bit) : Build 1073 Program Memory: 724/32768 bytes (2.21%) RAM: 11/2048 bytes (0.54%) OSC: 16Mhz Chip: MEGA328 Duration: 1.8 Seconds. EDIT: Can you blink an led by just...

  • kent_twt4 kent_twt4 modified a comment on discussion Open Discussion

    Copied the make hex output window from 0.99.01 from help example, no errors: 20:03:04 G+Stool started with parameter 'hex' -> processing C:\GCB@Syn\G+Stools\makeHEX.bat Source-File = C:\GCB@Syn_Programs\Forum\HPWM_Nano_m328.gcb Target-File = C:\GCB@Syn_Programs\Forum\HPWM_Nano_m328.hex Compiler Version: 0.99.01 2022-01-27 (Windows 64 bit) : Build 1073 Program Memory: 724/32768 bytes (2.21%) RAM: 11/2048 bytes (0.54%) OSC: 16Mhz Chip: MEGA328 Duration: 1.8 Seconds. EDIT: Can you blink an led by just...

  • kent_twt4 kent_twt4 modified a comment on discussion Open Discussion

    Copied the make hex output window from 0.99.01 from help example, no errors: 20:03:04 G+Stool started with parameter 'hex' -> processing C:\GCB@Syn\G+Stools\makeHEX.bat Source-File = C:\GCB@Syn_Programs\Forum\HPWM_Nano_m328.gcb Target-File = C:\GCB@Syn_Programs\Forum\HPWM_Nano_m328.hex Compiler Version: 0.99.01 2022-01-27 (Windows 64 bit) : Build 1073 Program Memory: 724/32768 bytes (2.21%) RAM: 11/2048 bytes (0.54%) OSC: 16Mhz Chip: MEGA328 Duration: 1.8 Seconds. EDIT: Can you blink an led by just...

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    Copied the make hex output window from 0.99.01 from help example, no errors: 20:03:04 G+Stool started with parameter 'hex' -> processing C:\GCB@Syn\G+Stools\makeHEX.bat Source-File = C:\GCB@Syn_Programs\Forum\HPWM_Nano_m328.gcb Target-File = C:\GCB@Syn_Programs\Forum\HPWM_Nano_m328.hex Compiler Version: 0.99.01 2022-01-27 (Windows 64 bit) : Build 1073 Program Memory: 724/32768 bytes (2.21%) RAM: 11/2048 bytes (0.54%) OSC: 16Mhz Chip: MEGA328 Duration: 1.8 Seconds.

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    The AVR HPWM Programs compile just fine on GCB version 0.99.01 So I would suspect a corrupt toolchain?, could try reinstall or go with Anobiums suggestion of updated compiler. The Port assignments to HPWM channels look good. There are Nano pinout diagrams that have the OCnx locations like https://descubrearduino.com/wp-content/uploads/2018/12/arduino-nano-pinout-1024x876.jpg

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    Agree with Anobium, try "Just" the HPWM command first. Divide and conquer as they say. Nothing more frustrating then trying to run down multiple bugs, all at the same time, impossible to troubleshoot. Or, just dive right in. Then, take a look at https://sourceforge.net/p/gcbasic/discussion/projects&guides/thread/66153766/#ae47 to set up the registers manually, and which registers to manipulate for the period and duty cycle. If you are going to do servos, then there is your servo code. Consider the...

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    To my knowledge their is not a software PWM command for the AVR?. There is a hardware PWM command (i.e. HPWM). The HPWM command is whole number based over the 1-255khz range. If more resolution, accuracy, or sub 1khz values required then manually setting the registers would be in order. From Help: 'Using HPWM command to alternate ramping leds with the UNO board #chip mega328,16 '************pwm************************ 'Must define AVRTCx, AVRCHANx, and set OCnX pin dir to out #define AVRTC0 'Timer0...

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    The AVR HPWM command is fully described in Help. The example for the Mega328p should be just the ticket for the NANO? The code is set to adjust the duty cycle over its full range at a fixed frequency. One could use nested loops to demonstrate every permutation of freq and duty. Writing a 0 to the duty cycle shuts the PWM enable bit off. Please test the example for expected behavior, then progress from there.

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    Please take a peek at the 10f's. I always thought I was cheated by one byte, but your analysis may prove otherwise?

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    Yes it has been done in a pre-formatted sort of way. Lots of variables involved. I would start a new topic. https://sourceforge.net/p/gcbasic/discussion/629990/thread/bf896980/#e4a9

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    Huh, learn something new everyday, good job!

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    Are the PortH pins brought out to a header?. Then start with the basics by turning on/off leds (or check with DVM/probe) for PortH as output, and let us know the results. Still no go? then attach asm file. It doesn't seem like the PortH is acting correctly.

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    Voltages for PortG and PortH pins look good? Brand and part number for the bcd switch? Not sure if I am going to help further, not having the setup, or much PPS experience if that someway enters into it. Perhaps others have some ideas?

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    Apologies, I am trying to decipher years old code written for a single pushbutton, 3 input bcd switch (0-7). Com is 5V and 10k pulldowns on input pins. Sounds like a similar or equivalent setup. Changing ports may or may not expose dat file register or power on reset(initialization) problems. Default PPS conditions could also be a factor. Of course if PortH already committed to pcb then? Not able to follow along in hardware, do not have this device. A couple of lines of similar code on the switch,...

  • kent_twt4 kent_twt4 modified a comment on discussion Open Discussion

    Declare and add shadow register help? dim BCDSW as Byte Address1 = PORTH BCDSW = Address1 Print BCDSW Or, different port nibble?

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    Declare and add shadow register help? dim BCDSW as Byte Address1 = PORTH BCDSW = Address1 Print BCDSW

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    The glcd_ssd1306.h has a soft SPI implementation for sending byte size data. See the S4wire routines for Command, Data, and BitBang. A proper SPI routine would also include the receive bytes in the same sub, and I'm sure that is around someplace also.

  • kent_twt4 kent_twt4 posted a comment on discussion Help

    One could try the UsartRXxReady interrupts and perhaps UsartTXxSent too for some sort of Usart data flow? Next option would be to poll the individual register bits, and handle it that way.

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    You can just import the hex file from you GCB file folder, right from MPLABX. Also can download or use the MPLABX IDE app for a slimmed down version, but more detailed information? You can program your AVRs this way also.

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    The data sheet gives the peripherals that can generate an interrupt during sleep (INT pin, GPIO change, etc.). The next instruction after sleep will be executed prior to branching to the interrupt address. So, it all depends if that instruction is detrimental or not. As a general rule, I always use a nop after sleep, and then I don't worry about it.

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    Glad you got it working! Some WDT's allow reset I believe or program continuation. Other thoughts or considerations: Highly recommend 10k pullup on MCLR pin per data sheet (so POR circuit works correctly) Use clrwdt instruction instead of sleep as needed Use clrwdt before sleep per data sheet Use nop directly after sleep if using interrupts?

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    Just some suggestions: Always use a 0.1uf cap across supply with micro Try to inline code, no interrupts or subs? Use the WDT , along with sleep, for wait Initialize all variables? There are other ways to check for restart, like the STATUS register Charge a battery with the solar

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    I do not have the mega328PB. For those devices I did not have, I had to make some assumptions during development. My extended 16 bit TC library (TC3, TC4, TC5) was based off the mega2650 Mega board. The mega328PB has three 16bit PWM's available, but only two PWM channels per TC instead of the three in the library. Sub 1kHz values are probably not going to be valid if my recollection is correct. This is due to the effort to keep the library small and compact without using Word variables in preprocessing....

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    Never argue with a result that works! Another thought is (if you want to go there), is to do the work inside the RTC interrupt. I have done this with a DS1307 RTC in combo with the DS18b20. Used the 1 sec square wave output for the interrupt, start the ds18b20 conversion, then comeback a second later to read the conversion results, start the next conversion, and so on. The conversion complete flag could also be polled in Main: to read the results, if there was reason to do so, just guessing here....

  • kent_twt4 kent_twt4 modified a comment on discussion Open Discussion

    I mentioned earlier about a sd card project. The library reads bmp files from a preformatted card in fat16 or fat32 file formats. Has debug mode to see output of various commands to terminal. https://sourceforge.net/p/gcbasic/discussion/629990/thread/bf896980/#e4a9

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    I mentioned earlier about a sd card project. The library reads bmp files from a preformatted card in fat16 or fat32 file formats. Has debug mode to see output of various commands to terminal.

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    The ILI9481 only because it is the one I know. Really fast 16bit data bus available, but I don't think they sell the touch screen with that model? Lots of wires :-) The Mega board with the AVR mega2560 has lots of everything, but no DMA.

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    I need to try some DMA, I know there was a big thread on that a while ago.

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    Thanks, good to know. about bmp to table. If there is enough SRAM to cover the table size plus extra for program, then that would work really well. I do not have a good feel for how fast multiple large sets of table reads would go?

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    Do not have the Nextion experience. From a bare hardware standpoint all a bit tedious but rewarding to go from bmp to glcd. I have a project in the demo section for an SD card, take what you will from that. Lots of extra uneeded steps though, because it goes from an interpreting 565 bmp csv file on the SD to buffer to GLCD print. A loooong slow process for a large full screen! Perhaps a standard, yet custom, bmp button table could be created for 1/8, 1/16 (or?) of the screen size with the appropriate...

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    Stan, I agree that interrupt(s) routines would be an excellent topic to discuss. There have been many topics discussed individually on the forum over time. The Help on On Interupt, Interrupt commands, and demo code do a pretty good job. I think you or others have mentioned a servo command, but do not remember what the outcome of that was? So many interrupts, so many devices, would have a hard time to generalize the interrupt topic. So I am out on this idea. If you have ideas, then start new topic...

  • kent_twt4 kent_twt4 modified a comment on discussion Open Discussion

    Going back to the very first conversations, problem solved when HPWM and the TimerOverflow heartbeat were put on different Timers (Timer1 and Timer3). No, Yes? I am a feared that I led you down a stray path when trying to use the Timer Interrupt other than Timer3. The mega328p that i am using, does not have a Timer3. I think I will order a Leonardo for any further developments. Edit: Ordered, now I will have trio next to the UNO, and Mega boards :-)

  • kent_twt4 kent_twt4 modified a comment on discussion Open Discussion

    Going back to the very first conversations, problem solved when HPWM and the TimerOverflow heartbeat were put on different Timers (Timer1 and Timer3). No, Yes? I am a feared that I led you down a stray path when trying to use the Timer Interrupt other than Timer3. The mega328p that i am using, does not have a Timer3. I think I will order a Leonardo for any further developments. Edit: Ordered, now I will have trio next to the UNO, and Mega boards :-)

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    Going back to the very first conversations, problem solved when HPWM and the TimerOverflow heartbeat were put on different Timers (Timer1 and Timer3). No, Yes? I am a feared that I led you down a stray path when trying to use the Timer Interrupt other than Timer3. The mega328p that i am using, does not have a Timer3. I think I will order a Leonardo for any further develpments.

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    See chapter 8.9 of data sheet. The few main advantages of the WDT is that: 1. Independent 128kHz clock. 2. Can provide much longer timer interrupt intervals 16ms to 8s. 3. Will wake up device from sleep, to save power, which is important for battery operations. Not so important if project is on line power. Could be useful if timer resources are short, or code conflicts arise with shorter interrupt cycles, otherwise, it is just extra baggage to worry about :-)

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    How important is that 1 sec interval, or that your timer interrupts add up to exactly 1 sec? How about using the Watch Dog Timer WDT for interrupts?

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    I appreciate the offer but I don't think it is required? I have been a bit inconsistent here lately on the forum. Hopefully, we get your project tackled.

  • kent_twt4 kent_twt4 modified a comment on discussion Open Discussion

    Using TC2 on the UNO for the timeroverflow, instead of TC0, seems to work OK. I think this will transfer over to the TC4, which the mega328p does not have. Different PS and so forth because TC2 is 8 bit, and TC4 is 10 bit. For the UNO board: CKDIV8 fuse is checked, #chip mega328p,2, and counter is 244. Some HPWM gymnastics, change freq and duty cycle at will!!! Again Interrupt period is very rough on my end. All the best. #chip mega328p,2 #option explicit #define AVRTC1 'Specifies AVR TC1 associated...

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    Winch,well you have me doubting myself now about the CKDIV8 selection. Having a slower clock did seem at one time to provide more consistent results. I am going to change my program back again to selecting the CKDIV8 fuse, mega328p,2, and counter of 244, for the UNO board. Feel free to experiment. Not having a mega32u4, or a Leonardo board puts me at a disadvantage. The question was asked if one could use HPWM and TimerOverflow interrupt at the same time, and the answer should absolutely be yes....

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    Winch, meant mega328p, my bad. UNO has 16MHz crystal like your Leonardo? board. So, yes was able to finally figure out values for 16MHz clock that worked for my UNO board. CKDIV8 is NOT checked! config -----#chip mega328p,16 TC2-----InitTimer2 OSC, PS_64 Interrupt counter-----1024 I have edited the previous example code. Heh, cannot have different channel frequencies for the same Timer, at the same time!!! My guess for the mega32u4 Timer4, to at least start??? I am always bad at guessing. config...

  • kent_twt4 kent_twt4 modified a comment on discussion Open Discussion

    Using TC2 on the UNO for the timeroverflow, instead of TC0, seems to work OK. I think this will transfer over to the TC4, which the mega328p does not have. Different PS and so forth because TC2 is 8 bit, and TC4 is 10 bit. CKDIV8 fuse is not checked and Osc 16MHz. Some HPWM gymnastics, change freq and duty cycle at will!!! Again Interrupt period is very rough on my end. All the best. #chip mega328p,16 #option explicit #define AVRTC1 'Specifies AVR TC1 associated with channel 3, 4 and 5 #define AVRCHAN3...

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    Using TC2 on the UNO for the timeroverflow, instead of TC0, seems to work OK. I think this will transfer over to the TC4, which the mega328 does not have. Different PS and so forth because TC2 is 8 bit, and TC4 is 10 bit. CKDIV8 fuse checked and Osc 2 MHz. Some HPWM gymnastics, change freq and duty cycle at will!!! Again Interrupt period is very rough on my end. All the best. ; ----- Configuration #chip mega328,2 #option explicit ; ----- Define software settings PWM output #define AVRTC1 'Specifies...

  • kent_twt4 kent_twt4 modified a comment on discussion Open Discussion

    I seem to be at a loss here, so if someone has an idea, or can duplicate on a mega32u4, heh, heh. I have used a couple interrupts at the same time before but this one has me stumped so far. Using freq=64 and counter of 10500 does give me about a 1 sec on time for the LED_Red. I do not have the scope pulled out. So using freq=2 and counter of 5000 very roughly speaking 1 sec on time. You wouldn't think changing HPWM freq would change the counter value in the timeroverflow interrupt. That's the rub.....

  • kent_twt4 kent_twt4 modified a comment on discussion Open Discussion

    I seem to be at a loss here, so if someone has an idea, or can duplicate on a mega32u4, heh, heh. I have used a couple interrupts at the same time before but this one has me stumped so far. Using freq=64 and counter of 10500 does give me about a 1 sec on time for the LED_Red. I do not have the scope pulled out. So using freq=2 and counter of 5000 very roughly speaking 1 sec on time. You wouldn't think changing HPWM freq would change the counter value in the timeroverflow interrupt. That's the rub.....

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    I seem to be at a loss here, so if someone has an idea, or can duplicate on a mega32u4, heh, heh. I have used a couple interrupts at the same time before but this one has me stumped so far. Using freq=64 and counter of 10500 does give me about a 1 sec on time for the LED_Red. I do not have the scope pulled out. So using freq=2 and counter of 5000 very roughly speaking 1 sec on time. You wouldn't think changing HPWM freq would change the counter value in the timeroverflow interrupt. That's the rub.....

  • kent_twt4 kent_twt4 modified a comment on discussion Open Discussion

    Still not asleep. I wouldn't think that 2khz PWM is too low at all, unless you get a buzzing noise from the motor, or need a very granular duty cycle? That's seems to be the problem tho, try 2 khz then try 64khz and see what I mean. EDIT: If you intend to use the USB, then I am not sure what the knock on effect of the 64Mhz, PLL clock would be. I forgot about that. definitely going to bed now.

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    Still not asleep. I wouldn't think that 2khz PWM is too low at all, unless you get a buzzing noise from the motor, or need a very granular duty cycle? That's seems to be the problem tho, try 2 khz then try 64khz and see what I mean.

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    No, you still need to set the programming fuse, and the osc as 2. GCB has to use 2Mhz (i.e. 16/8=2) in define for wait, PWM and other things. I'm going to try and get some sleep!

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    Oh, you wouldn't call me a "programmer", I have to slog through it. Skip the state machine for now. I it is basically setting up a timer for say 100ms interrupts and a small counter of such 100ms interrupts, then say at 100ms (1) check PIR sensor, 200 ms (2) check button and so forth till you reset the number and start again. I hope that explains it. Here is a stripped down version for the UNO board. Port number(s) change of course. ; ----- Configuration #chip mega328,2 #option explicit ; ----- Define...

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    I see the frustration here on making the HPWM and the timeroverflow interrupt to work nicely together. Seems to be a delicate dance between the length of the Osc, timeroverflows and the HPWM freq. I finally got the timer0Overflow to sort of work. It required reducing the HPWM freq to 2(khz), checking the CKDIV8 fuse, using PS_256, and making the #chip mega328, 2 for my UNO board. My counter value in the overflow sub was 10500. Change the freq and everything goes to heck. Will try TC4. Another idea...

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    I don't have the answer right now, perhaps later my time. Should be quick fix for TC0 at least. You are doing good. You can check out the examples, and see if there is something there that is relevant.

  • kent_twt4 kent_twt4 modified a comment on discussion Open Discussion

    In theory, you could still use TC0/TC4 for the interrupt by using a counter flag on rollovers (if need be) and adjusting the register count for your 1 sec. Then, for sure you would at least have 6 or 7 PWM's available as is.

  • kent_twt4 kent_twt4 modified a comment on discussion Open Discussion

    In theory, you could still use TC0/TC4 for the interrupt by using a counter flag on rollovers (if need be) and adjusting the register count for your 1 sec. Then, for sure you would have 6 PWM's available as is.

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    In theory, you could still use TC0 for the interrupt by using a counter flag on rollovers and adjusting the register count for your 1 sec. Then, for sure you would have 6 PWM's available as is.

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    Well, glad you got it working, that is certainly the most important part. I didn't say that the 32u4 was unsupported, just did not have one to test. I would say that Timer4, the 10 bit timer, may not be supported because I don't recollect dealing with a 10 bit timer, just not sure off the top of my head. You could try TC4 chan11, 12 and see if that works, there is no chan13 with the 10 bit timer. But, TC0 chan2, TC1 chan3, 4, 5, and TC3 chan8,9,10 should work. Feel free to check them out with the...

  • kent_twt4 kent_twt4 modified a comment on discussion Open Discussion

    Oh, Dear, did not know a PCB was involved from my suggestions! Looks like we are on differents sides of the pond so to speak, thus the slow response. I see you are using the mega32U4, missed that on the first look. HPWM was not developed for that chip, did not have one for testing at the time. I based my suggestions on the mega328 on an UNO board, not the same at all. I can help by simulating on the UNO board based on the type of timers involved if need be, First few suggestions would be to test...

  • kent_twt4 kent_twt4 modified a comment on discussion Open Discussion

    Oh, Dear, did not know a PCB was involved from my suggestions! Looks like we are on differents sides of the pond so to speak, thus the slow response. I see you are using the mega32U4, missed that on the first look. HPWM was not developed for that chip, did not have one for testing at the time. I based my suggestions on the mega328 on an UNO board, not the same at all. I can help by simulating on the UNO board based on the type of timers involved if need be, First few suggestions would be to test...

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    Oh, Dear, did not know a PCB was involved from my suggestions! Looks like we are on differents sides of the pond so to speak, thus the slow response. I see you are using the mega32U4, missed that on the first look. HPWM was not developed for that chip, did not have one for testing at the time. I based my suggestions on the mega328 on an UNO board, not the same at all. I can help by simulating on the UNO board based on the type of timers involved if need be, First few suggestions would be to test...

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    Hello, I wrote the HPWM for the AVR There is a conflict with trying to using TC1 as both a counter and PWM as suspected,. In the PWM mode it clears the counter when it reaches the top value for PWM, and when it is 0, it disables the Timer altogether. You have three PWM's on TC1 why not put your fan on Chan5 (OC1C)? Then use TMR0 for the counter, or TMR2 if the prescale does not work out.

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    OK back on me, step -1 it is. Somehow the old for next was letting me get away with stuff. Need to change Help example. Step -1 confirmed correct on hardware with 99.01

  • kent_twt4 kent_twt4 modified a comment on discussion Open Discussion

    Here are the asm files for V99.01 and V98.07 rc19 respectively EDIT : yes the legacy define for next works. The attach asm file is pre-define.

  • kent_twt4 kent_twt4 modified a comment on discussion Open Discussion

    Here are the asm files for V99.01 and V98.07 rc19 respectively EDIT : yes the legacy define for next works

  • kent_twt4 kent_twt4 modified a comment on discussion Open Discussion

    Here are the asm files for V99.01 and V98.07 rc19 respectively

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    Here are the asm files for V99.01 and V98.07 rc19 respectively

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    I don't want to add define for all my dozens and dozens of programs. Why not make it so '#Define USENEWFORNEXT' So I don't have to go back and change them all???

  • kent_twt4 kent_twt4 modified a comment on discussion Open Discussion

    OK, V99.01 not handling the for/next correctly for dimming led . The endpoint of "0" not being compared, but instead "255" :-(! So have to wait till rollover to repeat first loop. P.S. just a guess that the compiler is grabbing wrong parameter or excluded from using "0"?

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    OK, V99.01 not handling the for/next correctly for dimming led . The endpoint of "0" not being compared, but instead "255" :-(! So have to wait till rollover to repeat first loop.

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    Version 0.99.01 1/29/2022 from downloads?

  • kent_twt4 kent_twt4 modified a comment on discussion Open Discussion

    Copied program, tried out with UNO, and works as intended. Compiled with 98.07 rc19 P.S. If you could post and attach the .asm file, I could check against rc19 for differences.

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    Copied program, tried out with UNO, and works as intended. Compiled with 98.07 rc19

  • kent_twt4 kent_twt4 posted a comment on discussion Help

    By far one of the best ways to learn GCB from my own experience was using the Microchip Low Pin Count Board. Too bad they don't make those any more. Maybe someone makes a clone? Agree with the PicKit3 clone or even an OEM Pickit4, they can be on sale around this time, or first of the year? A high voltage programmer is great so you can use the MCLR pin as an input if you want (every pin counts on the small ones).

  • kent_twt4 kent_twt4 posted a comment on discussion Help

    Good to know, I'll refer back to if this comes up in a project, thanks.

  • kent_twt4 kent_twt4 posted a comment on discussion Help

    OK that makes more sense, and understood about the general case, Thanks. I get "0" on first read, so I believe in throwing the very first reading out in initialization as you noted.

  • kent_twt4 kent_twt4 posted a comment on discussion Help

    I have been following along with interest, and got the internal temp to work manually, but haven't downloaded the library yet. Does using the constant '#define ADREADPREREADCOMMAND ADMUX = ( ADMUX and 0X20 ) or 0X8F: wait 100 ms allow for multiple adc inputs to be used in the same program?

  • kent_twt4 kent_twt4 posted a comment on discussion Help

    Haven't fooled with the internal temperature before with the AVR. But I will say the GCB library is not recognizing the fact that ADC4 is an internal register/function. This would require some work to fix or fire a one off adc function/sub that will correctly set the MUX bits. My goto solution is to use a cheap MCP9700/9701 analog temp sensor.

  • kent_twt4 kent_twt4 posted a comment on discussion Help

    AVR's come from the factory with the internal clock at 1 Mhz. You must change the fuse selection to 8 Mhz in whatever programmer is being used. You can verify by changing the chip define to 1MHz.

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    I wouldn't discount playing around with the Mega(Atmel2560) Board. Lots of Timers and PWM that can go low at 50HZ. Here is some background on the Atmet2560 Mega Board servo PWM setup https://sourceforge.net/p/gcbasic/discussion/projects&guides/thread/66153766/#ae47

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    For sure, that is another way to handle it. Whatever it takes to keep things straight in our own individual minds :-)

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    Oh, I can sympathize with the dilemma on alt libraries. Valid reasoning all around. Ultimately I have had to rename the methods within my alt libraries so as to coexist with existing libraries, kind of a hassle, but thankfully not used much. It is an Easter egg hunt when I need to use one when last used 5 compiler revisions ago.

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    I would say to pull the On Interrupt stuff out of the loop. Just initialize and forget.

  • kent_twt4 kent_twt4 posted a comment on discussion Help

    I have used the internal FVR for ADC measurements with good success. Using it for decision making on my solar charged LIFEPO4 powered flashlight, as seen in my icon for years. If FVR1024 < 71 Then '73 by inspection, OVLO(1.024V/3.65V)*255 = 72 'Battery voltage high Burn some ma's and check again OverVolt = True savebat = False End If If FVR1024 > 99 Then 'UVLO(1.024/2.7V)*255 = 97 'Battery voltage low so wait for charge from PV OverVolt = False savebat = true End If If FVR1024 <= 99 AND FVR1024 >=...

  • kent_twt4 kent_twt4 modified a comment on discussion Open Discussion

    Sorry, glcd_simple_demonstration_software_spi_mega328p_for_ssd1306@16.gcb

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    Sorry, glcd_simple_demonstration_software_spi_mega328p_for_ssd1306@16.gcb

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    Thanks to all. All good with the UNO now too. @Anobium could you replace the demo file for the M328 to revised pin placements? This is to reflect the defines to the 4wire SPI module pin order. Also, places the M328 hardware SCK, MOSI, and SS pins to their respective pins too. Tested. Thanks.

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    Substituted @Anobium code, and no difference. Text commands work, line draws work, along with demo circle, filled circle, box, filled box of demo code. This could be a CLS problem? Reduced program to just GLCDCLS and therein full screen of random dots.

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    So I hooked up the UNO and fired up the demo, and there is something to this. I get lots of random pixels, although the general commands seem to execute OK. Still way back on 98.07_RC19, so something went astray, even before then.

  • kent_twt4 kent_twt4 posted a comment on discussion Help

    I don't think I would use strings here as Dec will suffice. Please substitute GCB I2C routines for my I2CWrites. If DS1307 then use BCD to Dec routine before storing. Something like this: sub WriteRTCeeprom I2CWrite(write_HK24C32,addr1,Mth) wait 6 ms addr1 += 1 I2CWrite(write_HK24C32,addr1,Dte) wait 6 ms addr1 += 1 I2CWrite(write_HK24C32,addr1,Yr) wait 6 ms addr1 += 1 I2CWrite(write_HK24C32,addr1,Hr) wait 6 ms addr1 += 1 I2CWrite(write_HK24C32,addr1,Min) wait 6 ms addr1 += 1 I2CWrite(write_HK24C32,addr1,Secs)...

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    Oh, I forget, fix the singular file attachment problem, so that by default can post up to three files on the first go, instead having to immediately edit the post.

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    I think the ideas presented are good and maybe it is time to make an ask of the Sourceforge team like Anobium says. A long time ago I remember we made some asks thru their ticket system, and in due time, low an behold, the changes were made. I can't remember even what the asks were, but it may have been back when the forum was being bombarded with spam. I like the idea firstly presented about being able to see the number of posts not read, and being able to jump right to the first unread post. Another...

  • kent_twt4 kent_twt4 posted a comment on discussion Compiler Problems

    Yes, that looks good.

  • kent_twt4 kent_twt4 modified a comment on discussion Open Discussion

    Well, if you happened to have an AVR MegaBoard (mega 2650) kicking around, I would say the 320x480 GLCD with the 16bit data bus interface controlled by the ILI9481. Nice size for the money and really fast. My example had an sd card on the back along with the 5V logic level voltage converters. You can see it here https://sourceforge.net/p/gcbasic/discussion/629990/thread/bf896980/#e4a9 Using an flat 40-44pin? IDC cable salvaged from an old computer helps out with hookup. Oops I see you were looking...

  • kent_twt4 kent_twt4 posted a comment on discussion Open Discussion

    Well, if you happened to have an AVR MegaBoard (mega 2650) kicking around, I would say the 320x480 GLCD with the 16bit data bus interface controlled by the ILI9481. Nice size for the money and really fast. My example had an sd card on the back along with the 5V logic level voltage converters. You can see it here https://sourceforge.net/p/gcbasic/discussion/629990/thread/bf896980/#e4a9 Using an flat 40-44pin? IDC cable salvaged from an old computer helps out with hookup. Oops I see you were looking...

  • kent_twt4 kent_twt4 posted a comment on discussion Compiler Problems

    No, do not delete the chip files. They are fully functional for these resource limited chips. Just like the PIC 10f series chips, the tiny10 family have entered the manual register manipulation and assembly instructions Zone. Even if more RAM becomes available thru optimization, people could be sorely disappointed with the 256 or 512 word data program size. The tiny10 family will never live up to do all devices like the m328p. Not enough on chip periperals at hand. But no one should not be denied...

1 >