Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Computer Language Discussion + PIC Programmers

Status
Not open for further replies.
Yes, but Sun is now owned by Oracle; Microsoft is still Microsoft.
Good point.... However didn't he have to split the company as requested by the monopolies commission?
Google and Oracle were now locked in a battle over IP infringement involving Java.
Now I didn't know that.... I shall watch with interest.... Google, I feel, is getting too big... They seem to be dominating and throwing their weight around lately (or is this just me!!)
Usually C programmers use libraries that hide much of the hardware. Beginners do not usually know how to access memory locations directly etc. However C as a language does not hide the hardware.
This is why Nigel and others believe that beginners at least spend a time assembly programming..
 
It is a combination of the compiler and linker that locates code in memory.

wikipedia said:
In computer science, abstraction is the process by which data and programs are defined with a representation similar in form to its meaning (semantics), while hiding away the implementation details.

The abstraction in C hides the machine instructions. It does not prevent us from accessing memory but we can not use the instruction set without dropping into ASM. The instruction set is hidden. I feel that embedded people should learn some assembly but not as a first language.
 
This is why Nigel and others believe that beginners at least spend a time assembly programming..

Although I agree with this sentiment I think beginners should have a little bit of success with C (or another HLL) before learning ASM. In the past I have seen people scared away from μC's at my local electronics club after being advised to start with ASM. Early success goes a long way in encouraging someone to learn deeper.
 
Last edited:
Although I agree with this sentiment I think beginners should have a little bit of success with C (or another HLL) before learning ASM. In the past I have seen people scared away from μC's at my local electronics club after being advised to start with ASM. Early success goes a long way in encouraging someone to learn deeper.

I actually think it's better the other way around. Learning assembly really forces you to focus on the hardware and learn how it works. Once you've learned that, it's much easier to learn C because you already know how the chip operates, what registers do what, etc. IMO it doesn't require much ASM. I started with ASM and wrote a simple LED chaser program, and then moved to C. Even that tiny bit of Assembly helped me learn C a little bit faster. Of course, this is with micro-controllers, but I can't imagine it'd be much different with computer programming. That's my 2¢.
 
Last edited:
If there is something sacred or blessed about ASM level programming maybe we should all switch to a processor where we can write programs in microcode and get even closer to the hardware. Or maybe switch to a processor with a more user friendly instruction set!

"Focus on the hardware" Fine if we are talking about peripherals. We do not want people focusing on the instruction set(s). We have compilers for that. Do we want are people that only program in one instruction set forever shying away from HLLs. It happens.

It is far easier to learn programming concepts if one does it independent of a specific instruction set. Doing so enables the student to think of programming at the problem level rather then at the machine level.

It might sound that I am anti ASM. I am not but the idea that it should be used as an introduction to programming forces my further into the HLL camp that I feel comfortable with. All embedded programmers need to lean a few different ASM's but I do not expect or want them to use ASM exclusively in place of a HLL.

I would prefer people learn to program in a HLL on a PC prior to working with microcontrollers.
 
Does building a microcoded processor from SSI logic count. It didn't do much, but sort numbers in ascending or descending order, but it had, conditionals, swaps and branches. 16 bits wide x 16 long.

This was done in the ERA of the 8008, 6800 processor.
 
I like to relate the use of high level "Computer Languages" to hardware design.
We use the abstraction of a HLL computer language for the same reasons we use circuit theory in electronics instead of Maxwell's equations to find the power in a DC resistive circuit. In engineering abstraction is used to simplify unneeded details in a box within the overall design. If there is a block in the design that deals with EM fields then within that box the proper methods are used but the interfaces with it are designed to be compatible with the overall level of circuit abstraction.

This video is about circuit design but the exact same ideas are used in computer science for program design with high level languages.
https://www.youtube.com/watch?v=AfQxyVuLeCs&feature=youtu.be

The MIT online materials are an incredible resource for learning and the price is right, FREE. https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/
 
Last edited:
The Microsoft C# IS Java really.... It was spawned from the legal battle between Java and Microsoft's J..... ooohhh remember J... they got their hand wrapped with that one... (One Bill didn't win).

I like C# it's actually better than the new visual basic .net... More professional. the free version will let you do almost everything you need to do.

Java is a runtime application. C# is a compiled application. Big Difference.
 
In 6th grade ('98) I was given my first computer. Within a few weeks I was asking my dad "what program do you use to make other programs?" He had a friend come over and install Visual Studio, and he showed me the basics of Visual Basic and gave me a book. I played around with VB for a while and got pretty good with it (for a grade school kid). When I got into high school I battled with my identity and decided that I was too cool to have interest in computers, so technology surpassed me. In the last 2 years my inner nerd that I suppressed for so long is coming out and I'm interested in μcontrollers. I've played with Arduino and I find it pretty intuitive. I opened up VB the other day and surprisingly I remembered enough to just start writing code. I also find VB intuitive. I am interested in C, and PICs, but so far haven't tried either. I'm interested in learning ASM because I've heard so many people say that it's some crucial thing that everybody should know, but it scares me, and I don't know it is so crucial; I've gotten this far without it. So far the only quantifiable advantage I've seen to programming a μcontroller in ASM is to make it run really fast, but that hasn't been an issue for me yet. Maybe when I start working on more complicated projects it will all become clear to me, as to why I need to know it.
 
Last edited:
Do not let ASM scare you away from micro controllers. While all good embedded programmers should know ASM much of the code is written in a HLL. You can study ASM after you are comfortable with programming in C or BASIC.

C and BASIC are both procedural languages and have much in common. C has a good number of short hand notations that can look strange at first glance but you really do not need to use them.

x++; // same as x = x + 1

if(x) x=3; // same as if(x <> 0) then x = 3

It is important that you understand the binary and hex number bases.

A while back I wrote a tutorial that you may be interested in reading.
https://www.rocklore.com/3v0/tutorials/JunebugTut1C3.pdf
 
Do not let ASM scare you away from micro controllers. While all good embedded programmers should know ASM much of the code is written in a HLL. You can study ASM after you are comfortable with programming in C or BASIC.

C and BASIC are both procedural languages and have much in common. C has a good number of short hand notations that can look strange at first glance but you really do not need to use them.

x++; // same as x = x + 1

if(x) x=3; // same as if(x <> 0) then x = 3

It is important that you understand the binary and hex number bases.

Oh I'm not going to be scared away from them, I am in love with them. I just tend to learn things as I go along and have no choice.

A while back I wrote a tutorial that you may be interested in reading.
https://www.rocklore.com/3v0/tutorials/JunebugTut1C3.pdf

Printed, and inserted into my "Book of Knowledge" binder. Thank you. Very well put together.
 
Get the Pickit 2 from Ebay, I hear the 3 was like win95.
 
Get the Pickit 2 from Ebay, I hear the 3 was like win95.

Can you be a little more specific?

I had PicStart Plus, and while that was very nice, I needed a new programmer for the newer chips. I got PK3 from Microchip and the adapter boards on eBay, and have had no problems whatsoever.

I have thought about selling the PS+, but my ethics won't let me. BTW, PK3 (real, OEM) and the adapter boards can be obtained on eBay for almost the same price as retail PK3 alone is from Microchip.

John
 
Can you be a little more specific?

I had PicStart Plus, and while that was very nice, I needed a new programmer for the newer chips. I got PK3 from Microchip and the adapter boards on eBay, and have had no problems whatsoever.

I have thought about selling the PS+, but my ethics won't let me. BTW, PK3 (real, OEM) and the adapter boards can be obtained on eBay for almost the same price as retail PK3 alone is from Microchip.

John

Actually I am just going by this review.
https://www.youtube.com/watch?v=LjfIS65mwn8
 
The PK3 works better then it did when it first came out but lacks the logic tool and the uart tool software. You can not use a PK2 with the newer chips. Where there is a choice I am using the PK3 these days. It works a bit better with MPLAB X and seems faster.

Any PIC programmer should work with the tutorial.
 
...
I have thought about selling the PS+, but my ethics won't let me. BTW, PK3 (real, OEM) and the adapter boards can be obtained on eBay for almost the same price as retail PK3 alone is from Microchip.
...

Sorry to ask a personal question but what is the ethical issue you have with selling your PICstart Plus? Isn't it just a piece of old equipment you own?
 
@Mr RB,

Yes, it is a piece of old equipment that has been obsoleted. If someone understood that and wanted it as a collector's item or for its limited usefulness, I would sell it to them. I have no ethical issue with that.

I would not want to sell it to someone who did not understand that limitation. For the money they are selling for, including reasonable shipping, you can get a factory new and fully supported PK3. (See this extraordinary example: **broken link removed** ). Mine is like new cosmetically and includes the power supply and newest version of the flash board.

I generally support "buyer beware" when the sellers and buyers are on equal footing. Unfortunately, there is no way to ensure that in a marketplace like eBay. A brief review of negative comments by buyers clearly shows there are a lot of impulse-driven buyers who don't/didn't understand what they were buying. (I am not ignoring those sellers who intentionally mislead buyers.) Some buyers may be kids who have money, but no guidance. We see the results here with people buying electronic devices, like lasers, who have no idea how to work them.

Thus, for the few dollars involved, I would just as soon give it to some young person who is starting out and needs a little help. The fun of helping them learn to use it, or any of my other old stuff, would outweigh any fair price I might get in the market.

Now, if you want to make a reasonable offer, it is all yours. :D

John
 
hi John,
I have and use a PicStart+, it works fine for 16F and 18F series programming, wouldn't let it go. ;)
Very useful as a back up prommer.

E.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top