Keyboard Shortcuts
Likes
- BITX20
- Messages
Search
Re: Frequency display refresh (or lack thereof)
¿ªÔÆÌåÓýOnly pins 2 and 3 are interrupt driven. You mentioned you changed pins. May be worth a look. ? v/r Fred W4JLE ? From: [email protected] [mailto:[email protected]] On Behalf Of Eric Torraca ? Good morning all, I'm having a problem with an Si5351/Arduino nano kit that I'm hoping to add to my pre-Raduino BITX40. I'm using the code site.? The trouble is that the LCD only refreshes with the current frequency when the button is pressed to change the frequency step. Once I do that everything updates, but you can turn the encoder all day long and nothing will change on the LCD until you push the button to change the step. I've looked over the sketch and am just not seeing the problem. Can anyone else see where I'm going wrong? I'm using AK2B's sketch as-is with only the pins changed to match my setup. (Let me know if I should post the sketch. I wasn't sure what the etiquette was in this case.) Any advice would be greatly appreciated! 73 de KB1VNA Eric |
Re: Frequency display refresh (or lack thereof)
Agreed Joel, that was an excellent explanation. Thank you Jack and Rob. Also, it's not just the two year olds. My harmonics are 7 and 9. There are plenty of interrupts! 73 de KB1VNA On Sat, Feb 4, 2017 at 12:10 PM, Joel Caulkins <caulktel@...> wrote:
|
Re: Frequency display refresh (or lack thereof)
¿ªÔÆÌåÓýCheck my sketch on w5kub fb page. ? Wiring same probably will work. ? Ron ¨C PA3FAT ? Van: [email protected] [mailto:[email protected]]
Namens Eric Torraca
Verzonden: 4 February, 2017 16:27 Aan: [email protected] Onderwerp: [BITX20] Frequency display refresh (or lack thereof) ? Good morning all, I'm having a problem with an Si5351/Arduino nano kit that I'm hoping to add to my pre-Raduino BITX40. I'm using the code site.? The trouble is that the LCD only refreshes with the current frequency when the button is pressed to change the frequency step. Once I do that everything updates, but you can turn the encoder all day long and nothing will change on the LCD until you push the button to change the step. I've looked over the sketch and am just not seeing the problem. Can anyone else see where I'm going wrong? I'm using AK2B's sketch as-is with only the pins changed to match my setup. (Let me know if I should post the sketch. I wasn't sure what the etiquette was in this case.) Any advice would be greatly appreciated! 73 de KB1VNA Eric |
Re: Frequency display refresh (or lack thereof)
toggle quoted message
Show quoted text
On Feb 4, 2017, at 9:04 AM, Jack Purdum via Groups.Io <econjack@...> wrote:
|
Re: Frequency display refresh (or lack thereof)
Jack Purdum
There are two ways to read an encoder: 1) polling, or 2) an ISR. Polling is easiest to code; you'd just stick a call in loop() to see if the encoder has moved on each pass through the loop. That would probably be fine here, but consider a fire alarm system for the Empire State building. In that case, you might have 100 fire sensors on each floor. The polling method would go out, visit each sensor and take, perhaps, one second to read the sensor and report back FIRE or NOFIRE. At the end of reading the first floor, it goes to the second floor and repeats the process there. This repeats for all floors. The problem is that, suppose you just started reading sensor 101, and fire broke out on the first floor. It would be almost 3 hours before the polling would get back to the first floor. You'd be surprised how cranky people get when they have to wade through 10 floors of fire to go to lunch. Anyone who has raised a two year old knows what an Interrupt Service Routine is. With an ISR, each fire sensor can immediately interrupt the uC that some event happened (e.g., fire, encoder was turned). When that happens, the uC immediately transfers control to the ISR() routine. The process() method of the Rotary object returns 0 if nothing is going on. In theory, The IRS() should only get called with the encoder is rotated, but it can give false strobes (e.g., contact bounce, voltage spikes, etc.).? In looking at the code, the ISR made it possible for the display routine to get called before the dirty display flag variable (changed_f) was set. I just forced a display call when I was certain the display needed to be updated. Jack, W8TEE From: Eric Torraca <eric.torraca@...> To: [email protected] Sent: Saturday, February 4, 2017 11:41 AM Subject: Re: [BITX20] Frequency display refresh (or lack thereof) Jack! That did it! I suspect that the simple addition of the display_frequency?was what did the trick, and I intend to experiment a bit, but what does the interrupt service routine do? Thanks again all! 73 de KB1VNA On Sat, Feb 4, 2017 at 11:24 AM, Jack Purdum via Groups.Io <econjack@...> wrote:
|
Re: Frequency display refresh (or lack thereof)
Rob, You might be right, there may be some library version issues going on. I know the Si5351 library got updated at some point and I had to change some things around to accommodate that as well. I knew there was something little I was missing, I just wasn't sure where it was. I knew you all would know! Is anyone else seeing duplicates when I post or is it just my email being funny? 73 de KB1VNA Eric On Sat, Feb 4, 2017 at 11:45 AM, G4NQX <tasmod@...> wrote: Now that is interesting.? It runs fine here as is.? I suspect there is something I did to make it work but don't know what !!! |
Re: Frequency display refresh (or lack thereof)
Jack Purdum
That can be a problem and I've run into this before. As I recall, one had "Rotary.h" and the other was "rotary.h". I can remember the details. (Hell, I can't remember what I had for breakfast!) Jack, W8TEE From: G4NQX <tasmod@...> To: [email protected] Sent: Saturday, February 4, 2017 11:40 AM Subject: Re: [BITX20] Frequency display refresh (or lack thereof) I just run the code on a quick setup and it works fine. Are you using the mentioned library, there are at least two I know of with the same name. Do you have another Rotary library on your computer by any chance?
-- Rob G4NQX |
Re: BitX40 Tips and Mods doc
Jack Purdum
Thanks from everyone, Rob...Herculean service for us all! Jack, W8TEE From: G4NQX <tasmod@...> To: [email protected] Sent: Saturday, February 4, 2017 7:33 AM Subject: [BITX20] BitX40 Tips and Mods doc Well,? I've trawled through over 2000 posts and gleaned as much useful information as I can.? This version is dated and contains lots more useful info. At this point since early January there has been around 1500 posts to Groups.io BitX20 ! That's some going for a group, just shows how popular the BitX is.
-- Rob G4NQX |
Re: Frequency display refresh (or lack thereof)
Jack! That did it! I suspect that the simple addition of the display_frequency?was what did the trick, and I intend to experiment a bit, but what does the interrupt service routine do? Thanks again all! 73 de KB1VNA On Sat, Feb 4, 2017 at 11:24 AM, Jack Purdum via Groups.Io <econjack@...> wrote:
|
Re: Using STM32 board with Arduino IDE
Jack Purdum
Interesting and I don't know much about these. I do like the Teensy 3.5 and 3.6 because the have at least 512Kb of flash and 192K of SRAM and are clocked at 120MHz or higher. So far, however, I haven't needed that much horsepower. Jack, W8TEE From: G4NQX <tasmod@...> To: [email protected] Sent: Saturday, February 4, 2017 7:39 AM Subject: [BITX20] Using STM32 board with Arduino IDE One for Jack W8TEE really ut it may interest others, this webpage details some boards and using them with the Arduino IDE. Very interesting. -- Rob G4NQX |
Re: Frequency display refresh (or lack thereof)
Jack Purdum
I don't know if this fixes it, but give this a try (make a backup of your current code...just in case!). Change the current interrupt service routine to: ISR(PCINT2_vect) { ? unsigned char result = r.process(); ? if (result == 0) ? ? ? ? ? ? ? ?// New lines. No reason to check if 0 return; ? if (result == DIR_CW) ? ? set_frequency(1); ? else ? ? ? ? ? ? ? ? ? ? ? ? ? ? // No reason for else since it is not 0 ? ? set_frequency(-1); } Then make this change: void set_frequency(short dir) { ? if (dir == 1) ? ? vfo += radix; ? if (dir == -1) ? ? vfo -= radix; ? // ? ?if(vfo > F_MAX) ? // ? ? ?vfo = F_MAX; ? // ? ?if(vfo < F_MIN) ? // ? ? ?vfo = F_MIN; ? display_frequency(); ? changed_f = 1; } I can't test this so you'll have to let us know what happened. Jack, W8TEE From: Eric Torraca <eric.torraca@...> To: [email protected] Sent: Saturday, February 4, 2017 10:26 AM Subject: [BITX20] Frequency display refresh (or lack thereof) Good morning all, I'm having a problem with an Si5351/Arduino nano kit that I'm hoping to add to my pre-Raduino BITX40. I'm using the code site.? The trouble is that the LCD only refreshes with the current frequency when the button is pressed to change the frequency step. Once I do that everything updates, but you can turn the encoder all day long and nothing will change on the LCD until you push the button to change the step. I've looked over the sketch and am just not seeing the problem. Can anyone else see where I'm going wrong? I'm using AK2B's sketch as-is with only the pins changed to match my setup. (Let me know if I should post the sketch. I wasn't sure what the etiquette was in this case.) Any advice would be greatly appreciated! 73 de KB1VNA Eric
|
Re: Frequency display refresh (or lack thereof)
Hey Rob. Yes, it's on a nano. Sorry I meant to mention that. 73 de KB1VNA On Sat, Feb 4, 2017 at 11:22 AM, eric torraca <eric.torraca@...> wrote:
|
Re: Frequency display refresh (or lack thereof)
Hello Gents. Thanks for the replies. I'll attach the sketch, here are the pin-outs as physically attached: Arduino pins:? D2 - R encoder D3 - R encoder D4 - not connected (NC) D5 - LCD RS D6 - LCD E D7 - LCD D4 D8 - LCD D5 D9 - LCD D6 D10 - LCD D7 D11 - R encoder button D12 - NC A4 - Si5351 SDA A5 - Si5351 SCL 73 de KB1VNA On Sat, Feb 4, 2017 at 11:09 AM, M Garza <mgarza896@...> wrote:
|
Re: Frequency display refresh (or lack thereof)
M Garza
And I should learn to read.... I would attach the sketch you are using, since it has been modified for your needs. Marco - KG5PRT? On Feb 4, 2017 10:07 AM, "M Garza" <mgarza896@...> wrote:
|