component required
Moderator: Benj
-
Roy Johnston
- Flowcode V4 User
- Posts: 220
- Joined: Mon Aug 24, 2009 8:38 am
- Has thanked: 2 times
- Been thanked: 34 times
component required
I am using a 18f4550 chip. I am connecting a chip tlc5628cn which is a 8 analogue output. Its communications to the 184550 is pin 19 and 20 which is spp0 and spp1, my question is what component do I use to interface to this component.
-
Roy Johnston
- Flowcode V4 User
- Posts: 220
- Joined: Mon Aug 24, 2009 8:38 am
- Has thanked: 2 times
- Been thanked: 34 times
Re: component required
Sorry would it be possible to stream to this port whilst using the usb slave component.
I want to receive data from the usb port store it into variables and then stream this to the dac chip.
I want to receive data from the usb port store it into variables and then stream this to the dac chip.
-
Roy Johnston
- Flowcode V4 User
- Posts: 220
- Joined: Mon Aug 24, 2009 8:38 am
- Has thanked: 2 times
- Been thanked: 34 times
Re: component required
The TLC5628C and TLC5628I are octal 8-bit voltage output digital-to-analog converters (DACs) with buffered
reference inputs (high impedance). The DACs produce an output voltage that ranges between either one or two
times the reference voltages and GND and are monotonic. The device is simple to use, running from a single
supply of 5 V. A power-on reset function is incorporated to ensure repeatable start-up conditions.
Digital control of the TLC5628C and TLC5628I are over a simple three-wire serial bus that is CMOS compatible
and easily interfaced to all popular microprocessor and microcontroller devices. The 12-bit command word
comprises eight bits of data, three DAC select bits, and a range bit, the latter allowing selection between the
times 1 or times 2 output range. The DAC registers are double buffered, allowing a complete set of new values
to be written to the device, then all DAC outputs are updated simultaneously through control of LDAC. The digital
inputs feature Schmitt triggers for high-noise immunity.
reference inputs (high impedance). The DACs produce an output voltage that ranges between either one or two
times the reference voltages and GND and are monotonic. The device is simple to use, running from a single
supply of 5 V. A power-on reset function is incorporated to ensure repeatable start-up conditions.
Digital control of the TLC5628C and TLC5628I are over a simple three-wire serial bus that is CMOS compatible
and easily interfaced to all popular microprocessor and microcontroller devices. The 12-bit command word
comprises eight bits of data, three DAC select bits, and a range bit, the latter allowing selection between the
times 1 or times 2 output range. The DAC registers are double buffered, allowing a complete set of new values
to be written to the device, then all DAC outputs are updated simultaneously through control of LDAC. The digital
inputs feature Schmitt triggers for high-noise immunity.
- 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: component required
Hello Roy
I would create a little macro function in Flowcode to bit bang out the signal to the device by toggling the I/O pins. The bus looks fairly simple and I dont think there is specifically any Flowcode component that will do that for you.
You say you only have two connections but it looks like you need a third signal to clock through the next DAC output. This could be incorrect I only glanced at the datasheet.
You should be able to setup a timer interrupt that will take a byte from a master buffer and output the value to the DAC. Each time the timer interrupt fires another byte is read from the master buffer and sent to the DAC. When a USB transaction occurs then this adds bytes to the buffer. If there is no data left in the buffer then continue with the last byte that was sent. This should allow you to produce a nice stable controllable output.
I would create a little macro function in Flowcode to bit bang out the signal to the device by toggling the I/O pins. The bus looks fairly simple and I dont think there is specifically any Flowcode component that will do that for you.
You say you only have two connections but it looks like you need a third signal to clock through the next DAC output. This could be incorrect I only glanced at the datasheet.
You should be able to setup a timer interrupt that will take a byte from a master buffer and output the value to the DAC. Each time the timer interrupt fires another byte is read from the master buffer and sent to the DAC. When a USB transaction occurs then this adds bytes to the buffer. If there is no data left in the buffer then continue with the last byte that was sent. This should allow you to produce a nice stable controllable output.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
Roy Johnston
- Flowcode V4 User
- Posts: 220
- Joined: Mon Aug 24, 2009 8:38 am
- Has thanked: 2 times
- Been thanked: 34 times
- 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: component required
Hi Roy
The DAC you suggested looks good. The bit banging routine shouldn't take long to do. You will simply need to create a macro containing a loop of 8 that outputs a bit from a data byte, performs the clock toggling maybe with a delay in between and then shifts the byte to move to the next data bit.
Otherwise you should be able to get I2C and SPI DACs that will work directly with a component.
The DAC you suggested looks good. The bit banging routine shouldn't take long to do. You will simply need to create a macro containing a loop of 8 that outputs a bit from a data byte, performs the clock toggling maybe with a delay in between and then shifts the byte to move to the next data bit.
Otherwise you should be able to get I2C and SPI DACs that will work directly with a component.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
Roy Johnston
- Flowcode V4 User
- Posts: 220
- Joined: Mon Aug 24, 2009 8:38 am
- Has thanked: 2 times
- Been thanked: 34 times
Re: component required
Does anyone have a working module that works with a I2C or SPI DACs.
also can someone recommend a part number for either of the above.
also can someone recommend a part number for either of the above.