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: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Run out of outputs

Post by Steve001 »

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.35 KiB) Downloaded 7576 times
Success always occurs in private and failure in full view.

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: Run out of outputs

Post by Steve001 »

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.97 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: 458
Joined: Mon Feb 08, 2010 10:17 am
Location: Greece
Has thanked: 109 times
Been thanked: 117 times
Contact:

Re: Run out of outputs

Post by fotios »

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
Best Regards FOTIS ANAGNOSTOU

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Run out of outputs

Post by medelec35 »

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
Martin

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

Post by Spanish_dude »

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

Cheers

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: Run out of outputs

Post by Steve001 »

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: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Run out of outputs

Post by Benj »

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.

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: Run out of outputs

Post by Steve001 »

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: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Run out of outputs

Post by Benj »

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: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Run out of outputs

Post by Benj »

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
(14.39 KiB) Downloaded 525 times

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: Run out of outputs

Post by Steve001 »

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: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: Run out of outputs

Post by Steve001 »

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 KiB) Viewed 21949 times
Success always occurs in private and failure in full view.

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

Re: Run out of outputs

Post by Benj »

Hello,

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

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: Run out of outputs

Post by Steve001 »

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: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: Run out of outputs

Post by Steve001 »

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 21920 times
Flowcode1.fcf
(4.5 KiB) Downloaded 418 times
Success always occurs in private and failure in full view.

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

Re: Run out of outputs

Post by Benj »

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: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: Run out of outputs

Post by Steve001 »

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 21879 times
Success always occurs in private and failure in full view.

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

Re: Run out of outputs

Post by Benj »

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: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: Run out of outputs

Post by Steve001 »

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 21813 times
Success always occurs in private and failure in full view.

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

Re: Run out of outputs

Post by Benj »

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: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Run out of outputs

Post by Benj »

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 21785 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: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Run out of outputs

Post by Benj »

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 21785 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.

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: Run out of outputs

Post by Steve001 »

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 21772 times
Steve_Display_Model_(1).pdf
(16.1 KiB) Downloaded 454 times
Success always occurs in private and failure in full view.

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: Run out of outputs

Post by Steve001 »

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: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Run out of outputs

Post by Benj »

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.

Post Reply