PIC Controller Board for Colour TV Pattern Generator – What size PIC do I need? - Page 1
Forum section: electronics / general

author: Chris56000
author_rank: Frequent Contributor
timestamp: May 22, 2023, 06:23:45 am
content: Hi!I want to design a PIC microcontroller PCB to control the Pattern Selection Relays of a Colour TV Pattern Generator I am starting to put together.I want to use a Turn and Push Rotary Encoder to select the patterns which are displayed by name on a 16 × 2 LCD, and also by the illumination of LEDs, that also operate in tandem with the Pattern Select Relays.There will be sixteen different pattern names displayed on the LCD, and sixteen Pattern Selected LEDs, with up to six toggled on or off together to select different pattern combinations.A further three sound control options (440 Hz, 1 kHz and EXTERNAL), each with its own indicator LED, operated by turning the encoder in the reverse direction to select the video patterns, is intended also!The PIC is NOT used to generate the patterns or the sync pulses, the sync pulses are from a B.A.T.C. ZNA 134 Sync Processor PCB I acquired and the video patterns themselves are generated by TTL and Transistorised circuitry.Can anyone advise me what PIC16 available in the Hobbyist Flowcode V10 package will accommodate my requirements please?I'm new to both PIC Microcontrollers and Flowcode with no previous experience in this field!Chris Williams

author: jpanhalt
author_rank: Super Contributor
timestamp: May 22, 2023, 09:53:31 am
content: If the PIC is only reading a 1 of 16 encoder (4 bits), running a 16X2 character LCD, and selecting one of 16 options, it won't take much. Do you need interrupts? If not, a 12F5xx will work. If you need interrupts, go to the 12F6xx. Actually a 10F322 may work. Despite minimal requirements, I would probably start at a 16F1xxx or later 8-bit chip. Anything more capable would also work.With which PIC chips are you familiar? Have you written any code yet? If so, that is probably the place to start your decision making for choice of MCU.

author: Chris56000
author_rank: Frequent Contributor
timestamp: May 24, 2023, 09:29:13 am
content: I must confess I've not written anything yet, but I am familiar with the 16F877 – the design I originally proposed has now expanded to twenty pattern control outputs, so I am thinking of driving the relays either by row/column matrixing them or by expanding the port with 74138s!The LCD code seems to be the first thing to tackle, followed by the rotary encoder code, and finally the relay output code!Unfortunately I'm stuck down at my sister's with gout and don't have my laptop with me to begin writing yet I'm afraid!Chris Williams

author: jpanhalt
author_rank: Super Contributor
timestamp: May 24, 2023, 10:20:46 am
content: Do you plan to use a single ZNA134 (https://www.mikrocontroller.net/wikifiles/b/be/ZNA134.pdf)?If so, I don't see why you need a port expander, but that is certainly an option. I have never used Flowcode, but I was not impressed by the few examples I saw a few years ago. If something is complicated, I create a typical flowchart and/or spreadsheet to facilitate coding.EDIT: If you want easy access to a lot of user RAM, consider on of the enhanced PIC's like the 16F1xxx or later. In those chips, the entire user RAM can be mapped to a single linear block.

author: Chris56000
author_rank: Frequent Contributor
timestamp: May 24, 2023, 06:57:17 pm
content: The reason I was thinking about port expansion was because the contacts of the pattern select relays are all over the place in the analogue sections of the design with no common connections, hence it will need a unique relay for each pattern selected, hence twenty relays!Can a PIC operate a relay on the matrix principle, by arranging the relays in rows & columns with 4 lines from one port and five from another port, or will that cause really awkward pin definition problems with the code?Chris Williams

author: jpanhalt
author_rank: Super Contributor
timestamp: May 24, 2023, 08:10:18 pm
content: Why not use a mosfet instead of a relay? Yes, a PIC can support either directly so long as the relay requires less than 25 mA. That is the maximum sourced per pin and is clearly state in the datasheet.How about posting the schematic for just 2 sections (not the entire array of 20 relays)?

author: Chris56000
author_rank: Frequent Contributor
timestamp: May 28, 2023, 05:48:57 pm
content: I can do that when I finally get back home from my sister's – I've only got a phone here and trying to write code on one is so frustrating I don't want to try again!I'll draw a simplified diagram when I get back home!Chris Williams