PIC Assembly Language Update: #1.1 - PCB schematic

  Рет қаралды 17,368

Julian Ilett

Julian Ilett

Күн бұрын

Пікірлер: 148
@tomgeorge3726
@tomgeorge3726 7 жыл бұрын
Hi Julian, great stuff, takes me back to University days with Z80 and then PIC days with PC. Nice efficient code for a small PIC.
@richardboyce4921
@richardboyce4921 7 жыл бұрын
Very interesting Julian, well presented. Really love this series.
@JulianIlett
@JulianIlett 7 жыл бұрын
Thanks Richard - another follow up video just processing now :)
@UpcycleElectronics
@UpcycleElectronics 7 жыл бұрын
I'm following this series for future reference. Thanks for your efforts Julien.
@nabarnes
@nabarnes 7 жыл бұрын
Comprehensively answered. Thank you. Looking forward to part 2 (A.K.A. Project blinky!).
@jonathancrossley6803
@jonathancrossley6803 7 жыл бұрын
From the datasheet, the internal oscillator is calibrated at Vdd = 3.5V @ 25C (table 12-2). From figure 13-15 it can be seen that the frequency will drop with higher supply voltages
@JulianIlett
@JulianIlett 7 жыл бұрын
+Jonathan Crossley Ah, interesting. 3.5v sounds like something of a compromise.
@alphahr
@alphahr 7 жыл бұрын
excellent! Answered all my questions! Can't wait for the next installment
@ntoobe
@ntoobe 7 жыл бұрын
I'm very excited about this tutorials, keep up the good work! Also, I find the schematic very useful. Most of us, your subscribers, are visual types I presume, putting an effort in drawing the schematic goes an extra mile than just explaining what this and that does on the board. You should do more schematics ;)
@DavidWatts
@DavidWatts 7 жыл бұрын
Thanks for doing these tutorials Julian, I am eagerly awaiting my cheap Chinese programmer and ICs so I can follow along.
@JulianIlett
@JulianIlett 7 жыл бұрын
Did you go for the PICkit 2 or 3?
@DavidWatts
@DavidWatts 7 жыл бұрын
I went for the PICkit 3... higher is better right...? :-S
@JulianIlett
@JulianIlett 7 жыл бұрын
After an evening of tearing my hair out... yes, the PICkit3 works fine - phew!
@DavidWatts
@DavidWatts 7 жыл бұрын
Julian Ilett Ha ha, I know the feeling. I enjoy the end of those evenings but feel terrible nerd panic during them.
@JerryEricsson
@JerryEricsson 7 жыл бұрын
Very interesting. Being an old Commodore man, I was very used to entering machine code into a programmer into a program that wrote it to disk as machine code. Used to have the wife read the code to me as I entered it into the coder program via the keyboard. I never really understood what exactly the code did, other then work great if you did everything right, the software had the uncanny ability to tell you if you messed up and show you where your error might be. I used to enter all sorts of programs that way from RUN magazine, as well as COMMODORE. I kept those magazines for years, and finally sold them as a package deal with my C=128, 1571, printer and monitor to a lady who needed some sort of computer to type up reports and such, which was very doable with the Commodore. I saved my software for many years, and here about 10 years ago, sold my collection on Ebay, receiving enough money to purchase a brand spanking new HP Laptop. I believe my total collection numbered around 1000 disks and covered lots of commercial software, and all those codes I typed in from the magazines. I always saved the code, after all it took hours to type in some programs. this looks like it could get about that complicated, but now all that code I typed in is beginning to make sense. I always wrote the software I needed and could not locate in Basic, and became quite good at Basic on the old Commodore.
@JulianIlett
@JulianIlett 7 жыл бұрын
I sold all my electronics magazines to a chap from Diss (Brian maybe) via eBay for £1 the lot - and I had nearly 2000 magazines. Massive regret, but I had (and still have) no space for them.
@TheDutyPaid
@TheDutyPaid 7 жыл бұрын
But we do now have the near unlimited resource of the interwebs.
@JulianIlett
@JulianIlett 7 жыл бұрын
True, but there are very few scans of old electronics magazines archived on the web.
@webchimp
@webchimp 7 жыл бұрын
+Jerry Ericsson Used to do similar with my Atari ST, got very good at reading the mag and just tap away on the num pad (the listings were in decimal not hex in the magazine I used to get). Can still get up to a reasonable speed sometimes entering numbers 30 years later.
@TheBananaPlug
@TheBananaPlug 7 жыл бұрын
While true, try this web site, americanradiohistory.com it is mainly US magazines, but does have UK titles like PW from start to the 1990's, plus other mags including ETI and PE. There is another site that is UK based that covers Radio Constructor and PW,but memory not working just now. Enjoying your videos btw
@IvoBallie
@IvoBallie 7 жыл бұрын
Hi Julian. An easy mod to the PIC board so that the Vpp does nor cause problems, is to isolate capacitor c4 via a diode. So you need to cut the branch track that to C4 R5 and fit a diode with cathode on Vpp track and anode on the cap-resistor junction. Job done and no need for extra wiring under the board.
@tomg1004
@tomg1004 7 жыл бұрын
Interesting video, as always! How accurate is the frequency counter? A few percent error isn't unrealistic with low cost (or cheap) counters.
@JulianIlett
@JulianIlett 7 жыл бұрын
The frequency counter matched my oscilloscope almost exactly. It's crystal controlled so inherently accurate.
@NivagSwerdna
@NivagSwerdna 7 жыл бұрын
Data sheet 2.2.2.7 OSCCAL six bits, least significant two bits unimplemented
@JulianIlett
@JulianIlett 7 жыл бұрын
Ha ha, well spotted. I haven't been reading my data sheets!!!
@Anvilshock
@Anvilshock 7 жыл бұрын
2 unimplemented bits = 2 bits of usable memory ;)
@NivagSwerdna
@NivagSwerdna 7 жыл бұрын
Anvilshock you could use them for storing zeros
@Anvilshock
@Anvilshock 7 жыл бұрын
Or ones! Or a mixture of both! Very flexible.
@NivagSwerdna
@NivagSwerdna 7 жыл бұрын
Anvilshock according to the data sheet they always read as zero. so it works better for the storage of zeros. the two bits at the end of program flash could be used though.
@KX36
@KX36 7 жыл бұрын
You don't want red electrical tape, you want red quality street wrappers. 7 seg displays are designed to go behind coloured filters.
@senseibaka1
@senseibaka1 7 жыл бұрын
Julian, I think you need a forum or something where it is much easier for people to ask questions and help out other people with problems. It would be so useful for these tutorials.
@JulianIlett
@JulianIlett 7 жыл бұрын
Probably the easiest way is to start a new thread on EEVblog forum.
@DAVIDGREGORYKERR
@DAVIDGREGORYKERR 7 жыл бұрын
I cannot find the GCC compiler and AT&T assembler for that chip although I have all the other GCC and AT&T assemblers for all the other processors.
@SwordQuake2
@SwordQuake2 7 жыл бұрын
Is GCC at all needed?
@DAVIDGREGORYKERR
@DAVIDGREGORYKERR 7 жыл бұрын
SwordQuake2 I use GCC to interface with the AT&T assembler
@nickpelov
@nickpelov 7 жыл бұрын
I wouldn't bet my life on that frequency meter
@pikadroo
@pikadroo 7 жыл бұрын
I'd bet on the frequency counter before I bet on that garbage pic board. ugh. LOL. XD
@nickpelov
@nickpelov 7 жыл бұрын
pikadroo he-he. you know they came from the same source, right. however if the chip is genuine the board can't affect the internal oscillator. And this chip is not worth making a fake. it's not widely used $8 FTDI chip.
@pfeerick
@pfeerick 7 жыл бұрын
Surely you can't be thinking they're not accurate pieces of lab equipment now!!! I was wondering how accurate that was... would have liked to have seen the scope on it before being so quick to say the PIC wasn't calibrated properly ;) Although with the probably lower than 5v and lower than 25C, the clock should be a bit out...
@JulianIlett
@JulianIlett 7 жыл бұрын
The frequency counter and my scope gave identical results - both are crystal locked, so that's no surprise.
@glennlawrie-smith8570
@glennlawrie-smith8570 7 жыл бұрын
Julian Ilett As a former military technician who ran a calibration lab in the far east, I was wondering if your scope was calibrated against a standard that can be traced back to any international standards for frequency?
@pfeerick
@pfeerick 7 жыл бұрын
Great video Julian. And thanks for the schematic... I've ordered a bunch of PIC12F675s and was going to make my own board instead of hacking that crudy board up... so much appreciated!! :D Now... how long was it before you read the gray note text under 9.2.5.1 which actually says "Microchip Development Tools maintain all calibration bits to factory settings."?? :-P
@JulianIlett
@JulianIlett 7 жыл бұрын
+Peter Feerick haha. In my defence, it is a very long data sheet ;)
@pfeerick
@pfeerick 7 жыл бұрын
lol... that it is... although the ATtiny84/ATtiny85 datasheets weigh in at 234 (just comparing with a 8pin micro from the AVR lineup that I am familar with)... so this one is short by comparison! :-P I just found it hilarious that you have just been talking about it (erasing calibration data not working), and then you were showing the very page from the datasheet that had the note on it! :-O :-D
@bovinberg7349
@bovinberg7349 7 жыл бұрын
Struggled for a few hours to get this to work. Had to go to Programmer-->Release from reset before i got it to work.
@johncherry108
@johncherry108 7 жыл бұрын
I'm sure Arizona Microtech would test and/or calibrate their product in air-conditioned premises, independent of extreme outside temperature variations.
@pfeerick
@pfeerick 7 жыл бұрын
lol... yeah... it's probably done at 25C and at exactly 5v... but that isn't to important is it? :-P
@arifanwari3168
@arifanwari3168 7 жыл бұрын
cheerio but comeback quick :) always look forward to a new upload.
@TheDutyPaid
@TheDutyPaid 7 жыл бұрын
Bit off topic, have you added the widget from KZbin to your own website as that is a big part of getting verified?
@JulianIlett
@JulianIlett 7 жыл бұрын
er, I can't remember - I haven't looked at my websites for a while.
@paranoiia8
@paranoiia8 7 жыл бұрын
I showed that video to 10 years old kid, he said all he heard was: "vidddidvviddgeg connect to vegevididivivegg connect to gievidgegege" xD Now he know that electronic is not only about + and - cable :D
@God-CDXX
@God-CDXX 7 жыл бұрын
can I tie more than 1 of these PICs together
@UberAlphaSirus
@UberAlphaSirus 7 жыл бұрын
Jamie Phillips yes, but it would be much easier to use a bigger pic
@bluedeath996
@bluedeath996 7 жыл бұрын
What happens if you set the calibration up to "ff" with the chip run at a higher speed, or will it just not work at all?
@JulianIlett
@JulianIlett 7 жыл бұрын
I'm sure it would run at a higher frequency.
@danielroibert5631
@danielroibert5631 7 жыл бұрын
Thank you for this good video and thank you very much for your citation, I am delighted to contribute just a little.
@JulianIlett
@JulianIlett 7 жыл бұрын
Excellent contribution - thanks Daniel :)
7 жыл бұрын
whats difference between vcc & vdd?
@JulianIlett
@JulianIlett 7 жыл бұрын
just that bipolar transistors have collectors and FETs have drains - Vcollectors, Vdrains.
7 жыл бұрын
im not sure what fets and drains are lol
@joshuabest100
@joshuabest100 7 жыл бұрын
Jay Mee he is hinting to mosfets and a mosfet has a drain pin im not too sure what the drain pin does but i thing it is similer to a relay
@andymouse
@andymouse 7 жыл бұрын
keep going bud it will all start to make sense its a good hobby!
@andymouse
@andymouse 7 жыл бұрын
drain as in "down the " except not water but electricity they are fun transistors to play with and the relay isn't to far from the truth keep playing bud!
@andreweastland9634
@andreweastland9634 7 жыл бұрын
Would think it's more likely the frequency error is in your counter than the pic. Only needs a few nano secs out on the gate time, don't think the counter was made by Tektronix.
@joshuabest100
@joshuabest100 7 жыл бұрын
what does pic stand for
@JulianIlett
@JulianIlett 7 жыл бұрын
I think it's Peripheral Interface Controller. Silly name really.
@joshuabest100
@joshuabest100 7 жыл бұрын
Julian Ilett thanks for the reply that is a weird name for it
@LemoUtan
@LemoUtan 7 жыл бұрын
Not to mention that thing about registers being called files
@stevesm2010
@stevesm2010 7 жыл бұрын
Good stuff. Answered a few of my questions.
@TomStorey96
@TomStorey96 7 жыл бұрын
I believe that it is recommended to use BANKSEL to switch banks as it takes care of setting and clearing the required status bits. And if you include the appropriate header for your chip you should be able to reference registers by their name, which is way more human friendly than a series of addresses.
@JulianIlett
@JulianIlett 7 жыл бұрын
I'll introduce the header file in the next part
@TomStorey96
@TomStorey96 7 жыл бұрын
Cool. Even though I have been writing assembly for PICs for years, I am still enjoying this series. You just never know if you'll learn something new!
@JulianIlett
@JulianIlett 7 жыл бұрын
Excellent - I'll introduce BANKSEL too at some point.
@Brainstorm4300
@Brainstorm4300 7 жыл бұрын
Sees the video. Sticks red tape on all the 7 seg displays.
@superdau
@superdau 7 жыл бұрын
The "typical" temperature for values in datasheets is pretty much 25°C in all I looked at. Does not sound much different from the 20°C in your room, but just put your finger on the chip and see how much the clock drifts. So don't even think about using the internal oscillator if you want to do serial communication.
@Brainstorm4300
@Brainstorm4300 7 жыл бұрын
superdau As far as I remember this chip (12f675) doesn't have uart facilities. So not much to think about.
@JulianIlett
@JulianIlett 7 жыл бұрын
Probably OK if you use a low baud rate - 300 baud would work fine!
@LemoUtan
@LemoUtan 7 жыл бұрын
If you want to serially communicate at 115200 then - yep - you definitely have a good point there. But the original RS232 spec permitted some drift, so maybe don't worry too much about it at 1200 to 9600 baud. When the standard arose, they were probably used to running at 110 bits per second :)
@superdau
@superdau 7 жыл бұрын
The baudrate is irrelevant because the error is relative. If your oscillator is 1% off your baudrate is 1% off. Typical datasheets recommend around 2% error max. You have to consider that the clock on the receiving end can be off, too. If the sender is 2% fast and the receiver 2% slow that's a 4% error for every bit. Considering start bit, data bits, parity bit and stop bit, that means the last bit can be off by something like 40% (depends on the total number of bits per "character", so your serial settings). Many receivers try to sample at the center of a bit. So if a bit is off by more than 50% it is read incorrectly. You can easily do software UART in case you need one (I think 57600 was no problem at all on an AVR) and the same holds true there.
@JulianIlett
@JulianIlett 7 жыл бұрын
Ugh, now I have to really think about this! If the clock deviated by a few Hertz, wouldn't that affect fast baud rates more than slow baud rates? And the temperature vs. clock speed graphs are marked up as degrees C vs. Hertz.
@phdDotCom
@phdDotCom 7 жыл бұрын
9.2.5.1 Calibrating the Internal Oscillator: "Microchip Development Tools maintain all calibration bits to factory settings." You almost read it out in the video :)
@CornishMiner
@CornishMiner 7 жыл бұрын
Now we know why led segment displays usually had a red filter in front of them. :)
@ThatGuy-nv2wo
@ThatGuy-nv2wo 7 жыл бұрын
Every time I try to read my chips I get invalid target device ID (0x0) and a bunch of NOPs. Clearly not communicating with my pickit 3, I shall have to put together my own board *sigh*.
@JulianIlett
@JulianIlett 7 жыл бұрын
Are you using MPLABX?
@ThatGuy-nv2wo
@ThatGuy-nv2wo 7 жыл бұрын
Julian Ilett Tried both versions, v8.9 (whichever was recommended), MPPLAB IPE, MPLAB IDE, all giving bad results. I'm starting to think it's the pickit as none of the 6 PICs I have are being read or seemingly communicating with the pickit(a knockoff from Alice).
@JulianIlett
@JulianIlett 7 жыл бұрын
Wire mod fitted? GP3 yellow link removed while programming? Try playing with the other programmer controls, particularly the reset up arrow, down arrow and traffic light buttons.
@JulianIlett
@JulianIlett 7 жыл бұрын
Also, I bought some well dodgy PIC chips from some well dodgy eBay sellers a few years ago.
@ThatGuy-nv2wo
@ThatGuy-nv2wo 7 жыл бұрын
Julian Ilett Tried with wire mod, a breadboard version(wires directly to PIC), breadboard with pull-up resistor (saw on the internet it may work, it didn't). What do you mean by reset up, down arrows and traffic lights? I'll consider getting some official chips to see if they work (that'll see if it's the chips), but 6? Seems unlikely they're the problem, but not impossible. They were also from Alice, which is better than most sellers.
@nickpelov
@nickpelov 7 жыл бұрын
PicKit 2 standalone programmer has oscillator calibration. It's in the menu Tools->OSCCAL - options are Set manually and autogenerate (probably based on the accuracy of the quartz crystal of PicKit2, which is way better than the stability of internal oscillator). PicKit 3 sucks. Whenever possible use picKit2.
@JulianIlett
@JulianIlett 7 жыл бұрын
Pickit 3 really does suck - I've been messing about with it all evening and I can't get it to program reliably.
@JulianIlett
@JulianIlett 7 жыл бұрын
Finally solved - using the PICkit 3 V3.1 standalone programmer :)
@raminrajabioskouei781
@raminrajabioskouei781 7 жыл бұрын
Hi Julian, I increased my internal clock calibration to highest set bits but still my clock speed shows 0.7467 Mhz, I checked my voltage and it is 4.95. So what's I'm doing wrong? is it my chip clone or can I increase (movlw 0xff) to 3 bit like (movlw 0x2ff) or not? photos I took from my multimeter and IDE www.flickr.com/photos/139987789@N07/32922773010/in/dateposted-public/ www.flickr.com/photos/139987789@N07/32922765830/in/dateposted-public/ Thanks
@JulianIlett
@JulianIlett 7 жыл бұрын
I'm assuming your yellow wire is on GP4. I notice GP3 is not connected - you should at least have a pullup to Vdd on GP3 (which is the MCLR pin).
@raminrajabioskouei781
@raminrajabioskouei781 7 жыл бұрын
Thanks Sir, The yellow wire connected to GP3 and yes 10k resistor fixed my problem :), now time to watch next tutorial. Thanks Again
@SpeccyMan
@SpeccyMan 7 жыл бұрын
Who on earth connects their LED to a PIC in current sink mode? Kind of wishing I'd not ordered one of these boards now. :P
@JulianIlett
@JulianIlett 7 жыл бұрын
It's not completely stupid - the switches pull low when pressed, so they're active low as well.
@_who_cares_1123
@_who_cares_1123 7 жыл бұрын
Can you explain you PWM5 code in a Video? it would be very interresting. Also thanks for the schematic. :) -φ
@JulianIlett
@JulianIlett 7 жыл бұрын
I'm planning to do that. I want to design a new surface mount PCB for it to try and encourage the Chinese factories to produce $2 copies of the PWM5 :)
@_who_cares_1123
@_who_cares_1123 7 жыл бұрын
Julian Ilett You want the Chineese to copy you product? But I wanted to give you all my money :(
@JulianIlett
@JulianIlett 7 жыл бұрын
Ha ha, no need - it's all open source.
@UberAlphaSirus
@UberAlphaSirus 7 жыл бұрын
I owe Daniel a beer. Bloody obvious aswell.
@bakeronews1
@bakeronews1 10 ай бұрын
Good tutorial
@narayanbandodker5482
@narayanbandodker5482 7 жыл бұрын
Really nice video! But careful! Each reprogram reduces one of it's 100000 lives! (Not that big of a problem though)
@JulianIlett
@JulianIlett 7 жыл бұрын
Not really a problem - the PIC chips are pretty cheap :)
@madbstard1
@madbstard1 7 жыл бұрын
Am I first?
@madbstard1
@madbstard1 7 жыл бұрын
lol
PIC Assembly Language Update: #1.2 - PICkit3 Issues
13:59
Julian Ilett
Рет қаралды 40 М.
PIC Assembly Language Tutorial: #2 - LED Blinky
28:12
Julian Ilett
Рет қаралды 35 М.
It works #beatbox #tiktok
00:34
BeatboxJCOP
Рет қаралды 41 МЛН
Try this prank with your friends 😂 @karina-kola
00:18
Andrey Grechka
Рет қаралды 9 МЛН
PIC Assembly Language Tutorials: #0 - Shopping List & Mods
16:42
Julian Ilett
Рет қаралды 30 М.
3 engineers race to design a PCB in 2 hours | Design Battle
11:50
Predictable Designs
Рет қаралды 516 М.
Playing with: PIC12F675 Microcontroller Demo PCB
24:48
Julian Ilett
Рет қаралды 38 М.
PIC Assembly Language Tutorial: #1 - Config and Clock
26:28
Julian Ilett
Рет қаралды 54 М.
Using a 1930 Teletype as a Linux Terminal
16:33
CuriousMarc
Рет қаралды 1,5 МЛН
PWM5 Solar Charge Controller PIC Programming
23:55
Julian Ilett
Рет қаралды 17 М.
Microchip PIC - In Circuit Serial Programming Issues
26:31
Julian Ilett
Рет қаралды 18 М.
Light Saber PIC Assembly Code Structure
19:22
Julian Ilett
Рет қаралды 12 М.
Baseline PIC C programming lesson 1 -  Flash an LED
27:02
Gooligum Technologies
Рет қаралды 71 М.
Flawless PCB design: RF rules of thumb - Part 1
15:45
Hans Rosenberg
Рет қаралды 95 М.