from eval to production using DEMO9S08QG8 requirements (noob)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

from eval to production using DEMO9S08QG8 requirements (noob)

3,050 Views
Monkins
Contributor I
Hi all
 
I have been searching this forum and on the web for a guide to getting started.
 
Basically I am going to use the DEMO9s08qg8 to create a simple RS232 to SPI bridge.
 
I want to input 3 x 8bytes in RS232 and then convret it to a 24bit SPI string to control a voltage controlled oscilator.
 
my board has not arrived yet but ive been playing with an HC08 (MC908Q4CP) and the free code warrior.
 
when the HCS08 board comes will it be possible to use this to create a rs232 to spi bridge?
 
and then I will want to create production boards, integrated with the VCO an what not. WIll i need a chip programmer or can i do it with tthe RS232 interface?
 
how about software will the 16k codewarrior version do?
 
if some one could bullet point what i need i would be over the moon :smileyhappy:
 
just to recap
 
a tiny conversion board to convert 3 x 8 byte rs232 to 24-bit string spi.
how to go about taking the code created in codewarrior, and making a protuction board, all tools needed etc.
 
many thanks, and i look forwards to your responeses
 
Chris Staines,
Labels (1)
0 Kudos
Reply
6 Replies

839 Views
Encoder
Contributor I
I agree with Peg:
1) Your program will be hopefully comprised in 1.5-3k in assembler or less. I.e. no problem with codewarrior and 8S08QG
2) you will use your Demoboard as BDM programmer in production.
3) I suggest to use bit banging for SPI programming your synthesizer and not the SPI port because it could be simpler for this easy task if you have no previous experience of SPI module programming in the HC8(S)08 family: they are few rows of ASM
 
Good luck
0 Kudos
Reply

839 Views
Monkins
Contributor I
Thanks for the advice, I have been looking at the capabilities, etc.  And basically heres the deal:
 
The VCO requires 3 strings of 24bit SPI to set it up to a certain frequencey output e.g. 2.4 GHz.
 
I am going to talk to the HCS08 with labview via the serial port. Instead of getting labview to send the requred binary strings out i will just send a number out via the RS232 port. 
 
 
Then microcontroller will have the string i want to send out stored in it and also the conversion routine to convert the number to the frequencey.
 
so as u say i think bit banging willl keep things simple as there is no two way comms / data speed issues.
 
regards
 
chris
0 Kudos
Reply

839 Views
bigmac
Specialist III
Hello Chris,
 
I totally agree with Peg's statement about using the SPI hardware module.  The most difficult part is to understand the precise requirements of the peripheral device, the VCO in your case, and match the initialisation of SPI operation to these requirements.  If you were to write bit-bang code, you would still need the same detailed understanding of these requirements.
 
When the MCU is the master (which is more often the case), the the code required to communicate with the SPI module can be quite simple, and should not require use of interrupts.  Typically, only a few lines of code would be required, either in C or assembler.
 
Regards,
Mac
 
0 Kudos
Reply

839 Views
Monkins
Contributor I
the help in heres great :smileyhappy:
 
I downloaded the appcation note AN2878SW software and i see that setting up the SPI module to output the 3-byte string looks pretty straight forwards.   all i need to play around with is capturing the input comm's now and buffring, decoding and outputting
 
 
Will keep you posted
 
thanks, chris
0 Kudos
Reply

839 Views
peg
Senior Contributor IV
Hi,
I would use the SPI module, I have never understood why so many people have so much difficulty with it, its really quite simple.
Its maximum baud rate is 10 MHz however and even then you won't be able to keep it fed at this rate as this is buss/2. Usually gaps between bytes don't matter so this is not such an issue.
 
Regards David
 
0 Kudos
Reply

839 Views
peg
Senior Contributor IV
Hi Chris,
 
Pretty big question for your first one!
 
I will attempt to answer at least some of it.
Should be very straight forward.
You can do it on the demoboard to test it out.
Then when you make your own board you can remove the chip from the demo board and use it as a BDM programmer to programme a device mounted on your own PCB if you create a BDM port on your PCB.
The free version of CW for HCS08 will do as the programme will be small and you only have 8K on the QG8 anyway.
Take a look at the stickys at the top of this forum for the 3rd party QG8 getting started document.
 
Regards David
 
0 Kudos
Reply