Re: Coding styles
First coding ~ was typing games out of Hot CoCo magazine into everything from 4k to 64k color computers with my son….color basic… Then first job coding was a little columnar based RPG on AS/400’s…..if you can see the girl in the red dress….then you were good to go…. But, I immediately pushed myself to head of the pack and was an early adopter of free form RPG, a quasi- ‘real’ language with sort of procedures…. In my travels….I found two kinds of programmers….hoarders and sharers….. Those who think they are so slick they can write code that no one else can maintain….therefore maintaining a sense of false job security….some for a while (these are your stressful, suicidal coders)…..always on call over night to maintain their nightmares…..not much into sharing anything….. And then I found those who eagerly shared the latest whizz bang routine they had come up with…..along with the documentation to allow you to comfortably use it….so it was always easy to share what you did with them…. Probably some of the hard to maintain code is from laziness….(from experienced lazy programmers…..new programmers might be given a little slack….but not after any intro like this), and some might be from rushed deadlines in the business world and self imposed deadlines in hobby stuff….but, I found most of the hard to maintain code in the business world….came from greedy people….. The one thing extra I would add…..is add those comments when you write the code…..too many reasons to list to do this….far worse than NO comments is the comments that are added after the fact…..maybe reciting the business rule….not what was actually coded…and following not set pattern or style… That was then….wonder what any code I might write today will look like…. anyway….just my thoughts Craig KM4YEC
|
|
Re: Coding styles
Ashhar Farhan
C88? That was a very very long long ago... I remember ads for it, probably it was in Dr.Dobbs? - f
On Mon, 7 May 2018, 21:57 Mark Pilant, <mark@...> wrote: My number 1 rule about coding is:
|
|
Re: 4pin mic wiring
Gary Anderson
Hi Ivo,
Sunil's pictures show he is using 1K ohm resistors. https://i1.wp.com/amateurradiokits.in/wp-content/uploads/2018/03/Mounting-Led-TX-RX.jpg?ssl=1 I don't know the exact specs on the LED included in the kit, but assuming a standard estimate of ~2V forward voltage for red/green LED, and a 12V supply: (12V-2V)/1k Ohms = 10mA of current through the diode. Regards, Gary
|
|
Re: Coding styles
ajparent1/KB1GMX <kb1gmx@...>
I forgot my first rule of programming and computers.
0+1=10 (all binary) , never ignore the carry flag or were you testing it? Side effect of being a PDP-8 user at one time. Allison
|
|
Re: Coding styles
ajparent1/KB1GMX <kb1gmx@...>
As a bleeding edger... CP/M 1.3, 1.4 and 2.2, Smallc, BDS C and even Pascal.
My copy of K&E has a Bell system cover and marginal notes from K! I Used to call on them back when and it was a gift, one I treasure. However space was never an issue as I was running hard disks before many. I may add that system is still in use as I can bang out good code fast on it (large library and old code reserve) and a 10mhz Z80 kind does the job. When I want to show the kiddies I fire up the the microPDP 11/23 (its smaller) and run Unix V6 and show how far we have not gone. Coding style. I try to keep the code English as adverse to "reads like Greek". Many many years in assembler and macro assemble if I could not figure it out six months later either it needed more comments or I was trying to be too slick. So all the C I wrote/write is every effort to be plain, structured and consistent in style even if I'm doing different than last project. One area is data structures shat I see these days is very hard to decrypt due to layers of layers. Yes, I know its C++, sometimes leaving out the ++ part makes it cleaner other times It is handy to make it better packaged. I'm used to writing for small systems as in embedded and often resource limited. Arduino feels big to me! Oh, 64x16 must be a PT VDM-1 video or similar, Stiill have a system using that. I've accumulated systems over the years astating with my first build back in '74. Allison
|
|
Re: SWR
Tim Gorman
Since the ADC on the nano is muxed, i.e. not every channel has its own
ADC, it takes time for the ADC to be connected to a specific channel and for that channel to settle to a correct reading. So you do lose time slots while this is occuring. It's why a random read takes 2 to 3 times longer than successive reads from the same channel. At least that's how I read the specs. And you are right about letting the ADC in the peripheral just run continuously. I don't consider SWR to be a critical item. You can measure reverse power when you need to. And you can do the same for forward power if you want. SWR isn't going to tell you anything extra over just the two measurements themselves. tim ab0wr On Mon, 7 May 2018 11:40:02 -0500 "K9HZ" <bill@wjschmidt.com> wrote: Correct, but it is more important that, in the case of SWR that the
|
|
Re: For those keeping track of uBITX shipping times
#ubitx
Ashhar Farhan
I just had an ice cream with ehsan. He said they will ship may 6th orders tomorrow. - f
On Mon, 7 May 2018, 22:25 Keith McQueen, <kb7m@...> wrote: Ordered April 29
|
|
Re: #ubitx Powel Levels after SImple Mods
#ubitx
Good summary post, Mark. I have been considering each (and all) of these methods as well, and was wondering what the sum of these would be. My uBitX came last week, and i am just now starting to modify it.
-- Mark, KE6BB
|
|
Re: Coding styles
Jeff Gazdacko
I always defer to google's style guide, which if I'm remembering correctly is similar to K&R's usage.
On Sun, May 6, 2018 at 11:51 PM, Jerry Gaffke via Groups.Io <jgaffke@...> wrote: You guys take this so seriously.
|
|
Re: Amateur Radio Kits Case Arrived - 5 STARS * * * * * -#ubitx
K9HZ <bill@...>
Yeah i got one too. Nice but some things are not what you would call perfect (circuit boards). Also i sure wish they would learn about lock washers in India...
toggle quoted messageShow quoted text
Dr. William J. Schmidt - K9HZ J68HZ 8P6HK ZF2HZ PJ4/K9HZ VP5/K9HZ PJ2/K9HZ
Owner - Operator Big Signal Ranch – K9ZC Staunton, Illinois
Owner – Operator Villa Grand Piton - J68HZ Soufriere, St. Lucia W.I. Rent it: www.VillaGrandPiton.com email: bill@...
On May 7, 2018, at 12:00 PM, Lawrence Macionski via Groups.Io <am_fm_radio@...> wrote:
|
|
Amateur Radio Kits Case Arrived - 5 STARS * * * * * -#ubitx
Lawrence Macionski <am_fm_radio@...>
I ordered a uBITX case from https://amateurradiokits.in/store/ BITX Store by Sunil. on March 23,2018.
I reported he was shipping 50 cases when I contacted him last week regarding a DHL upgrade to shipping. My case was shipped DHL 2018-05-04 from India Arrived KANSAS USA DHL 2018-04-07 1100 hr local. Case is beautiful.. Siemens Gray.. Note the case comes with: 10K linear pot Main tuning knob Small knob (volume) Push on - power switch Fuse Holder DC socket DC connector SO239 connector Speaker 8 ohm Screws for PCB and case Plastic and Brass standoffs. Acrylic Cover for LCD -(Window) 4 pin Mic socket. PCB for USB sockets USB socket DB 9 socket -for accessories on rear panel 3 extra PCB boards... PCB mounting for Rotary encoder PCB mounting for Power switch and fuse PCB USB and DB9 socket. Additionally, a red/green T/R LED, tywraps- heat shrink tubing, tywrap mounting adhesive blocks, additional connectors, plastic feet and a front stand for tilting unit. WHAT A VALUE FOR THE MONEY!!!!- silk screened case, shielded metal construction, all the extra's you need to complete the build!!! Now- let's mention the packing.. Mine arrived DHL unpacked as follows: TYVAC DHL envelope- India to Kansas 3 Days. 0.5 Kg weight Unit was DOUBLE wrapped in small air bubble sheets, completely encased in clear 2" wide clear tape..amounted to 3/4-1 inch bubble wrap all sides. Once 2 layers of bubble wrap was removes the unit was encased in a high density stryafoam box with 1/2 thick sides and taped shut. Upon opening the Styrofoam box, the case was then neatly wrapped in a plastic bag. The uBITX case was finally exposed but required unscrewing the top cover to continue unpacking. Inside the box double wrapped in newspaper is a ziplock sandwich bag filled with all the small accessories included it the price. Some of the items (the Display Window) were protected in yet another layer of newspaper.
God love all the other case builders, and those that "roll" their own..Better men than I. This is the ROLLS ROYCE STANDARD you need to consider. Especially recommended for a group- club builds when replication and quality is desired. Respectfully Submitted- Larry W8LM ARRL Life Member - Licensed 52 Years. Past President, 2 terms -VFW post 3115 Amateur Radio Club, WØVFW -Wichita, KANSAS
|
|
Re: For those keeping track of uBITX shipping times
#ubitx
Keith McQueen
Ordered April 29
Shipped May 4 Delivered DHL May 7 Keith KB7M
|
|
Re: Coding styles
w7hd.rh <w7hd.rh@...>
I always put a summary comment at the top describing the overall function of the program, then a descriptive comment just before each function. If I'm doing it for my students, then I comment heavily.
I, too, used K&R C back in 1975 while working for Pacific NW Bell. We had a DEC 11/45 and I personally had a Z80-based microcomputer with Smith C running MP/M (multi-user version of CP/M). Did my first satellite-tracking program on the Z80 in Basic and assembler. And yes, I used a Kaypro! Had to write a comm program for it as part of my next job, so did that in assembler. It used a 300-baud modem to communicate with a remote unit about 100 miles away. That reduced travel time considerably :-) -- Ron W7HD - NAQCC#7587 OMISS#9898 KX3#6966 LinuxUser#415320 Editor OVARC newsletter
|
|
Re: Coding styles
Arv Evans
Tim, and others... Coders and coding "style" is similar to farmers, if you get two of them together you have 3 opinions and no agreement on anything. 8-) Been there, done that. Arv _._
On Mon, May 7, 2018 at 10:43 AM, Tim Gorman <tgorman2@...> wrote: Terse? Our mainframe fortran compiler saw spaces as just null space.
|
|
Re: Coding styles
Tim Gorman
Terse? Our mainframe fortran compiler saw spaces as just null space.
I'll never forget the time the teacher gave us a fortran program with all spaces removed and had us try to figure out what it was doing. *That* was terse tim ab0wr On Mon, 07 May 2018 07:58:57 -0700 "Jerry Gaffke via Groups.Io" <jgaffke=yahoo.com@groups.io> wrote: Some C coders won't see that as humor.
|
|
Re: SWR
Tim Gorman
Arv,
I appreciate the info but using external ADC units don't require much support from the main processor. And even at the 100khz bus speed don't load the processor down when they aren't accessed repetitively as critical operation elements. tim ab0wr On Mon, 7 May 2018 09:55:59 -0600 "Arv Evans" <arvid.evans@gmail.com> wrote: Tim AB0WR
|
|
Re: SWR
K9HZ <bill@...>
Correct, but it is more important that, in the case of SWR that the forward power and the reverse power be synced in time. Thats where the Arduino fails and you would want to do it off the Arduino. With ten random variables that don't need to be time related, you can just let the A/D run continuously and just grab data from the conversion register when you need it. They run in parallel with instruction processing so no time slots are lost.
toggle quoted messageShow quoted text
Dr. William J. Schmidt - K9HZ J68HZ 8P6HK ZF2HZ PJ4/K9HZ VP5/K9HZ PJ2/K9HZ
Owner - Operator Big Signal Ranch – K9ZC Staunton, Illinois
Owner – Operator Villa Grand Piton - J68HZ Soufriere, St. Lucia W.I. Rent it: www.VillaGrandPiton.com email: bill@...
On May 7, 2018, at 10:49 AM, Tim Gorman <tgorman2@...> wrote:
|
|
Re: 45Mhz crystal filter specification
Arv Evans
Jerry Thanks for the information. Being a dual-log detector the AD8302 could be advantageous for any application that needs two simultaneous measurements ( input versus output ) or ( both ends of a component or circuit ) or ( forward and reflected power ). Ebay: <http://tinyurl.com/ychovwc3> Arv _._
On Sun, May 6, 2018 at 10:52 PM, Jerry Gaffke via Groups.Io <jgaffke@...> wrote: The AD8302 is an interesting part, been around a couple decades now, about as long as the AD8307.
|
|
Re: SWR
Jerry Gaffke
Power is proportional to the square of the voltage read from a diode detector, so that's just an extra multiply.
toggle quoted messageShow quoted text
The Nano does an 8x8 hardware multiply in 2 clock ticks, so maybe a dozen ticks for 16x16, or 1us. Vs a lookup table in flash to convert dBm to Watts, most hams will prefer a display in Watts. Nano flash is in short supply, but it has lots of microseconds. And the supply of $0.30 AD8307's is not guaranteed. Advantage here is that the AD8307 can detect ridiculously low power levels if you can keep all those other noise sources from sneaking in. Works either way, not too big a deal. Could easily lay the board out for both, the additional area consumed is less than a toroid. Jerry
On Mon, May 7, 2018 at 08:58 am, Kees T wrote:
So what would be the minimum compute requirement on an existing Nano ? Maybe read 2 analog inputs directly from 2 AD8307s with only a scaling factor for Stockton Bridge coupler loss. Multiply that by 1dBm per 25mV (linear spec for the AD8307) and you have the Forward and Reflected power in dBm into a 50 ohm load. Look up the "power" in Watts or tape a small chart on the bottom of the uBITX.
|
|
Re: Coding styles
Mark Pilant
My number 1 rule about coding is:
Expect / assume someone else will have to modify or maintain the code being written. This means: *comment* the code. I can't tell you how much I *hate* the statement "the code is the comments". Even the code I write for myself, I still put in lots of comments. Having them makes it soooo much easier later on when I need to make changes. My number 2 rule about coding is: Use the same coding style of the existing code when making changes. Trying to follow and understand code written using different coding styles can be really hard, and lead to misunderstanding and errors. Probably the best example I have is one piece of assembly code I wrote years ago. The code itself was only about 25-30 lines of assembly code, but there was another page of comments explaining how the code actually worked because there was a lot of bit manipulation and "odd" instructions because they were faster than the expected instruction. (This was the main protection checking function in the OpenVMS kernel [dating myself] if anyone is wondering, and it had to be really fast.) 73 - Mark N1VQW
|
|