Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC12F683 UART_Soft problems

Status
Not open for further replies.

imranahmed

Advanced Member level 3
Joined
Dec 4, 2011
Messages
817
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Location
Karachi,Pakistan
Activity points
6,492
Please anyone clear my some confusions about attached code.
In the code,Soft_UART_Write(10); // Line Feed
Soft_UART_Write(13); // Carriage Return
what is the purpose of these commands.
 

Attachments

  • UART.txt
    878 bytes · Views: 92
Last edited:

These commands send data through UART (Software UART).
10 is the ASCII code for "Line Feed".
13 is the ASCII code for "Carriage Return".

The above 2 lines basically instruct to go the beginning of a new line.
 
Please check attached circuit,this is not working, what should I do?
 

Attachments

  • 7cc.bmp
    2.3 MB · Views: 56

Maybe the transistor you have used in Proteus doesn't have a spice model. Try using 2N3095 because you are using Common Anode type 7 Segment display.
See the image.
 

Attachments

  • CA 7 Segment.jpg
    CA 7 Segment.jpg
    108.3 KB · Views: 77
Last edited:

Please check attached circuit,this is not working, what should I do?

Use a base resistor for the transistor. You can see my simulation result below. Use this circuit.

2202676100_1354953140.png


Note: In practice, you don't need R3. I used it for simulation purpose.

Hope this helps.
Tahmid.
 
Please let me know about the 7-segment display (SEC2414NK 11A, SENIOR).
I cannot find its datasheet on internet.
In direct connections,the above mention 7-segment display on at 7.5Volts @ 25mA but microcontroller output have 5Volts @ 2mA.
Would i use transistors?
I make a digital clock but 7-segment display cannot display.
I will attached simulation.

- - - Updated - - -

I used common cathode.
 

Most 7 segment displays will work easily at 5V. If your display does not work with 5V, but requires a minimum of 7.5V, then you can use 7.5V supply. But you'll need a level shifter circuit to convert the microcontroller output voltage up to 7.5V. You can use transistors for that.
 
I don't see any attached pictures. Perhaps they weren't uploaded properly. Can you upload them again?
 

Attached please check it.
Problem in the connections of 7-segment display it is 7.5V and transistor conncetions.
 

Attachments

  • dc.bmp
    2.3 MB · Views: 49
  • Photo0200.jpg
    Photo0200.jpg
    24.6 KB · Views: 56

You transistor emitter connections are not done properly in Proteus. You have to ground the emitters. Are you using Common Cathode type 7 segment?
 
Last edited:

Ground the emitters of the transistors. Connect resistors between the microcontroller outputs and transistor bases. Connect resistor to limit current to D1 and D2.

Remember to use current limiting resistors between the microcontroller outputs and the 7 segment connections if required by the 7 segment display.

This is for 5V. For 7.5V, you'll need to make some changes since in this case the 7 segments are driven with 5V.

Hope this helps.
Tahmid.
 
You can test them and can quickly find out their connections. The center pins on either side are the common pins (common cathode or common anode). Connect the common pins to +5V or ground depending on whether they are common anode or common cathode. Then use a resistor and connect +5V or ground (depending on common cathode or common anode) to all the other pins and see which segments light up.

Hope this helps.
Tahmid.
 

I found their pins successfully and connection are built properly but displays are operate at 7.5V not at 5V what nscan i do to increase voltage 5v to 7.5v.If I use transistors at all A-G pins they will successfully operate or not?
 

You need to use some sort of level-shifting to bring the voltage up to 7.5V. One method is to use this:

2522967600_1355060478.png


You'd need one set for each of A to G.

Hope this helps.
Tahmid.
 
Do you have any 7-segment display datasheet.I need segment of size 3 inch by 2 inch for 5volts common anode.
 

Please let me know what is the meaning of this command below.

" if((GPIO & 0x33) != 0x33)" // wait for switch to go low
 

Please let me know what is the meaning of this command below.

" if((GPIO & 0x33) != 0x33)" // wait for switch to go low

The first part of the if statement expression,

Code:
([COLOR="#FF0000"]GPIO & 0x33[/COLOR]) != 0x33

Masks the value of GPIO to the value of 0x33.

The bitwise AND operator (&) masks all the bits of first operand (GPIO) with the value of the second operand (0x33 or 0b00110011).

The operation essentially clears all corresponding bits which are not set and leaves any corresponding bits set unchanged.

Therefore bits 0, 1, 4 and 5 of the value in GPIO are left unchanged while all other bits are cleared.

The second part of if statement expression,

Code:
(GPIO & 0x33) [COLOR="#FF0000"]!= 0x33[/COLOR]

Simply tests whether the results of the mask operation are not equal to the value 0x33.


Essentially if any of the bits 0, 1, 4, or 5 are clear the expression is true, if they are all set then the expression is false as the resulting is indeed 0x33.

Perhaps there are switches attached to the lines, GPIO0, GPIO1, GPIO4 and GPIO5, these lines are normally held high, however when a switch is closed the corresponding line goes low which causes the if statement expression to become true, the contents of which handle the switch closure.



Mask (computing)

Bit Operations


BigDog
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top