Run out of outputs

For E-blocks user to discuss using E-blocks and programming for them.

Moderators: Benj, Mods

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1104
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 453 times
Been thanked: 505 times
Contact:

Run out of outputs

Postby Steve001 » Sun Aug 21, 2011 6:54 pm

i have run out of available outputs :( will the attached circuit idea work ? espcially with a lcd dispaly attached too ?

the 74LS273 that i am looking at has a clock spped of 40Mhz max

steve
Attachments
output port expansion cct.JPG
(65.36 KiB) Downloaded 7576 times
Success always occurs in private and failure in full view.

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1104
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 453 times
Been thanked: 505 times
Contact:

Re: Run out of outputs

Postby Steve001 » Sun Aug 21, 2011 7:00 pm

OPPS :oops: made a mistake don't need the circled red gate

and ouputs 7 and 8 cannot be used ( Inputs tied to 0 Volts ) on both chips

steve
Attachments
output port expansion cct.JPG
(92.98 KiB) Downloaded 7571 times
Last edited by Steve001 on Tue Aug 23, 2011 9:49 pm, edited 1 time in total.
Success always occurs in private and failure in full view.

User avatar
fotios
Posts: 436
Joined: Mon Feb 08, 2010 10:17 am
Location: Greece
Has thanked: 100 times
Been thanked: 113 times
Contact:

Re: Run out of outputs

Postby fotios » Sun Aug 21, 2011 7:39 pm

Hi Steve
For expanding the outputs of a micro, you could also use HC373 or HC573 (Octal 3-State Non Inverting Transparent Latch) instead LS273. Pinout is the same: LS273 CLK = HC373 LATCH, LS273 RST = HC373 OE. The Latch when enabled, can be used like the CLK input of LS273. Please take a look on the related datasheets.
Fotis
These users thanked the author fotios for the post:
Steve001 (Mon Aug 22, 2011 7:29 am)
Rating: 5.26%
 
Best Regards FOTIS ANAGNOSTOU

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8541
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2456 times
Been thanked: 3526 times
Contact:

Re: Run out of outputs

Postby medelec35 » Sun Aug 21, 2011 8:33 pm

I did a similar thing using a 74HC595 (8 bit serial in, serial or parallel out that works up to 100MHz). It was used to drive a seven segment display. I still have the flowchart for that. Let me know if you would find it useful, and I will post it.
All it does is convert a serial input using 3 pins of microcontroller, to 8bit parallel o/p
Alternatively you could use another microcontroller, that converts a serial i/p to a parallel o/p
Just a thought on a different approach.
Martin
These users thanked the author medelec35 for the post:
Steve001 (Mon Aug 22, 2011 7:28 am)
Rating: 5.26%
 
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

Spanish_dude
Posts: 594
Joined: Thu Sep 17, 2009 7:52 am
Location: Belgium
Has thanked: 63 times
Been thanked: 102 times
Contact:

Re: Run out of outputs

Postby Spanish_dude » Mon Aug 22, 2011 12:27 am

You could use an MCP23S018, 16 bit I/O expander using SPI (there's also an I²C version of this chip).

Cheers
These users thanked the author Spanish_dude for the post:
Steve001 (Mon Aug 22, 2011 7:28 am)
Rating: 5.26%
 

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1104
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 453 times
Been thanked: 505 times
Contact:

Re: Run out of outputs

Postby Steve001 » Mon Aug 22, 2011 7:30 am

Thanks guys, i am using port c on my pic at a later day for a comms interface thats why i am stuck a bit

steve
Success always occurs in private and failure in full view.

User avatar
Benj
Matrix Staff
Posts: 14577
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4604 times
Been thanked: 4241 times
Contact:

Re: Run out of outputs

Postby Benj » Mon Aug 22, 2011 12:27 pm

Hello,

The circuit shown on the link below works great if you need more I/O pins and are using a LCD display. The LCD component c code will need to be altered but I think I have an example of this tucked away somewhere. Let me know and I will have a dig for it.

http://www.rentron.com/myke1.htm

This circuit also works well if you can multiplex your outputs.

http://adrianus.3x.ro/electronic/zws_co ... lboard.htm

Otherwise output buffer chips work well and you can use them as shift registers to get as many outputs as you require. This is the technique I used for my 32 x RBG LED propeller displays.
These users thanked the author Benj for the post:
Steve001 (Mon Aug 22, 2011 1:01 pm)
Rating: 5.26%
 

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1104
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 453 times
Been thanked: 505 times
Contact:

Re: Run out of outputs

Postby Steve001 » Mon Aug 22, 2011 1:01 pm

Hi Benj,

The 2-Wire LCD Interface looks like it would do the job nicley,

Could you have a look to see if you have the modified c code please, as my programming is not brilliant :(

steve
Success always occurs in private and failure in full view.

User avatar
Benj
Matrix Staff
Posts: 14577
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4604 times
Been thanked: 4241 times
Contact:

Re: Run out of outputs

Postby Benj » Mon Aug 22, 2011 2:17 pm

Hi Steve,

I will have a look tonight as I think the code is on my home computer. As for the second link I posted before some antivirus programs are warning that the page is not safe. I have personally been referring to this project for years now without any issues and I can't see anything odd on the page so I can't see why this is happening. Just a warning, there may be something fishy there somewhere, or it could be a false positive. The circuit works great :)

User avatar
Benj
Matrix Staff
Posts: 14577
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4604 times
Been thanked: 4241 times
Contact:

Re: Run out of outputs

Postby Benj » Tue Aug 23, 2011 2:00 pm

Hi Steve,

Here is the component C file for v4.

The clock is tied to DATA1 and the Data is tied to DATA2 in the Flowcode component connections. The other connections shown in the connections window are not used by the component code so can be used by other components etc.

Make sure you make a backup of the original C code file so you can go back to non serial based displays.

PS. I could not find my original Flowcode file so I have cobbled together a file using my old C version. It should work but I have not tested it.

Let me know how you get on.
Attachments
PIC_LCD.c
(15.25 KiB) Downloaded 331 times
These users thanked the author Benj for the post:
Steve001 (Tue Aug 23, 2011 9:44 pm)
Rating: 5.26%
 

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1104
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 453 times
Been thanked: 505 times
Contact:

Re: Run out of outputs

Postby Steve001 » Tue Aug 23, 2011 8:53 pm

Hi Benj,
Thanks a lot for that i appreciate it i am off now so can have a look over the next few days and i'll let you know

Thanks again

Steve :D
Success always occurs in private and failure in full view.

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1104
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 453 times
Been thanked: 505 times
Contact:

Re: Run out of outputs

Postby Steve001 » Thu Aug 25, 2011 5:10 pm

Hi benj,

I may have done this incorrectly, trying the modified code that you posted i placed it in flowcode components folder (after copying original lcd file)
as soon as i pick the lcd componet windows closes flowcode ? i managed to get this screen shot

i have copyied back the original file and i am back working

steve
Attachments
lcd error.JPG
lcd error.JPG (115.01 KiB) Viewed 14232 times
Success always occurs in private and failure in full view.

User avatar
Benj
Matrix Staff
Posts: 14577
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4604 times
Been thanked: 4241 times
Contact:

Re: Run out of outputs

Postby Benj » Thu Aug 25, 2011 5:51 pm

Hello,

Ok here is a better file that should work correctly.
Attachments
PIC_LCD.c
(14.8 KiB) Downloaded 333 times

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1104
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 453 times
Been thanked: 505 times
Contact:

Re: Run out of outputs

Postby Steve001 » Fri Aug 26, 2011 7:33 am

Thanks for that benj, will give that a go and let you know how i get on

steve
Success always occurs in private and failure in full view.

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1104
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 453 times
Been thanked: 505 times
Contact:

Re: Run out of outputs

Postby Steve001 » Fri Aug 26, 2011 10:05 am

Hi benj

Just had a quick go now is this correct ?

as i get the following

Launching the compiler...
C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\boostc\boostc.pic16.flowcode.exe -v -t PIC16F877A "Flowcode1.c"

..........
Return code = 1

Flowcode was unable to compile the flowchart's C code due to the following errors:


If your flowchart contains C code, please review this carefully. If your flowchart contains no C-code or you have thoroughly reviewed the code, contact Technical Support.

FINISHED


Going to have another go when i get more time later on

steve
Attachments
Capture.JPG
Capture.JPG (184.37 KiB) Viewed 14203 times
Flowcode1.fcf
(4.5 KiB) Downloaded 288 times
Success always occurs in private and failure in full view.

User avatar
Benj
Matrix Staff
Posts: 14577
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4604 times
Been thanked: 4241 times
Contact:

Re: Run out of outputs

Postby Benj » Fri Aug 26, 2011 10:49 am

Hi Steve,

I have tried your program here and it is compiling correctly for me. Have you restarted Flowcode since you modified the component C file. Maybe worth restarting your PC too if restarting Flowcode itself doesn't help.

Building CASM file
Memory Usage Report
===================
RAM available:368 bytes, used:42 bytes (11.5%), free:326 bytes (88.5%),
Heap size:326 bytes, Heap max single alloc:110 bytes
ROM available:8192 words, used:315 words (3.9%), free:7877 words (96.1%)

success
Return code = 0

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1104
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 453 times
Been thanked: 505 times
Contact:

Re: Run out of outputs

Postby Steve001 » Tue Aug 30, 2011 2:13 pm

Hi benj ,

just a quick question what do i do with the unsued conections on the lcd display within flowcode ?
if i turn them off i get the error bellow. .

Still not got my display working . but if i connect the led e block to port A i can see the led's 0 , 1 flashing so going to to look at my circuit again
and possabley rebuild it

will let you know if i get it working, thanks again for your help

steve
Attachments
lcd pins connected.JPG
lcd pins connected.JPG (37.01 KiB) Viewed 14162 times
Success always occurs in private and failure in full view.

User avatar
Benj
Matrix Staff
Posts: 14577
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4604 times
Been thanked: 4241 times
Contact:

Re: Run out of outputs

Postby Benj » Wed Aug 31, 2011 1:17 pm

Hello,

The message that appears is nothing to worry about. If you want to get rid of the message then you can connect up the other pins of the LCD component. They will not actually be used by the C code.

Let me know how you get on. I have a test circuit available if you need me to confirm that the code is ok.

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1104
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 453 times
Been thanked: 505 times
Contact:

Re: Run out of outputs

Postby Steve001 » Wed Sep 07, 2011 8:28 pm

Hi Benj,

sorry for the late response have been realy busy, Still not had any luck with it
Would be interested in the test circuit if you can forward it to me. checked my circuit several times and put a couple of new ic's in
and tested them on a bread board and can see them changing state

not too convinced about the diode / resistor "and" gate tho waiting for some and gates to try and see if that works

any ideas

P.S using a everbouquet display 4 x 16 from farnell EVERBOUQUET MC1604B-SBLW
Farnell Order Code: 9449086

and a 1n4148 diode

steve
Attachments
2wirelcd.jpg
2wirelcd.jpg (25.78 KiB) Viewed 14096 times
Success always occurs in private and failure in full view.

User avatar
Benj
Matrix Staff
Posts: 14577
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4604 times
Been thanked: 4241 times
Contact:

Re: Run out of outputs

Postby Benj » Thu Sep 08, 2011 9:18 am

Hi Steve,

Your diode should be ok. I will give the code a go on my known working hardware and make sure there is nothing wrong with the component code.

User avatar
Benj
Matrix Staff
Posts: 14577
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4604 times
Been thanked: 4241 times
Contact:

Re: Run out of outputs

Postby Benj » Fri Sep 09, 2011 12:05 am

Hi Steve,

Ok I've tested the component code file now and it appears to be working well on my hardware.

2011-09-09 00.03.04.jpg
2011-09-09 00.03.04.jpg (33.47 KiB) Viewed 14068 times


I've also had a look at the Farnell part you mentioned and it should be 100% compatible with the component C file.

Which microcontroller pins are you using. Pin RA4 on some devices is not capable of outputting a logic 1 without the aid of a external pull up resistor.

User avatar
Benj
Matrix Staff
Posts: 14577
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4604 times
Been thanked: 4241 times
Contact:

Re: Run out of outputs

Postby Benj » Fri Sep 09, 2011 12:12 am

Here is a copy of the LCD portion of the schematic for my board.

The pins going to the microcontroller are the traces marked LCDK (clock) and LCDD (data). Note the supply pins (8 and 16) for the 74LS174 device are not shown but are connected.

sch1.jpg
sch1.jpg (53.92 KiB) Viewed 14068 times


R10 and R11 should ideally be replaced with a preset potentiometer so you can set the contrast for the specific display on the board.

There's also some 100nF ceramic caps and a 10uF elco cap across the power rails VDD and GND that are not shown on the schematic. These are not strictly nessisary but may help if you have a noisy PSU etc.

If your still struggling to get it to work then have you performed a 1 second flasher test to confirm your Flowcode clock speed and config settings are correct for the hardware? If you need more info on this let me know.
These users thanked the author Benj for the post:
Steve001 (Sat Sep 10, 2011 12:15 pm)
Rating: 5.26%
 

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1104
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 453 times
Been thanked: 505 times
Contact:

Re: Run out of outputs

Postby Steve001 » Fri Sep 09, 2011 6:37 pm

Hi benj

Thanks for that ,

i am using a 16F884 I/P with the lcd conected to port A
These are the tests i have done

if i connect the led board (on its own) to port A i can see led led 0, 1 flashing - ok
if i connect my circuit and my display board to port A i cannot see anything on the display just the cursor flashing
if i connect the led board between my circuit board and my display no leds light
if i remove the lcd board and leave the led board conected some leds flash (Bit quick cannot fully see whats happened)

i Can test the flip flop action on bread board ok

if i replace the modified c code back to the original one my lcd display works fine

just realised today that the flip flops that i am using have a max o/p current of 2 Ma (surley that must be enough for a display ?) ordered some more from farnell going to try again tommorrow when i have picked them up ordered some with a 8 Ma and going to try a different port and a couple of different pics that i have lurking somewhere.

just a quick thought i am using a EB-16-00-2 board with J2 as a Male plug and J1 swapped for a Female with EB634 leads could that be my problem ?

attached is my circuit diagram which looks like your's

steve :?
Attachments
2wirelcd.jpg
2wirelcd.jpg (30.25 KiB) Viewed 14055 times
Steve_Display_Model_(1).pdf
(16.1 KiB) Downloaded 332 times
Success always occurs in private and failure in full view.

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1104
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 453 times
Been thanked: 505 times
Contact:

Re: Run out of outputs

Postby Steve001 » Mon Sep 12, 2011 8:26 pm

Sort of sussed it out now the voltage level was dropping too low when the output of flip flop 2 went high then nothing worked correctley.
just placed two nand gates in the data and clock lines to act as a buffer now i can see all the flip flops working on the led board.

ordered some 74HC05's and going to try again . . . Looking good so far :D will let you know when i have another go

thanks for everyones help

steve
Success always occurs in private and failure in full view.

User avatar
Benj
Matrix Staff
Posts: 14577
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4604 times
Been thanked: 4241 times
Contact:

Re: Run out of outputs

Postby Benj » Tue Sep 13, 2011 10:06 am

Hi Steve,

Your schematic looks correct apart from the labels for Clock and Data and the wrong way around.

Let me know how you get on.