Menu

UART-SPI bridge

Help
Grant
2010-10-12
2013-05-30
  • Grant

    Grant - 2010-10-12

    Hi All,

    Just wondering if anyone has used GCBasic to create a UART-SPI bridge before. I've got a project going where I've bought some pre-fab components which use SPI. Also, I've got some wireless UART transceivers which I'd like to use, so I'm going to need a bridge.

    I know I could just as easily use a MAX3100 chip, but I have 30+ 16F690's laying around, so I'd like to save the expense.

    Anyone done this before and want to share? If not, I'm happy to share when (if) I'm successful (if anybody's interested).

    Thanks,

    Grant

     
  • kent_twt4

    kent_twt4 - 2010-10-12

    I have played with pic16f648a's and Xbee modules, if that is what you are talking about.  At the time, I just polled the hardware usart, and sent back a string upon receiving communication from the master.  Since then, interrupts were implemented, and that is the direction I would go.

    So in Main, have the slave(s) gather info from the SPI devices, and write the variables to their registers.  Use the usart on interrupt command, to send back data to the master.

    Probably not much help, but here was the slave code (polling method), and using the old hardware usart routine. 

    Main:  
    Loopx: 
    Character = ReceiveSerial 
    If flags.gotnewdata OFF then GOTO Loopx 
    If Character = 1 Then
    TransmitSerial_Print("Hello")
    Set Transmit On
    End if
    If Character = 0 Then Set Transmit Off
    wait 2 sec
    Set flags.gotnewdata OFF 
    wait 25 ms 
    goto Main
    
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.