Search found 48 matches

Return

by Benj
Sat Jul 06, 2013 1:42 pm
Jump to forum
Jump to topic

Re: RB0/INT issue..

Hello, Sounds like you need to keep RB0 free to do your interrupt. You could use Pins RA0 and pins RB1-7 for the common bus by using masking techniques. porta = (porta & 0xFE) | (data & 0x01) portb = (portb & 0x01) | (data & 0xFE) Or maybe RA0-3 and RB4-7 porta = (porta & 0xF0) |...
by DavidA
Wed Mar 28, 2012 12:04 am
Jump to forum
Jump to topic

Re: inputs and outputs on same port?

hello hazic,

Some pins may only allow inputs or outputs on them, i would advise you check the datasheet of your particular device to try and locate your pins and whether they provide input and output, or just one of them.
by Benj
Thu Mar 29, 2012 10:23 am
Jump to forum
Jump to topic

Re: inputs and outputs on same port?

Hello Hazic,

Great glad you got it sorted thanks for letting us know.
by hazic
Wed Mar 28, 2012 10:34 pm
Jump to forum
Jump to topic

Re: inputs and outputs on same port?

thank you for trying to help

problem is solved!
Atmega16 arrives from factory with JTAG enable fuse set and for using all port C pins properly it is nessecary to disable JTAGEN fuse.
by Benj
Tue Mar 30, 2010 9:29 am
Jump to forum
Jump to topic

Re: Is your Project Not working? Help and General Advice

Rule of thumb to follow when working with variables on micros is:

Do I read the variable before I write to the variable?

If you do then you must initialise the variable.
by medelec35
Mon Dec 14, 2009 4:28 pm
Jump to forum
Jump to topic

Is your Project Not working? Help and General Advice

Here are some basic solutions. First make a very simple 1Hz flasher, using an LED and something like 270R resistor in series. E.g: Loop while 1 A0=1 Delay 500ms A0=0 Delay 500ms If LED not flashing at correct rate (or at all) then check: A) All voltages are correct. VDD or VCC = +5V. VSS or VEE=0V. ...
by Spanish_dude
Thu Oct 17, 2013 11:44 pm
Jump to forum
Jump to topic

Re: Custom 7Segment display characters

Hi, It's quite simple. Make a LUT (lookup table)/array and go through the table whenever you want to display a certain pattern on your 7 segment display. LUT_7SEG[] = { 0x3F, // 0 0x06, // 1 0x5B, // 2 0x4F, // 3 // ... }; Checkout wikipedia for other hexcode: http://en.wikipedia.org/wiki/Seven-segm...
by medelec35
Fri Oct 18, 2013 12:51 pm
Jump to forum
Jump to topic

Re: Custom 7Segment display characters

Spanish_dude wrote:PS: I always forget which bit value sets the I/O as output in a TRIS register.


Nice easy way to remember:

I as in Input looks like a 1

O as in Output looks like a 0

So with TRIS register:
Use 1 for Input
Use 0 for Output

Martin
by Benj
Mon Oct 21, 2013 5:31 pm
Jump to forum
Jump to topic

Re: Custom 7Segment display characters

I as in Input looks like a 1
O as in Output looks like a 0


That's how I remember it too :D

Unfortunately AVRs work the other way, 1 is output, 0 is input. Here I just remember that AVRs are backwards to what you would expect :wink:
by Benj
Tue Oct 22, 2013 5:02 pm
Jump to forum
Jump to topic

Re: Calculate with 16 bits value

Hello Rinie, First of all you can combine two 8-bit bytes into a 16-bit variable like this. Int = (Byte_MSB << 8) + Byte_LSB This way you can store into 16-bit unsigned integer variables straight away. You can then perform averaging by doing something like this. IntOld = Int IntOldOld = IntOld Int =...
by medelec35
Sat Sep 14, 2013 12:01 am
Jump to forum
Jump to topic

Re: ADC Calculation

Hi Stuart,
You could try:
Value = (ReadADCByte * 39) / 99


Martin
by medelec35
Mon Sep 16, 2013 7:07 pm
Jump to forum
Jump to topic

Re: view variables in simulation mode

Or when simulation speed (Build, Project options, General Options tab)is set to 1000 or less and run is selected.
by kersing
Mon Sep 16, 2013 4:51 pm
Jump to forum
Jump to topic

Re: view variables in simulation mode

The variable values are only visible if the execution is paused at a breakpoint or while single stepping.
by dazz
Wed Oct 23, 2013 8:29 pm
Jump to forum
Jump to topic

Re: LM34 Temp sensor

Hi Fella With flow-code try to make all your variable meaningful to the job they perform again comment your code extensively as it will help you remember what a particular calculation or something else is trying to do , also try using a switch icon instead of a decision icon as a switch icon lays ni...
by medelec35
Sat Oct 26, 2013 11:43 am
Jump to forum
Jump to topic

Re: LM34 Temp sensor

Hi Prashant & Bill , I have not got an LM34 so this is only my theory so I can't guarantee it will work. Reading variable as int (not Byte) then try the following formula: Fahrenheit = ReadADCVariable *50/102 Below is my theory if you would like to know how I came up with the formula: If you use...
by medelec35
Sat Oct 26, 2013 1:31 pm
Jump to forum
Jump to topic

Re: LM34 Temp sensor

I have created a flowchart (with Flowcode V5) to display Fahrenheit and Celsius using LM34
Its untested so hope it works.

I have left both readings of Fahrenheit and Celsius on the LCD, so you can edit flowchart as you see fit.
LM34 Thermometer.png


Martin
by Spanish_dude
Fri Oct 25, 2013 9:42 pm
Jump to forum
Jump to topic

Re: Getting started with PIC - need advise !

Hi Alberta, What's your preferred programming language ? Microchip has a free IDE (MPLABX) with C/C++ compilers (XC8, XC16, XC32). There are free versions of the compilers provided by microchip but you should know there's a file size restriction. I'm sure you could find some interesting source codes...
by medelec35
Sat Apr 24, 2010 9:06 am
Jump to forum
Jump to topic

Re: Sine Wave

Hello Astrea.
Did you have any success, or would you like some further assistance?
If you require assistance, I maybe able to help you out with some simple circuity to convert PWM directly to a sine wave
by Benj
Thu Oct 31, 2013 11:30 am
Jump to forum
Jump to topic

Re: AC line voltage measurements

Hello,

With the second approach can you simply use a separate DC PSU to drive the electronics and supply power to the relay. This should then leave the AC voltage completely untouched so you get an accurate reading no matter what.
by medelec35
Thu Oct 31, 2013 8:40 pm
Jump to forum
Jump to topic

Re: AC line voltage measurements

Hi prasha920 Food for thought: If it was me measuring AC mains, I would probably use opto-isolator with a fixed CTR. This would provide total isolation. I would use something like 2 x 120K resistors in series from say live to one of the inputs, then the other i/p would go to neutral. you have to sti...
by medelec35
Sat Nov 02, 2013 1:14 am
Jump to forum
Jump to topic

Re: AC line voltage measurements

I would use any that has high linearity How about something like http://uk.rs-online.com/web/p/optocouplers/0450806/ CTR is the Current Transfer Ratio. If you want to make a production item then fixed ctr will be ideal. after 190Vac i even dont get a single digit change Sounds like either input has ...
by Enamul
Sun Aug 19, 2012 11:24 am
Jump to forum
Jump to topic

Re: Pins from various ports for 7 segment display

Hi,
Thanks for the head into the code. I am certain others will get help from it.
by yousafzai
Sun Aug 19, 2012 3:17 am
Jump to forum
Jump to topic

Re: Pins from various ports for 7 segment display

Hi Enamul
It works great. I have studied the file that you sent me for single segment and have modified for 4 seg which also works fine.


Thanks a lot for the nice (and timely) help.


Regards
by Enamul
Wed Aug 15, 2012 5:59 pm
Jump to forum
Jump to topic

Re: Pins from various ports for 7 segment display

Hi, In my modified one I have done similar thing which I was thinking for any pic..that's why I have modified for upto 5 ports. But it seems that the component code a bit changed in FCV5.4 although mine one was for FCV5.2. Enamul Edit: ok..I got it..still you can't change port in FC connection windo...
by Benj
Tue Jun 10, 2014 10:10 am
Jump to forum
Jump to topic

Re: How to protect microcontrollers?

Hi John, The easiest way to check for damage on a batch is to have some kind of a test rig that allows you to do the following. program/verify the device switch each pin high and confirm that the pin has indeed gone high, no other pins should go high switch each pin low and confirm that the pin has ...